Essential Redis Cluster Configuration Parameters: Required and Optional Settings
This article explains the key Redis cluster configuration options found in redis.conf, detailing required settings such as cluster-enabled, cluster-config-file, and cluster-node-timeout, as well as optional parameters like cluster-slave-validity-factor, migration barrier, full coverage requirement, and read‑when‑down behavior.
Redis cluster configuration parameters are specified in the redis.conf file; some are mandatory while others are optional, and these settings are crucial for the proper operation of a Redis cluster.
The following parameters are required:
cluster-enabled <yes/no>: Determines whether the node runs in cluster mode. It must be set to yes for the node to participate in a cluster; otherwise the node starts as a standalone instance.
cluster-config-file <filename>: The name of the file used to persist cluster state. Redis generates and maintains this file automatically, and users should not edit it. Each node needs its own configuration file, and its default name is nodes-6379.conf .
cluster-node-timeout <milliseconds>: The timeout for node responses, expressed in milliseconds. For example, a value of 5000 means that if a node does not respond within 5 seconds, it is considered failed.
The following parameters are optional:
cluster-slave-validity-factor <factor>: Controls slave node validity. A value of 0 allows a slave to become a master regardless of disconnection duration, while a positive value multiplies cluster-node-timeout to set the threshold for failover (e.g., factor = 10 and timeout = 5 s means a slave will not attempt failover if disconnected for more than 50 s).
cluster-migration-barrier <count>: Minimum number of slave nodes that must remain on a master after a migration. The default is 1; migration is prevented if moving a slave would leave the source master with fewer than this number of slaves.
cluster-require-full-coverage <yes/no>: Determines whether the cluster requires full key coverage. When set to yes (default), the cluster stops write operations if any key has no assigned slot. Setting it to no allows reads for keys that can be handled even if some slots are uncovered.
cluster-allow-reads-when-down <yes/no>: Controls read access when the cluster is marked as failed. The default no stops all services to avoid data inconsistency; setting it to yes permits reads from slave nodes during failures, improving availability.
Follow the public WeChat account "Internet Full‑Stack Architecture" for more programming insights, and feel free to add the author’s WeChat (remark "Internet Full‑Stack Architecture") to connect on the journey of improving coding skills.
Recommended reading:
Redis Cluster Nuggets: Must‑Know Knowledge Points
Redis Cluster Nuggets: What Is the Cluster Bus?
Redis Cluster Nuggets: Obscure but Important Epochs
Full-Stack Internet Architecture
Introducing full-stack Internet architecture technologies centered on Java
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.