Sentinel not finding quorum in Redis 3.2.1

123 views
Skip to first unread message

mmasl...@gmail.com

unread,
Jul 14, 2016, 6:27:25 PM7/14/16
to Redis DB
Replication is working fine with 1 master and 2 slaves, but failover is not. The Master, "devmaster", recognizes 2 slaves when they connect to 26379, but fails to count them as a quorum. I am confused by the Sentinel documentation, especially the IP and name. I'm unsure what the documentation:
sentinel monitor resque 192.168.1.3 6380 4
is trying to do. When I use "resque" there is no association with "devmaster" and 
redis-cli sentinel slaves devmaster returns an empty set
and I've no clue what the IP 192.168.1.3 refers to in the documentation. Is it the master? The slave? I see a new port. But does that mean there's a second Redis replication ring instantiated?

Could you please correct my foolishness and help me achieve failover? My master-slave replication is awesome.

# Master sentinel.conf
# port <sentinel-port>
port 26379

pidfile /var/run/redis/redis-sentinel.pid
dir /tmp
loglevel debug
logfile "/var/log/redis/redis-sentinel.log"
maxclients 4000

sentinel monitor devmaster 127.0.0.1 6379 2
sentinel down-after-milliseconds devmaster 10000
sentinel parallel-syncs devmaster 1
sentinel failover-timeout devmaster 30000

==============

# Slave sentinel.conf
# port <sentinel-port>
port 26379

pidfile "/var/run/redis/redis-sentinel.pid"
dir "/tmp"
loglevel debug
logfile "/var/log/redis/redis-sentinel.log"  # This log shows ping? connections every second between the two slaves
maxclients 4000

sentinel monitor devmaster 143.61.2.31 26379 2   
# devmaster IP is 143.61.2.31, if I use port 6379 then redis-cli sentinel slaves master { empty set}
sentinel down-after-milliseconds devmaster 10000
sentinel parallel-syncs devmaster 1
sentinel failover-timeout devmaster 30000


The Real Bill

unread,
Jul 15, 2016, 2:46:05 AM7/15/16
to Redis DB
Well sentinel shouldn't point to a sentinel to try to manage failover - it just won't work.

Each sentinel, of which you will need three, need to be told to talk to the master Redis server and nowhere else. Once each is connected they will discover each other and handle things. Please read the sentinel docs at http://redis.io/topics/sentinel for a more complete walk through. You've missed some important details that are ther.

Cheers,
Bill

mmasl...@gmail.com

unread,
Jul 18, 2016, 5:12:07 PM7/18/16
to Redis DB
Thanks Bill. I have read (perused) the Redis Sentinel Documentation prior to attempting this and yet again after your comment. I'm trying my best to follow directions yet I'm not getting the expected failover results. I have three RHEL servers with Redis 3.2.1 installed as a service on port 6379 running a replicated group where 143.61.2.31 is the master. The redis-sentinels are likewise set up on port 26379. The new slave config now monitors the master Redis. We have firewalls that I have submitted rules exceptions for ports 6379, 16379 and 26379 bi-directionally between all three servers.

Are there other handshakes going on? I'm watching the debug logs and see what look like pings between the two slaves, but nothing from the master sentinel:
...
6844:X 18 Jul 17:02:01.852 - Accepted 143.61.2.32:58027
6844:X 18 Jul 17:02:02.886 - Accepted 143.61.2.32:58032
6844:X 18 Jul 17:02:03.924 - Accepted 143.61.2.32:58037
6844:X 18 Jul 17:02:04.980 - Accepted 143.61.2.32:58042
6844:X 18 Jul 17:02:06.061 - Accepted 143.61.2.32:58047
6844:X 18 Jul 17:02:07.102 - Accepted 143.61.2.32:58052
...
28699:X 18 Jul 17:04:27.347 - Accepted 209.82.241.145:51140
28699:X 18 Jul 17:04:28.408 - Accepted 209.82.241.145:51145
28699:X 18 Jul 17:04:29.421 - Accepted 209.82.241.145:51150
28699:X 18 Jul 17:04:30.484 - Accepted 209.82.241.145:51155
28699:X 18 Jul 17:04:31.498 - Accepted 209.82.241.145:51160
...
I performed a service Redis stop on the Master and both sentinel slaves logged:
6844:X 18 Jul 17:06:02.139 # +sdown master devmaster 143.61.2.31 6379
... and that's as far as it got

The new slave conf file per the comment by Real Bill, follows. It monitors the Master Redis. but the Master Sentinel never finds the slave sentinels. If someone could please identify what I'm missing.
# Slave sentinel.conf
# port <sentinel-port>
port 26379

pidfile "/var/run/redis/redis-sentinel.pid"
dir "/tmp"
loglevel debug
logfile "/var/log/redis/redis-sentinel.log"
maxclients 4000

sentinel monitor devmaster 143.61.2.31 6379 2

sentinel down-after-milliseconds devmaster 10000
sentinel parallel-syncs devmaster 1
sentinel failover-timeout devmaster 30000


Reply all
Reply to author
Forward
0 new messages