redis 集群启动报错 解决方案

      redis 集群启动报错 解决方案

1  [ERR] Node 192.168.126.133:7000 is not empty. Either the node already knows other nodes (check with CLUSTER NODES) or contains some key in database 0.


解决方法:

1)、将需要新增的节点下aof、rdb等本地备份文件删除;

2)、同时将新Node的集群配置文件删除,即:删除你redis.conf里面cluster-config-file所在的文件;

3)、再次添加新节点如果还是报错,则登录新Node,./redis-cli–h x –p对数据库进行清除:

192.168.126.133:7000>  flushdb      #清空当前数据库

2  /usr/lib64/ruby/gems/1.8/gems/redis-3.3.2/lib/redis/client.rb:121:in `call': ERR Slot 3853 is already busy (Redis::CommandError)

经检查,这是由于上一次配置集群失败时留下的配置信息导致的。 只要把redis.conf中定义的 cluster-config-file 所在的文件删除,重新启动redis-server及运行redis-trib即可。

[root@tracker_ip src]# redis-trib.rb create --replicas 1 192.168.126.133:7000 192.168.126.133:7001 192.168.126.133:7002 192.168.126.132:7003 192.168.126.132:7004 192.168.126.132:7005
>>> Creating cluster
>>> Performing hash slots allocation on 6 nodes...
Using 3 masters:
192.168.126.132:7003
192.168.126.133:7000
192.168.126.132:7004
Adding replica 192.168.126.133:7001 to 192.168.126.132:7003
Adding replica 192.168.126.132:7005 to 192.168.126.133:7000
Adding replica 192.168.126.133:7002 to 192.168.126.132:7004
M: 6c9ac5b8c71ac7875590d44bca9fb6f425436f8e 192.168.126.133:7000
   slots:5461-10922 (5462 slots) master
S: 3f83c6e383277a68e390a5ff90e70a9804558b1f 192.168.126.133:7001
   replicates 65cee77975fa690694f94c3507de465363a5ed28
S: 914498b29d881b4d430551fdcfbd8e3a29b31601 192.168.126.133:7002
   replicates 1264f17a92688bf0c3f5b380de98415d4bf4c48f
M: 65cee77975fa690694f94c3507de465363a5ed28 192.168.126.132:7003
   slots:0-5460 (5461 slots) master
M: 1264f17a92688bf0c3f5b380de98415d4bf4c48f 192.168.126.132:7004
   slots:10923-16383 (5461 slots) master
S: d62fd09faa16363ab7cd6c57a4580bd1a9ef943e 192.168.126.132:7005
   replicates 6c9ac5b8c71ac7875590d44bca9fb6f425436f8e
Can I set the above configuration? (type 'yes' to accept): yes
>>> Nodes configuration updated
>>> Assign a different config epoch to each node
>>> Sending CLUSTER MEET messages to join the cluster
Waiting for the cluster to join....
>>> Performing Cluster Check (using node 192.168.126.133:7000)
M: 6c9ac5b8c71ac7875590d44bca9fb6f425436f8e 192.168.126.133:7000
   slots:5461-10922 (5462 slots) master
M: 3f83c6e383277a68e390a5ff90e70a9804558b1f 192.168.126.133:7001
   slots: (0 slots) master
   replicates 65cee77975fa690694f94c3507de465363a5ed28
M: 914498b29d881b4d430551fdcfbd8e3a29b31601 192.168.126.133:7002
   slots: (0 slots) master
   replicates 1264f17a92688bf0c3f5b380de98415d4bf4c48f
M: 65cee77975fa690694f94c3507de465363a5ed28 192.168.126.132:7003
   slots:0-5460 (5461 slots) master
M: 1264f17a92688bf0c3f5b380de98415d4bf4c48f 192.168.126.132:7004
   slots:10923-16383 (5461 slots) master
M: d62fd09faa16363ab7cd6c57a4580bd1a9ef943e 192.168.126.132:7005
   slots: (0 slots) master
   replicates 6c9ac5b8c71ac7875590d44bca9fb6f425436f8e
[OK] All nodes agree about slots configuration.
>>> Check for open slots...
>>> Check slots coverage...
[OK] All 16384 slots covered.
集群启动成功!


评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值