搭建好哨兵之后,哨兵一启动,过了30秒就会判断master sdown:
[root@cache01 ~]# redis-sentinel /etc/sentinal/5000.conf 1239:X 23 May 01:40:00.457 * Increased maximum number of open files to 10032 (it was originally set to 1024). _._ _.-``__ ''-._ _.-`` `. `_. ''-._ Redis 3.2.8 (00000000/0) 64 bit .-`` .-```. ```\/ _.,_ ''-._ ( ' , .-` | `, ) Running in sentinel mode |`-._`-...-` __...-.``-._|'` _.-'| Port: 5000 | `-._ `._ / _.-' | PID: 1239 `-._ `-._ `-./ _.-' _.-' |`-._`-._ `-.__.-' _.-'_.-'| | `-._`-._ _.-'_.-' | http://redis.io `-._ `-._`-.__.-'_.-' _.-' |`-._`-._ `-.__.-' _.-'_.-'| | `-._`-._ _.-'_.-' | `-._ `-._`-.__.-'_.-' _.-' `-._ `-.__.-' _.-' `-._ _.-' `-.__.-' 1239:X 23 May 01:40:00.463 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128. 1239:X 23 May 01:40:00.463 # Sentinel ID is f274f09cbae22d1a0c6d5743469d8438fcb360c9 1239:X 23 May 01:40:00.463 # +monitor master mymaster 192.168.8.181 6379 quorum 2 1239:X 23 May 01:40:30.499 # +sdown master mymaster 192.168.8.181 6379
原因是没有设置节点认证的密码,也就是我的redis设置了节点通信的密码,那么在哨兵里面也是需要配置的。
配置好之后就可以啦
此文章仅代表自己(本菜鸟)学习积累记录,或者学习笔记,如有侵权,请联系作者删除。人无完人,文章也一样,文笔稚嫩,在下不才,勿喷,如果有错误之处,还望指出,感激不尽~
技术之路不在一时,山高水长,纵使缓慢,驰而不息。
公众号:秦怀杂货店