REDIS Config
- REDIS_IDENTITY: REDIS Identity Params
- : REDIS Software, Dir & Exporter
- REDIS_PROVISION: REDIS Server Provisioning
Identity parameters are the information that must be provided to define a Redis cluster, including:
Name | Level | Description | Example |
---|---|---|---|
redis_cluster | MUST, cluster level | Cluster name | redis-test |
MUST, node level | Node Number | primary , replica | |
redis_instances | MUST, node level | Ins Definition | { 6001 : {} ,6002 : {}} |
- identifies the Redis cluster name, configured at the cluster level, and serves as the top-level namespace for cluster resources.
- redis_node identifies the serial number of the node in the cluster.
Redis cluster identity, type: string
, level: C, default value:
Redis cluster identity will be used as a namespace for resources within the cluster and needs to follow specific naming patterns: [a-z][a-z0-9-]*
to be compatible with different constraints on identity identification. It is recommended to use redis-
as the cluster name prefix.
Identity param is required params and cluster-level params.
redis_node
Redis node identity, type: int
, level: I, default value:
Redis node identity, unique in the cluster, is used to distinguish and identify different nodes, starting with an assignment of 0 or 1.
redis_instances
Redis instances definition on this node, type: instance[]
, level: I, default value.
This database node deployed all Redis ins in JSON K-V object format. The key is the numeric type port number, and the value is the JSON config entry specific to that instance.
Sample example:
Each Redis ins listens on a unique port on the node. You can configure separate parameter options for Redis ins (currently, only is supported for pre-built M-S replication).
Identity params required params and instance-level params.
redis_fs_main
Primary data disk for Redis, type: path
, level: C, default value: "/data"
.
Pigsty will create the redis
dir under that dir to store Redis data. For example, /data/redis
.
redis_exporter_enabled
Enable Redis exporter, type: bool
, level: C, default: true
.
Redis Exporter is enabled by default, one on each Redis node deployed and listens on port 9121 by default.
redis_exporter_port
Redis Exporter listens port, type: int
, tier: C, default value: 9121
.
Note: If you modify this default port, you will need to replace this port along with the relevant config rule file in Prometheus.
Redis Exporter command parameter, type: string
, level: C/I, default value: ""
.
redis_safeguard
Disable erasure of existing Redis, type: string
, level: C, default value: false
.
if true, and redis-remove.yml will not remove running redis instance
redis_clean
What to do when Redis exists, type: bool
, level: C/A, default value: "false"
.
If true, redis.yml will purge existing instance during init.
redis_mode
Redis cluster mode, type: enum
, level: C, default value: "standalone"
.
Specifies the mode of this Redis cluster, with three optional modes:
standalone
: Default mode, deploys a series of independent Redis ins.cluster
: Redis native cluster modesentinel
: Redis HA component: sentinel
Pigsty also sets up standalone Redis based on the replica_of
parameter when using the standalone
mode. Pigsty creates a native Redis cluster using all defined instances according to the redis_cluster_replicas parameter when using cluster
mode.
redis_conf
Redis config template, type: string
, level: C, default value: "redis.conf"
.
Redis listener the IP, or inventory_hostname
if left blank. The default listener has all local IPv4.
Max memory used by each Redis ins, type: size
, level: C/I, default value: "1GB"
Max memory used by each Redis ins, default is 1GB; it is recommended to configure this parameter at the cluster level to keep the cluster ins config consistent.
redis_mem_policy
Memory eviction policy, type: enum
, level: C, default value: "allkeys-lru"
.
Other optional policies include:
volatile-lru
allkeys-lru
volatile-lfu
allkeys-lfu
volatile-random
allkeys-random
volatile-ttl
noeviction
redis_password
Redis password, type: string
, level: C, default value: ""
.
masterauth
& requirepass
password to use, leave blank to disable password, disabled by default.
redis_rdb_save
RDB SAVE directives, type: string[]
, level: C, default value: [ "1200 1" ]
.
Redis SAVE directives, the config will enable RDB functionality, each Save policy as a string。
redis_aof_enabled
Enable AOF, type: bool
, level: C, default value: false
.
redis_rename_commands
Rename dangerous commands, Type: object
, Level: C, Default value: {}
.
JSON dictionary renames the command represented by Key to the command represented by Value to avoid misuse of dangerous commands.
--cluster-replicas {{ redis_cluster_replicas|default(1) }}
Last modified 2022-06-04: fii en docs batch 2 (61bf601)