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/confmkdir -p /usr/local/redis/datamkdir -p /usr/local/redis/logStep 2 – Edit redis.conf on the master node:
bind 0.0.0.0daemonize yeslogfile "/usr/local/redis/log/redis.log"dbfilename dump.rdbappendonly yesappendfilename "appendonly.aof"dir /usr/local/redis/datarequirepass 123456masterauth 123456replica-read-only yesStep 3 – Apply the same configuration on each slave node, adjusting only the replication target:
bind 0.0.0.0daemonize yeslogfile "/usr/local/redis/log/redis.log"dbfilename dump.rdbappendonly yesappendfilename "appendonly.aof"dir /usr/local/redis/datarequirepass 123456masterauth 123456replica-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.
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.
