[ERR] Not all 16384 slots are covered by nodes.

redis集群开不起来,用redis-cli连接的时候出现如下错误:

CLUSTERDOWN The cluster is down

然后使用redis-trib.rb检查:

./redis-trib.rb check 10.10.25.243:6379

出现如下错误:

Connecting to node 10.10.20.243:6379: OK

>>> Performing Cluster Check(using node 10.10.20.243:6379)

[OK] All nodes agree about slotsconfiguration.

>>> Check for open slots...

>>> Check slots coverage...

[ERR] Not all 16384 slots are covered by nodes.

因为我只有一个节点,单节点集群,所以使用如下方法来修复节点:

./redis-trib.rb fix 10.10.20.243:6379

之后输出如下:

.......
>>> Covering slot 16276 with 10.10.25.243:6379
>>> Covering slot 16277 with 10.10.25.243:6379
>>> Covering slot 16278 with 10.10.25.243:6379
>>> Covering slot 16279 with 10.10.25.243:6379
>>> Covering slot 16280 with 10.10.25.243:6379
>>> Covering slot 16281 with 10.10.25.243:6379
>>> Covering slot 16282 with 10.10.25.243:6379
>>> Covering slot 16283 with 10.10.25.243:6379
>>> Covering slot 16284 with 10.10.25.243:6379
>>> Covering slot 16285 with 10.10.25.243:6379
>>> Covering slot 16286 with 10.10.25.243:6379
>>> Covering slot 16287 with 10.10.25.243:6379
>>> Covering slot 16288 with 10.10.25.243:6379
>>> Covering slot 16289 with 10.10.25.243:6379
>>> Covering slot 16290 with 10.10.25.243:6379
>>> Covering slot 16291 with 10.10.25.243:6379
>>> Covering slot 16292 with 10.10.25.243:6379
>>> Covering slot 16293 with 10.10.25.243:6379
>>> Covering slot 16294 with 10.10.25.243:6379
>>> Covering slot 16295 with 10.10.25.243:6379
>>> Covering slot 16296 with 10.10.25.243:6379
>>> Covering slot 16297 with 10.10.25.243:6379
>>> Covering slot 16298 with 10.10.25.243:6379
>>> Covering slot 16299 with 10.10.25.243:6379
>>> Covering slot 16300 with 10.10.25.243:6379
>>> Covering slot 16301 with 10.10.25.243:6379
>>> Covering slot 16302 with 10.10.25.243:6379
>>> Covering slot 16303 with 10.10.25.243:6379
>>> Covering slot 16304 with 10.10.25.243:6379
>>> Covering slot 16305 with 10.10.25.243:6379
>>> Covering slot 16306 with 10.10.25.243:6379
........

然后再检查下集群的情况:

redis-trib.rb check 10.10.25.243:6379

输出如下:

>>> Performing Cluster Check (using node 10.10.25.243:6379)
M: 4df1b649c1d0d08c2fa2a55e13d8d95c6d4f2b22 10.10.25.243:6379
   slots:0-16383 (16384 slots) master
   0 additional replica(s)
[OK] All nodes agree about slots configuration.
>>> Check for open slots...
>>> Check slots coverage...
[OK] All 16384 slots covered.

检查下集群信息:

root@nick-VirtualBox:/home/nick/software/redis-3.2.8# redis-cli -h 10.10.25.243 -p 6379
10.10.25.243:6379> cluster info
cluster_state:ok
cluster_slots_assigned:16384
cluster_slots_ok:16384
cluster_slots_pfail:0
cluster_slots_fail:0
cluster_known_nodes:1
cluster_size:1
cluster_current_epoch:0
cluster_my_epoch:0
cluster_stats_messages_sent:0
cluster_stats_messages_received:0

 最后用redis-cli连下,正常了。可以连接,并且放入值和取出值也正常。

原文地址:https://www.cnblogs.com/toSeeMyDream/p/8716330.html