Redis [ERR] Nodes don’t agree about configuration!问题分析处理

作者: Huang Jinqiang 分类: Database 发布时间: 2018-02-25 19:47

查看集群状态是OK的
~]$ redis-cli -p 7000 cluster info
cluster_state:ok
cluster_slots_assigned:16384
cluster_slots_ok:16384
cluster_slots_pfail:0
cluster_slots_fail:0
cluster_known_nodes:6
cluster_size:3
cluster_current_epoch:8
cluster_my_epoch:1
cluster_stats_messages_sent:17704059
cluster_stats_messages_received:17505413

查看集节点信息也是正常的
~]$ redis-cli -p 7000 cluster nodes
e26a4dec99247c41276f49ee000e8587981fe3f6 10.135.119.101:7000 myself,master - 0 0 1 connected 0-5461
e82f495e95722fd5108248ce536ac2ecab574609 10.135.119.101:7004 slave 20eb30b9792c8e7c9e1360c88faf0a545fddbd64 0 1519555770190 6 connected
20eb30b9792c8e7c9e1360c88faf0a545fddbd64 10.135.119.101:7001 master - 0 1519555769188 6 connected 5462-10922
77eb27f57c498309c181f874697229d594bd3c3e 10.135.119.101:7005 slave 525542a557f5703166055f2ed126ff85017c5c58 0 1519555773194 8 connected
5bf6bfdb9e9e1d0b33fa448d7ee5abbd26649fa2 10.135.119.101:7003 slave e26a4dec99247c41276f49ee000e8587981fe3f6 0 1519555772193 6 connected
525542a557f5703166055f2ed126ff85017c5c58 10.135.119.101:7002 master - 0 1519555771191 8 connected 10923-16383

redis-trib.rb check的时候报[ERR] Nodes don't agree about configuration!
~]$ /usr/local/redis/bin/redis-trib.rb check 10.135.119.101:7000
>>> Performing Cluster Check (using node 10.135.119.101:7000)
M: e26a4dec99247c41276f49ee000e8587981fe3f6 10.135.119.101:7000
slots:0-5461 (5462 slots) master
1 additional replica(s)
S: e82f495e95722fd5108248ce536ac2ecab574609 10.135.119.101:7004
slots: (0 slots) slave
replicates 20eb30b9792c8e7c9e1360c88faf0a545fddbd64
M: 20eb30b9792c8e7c9e1360c88faf0a545fddbd64 10.135.119.101:7001
slots:5462-10922 (5461 slots) master
1 additional replica(s)
S: 77eb27f57c498309c181f874697229d594bd3c3e 10.135.119.101:7005
slots: (0 slots) slave
replicates 525542a557f5703166055f2ed126ff85017c5c58
S: 5bf6bfdb9e9e1d0b33fa448d7ee5abbd26649fa2 10.135.119.101:7003
slots: (0 slots) slave
replicates e26a4dec99247c41276f49ee000e8587981fe3f6
M: 525542a557f5703166055f2ed126ff85017c5c58 10.135.119.101:7002
slots:10923-16383 (5461 slots) master
1 additional replica(s)
[ERR] Nodes don't agree about configuration!
>>> Check for open slots...
>>> Check slots coverage...
[OK] All 16384 slots covered.

怎么办?通过其他节点查看集群节点信息是这样的
~]$ redis-cli -p 7001 cluster nodes
20eb30b9792c8e7c9e1360c88faf0a545fddbd64 10.135.119.101:7001 myself,master - 0 0 6 connected 5462-10922
~]$ redis-cli -p 7002 cluster nodes
525542a557f5703166055f2ed126ff85017c5c58 10.135.119.101:7002 myself,master - 0 0 8 connected 10923-16383

问题找到了,7000的节点有节点的握手信息,而其他节点之前执行过cluster reset,重新握手一次
~]$ redis-cli -p 7000 cluster meet 10.135.119.101 7001
OK
~]$ redis-cli -p 7000 cluster meet 10.135.119.101 7002
OK
~]$ redis-cli -p 7000 cluster meet 10.135.119.101 7003
OK
~]$ redis-cli -p 7000 cluster meet 10.135.119.101 7004
OK
~]$ redis-cli -p 7000 cluster meet 10.135.119.101 7005
OK

再次检查一下,都OK了
~]$ /usr/local/redis/bin/redis-trib.rb check 10.135.119.101:7000
>>> Performing Cluster Check (using node 10.135.119.101:7000)
M: e26a4dec99247c41276f49ee000e8587981fe3f6 10.135.119.101:7000
slots:0-5461 (5462 slots) master
1 additional replica(s)
S: e82f495e95722fd5108248ce536ac2ecab574609 10.135.119.101:7004
slots: (0 slots) slave
replicates 20eb30b9792c8e7c9e1360c88faf0a545fddbd64
M: 20eb30b9792c8e7c9e1360c88faf0a545fddbd64 10.135.119.101:7001
slots:5462-10922 (5461 slots) master
1 additional replica(s)
S: 77eb27f57c498309c181f874697229d594bd3c3e 10.135.119.101:7005
slots: (0 slots) slave
replicates 525542a557f5703166055f2ed126ff85017c5c58
S: 5bf6bfdb9e9e1d0b33fa448d7ee5abbd26649fa2 10.135.119.101:7003
slots: (0 slots) slave
replicates e26a4dec99247c41276f49ee000e8587981fe3f6
M: 525542a557f5703166055f2ed126ff85017c5c58 10.135.119.101:7002
slots:10923-16383 (5461 slots) master
1 additional replica(s)
[OK] All nodes agree about slots configuration.
>>> Check for open slots...
>>> Check slots coverage...
[OK] All 16384 slots covered.

发表评论

电子邮件地址不会被公开。 必填项已用*标注