Should Redis Sentinel Monitor Each Master in a cluster? - redis

Does it require sentinel to monitor each master in the cluster with a distinct service name, or just one of the 3 masters in the cluster?
My current config is 3 masters, 3 slaves, and 3 sentinel instances. Each instance of sentinel is monitoring each master. master1, master2, master3. I haven't seen any documentation that has more than a single master, and the redis documentation isn't real clear.

I found the solution by running a test myself. Yes, in a cluster configuration you need to monitor each master in order for failover to occur.

Related

Redis sentinel with multilevel replicas

I am using Sentinel as a high availability solution for redis.
I have a problem.
In consideration of reducing the replication pressure of the master, our redis instances are multi-level, as follow:
In the introduction of the sentinel, I found that can monitor multiple masters, so I import it and hope to work as follows:
The second row of the replica belongs to the "master" logically too, so it also needs to be monitored.
Get the opposite of what one wants When the Sentinels just started, they had an election and independent many masters, actual master(role: master), not logic master.
Q: So can sentinels do the monitoring mode in the figure above?
My main configuration is as follows:
sentinel monitor top-master xxx.x.x.x 6379 2
sentinel monitor second-level-first xxx.x.x.x 6379 2
sentinel monitor second-level-second xxx.x.x.x 6379 2
sentinel monitor second-level-third xxx.x.x.x 6379 2
IN BRIEF - NO
To answer the above you would want to drill down into what sentinel is doing.
It is going to find out all the slaves it is connected to a master.
it establishes a pub-sub with those nodes.
when your actual master fails and another node becomes master this cannot be propagated.
Infact, to answer further more, can you please share the configuration of your slave nodes on level1? Infact this should have not been possible at all. I am just wondering how this worked.
If you can share the config files, will go through and update accordingly.

Redis Sentinel Architecture for two node Redis Replication

I have two Redis instances, master and a slave, for which I need a High Availability architecture. I am using Sentinel for handling the failover scenario. But when I am using two instances of Sentinel on two individual machines with quorum value 1, and if the Master Redis node with it's Sentinel goes down the other Sentinel unable to promote the Slave node to Master.
Can anyone please suggest the best approach of Sentinel for 2 nodes Redis server?

Redis cluster on load balancer

I have setup a redis cluster with 1 master node and 2 slave nodes with sentinel running on all 3 nodes.
Prior to this setup, my application was pointing to a single node where redis instance was running.
After the clustering had been set up, where should my application point to?
Thanks.
you need more than one master nodes.
Slave is designed not writble
You can write to the master, and read from both slaves. Of course, you can also read from the master.
In most case, you should NOT write to slave, because even if you config the slave as writable, any write to slave does NOT sync to master or other slaves.
With slave you can achieve data replication. Also, reading from slaves scales out the read performance, if you set up each slave and master on distinct machine. However, you might have consistency problem, i.e. reading inconsistent data from slaves.
Redis cluster and Redis sentinel are two different concepts. If you only looking for HA I would recommend Sentinel, Redis cluster work on top of sharding which is highly distributed in nature. Redis cluster recommend to have minimum 3 masters and equal quantity of slaves for the healthy cluster.

Redis Sentinel with 2 master after multi az netsplit

Hello stack community,
I have a question about Redis sentinel for a specific problem case. I use AWS with Multi AZ to create a sensu cluster.
On eu-central-1a I have a sensu+redis(M), a RBMQ+Sentinel and 2 others Sentinels. Same on eu-central-1b but the redis is my slave on this AZ.
What happen if there is a problem and eu-central-1a can not communicate with eu-central-1b ? What I think is that Sentinel on eu-central-1b should promote my redis slave to master, because he can not contact my redis master. So I should have 2 redis masters running together on 2 different AZ.
But when the link is retrieved between AZ, I will still have 2 masters, with 2 different datas. What will happen in this case ? One master will become a slave and data will be replicated without loss ? Do we need to restart a master and he will be a slave ?
Sentinel detects changes to the master for example
If the master goes down and is unreachable a new slave is elected. This is based on the quorum where multiple sentinels agree that the master has gone down. The failover then occurs.
Once the sentinel detects the master come back online it is then a slave I believe thus the new master continues I believe. You will loose data in the switchover from master to new master that in inevitable.
If you loose connection then yes sentinel wont work correctly as it relies on multiple sentinels to agree the master redis is down. You shouldn't use sentinel in a 2 sentinel system.
Basic solution would be for you to put a extra sentinel on another server maybe the client/application server that isn't running redis/sentinel this way you can make use of the quorum and sentinels agreeing the master is down.

How to use redis sentinel to get configuration of current master?

I have configured Redis servers with 1 master and 2 salves and 1 sentinel to monitor the master.
As per the documentation if the master is down sentinel will promote any of the slave as the master.
So my question is how to get the configuration of the replaced master using the c# code via sentinel???
thank you in advance....