执行命令:docker stop redis_6379
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
1:X 10 May 2020 12:52:15.634 # +sdown master mymaster 172.17.0.2 6379 1:X 10 May 2020 12:52:15.634 # +odown master mymaster 172.17.0.2 6379 #quorum 1/1 1:X 10 May 2020 12:52:15.634 # + new -epoch 1 1:X 10 May 2020 12:52:15.634 # + try -failover master mymaster 172.17.0.2 6379 1:X 10 May 2020 12:52:15.649 # +vote- for -leader 6905a137af7baedbdfce4978d1d9126fdaad4faf 1 1:X 10 May 2020 12:52:15.649 # +elected-leader master mymaster 172.17.0.2 6379 1:X 10 May 2020 12:52:15.649 # +failover-state- select -slave master mymaster 172.17.0.2 6379 1:X 10 May 2020 12:52:15.725 # +selected-slave slave 172.17.0.3:6379 172.17.0.3 6379 @ mymaster 172.17.0.2 6379 1:X 10 May 2020 12:52:15.725 * +failover-state-send-slaveof-noone slave 172.17.0.3:6379 172.17.0.3 6379 @ mymaster 172.17.0.2 6379 1:X 10 May 2020 12:52:15.781 * +failover-state-wait-promotion slave 172.17.0.3:6379 172.17.0.3 6379 @ mymaster 172.17.0.2 6379 1:X 10 May 2020 12:52:16.798 # +promoted-slave slave 172.17.0.3:6379 172.17.0.3 6379 @ mymaster 172.17.0.2 6379 1:X 10 May 2020 12:52:16.798 # +failover-state-reconf-slaves master mymaster 172.17.0.2 6379 1:X 10 May 2020 12:52:16.845 * +slave-reconf-sent slave 172.17.0.4:6379 172.17.0.4 6379 @ mymaster 172.17.0.2 6379 1:X 10 May 2020 12:52:17.837 * +slave-reconf-inprog slave 172.17.0.4:6379 172.17.0.4 6379 @ mymaster 172.17.0.2 6379 1:X 10 May 2020 12:52:17.837 * +slave-reconf-done slave 172.17.0.4:6379 172.17.0.4 6379 @ mymaster 172.17.0.2 6379 1:X 10 May 2020 12:52:17.937 # +failover-end master mymaster 172.17.0.2 6379 # 生成执行故障转移 1:X 10 May 2020 12:52:17.937 # + switch -master mymaster 172.17.0.2 6379 172.17.0.3 6379 1:X 10 May 2020 12:52:17.938 * +slave slave 172.17.0.4:6379 172.17.0.4 6379 @ mymaster 172.17.0.3 6379 1:X 10 May 2020 12:52:17.938 * +slave slave 172.17.0.2:6379 172.17.0.2 6379 @ mymaster 172.17.0.3 6379 1:X 10 May 2020 12:53:18.010 # +sdown slave 172.17.0.2:6379 172.17.0.2 6379 @ mymaster 172.17.0.3 6379 |
注意
已经掉线的 172.17.0.2:6379
主节点重新上线后将自动切换为从服务