No of masters and slaves in redis cluster setup.

413 views
Skip to first unread message

Sanjeev Kumar Dangi

unread,
Jun 2, 2017, 7:31:20 AM6/2/17
to Redis DB
We were trying to setup redis cluster. I really want to know what are the guidelines for no of master nodes and slaves nodes.  Do no of master nodes has to be odd?

Our setup is like this.
We have 3 physical machines for redis cluster.
Each machine is running 4 redis processes - 2 masters and 2 slaves.
So we have 6 masters and 6 slaves running on 3 physical boxes.

Just wanted to know what are the pitfalls of this setup.
What if a network partition leads to two partitions,
where each partition is having 3 masters and 3 slaves (covering all hash slots each side)?
Do you see any other pitfalls for this configuration?

How redis handles partition tolerance?

Thanks
Sanjeev.

Parveen Khera

unread,
Jun 15, 2017, 7:22:47 AM6/15/17
to Redis DB
Sanjeev,

AS per https://redis.io/topics/cluster-spec recommended architecture for number of nodes to start is 6 (3Master+3Slaves) which provides tolerance upto 1 node failure.

With 6 Masters + 6 Slaves, this would be same as above, 1 node failure tolerance.

Pitfalls of this setup would be, one node tolerance or would be more correct to say that one Redis Process tolerance. If one of the Physical machine goes down then it mayl make the entire cluster inconsistent. Ideal would be to have a single Master or Slave process on a physical node. 

Not sure how this will happen: What if a network partition leads to two partitions, where each partition is having 3 masters and 3 slaves (covering all hash slots each side)?

Do you see any other pitfalls for this configuration?
I would recommend to start with a small setup may be 3 Masters + 3 Slaves and grow it from there.

Thanks

hva...@gmail.com

unread,
Jun 15, 2017, 12:06:19 PM6/15/17
to Redis DB
I think you're visualizing that a physical server contains a master Redis process and a slave Redis process that replicates from the master on the same machine.  The usual case is that a slave Redis is located on a different physical server from its master.

Yes, it's still better to have all Redis processes on different physical servers (6 servers), but 3 can suffice as long as you distribute the master processes and slave processes this way.
Reply all
Reply to author
Forward
0 new messages