原因主要是原有的添加在redis配置中,没有进行重置之前的配置
[root@host57 ~]# redis-cli -h 192.168.4.57 -p 6357
192.168.4.57:6357> CLUSTER RESET
OK
192.168.4.57:6357> cluster info
cluster_state:fail
cluster_slots_assigned:0
cluster_slots_ok:0
cluster_slots_pfail:0
cluster_slots_fail:0
cluster_known_nodes:1
cluster_size:0
cluster_current_epoch:9
cluster_my_epoch:8
cluster_stats_messages_ping_sent:32
cluster_stats_messages_pong_sent:7
cluster_stats_messages_sent:39
cluster_stats_messages_ping_received:7
cluster_stats_messages_pong_received:32
cluster_stats_messages_received:39
管理服务器
[root@51 ~]# redis-trib.rb add-node 192.168.4.57:6357 192.168.4.51:6351
>>> Adding node 192.168.4.57:6357 to cluster 192.168.4.51:6351
>>> Performing Cluster Check (using node 192.168.4.51:6351)
M: b00bfb1d93247f56719582e8b9865ae374e17c33 192.168.4.51:6351
slots:1365-5460 (4096 slots) master
1 additional replica(s)
S: 2f002d4ec870d72d2f966c6051a586c57cff1afa 192.168.4.52:6352
slots: (0 slots) slave
replicates 20b20d6ddf38a67e8f81bb7badec220bf2be7b3a
M: 20b20d6ddf38a67e8f81bb7badec220bf2be7b3a 192.168.4.56:6356
slots:6827-10922 (4096 slots) master
1 additional replica(s)
S: 0ba5e235aa72f9ea10ed8f7da1a60caefc9b9b6c 192.168.4.55:6355
slots: (0 slots) slave
replicates b00bfb1d93247f56719582e8b9865ae374e17c33
M: 45f61b35eaf179a4b161008b79c54122617048ee 192.168.4.53:6353
slots:0-1364,5461-6826,10923-16383 (8192 slots) master
1 additional replica(s)
S: 9672778d5a8c6685daa7339df325d93f6c73b6bd 192.168.4.54:6354
slots: (0 slots) slave
replicates 45f61b35eaf179a4b161008b79c54122617048ee
[OK] All nodes agree about slots configuration.
>>> Check for open slots...
>>> Check slots coverage...
[OK] All 16384 slots covered.
>>> Send CLUSTER MEET to node 192.168.4.57:6357 to make it join the cluster.
[OK] New node added correctly.
[root@51 ~]# redis-trib.rb check 192.168.4.51:6351
>>> Performing Cluster Check (using node 192.168.4.51:6351)
M: b00bfb1d93247f56719582e8b9865ae374e17c33 192.168.4.51:6351
slots:1365-5460 (4096 slots) master
1 additional replica(s)
M: 6df9172d2b03bf298dc7342acdcf1b385f367aba 192.168.4.57:6357
slots: (0 slots) master
0 additional replica(s)
S: 2f002d4ec870d72d2f966c6051a586c57cff1afa 192.168.4.52:6352
slots: (0 slots) slave
replicates 20b20d6ddf38a67e8f81bb7badec220bf2be7b3a
M: 20b20d6ddf38a67e8f81bb7badec220bf2be7b3a 192.168.4.56:6356
slots:6827-10922 (4096 slots) master
1 additional replica(s)
S: 0ba5e235aa72f9ea10ed8f7da1a60caefc9b9b6c 192.168.4.55:6355
slots: (0 slots) slave
replicates b00bfb1d93247f56719582e8b9865ae374e17c33
M: 45f61b35eaf179a4b161008b79c54122617048ee 192.168.4.53:6353
slots:0-1364,5461-6826,10923-16383 (8192 slots) master
1 additional replica(s)
S: 9672778d5a8c6685daa7339df325d93f6c73b6bd 192.168.4.54:6354
slots: (0 slots) slave
replicates 45f61b35eaf179a4b161008b79c54122617048ee
[OK] All nodes agree about slots configuration.
>>> Check for open slots...
>>> Check slots coverage...
[OK] All 16384 slots covered.
[root@host57 ~]# redis-cli -h 192.168.4.57 -p 6357
192.168.4.57:6357> CLUSTER RESET
OK
192.168.4.57:6357> cluster info
cluster_state:ok
cluster_slots_assigned:16384
cluster_slots_ok:16384
cluster_slots_pfail:0
cluster_slots_fail:0
cluster_known_nodes:7
cluster_size:3
cluster_current_epoch:9
cluster_my_epoch:8
cluster_stats_messages_ping_sent:1230
cluster_stats_messages_pong_sent:587
cluster_stats_messages_meet_sent:6
cluster_stats_messages_sent:1823
cluster_stats_messages_ping_received:587
cluster_stats_messages_pong_received:1236
cluster_stats_messages_received:1823
把移除的主机在此添加到原有的集群中
[root@host57 ~]# redis-cli -h 192.168.4.57 -p 6357