Hello, I found this problem when deploying redis cluster. I've always been confused.
This is my cluster configuration: 192.168.10.139 master -> 192.168.10.142 slave 192.168.10.140 master -> 192.168.10.143 slave 192.168.10.141 master -> 192.168.10.144 slave
This is the redis deployment cluster command:
redis-cli -a 123456 --cluster create 192.168.10.139:6379 192.168.10.140:6379 192.168.10.141:6379 192.168.10.142:6379 192.168.10.143:6379 192.168.10.144:6379 --cluster-replicas 1
This is my configuration of redis.conf: ` cluster-enabled yes
cluster-config-file nodes-6379.conf
cluster-node-timeout 5000
appendonly yes
`
So I successfully created a cluster. I found that at present, only the master can store data in this cluster, but when I use the Linux command to force the shutdown of 139 redis,There's something wrong with the cluster
I use the check command to check the cluster status, redis cli -- cluster check 192.168.10.139:6379 He made a mistake as follows:
` WARNING: 192.168.10.142:6379 claims to be slave of unknown node ID c67a299752c64bd7d470795ba2e431fc1bfc4a17. 192.168.10.139:6379 (3977d907...) -> 0 keys | 5461 slots | 1 slaves. 192.168.10.140:6379 (96a1e2fc...) -> 0 keys | 5462 slots | 1 slaves. [OK] 0 keys in 2 masters. 0.00 keys per slot on average. M: 3977d90715299067a567ae15daf2433d090e5bc2 192.168.10.139:6379 slots:[0-5460] (5461 slots) master 1 additional replica(s) S: 2699bac9036a4b2ff71a042cc71b576e8a97ae18 192.168.10.142:6379 slots: (0 slots) slave replicates c67a299752c64bd7d470795ba2e431fc1bfc4a17 M: 96a1e2fc56151fc82d4a300998914e546ac10dbd 192.168.10.140:6379 slots:[5461-10922] (5462 slots) master 1 additional replica(s) S: dcc113c36dbf82aed6d742797cdbb15e16384874 192.168.10.143:6379 slots: (0 slots) slave replicates 3977d90715299067a567ae15daf2433d090e5bc2 S: 82847b9cf2161c244e09a0ab41763a04ae8ea870 192.168.10.144:6379 slots: (0 slots) slave replicates 96a1e2fc56151fc82d4a300998914e546ac10dbd [OK] All nodes agree about slots configuration. Check for open slots... Check slots coverage... [ERR] Not all 16384 slots are covered by nodes.
`
I use the command ' cluster info':
192.168.10.140:6379> cluster info
cluster_state:fail
cluster_slots_assigned:16384
cluster_slots_ok:10923
cluster_slots_pfail:0
cluster_slots_fail:5461
cluster_known_nodes:6
cluster_size:3
cluster_current_epoch:6
cluster_my_epoch:2
cluster_stats_messages_ping_sent:2484
cluster_stats_messages_pong_sent:526
cluster_stats_messages_fail_sent:19
cluster_stats_messages_sent:3029
cluster_stats_messages_ping_received:526
cluster_stats_messages_pong_received:538
cluster_stats_messages_fail_received:7
cluster_stats_messages_received:1071
I use the command ' cluster nodes':
192.168.10.140:6379> cluster nodes
dcc113c36dbf82aed6d742797cdbb15e16384874 192.168.10.143:6379@16379 slave 3977d90715299067a567ae15daf2433d090e5bc2 0 1589768145000 5 connected
82847b9cf2161c244e09a0ab41763a04ae8ea870 192.168.10.144:6379@16379 slave 96a1e2fc56151fc82d4a300998914e546ac10dbd 0 1589768145555 6 connected
96a1e2fc56151fc82d4a300998914e546ac10dbd 192.168.10.140:6379@16379 myself,master - 0 1589768143000 2 connected 5461-10922
3977d90715299067a567ae15daf2433d090e5bc2 192.168.10.139:6379@16379 master - 0 1589768145556 1 connected 0-5460
2699bac9036a4b2ff71a042cc71b576e8a97ae18 192.168.10.142:6379@16379 slave c67a299752c64bd7d470795ba2e431fc1bfc4a17 0 1589768144548 4 connected
c67a299752c64bd7d470795ba2e431fc1bfc4a17 192.168.10.141:6379@16379 master,fail - 1589765197430 1589765195212 3 disconnected 10923-16383
So I judge that it is because the master node is down and there is no failover, which makes the slave node become the master node, but I don't know how to solve it Please help me with this, thank you
Comment From: xuyikai1
I solved it myself. From redis.log, it can be seen that the reason is that the password is set and the master password is not set from the node(command:masterauth password)