Redis sentinel, server priority/score

38 views
Skip to first unread message

Justin Keller

unread,
Jul 16, 2015, 5:57:39 AM7/16/15
to redi...@googlegroups.com
We are using redis sentinel, and it works, but when we take down the primary server (let's call it redis1) and another server takes over, when redis1 comes back online it does NOT become the primary again. Is there a way to set a server priority (score), like in MongoDB? We'd like a certain server to be the primary as much as possible (it has more resources and closer to the web servers in terms of latency).

The Baldguy

unread,
Jul 17, 2015, 12:58:56 AM7/17/15
to redi...@googlegroups.com
Redis Sentinel is not designed in the way you are asking about. Redis masters and slaves should be equal in capability, or you will have to manually issue a failover command to have one be a "mandatory master".

That said, if your data set become large you will likely encounter issues doing that as you will be doing extra replication.

Jan-Erik Rediger

unread,
Jul 17, 2015, 3:57:55 AM7/17/15
to redi...@googlegroups.com
Sentinel respects the `slave-priority`:
https://github.com/antirez/redis/blob/unstable/redis.conf#L380-L389

On Thu, Jul 16, 2015 at 09:58:56PM -0700, The Baldguy wrote:
> Redis Sentinel is not designed in the way you are asking about. Redis masters and slaves should be equal in capability, or you will have to manually issue a failover command to have one be a "mandatory master".
>
> That said, if your data set become large you will likely encounter issues doing that as you will be doing extra replication.
>
> --
> You received this message because you are subscribed to the Google Groups "Redis DB" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to redis-db+u...@googlegroups.com.
> To post to this group, send email to redi...@googlegroups.com.
> Visit this group at http://groups.google.com/group/redis-db.
> For more options, visit https://groups.google.com/d/optout.

Bill Anderson

unread,
Jul 17, 2015, 7:04:45 AM7/17/15
to redi...@googlegroups.com
Yes but slave priority won't cause a master to be demoted and a slave promoted in its place.
> You received this message because you are subscribed to a topic in the Google Groups "Redis DB" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/topic/redis-db/QQkNiIaRuB8/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to redis-db+u...@googlegroups.com.

Jan-Erik Rediger

unread,
Jul 17, 2015, 7:11:58 AM7/17/15
to redi...@googlegroups.com
Ah, indeed. I understood the question wrong.

CharSyam

unread,
Jul 17, 2015, 7:46:26 AM7/17/15
to redi...@googlegroups.com
Changing master is very expensive operation. so it,s not a good idea 

2015년 7월 17일 금요일, Jan-Erik Rediger<jan...@fnordig.de>님이 작성한 메시지:

Justin Keller

unread,
Jul 17, 2015, 6:21:24 PM7/17/15
to redi...@googlegroups.com
Ok, thanks for the reply.

It seems like sentinel was an afterthought, and honestly not great at managing a HA redis cluster. The first red-flag was that is seems to literally change configuration files (internally), which I've never seen before.

Would using RedisLabs enterprise cluster (https://redislabs.com/redis-enterprise) be a better option then?
Reply all
Reply to author
Forward
0 new messages