Redis 集群主从 - 无法添加密钥 [英] Redis cluster master slave - not able to add key
问题描述
我已经设置了 Redis 主从配置,在同一台机器上运行一个主(6379 端口)和 3 个从(6380,6381,6382).看起来集群设置正确,因为我可以在运行 info 命令时看到以下输出:
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
但是无论我在哪里尝试在 master 中添加新密钥,我都会收到以下错误:
But wherever I try to add new key in master, I get the following error:
(error) CLUSTERDOWN Hash slot not served
在 Mac OS X Yosemite 中使用 redis-3.0.7.
Using redis-3.0.7 in Mac OS X Yosemite.
推荐答案
我遇到了同样的问题,结果我忘了创建集群:http://redis.io/topics/cluster-tutorial#creating-a-redis-cluster-using-the-create-cluster-script
I had the same issue, turned out I forgot to create cluster: http://redis.io/topics/cluster-tutorial#creating-a-redis-cluster-using-the-create-cluster-script
这篇关于Redis 集群主从 - 无法添加密钥的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!