redis集群搭建报错-(error) CLUSTERDOWN The cluster is down

【README】

最近搭建一个redis集群,参考博文 (https://www.cnblogs.com/mafly/p/redis_cluster.html) 对集群配置后,master, slave 也启动起来,但无法插入数据;

 

【1】报错信息;

[root@centos201 redis-cluster]# /usr/local/bin/redis-cli -c -h 192.168.163.201 -p 6379   
192.168.163.201:6379> keys *
1) "k3"
2) "k2"
192.168.163.201:6379> set k4 v4
(error) CLUSTERDOWN The cluster is down

【2】解决方法

step1) 找到创建集群的 文件 redis-trib.rb 并执行如下命令检车集群服务(ip+端口号)

[root@centos201 bin]# ./redis-trib.rb check 192.168.163.201:6379
Connecting to node 192.168.163.201:6379: OK
Connecting to node 192.168.163.201:6381: OK
Connecting to node 192.168.163.202:6380: OK
Connecting to node 192.168.163.202:6381: OK
Connecting to node 192.168.163.201:6380: OK
Connecting to node 192.168.163.202:6379: OK
*** WARNING: 192.168.163.202:6381 claims to be slave of unknown node ID e3f10671246e54c0ae60b7bf9f73efc9c60a2669.
>>> Performing Cluster Check (using node 192.168.163.201:6379)
M: 3faa9492e958d4f7d4e882d0c478d5445e3eafa8 192.168.163.201:6379
   slots:0-5460 (5461 slots) master
   1 additional replica(s)
S: fb2d63eef5286da9613ff252ea3e02bc5bf1714a 192.168.163.201:6381
   slots: (0 slots) slave
   replicates ec6f04c5cb3e3392b7787445440b7494ddff8923
S: 2f71a7878b1ea9a773bc0c2b938a97b72fe99883 192.168.163.202:6380
   slots: (0 slots) slave
   replicates 3faa9492e958d4f7d4e882d0c478d5445e3eafa8
S: 5a3d443feba5c67451b31ded6480bb5a70804b88 192.168.163.202:6381
   slots: (0 slots) slave
   replicates e3f10671246e54c0ae60b7bf9f73efc9c60a2669
S: e2d2d0554c6051bb27b51aa5093ae66a85c4a16c 192.168.163.201:6380
   slots: (0 slots) slave
   replicates ec6f04c5cb3e3392b7787445440b7494ddff8923
M: ec6f04c5cb3e3392b7787445440b7494ddff8923 192.168.163.202:6379
   slots:5461-10922 (5462 slots) master
   2 additional replica(s)
[OK] All nodes agree about slots configuration.
>>> Check for open slots...
>>> Check slots coverage...
[ERR] Not all 16384 slots are covered by nodes.

step2)

你可能感兴趣的:(redis)