1

My Redis Sentinel failover is not working, when the master is done, no handshaking is done, and failover does not happen; however sentinel shows when the master is back to normal state or when it is down. My sentinel.conf file contents are below:

# Process Info
port 26379
daemonize yes
pidfile "/var/run/redis/sentinel.pid"

# Log files
loglevel notice
logfile "/var/log/redis/sentinel.log"

# Master setup
sentinel monitor mymaster 10.0.2.94 6379 2
sentinel auth-pass mymaster 118
sentinel down-after-milliseconds mymaster 10000
sentinel failover-timeout mymaster 60000
sentinel parallel-syncs mymaster 1

# Slave setup
sentinel monitor redis2 10.0.3.56 6379 2
sentinel auth-pass redis2 118
sentinel down-after-milliseconds redis2 15000
sentinel failover-timeout redis2 65000
sentinel parallel-syncs redis2 1

Redis.conf file is pretty much standard and redis is working without any issue.

I would really appreciate any help with this.

user2693188
  • 37
  • 1
  • 9

1 Answers1

1

Looking at the conf file you posted it appears to be setup wrong you have variation in cluster names mymaster and redis2 try the following

# Process Info
port 26379
daemonize yes
pidfile "/var/run/redis/sentinel.pid"

# Log files
loglevel notice
logfile "/var/log/redis/sentinel.log"

# Master setup
sentinel monitor redis2 10.0.2.94 6379 2
sentinel auth-pass redis2 118
sentinel down-after-milliseconds redis2 10000
sentinel failover-timeout redis2 60000
sentinel parallel-syncs redis2 1

# Slave setup
sentinel monitor redis2 10.0.3.56 6379 2
sentinel auth-pass redis2 118
sentinel down-after-milliseconds redis2 15000
sentinel failover-timeout redis2 65000
sentinel parallel-syncs redis2 1

Basically the clister name must be the same. You can actually just use the same sentinel .conf file on every server it's easier that way.

Matt Stephens
  • 922
  • 1
  • 6
  • 24