Databases 4 min read

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.

Practical DevOps Architecture
Practical DevOps Architecture
Practical DevOps Architecture
Step-by-Step Guide to Setting Up a Redis Cluster on Multiple Servers

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

3. 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.conf

On 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.conf

On 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.conf

4. 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.conf

5. 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 1

Cluster 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! 🙏🏻

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.

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