2.同时kill 两个主:
node2:/root/cluster/7002#redis-cli -h 192.168.137.3 -p 7002 -c
192.168.137.3:7002> CLUSTER nodes
9809b72ec290d73d99a3e1b0d12c4c7bf8583c45 192.168.137.3:7003@17003 master - 0 1583313824023 26 connected 0-5460
1b83e27acd5235726aea44702526a8ca0ede9a48 192.168.137.2:7000@17000 slave 9809b72ec290d73d99a3e1b0d12c4c7bf8583c45 0 1583313823120 26 connected
191d7306b81ffa85b5837898562eb6bf1479122c 192.168.137.3:7002@17002 myself,slave bf0edaba80c4f31e9b56101572d2a5ccc8aa145c 0 1583313821000 22 connected
3c6510bd29af80703ae7c0be5a5884caaa60cd4e 192.168.137.2:7001@17001 slave a7287834bc7db37249614d23e06ed8f9a6c7b3d3 0 1583313823530 14 connected
bf0edaba80c4f31e9b56101572d2a5ccc8aa145c 192.168.137.4:7005@17005 master - 1583313824525 1583313821985 24 connected 5461-10922
a7287834bc7db37249614d23e06ed8f9a6c7b3d3 192.168.137.4:7004@17004 master - 0 1583313823011 14 connected 10923-16383
kill 192.168.137.4:7005,192.168.137.4:7004
192.168.137.4:7004> quit
node3:/root#ps -ef | grep redis
root 5517 1 1 07:02 ? 00:00:11 redis-server 192.168.137.4:7004 [cluster]
root 5574 1 1 07:03 ? 00:00:11 redis-server 192.168.137.4:7005 [cluster]
root 9014 5670 0 07:19 pts/1 00:00:00 grep redis
node3:/root#kill -9 5517,5574
-bash: kill: 5517,5574: arguments must be process or job IDs
node3:/root#kill -9 5517 5574
node3:/root#ps -ef | grep redis
root 9091 5670 0 07:20 pts/1 00:00:00 grep redis
9809b72ec290d73d99a3e1b0d12c4c7bf8583c45 192.168.137.3:7003@17003 master - 0 1583314035456 26 connected 0-5460
1b83e27acd5235726aea44702526a8ca0ede9a48 192.168.137.2:7000@17000 slave 9809b72ec290d73d99a3e1b0d12c4c7bf8583c45 0 1583314034535 26 connected
191d7306b81ffa85b5837898562eb6bf1479122c 192.168.137.3:7002@17002 myself,slave bf0edaba80c4f31e9b56101572d2a5ccc8aa145c 0 1583314033000 22 connected
3c6510bd29af80703ae7c0be5a5884caaa60cd4e 192.168.137.2:7001@17001 slave a7287834bc7db37249614d23e06ed8f9a6c7b3d3 0 1583314035000 14 connected
bf0edaba80c4f31e9b56101572d2a5ccc8aa145c 192.168.137.4:7005@17005 master,fail? - 1583313861513 1583313859176 24 disconnected 5461-10922
a7287834bc7db37249614d23e06ed8f9a6c7b3d3 192.168.137.4:7004@17004 master,fail? - 1583313861513 1583313860702 14 disconnected 10923-16383
192.168.137.2:7001@17001 ,对应master 192.168.137.4:7004@17004上的日志:
14242:S 14 Mar 06:28:23.772 # Error condition on socket for SYNC: Connection refused
14242:S 14 Mar 06:28:24.804 * Connecting to MASTER 192.168.137.4:7004
14242:S 14 Mar 06:28:24.805 * MASTER <-> SLAVE sync started
14242:S 14 Mar 06:28:24.822 # Error condition on socket for SYNC: Connection refused
14242:S 14 Mar 06:28:25.835 * Connecting to MASTER 192.168.137.4:7004
14242:S 14 Mar 06:28:25.835 * MASTER <-> SLAVE sync started
14242:S 14 Mar 06:28:25.866 # Error condition on socket for SYNC: Connection refused
^C
node1:/root/cluster/7001#
192.168.137.3:7002@17002,对应master 192.168.137.4:7005@17005:
3052:S 04 Mar 17:31:00.665 * Connecting to MASTER 192.168.137.4:7005
3052:S 04 Mar 17:31:00.666 * MASTER <-> SLAVE sync started
3052:S 04 Mar 17:31:00.667 # Error condition on socket for SYNC: Connection refused
3052:S 04 Mar 17:31:01.695 * Connecting to MASTER 192.168.137.4:7005
3052:S 04 Mar 17:31:01.695 * MASTER <-> SLAVE sync started
3052:S 04 Mar 17:31:01.696 # Error condition on socket for SYNC: Connection refused
^C
node2:/root/cluster/7002#