Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Redis High Availibility when using multiple hosts #7050

Closed
madabhaviamit opened this issue Apr 2, 2020 · 4 comments
Closed

Redis High Availibility when using multiple hosts #7050

madabhaviamit opened this issue Apr 2, 2020 · 4 comments

Comments

@madabhaviamit
Copy link

Hi,

I am facing a problem when redis is setup as a cluster connecting redis nodes from different machine as slaves to the master nodes of the cluster.

For a cluster to work properly, we require at least three masters up and running.
I have a setup redis cluster on host 10.148.0.2 as following
10.148.0.2:6001 --> master A
10.148.0.2:6002 --> master B
10.148.0.2:6003 --> master C
10.148.0.2:6004 --> slave A1 of master A
10.148.0.2:6005 --> slave B1 of master B
10.148.0.2:6006 --> slave C1 of master C

I have also setup 3 slave nodes on host 10.148.0.3 which are connected to masters of host 10.148.0.2 as following,
10.148.0.3:6007 --> slave A2 of master A(10.148.0.2:6001)
10.148.0.3:6008 --> slave B2 of master B(10.148.0.2:6002)
10.148.0.3:6009 --> slave C3 of master C(10.148.0.2:6003)

Now following is the scenario to check whether slaves are getting promoted as master when the master goes down.

Scenario1 : master A(10.148.0.2:6001) goes down either of slaves A1(10.148.0.2:6004) or A2(10.148.0.3:6007) is promoted to master after node timeout is reached.
This works fine for all the other masters going down as with master A.

But assume a case, where the setup is made and somehow the host(10.148.0.2) with all the three masters A,B,C itself crashes or shuts down. In this case the slaves on host(10.148.0.2) must be promoted as the new masters but this never happens.

How to handle this shut down scenario of host going down with all the master nodes and promoting the slaves of these masters on the other host to be promoted to masters. I have read a lot of redis cluster documentation on this regard. I could not find anything that can help.

Request all in the community to guide me through this particular shut down scenario.

@trevor211
Copy link
Collaborator

I think you should ajust the deployment of redis instances.
Try to distribute masters over different machines (better if the machines are geographically distributed).

@madabhaviamit
Copy link
Author

I think you should ajust the deployment of redis instances.
Try to distribute masters over different machines (better if the machines are geographically distributed).

Hi Trevor,

I switched from redis cluster to sentinel and it solved my problem.. now i have one master and many slaves and as soon as a master goes down any one of the slaves becomes master. everything works fine until i have 1 master and 1 slave up and running. For Sentinel to be high available we would require at least 1 Master and 2 Slave configuration..

@trevor211
Copy link
Collaborator

So far so good. Do you have any other questions? If not, can you close the issue?

@madabhaviamit
Copy link
Author

madabhaviamit commented Aug 13, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants