先剔除不健康的Replica
依照Replica-priority进行排序
资料同步复制处理之同步差
RunID
在开始测试Redis Server异常自动切换Master前,先确认目前Sentinel丛集状态.
# 连线到sentinel丛集
# 目前监控的redis server master是mymaster中的 IP: 127.0.0.1 Port: 6380
# Sentinel 26379 状态
./redis-cli -h 127.0.0.1 -p 26379
127.0.0.1:26379> info sentinel
# Sentinel
sentinel_masters:1
sentinel_tilt:0
sentinel_running_scripts:0
sentinel_scripts_queue_length:0
sentinel_simulate_failure_flags:0
master0:name=mymaster,status=ok,address=127.0.0.1:6380,slaves=2,sentinels=3
# Sentinel 26380 状态
./redis-cli -h 127.0.0.1 -p 26380
127.0.0.1:26380> info sentinel
# Sentinel
sentinel_masters:1
sentinel_tilt:0
sentinel_running_scripts:0
sentinel_scripts_queue_length:0
sentinel_simulate_failure_flags:0
master0:name=mymaster,status=ok,address=127.0.0.1:6380,slaves=2,sentinels=3
# Sentinel 26381 状态
./redis-cli -h 127.0.0.1 -p 26381
127.0.0.1:26381> info sentinel
# Sentinel
sentinel_masters:1
sentinel_tilt:0
sentinel_running_scripts:0
sentinel_scripts_queue_length:0
sentinel_simulate_failure_flags:0
master0:name=mymaster,status=ok,address=127.0.0.1:6380,slaves=2,sentinels=3
# 连线至目前Redis Server (Master) 6380
./redis-cli -h 127.0.0.1 -p 6380
127.0.0.1:6380> info replication
# Replication
role:master
connected_slaves:2
slave0:ip=127.0.0.1,port=6381,state=online,offset=3204281,lag=0
slave1:ip=127.0.0.1,port=6379,state=online,offset=3204281,lag=0
master_failover_state:no-failover
master_replid:ea3bc11d99568d87b0496fb83c6f2ccc58425baa
master_replid2:a30878092cdd31e404af76eaa7a2d024c8ae843e
master_repl_offset:3204281
second_repl_offset:19299
repl_backlog_active:1
repl_backlog_size:1048576
repl_backlog_first_byte_offset:2155706
repl_backlog_histlen:1048576
#
ps -ef|grep redis-server
# kill
kill -9 409413
# 原Redis Server Master 6380 已侦测到异常
+sdown master mymaster 127.0.0.1 6380
# 投票选取Sentinel 此次进行切换的Leader
+vote-for-leader 6337212980ee71b6db0222c50ad525c94c6c48a8 1
# 选取Sentinel 26380为此次进行切换的Leader
+config-update-from sentinel 6337212980ee71b6db0222c50ad525c94c6c48a8 127.0.0.1 26380 @ mymaster 127.0.0.1 6380
# 切换Redis Server Master 6381为新的Master取代原有的
switch-master mymaster 127.0.0.1 6380 127.0.0.1 6381
Connecting to MASTER 127.0.0.1:6381
Full resync from master: c2f5749e8daef12058d98addb48e954afbc92698:1306638
# 确认Redis Server 6380角色为Replica
./redis-cli -h 127.0.0.1 -p 6380
127.0.0.1:6380> info replication
# Replication
role:slave
master_host:127.0.0.1
master_port:6381
master_link_status:up
master_last_io_seconds_ago:0
master_sync_in_progress:0
slave_repl_offset:1377655
slave_priority:100
slave_read_only:1
replica_announced:1
connected_slaves:0
master_failover_state:no-failover
master_replid:c2f5749e8daef12058d98addb48e954afbc92698
master_replid2:0000000000000000000000000000000000000000
master_repl_offset:1377655
second_repl_offset:-1
repl_backlog_active:1
repl_backlog_size:1048576
repl_backlog_first_byte_offset:1306639
repl_backlog_histlen:71017
# 确认Sentinel与Redis Server都已恢复
./redis-cli -h 127.0.0.1 -p 26379
127.0.0.1:26379> info sentinel
# Sentinel
sentinel_masters:1
sentinel_tilt:0
sentinel_running_scripts:0
sentinel_scripts_queue_length:0
sentinel_simulate_failure_flags:0
master0:name=mymaster,status=ok,address=127.0.0.1:6381,slaves=2,sentinels=3
>>: [Day 25] vue-router路由传送参数 props
昨天把整个专案架起来了 今天我们就可以开始来刻画面了 这边也要提一下之前我们其实是直接开写 先从会员...
让我告诉你XAMPP有多神 完全免费 容易安装,下载->解压缩->启动->完成 提...
快到结尾了,再让笔者水一篇 XDD,今天我们来聊聊 CNN 会不会是深度学习领域的最後呢? CNN...
决定了,就用这个主题当铁人赛30天的终点! 从起始点‧带着满满困惑学习这篇说起吧,文末提到as a ...
What should you do if the partition on your extern...