Databases 3 min read

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.

Practical DevOps Architecture
Practical DevOps Architecture
Practical DevOps Architecture
Setting Up a Redis Master‑Slave Cluster: Configuration and Deployment Steps

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/log

Step 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 yes

Step 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 yes

Specify 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.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

DatabaseRedisconfigurationLinuxMaster‑Slave
Practical DevOps Architecture
Written by

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.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.