Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Redis cluster master slave - not able to add key

Tags:

redis

I have setup up Redis master slave configuration having one master (6379 port) and 3 slaves (6380,6381,6382) running in the same machine. Looks like cluster is setup properly as I can see the following output on running info command:

# Replication
role:master
connected_slaves:3
slave0:ip=127.0.0.1,port=6380,state=online,offset=29,lag=1
slave1:ip=127.0.0.1,port=6381,state=online,offset=29,lag=1
slave2:ip=127.0.0.1,port=6382,state=online,offset=29,lag=1
master_repl_offset:43
repl_backlog_active:1
repl_backlog_size:1048576
repl_backlog_first_byte_offset:2
repl_backlog_histlen:42

But wherever I try to add new key in master, I get the following error:

(error) CLUSTERDOWN Hash slot not served

Using redis-3.0.7 in Mac OS X Yosemite.

like image 240
Rakesh Goyal Avatar asked Mar 21 '16 07:03

Rakesh Goyal


2 Answers

To fix slots issue while insertion:

redis-cli --cluster fix localhost:6379
like image 166
Abdul Saqib Avatar answered Dec 27 '22 09:12

Abdul Saqib


I had the same issue, turned out I forgot to run the create cluster:

cd /path/to/utils/create-cluster 
./create-cluster create

http://redis.io/topics/cluster-tutorial#creating-a-redis-cluster-using-the-create-cluster-script

like image 27
roboslone Avatar answered Dec 27 '22 11:12

roboslone