Setting Up a Redis Master‑Slave Cluster: Configuration and Deployment Steps
This guide walks through preparing the environment, creating necessary directories, editing Redis configuration files for both master and slave nodes, and launching a three‑node Redis cluster with appropriate authentication and replication settings.
Prerequisites: three servers with IPs 192.168.20.234 (master), 192.168.20.235 (slave), and 192.168.20.236 (slave).
Step 1 – Create directories for configuration, data, and logs:
mkdir -p /usr/local/redis/conf mkdir -p /usr/local/redis/data mkdir -p /usr/local/redis/logStep 2 – Edit redis.conf on the master node:
bind 0.0.0.0 daemonize yes logfile "/usr/local/redis/log/redis.log" dbfilename dump.rdb appendonly yes appendfilename "appendonly.aof" dir /usr/local/redis/data requirepass 123456 masterauth 123456 replica-read-only yesStep 3 – Apply the same configuration on each slave node, adjusting only the replication target:
bind 0.0.0.0 daemonize yes logfile "/usr/local/redis/log/redis.log" dbfilename dump.rdb appendonly yes appendfilename "appendonly.aof" dir /usr/local/redis/data requirepass 123456 masterauth 123456 replica-read-only yesSpecify the master for each slave: slaveof 192.168.20.234 6379 Step 4 – Start the Redis server on all three machines and verify that the master node accepts read/write commands while the slaves are read‑only.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Practical DevOps Architecture
Hands‑on DevOps operations using Docker, K8s, Jenkins, and Ansible—empowering ops professionals to grow together through sharing, discussion, knowledge consolidation, and continuous improvement.
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.
