Ranjitha.G Hiremath
Ranjitha.G Hiremath

Reputation: 11

how to form redis cluster using 3 master nodes and 3 slave nodes

I m new to redis. i want to create redis cluster using 3 master nodes and 3 slave nodes. First i installed redis-server on all the three linux systems. Redis-server version that got installed is 4.0.9 I Edited /etc/redis/redis.conf file initiall like as below bind 127.0.0.1 192.168.X.XX protected-mode no port 6379 pidfile /var/run/redis_6379.pid cluster-enabled yes cluster-config-file nodes-6379.conf cluster-node-timeout 15000

with these changes redis server stopped running and i couldn't correct it back so i uninstalled and installed it back again. Now to create cluter i followed below procedures like mkdir cluster cd cluster

vi redis_master1.conf

bind 127.0.0.1 192.168.X.XX protected-mode no port 6380 pidfile /var/run/redis_6380.pid cluster-enabled yes cluster-config-file nodes-6380.conf cluster-node-timeout 15000

vi redis_slave1.conf

bind 127.0.0.1 192.168.X.XX protected-mode no port 6381 pidfile /var/run/redis_6381.pid cluster-enabled yes cluster-config-file nodes-6381.conf cluster-node-timeout 15000

There is change in ip address and port num in respective systems accordingly Now, when i gave redis-cli --cluster create 192.168.X.XX:6380 192.168.Y.YY:6381 192.168.Z.ZZ:6382 --cluster-replicas 1

i get the following error Unrecognized option or bad number of args for: '--cluster'

My Quetions are

  1. Does Open source Redis supports cluster formation?
  2. Am i doing anything wrong?

Upvotes: 1

Views: 1726

Answers (1)

Ankit Sahay
Ankit Sahay

Reputation: 2043

To answer your 2 questions.

  1. Yes, open source Redis does provide cluster capability
  2. In your cluster create command, you have to connect to one of the node and then pass the --cluter create argument like:

redis-cli -h 127.0.0.1 -p 7000 --cluster create 127.0.0.1:7000 127.0.0.1:7001 127.0.0.1:7002 127.0.0.1:7003 127.0.0.1:7004 127.0.0.1:7005 --cluster-replicas 1

In the above command, the assumption is that redis is installed and running on all the 6 nodes.

For complete steps you can follow my github link

Upvotes: 2

Related Questions