-1

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.

3 Answers 3

0

you need more than one master nodes.

Slave is designed not writble

1
  • What would happen when master goes down and one of the slaves are promoted as master?
    – Ashok
    Apr 22, 2017 at 13:57
0

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.

2
  • So you are saying, initially I should point my application to the master? What would happen when master goes down and one of the slaves are promoted as master?
    – Ashok
    Apr 22, 2017 at 13:56
  • @Ashok Then you should write to the new master. With Redis sentinel you can get the new master's IP and port. Check the documentation for details.
    – for_stack
    Apr 22, 2017 at 14:21
0

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.