Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Redis sentinel doesn't auto-discover other sentinels

I have redis configured as master with two slaves, each on a separate box. I also have a sentinel process running on each box. It's the setup as described in the documentation here:

http://redis.io/topics/sentinel#example-2-basic-setup-with-three-boxes

Each of the sentinels can connect to my master, and can see the slaves. They are able to independently detect if the master or slaves go down. The problem is that the sentinels can't detect each other.

I have verified that each sentinel is publishing a message to the __sentinel__:hello channel as expected, but it seems that none of them are actually receiving the messages from the other ones.

How do I get the sentinels to see each other?

like image 875
nerdherd Avatar asked Jun 25 '16 23:06

nerdherd


People also ask

Is the number of sentinels that need to agree?

The quorum is the number of Sentinels that need to agree about the fact the master is not reachable, in order to really mark the master as failing, and eventually start a failover procedure if possible. However the quorum is only used to detect the failure.

Should I use Redis Sentinel or cluster?

If you need an automatic failover solution without going to a complete cluster solution, use Sentinel. To get a complete cluster solution that splits your database between multiple nodes, then go for clustering.

How do I know if Redis Sentinel is running?

You can also use monitor to see what Sentinel is doing: $ redis-cli -p 6379 monitor OK 1546981642.808843 [0 127.0. 0.1:54765] "PING" 1546981642.866671 [0 127.0. 0.1:54765] "PUBLISH" "__sentinel__:hello" "127.0.

How Sentinel Works in Redis?

Redis Sentinel is the high-availability solution for open-source Redis server. It provides monitoring of all Redis nodes and automatic failover should the master node become unavailable. This guide provides a sample configuration for a three-node Redis cluster.


1 Answers

In configuring the sentinels, I configured sentinel once and then copied that configuration file onto all the others.

Before copying the config I must have started up sentinel and it re-wrote the config file with an id like:

sentinel myid c766a0df56e72eda48cea984

When I copied the file to the other sentinels it caused each of them to have the same id, which in turn caused them to ignore any messages from the auto-discovery with that same id. Removing the myid line from each config file and restarting each sentinel process fixed the issue.

like image 63
nerdherd Avatar answered Oct 04 '22 20:10

nerdherd