redis主从部署使用sentinel做监控 为什么failover 无法切换到新的master上去?
黄舟
黄舟 2017-04-22 09:00:26
0
1
1447

sentinel 日志

29114:X 12 Jun 14:04:20.607 # Sentinel runid is 043891c936a959aec45f8e66076f23a268fdb3e4
29114:X 12 Jun 14:04:20.607 # +monitor master mymaster 10.10.0.5 6379 quorum 2
29114:X 12 Jun 14:04:20.607 * +slave slave 10.10.0.6:6379 10.10.0.6 6379 @ mymaster 10.10.0.5 6379
29114:X 12 Jun 14:04:20.608 * +slave slave 10.10.0.7:6379 10.10.0.7 6379 @ mymaster 10.10.0.5 6379
29114:X 12 Jun 14:04:26.833 * +sentinel sentinel 10.10.0.6:26379 10.10.0.6 26379 @ mymaster 10.10.0.5 6379
29114:X 12 Jun 14:04:29.203 * +sentinel sentinel 10.10.0.7:26379 10.10.0.7 26379 @ mymaster 10.10.0.5 6379
29114:X 12 Jun 14:07:45.950 # +sdown slave 10.10.0.6:6379 10.10.0.6 6379 @ mymaster 10.10.0.5 6379
29114:X 12 Jun 14:08:02.423 * +reboot slave 10.10.0.6:6379 10.10.0.6 6379 @ mymaster 10.10.0.5 6379
29114:X 12 Jun 14:08:02.480 # -sdown slave 10.10.0.6:6379 10.10.0.6 6379 @ mymaster 10.10.0.5 6379
29114:X 12 Jun 14:22:42.859 # +sdown master mymaster 10.10.0.5 6379
29114:X 12 Jun 14:22:42.927 # +odown master mymaster 10.10.0.5 6379 #quorum 2/2
29114:X 12 Jun 14:22:42.927 # +new-epoch 1
29114:X 12 Jun 14:22:42.927 # +try-failover master mymaster 10.10.0.5 6379
29114:X 12 Jun 14:22:42.928 # +vote-for-leader 043891c936a959aec45f8e66076f23a268fdb3e4 1
29114:X 12 Jun 14:22:42.930 # 10.10.0.6:26379 voted for 043891c936a959aec45f8e66076f23a268fdb3e4 1
29114:X 12 Jun 14:22:42.931 # 10.10.0.7:26379 voted for 043891c936a959aec45f8e66076f23a268fdb3e4 1
29114:X 12 Jun 14:22:42.999 # +elected-leader master mymaster 10.10.0.5 6379
29114:X 12 Jun 14:22:42.999 # +failover-state-select-slave master mymaster 10.10.0.5 6379
29114:X 12 Jun 14:22:43.100 # +selected-slave slave 10.10.0.7:6379 10.10.0.7 6379 @ mymaster 10.10.0.5 6379
29114:X 12 Jun 14:22:43.100 * +failover-state-send-slaveof-noone slave 10.10.0.7:6379 10.10.0.7 6379 @ mymaster 10.10.0.5 6379
29114:X 12 Jun 14:22:43.156 * +failover-state-wait-promotion slave 10.10.0.7:6379 10.10.0.7 6379 @ mymaster 10.10.0.5 6379
29114:X 12 Jun 14:25:43.170 # -failover-abort-slave-timeout master mymaster 10.10.0.5 6379
29114:X 12 Jun 14:25:43.232 # Next failover delay: I will not start a failover before Fri Jun 12 14:28:43 2015

sentinel info 信息

# /usr/local/redis/bin/redis-cli -p 26379
127.0.0.1:26379> info
# Server
redis_version:3.0.2
redis_git_sha1:00000000
redis_git_dirty:0
redis_build_id:505c8a5fd8dda26a
redis_mode:sentinel
os:Linux 2.6.32-431.11.7.el6.x86_64 x86_64
arch_bits:64
multiplexing_api:epoll
gcc_version:4.4.7
process_id:28648
run_id:d95639e7a3f0d7e640c8356da8665e59e2e9843e
tcp_port:26379
uptime_in_seconds:2034
uptime_in_days:0
hz:18
lru_clock:8027738
config_file:/usr/local/redis/sentinel.conf

# Sentinel
sentinel_masters:1
sentinel_tilt:0
sentinel_running_scripts:0
sentinel_scripts_queue_length:0
master0:name=xkredis,status=odown,address=10.10.0.5:6379,slaves=2,sentinels=3

redis 部署信息:

10.10.0.5:6379 master
10.10.0.6:6379
10.10.0.7:6379

redis sentinel 部署信息:

10.10.0.5:26379
10.10.0.6:26379
10.10.0.7:26379

sentinel.conf配置如下

port 26379
daemonize yes
logfile "/usr/local/redis/log/sentinel.log"

sentinel monitor mymaster 10.10.0.5 6379 2
sentinel down-after-milliseconds mymaster 5000
sentinel failover-timeout mymaster 180000
sentinel parallel-syncs mymaster 1

黄舟
黄舟

人生最曼妙的风景,竟是内心的淡定与从容!

全部回复(1)
阿神

啥都不说了 都是泪啊 。。。
可能是我rpm包打包问题,从redis源码编译安装的redis 主从启动后测试没有问题。
看来还有待研究啊。

热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板