How to set up Redis Cluster Slave only for backup? - redis

I'd like to add a new slave to the Redis Cluster, which has 3 masters and 3 slaves currently. But the new slave it's only for bgsave, it can't be master if the master fail-over, can I do that?

It looks like you can use the 'cluster-slave-no-failover' option as of this commit: https://github.com/antirez/redis/pull/3041/files discussed here https://github.com/antirez/redis/issues/3021

Related

Redis HA what happens if Master stops and restarted

In a Redis HA setup, with 1 master and 5 replicas:
Let's suppose the master goes down. Then the Sentinels would elect a replica as the next master.
What happens when the original master is restarted with its config? Would it be joining as a master or as a replica? I suppose, since it is not configured as a replica, so it should not be running as a replica.
When the original master is down and a new master is elected. The original master will be added as a virtual replica of the new master. When it recovers, original master will be set to be a replica of the new master automatically.
Master would join as a replica.
...The master will then demote itself to a replica...
https://redis.io/commands/failover

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.

Should Redis Sentinel Monitor Each Master in a cluster?

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.

Redis sentinel failover config change

I have a Redis cluster configuration with a master and 2 slaves. I want to enable AOF (fsync:always) on the master for full durability, while RDB in both the slaves. My question is, in case the master fails, and one of the slaves is chosen as the new master; will the old master config be also copied to the new master. And, when the old master restarts as the new slave, will the slave config be copied to the new slave by the redis sentinel automatically?
What you have isn't a Redus cluster, as cluster is a different setup. Pointedly Redis Cluster and Sentinel do not go together.
That said, no, Sentinel does not "copy configuration" it simply elects a new master. A Sentinel constellation elects a new master and issues a slave of Command on it to make it the master, then points any other slaves to the newly minted master. You will either need to write something which picks up the change and reconfigures the new master or keep those configuration items the same.

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....