Module: REDIS
Redis Identity
Redis are required parameters when defining a Redis cluster.
- redis_cluster: Redis cluster name, top-level namespace for cluster sources.
- : Redis node identity, integer the number of the node in the cluster.
- redis_instances: A Dict with the Key as redis port and the value as a instance level parameters.
Redis Mode
There are three available in Pigsty:
standalone
: setup redis as standalone (master-slave) modesentinel
: setup redis as sentinel for standalone redis HA
Redis Definition
Here are three examples:
Limitation
- A redis node can only belong to one redis cluster
- You can not set different password for redis instances on same redis node (since redis_exporter only allows one password)
- : create redis cluster / node / instance
- redis-rm.yml: remove redis cluster /node /instance
You can also create & destroy redis cluster/node/instance with util scripts:
bin/redis-add 10.10.10.10 # create redis node '10.10.10.10'
bin/redis-add 10.10.10.10 6501 # create redis instance '10.10.10.10:6501'
bin/redis-rm 10.10.10.10 # remove redis node '10.10.10.10'
bin/redis-rm 10.10.10.10 6501 # remove redis instance '10.10.10.10:6501'
Init Cluster/Node/Instance
You can also use wrapper script:
bin/redis-add 10.10.10.10 # create redis node '10.10.10.10'
bin/redis-add 10.10.10.10 6501 # create redis instance '10.10.10.10:6501'
Remove Cluster/Node/Instance
You can also use wrapper script:
bin/redis-rm redis-ms # remove redis cluster 'redis-ms'
bin/redis-rm 10.10.10.10 # remove redis node '10.10.10.10'
bin/redis-rm 10.10.10.10 6501 # remove redis instance '10.10.10.10:6501'
There are three dashboards for module.
Overview of a redis cluster
Detail information about a single redis instance
- REDIS_ID : REDIS Identity Parameters
- : Config & Launch Redis Instances
Parameter | Type | Level | Comment |
---|---|---|---|
redis_cluster | string | C | redis cluster name, required identity parameter |
dict | I | redis instances definition on this redis node | |
redis_node | int | I | redis node sequence number, node int id required |
path | C | redis main data mountpoint, /data by default | |
redis_exporter_enabled | bool | C | install redis exporter on redis nodes? |
port | C | redis exporter listen port, 9121 by default | |
redis_exporter_options | string | C/I | cli args and extra options for redis exporter |
bool | C | prevent purging running redis instance? | |
redis_clean | bool | C | purging existing redis during init? |
bool | A | remove redis data when purging redis server? | |
redis_mode | enum | C | redis mode: standalone,cluster,sentinel |
string | C | redis config template path, except sentinel | |
redis_bind_address | ip | C | redis bind address, empty string will use host ip |
size | C/I | max memory used by each redis instance | |
redis_mem_policy | enum | C | redis memory eviction policy |
password | C | redis password, empty string will disable password | |
redis_rdb_save | string[] | C | redis rdb save directives, disable with empty list |
bool | C | enable redis append only file? | |
redis_rename_commands | dict | C | rename redis dangerous commands |
int | C | replica number for one master in redis cluster |