Step-by-Step Guide to Setting Up a Redis Cluster on Multiple Servers
This article provides a detailed, English-language tutorial on preparing the network environment, creating necessary directories, configuring Redis instance files, launching six Redis nodes, and initializing a clustered Redis deployment across three servers using Linux command‑line tools.
1. Redis environment
IP addresses and ports for the six Redis instances:
192.168.240.234 6380 6381
192.168.240.235 6382 6383
192.168.240.8 6384 6385
2. Create directories on each server
[root@hd01 ~]# mkdir -p /usr/local/redis/cluster/conf [root@hd01 ~]# mkdir -p /usr/local/redis/cluster/data [root@hd01 ~]# mkdir -p /usr/local/redis/cluster/log3. Configuration files
On server hd01:
-rw-r--r-- 1 root root 904 Jun 21 10:36 redis-6380.conf -rw-r--r-- 1 root root 904 Jun 21 10:38 redis-6381.confOn server hd02:
-rw-r--r-- 1 root root 904 Jun 21 10:48 redis-6382.conf -rw-r--r-- 1 root root 904 Jun 21 10:49 redis-6383.confOn server hd03:
-rw-r--r-- 1 root root 902 Jun 19 15:32 redis-6384.conf -rw-r--r-- 1 root root 902 Jun 19 15:32 redis-6385.conf4. Start the six Redis nodes
[root@hd01 ~]# /usr/local/redis/bin/redis-server /usr/local/redis/cluster/conf/redis-6380.conf [root@hd01 ~]# /usr/local/redis/bin/redis-server /usr/local/redis/cluster/conf/redis-6381.conf [root@hd02 ~]# /usr/local/redis/bin/redis-server /usr/local/redis/cluster/conf/redis-6382.conf [root@hd02 ~]# /usr/local/redis/bin/redis-server /usr/local/redis/cluster/conf/redis-6383.conf [root@hd03 ~]# /usr/local/redis/bin/redis-server /usr/local/redis/cluster/conf/redis-6384.conf [root@hd03 ~]# /usr/local/redis/bin/redis-server /usr/local/redis/cluster/conf/redis-6385.conf5. Initialize the cluster
[root@hd02 ~]# /usr/local/redis/bin/redis-cli -a 123456 --cluster create 192.168.240.234:6380 192.168.240.234:6381 192.168.240.235:6382 192.168.240.235:6383 192.168.240.8:6384 192.168.240.8:6385 --cluster-replicas 1Cluster environment setup completed
If this guide helped you, please like, view, and share the article; your support encourages further high‑quality content creation. Thank you! 🙏🏻
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.
