Reputation: 141
I have 3 replicated Redis instances running on 3 different machines: A, B and C. I initially choose A as my master. I also have 3 sentinels (1 on each machine) monitoring A.
In case A goes down, I want sentinels to choose a specific master to failover to (say B). Is there a way to choose a specific master instead of leaving it to the election mechanism of the sentinels?
Since I couldn't find this question anywhere, I reckon it's not standard procedure so I'll explain the reason behind it: My application is running on A, B and C behind a load balancer. The master uses its local Redis db which is replicated to the other two slaves.
When A fails, the load balancer could choose B as master while Redis sentinels could elect C as Redis master. As I just said, I need the instance to be local, so that's why I need to specify B as the Redis master.
Upvotes: 1
Views: 1311
Reputation: 765
There's a Redis configuration setting called 'slave-priority' that may help you out.
Reference: http://download.redis.io/redis-stable/redis.conf
Upvotes: 1