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

Multiple connection strings for master-slave demotion/promotion. #830

Open
robblovell opened this issue Sep 10, 2015 · 6 comments
Open

Multiple connection strings for master-slave demotion/promotion. #830

robblovell opened this issue Sep 10, 2015 · 6 comments
Labels

Comments

@robblovell
Copy link

On ElasticCache, a redis cluster has one primary master read/write node and several secondary slave read-only nodes. The redis cluster periodically switches roles for nodes, exchanging master and slave nodes. The connection string to the ElasticCache is to the primary node when writes are needed. The createClient should be modified to take more than one connection port and host pair, and try each one in turn when an error like "Can't save packet:Error: READONLY You can't write against a read only slave." occurs so that the client can recover if the primary is switched while in operation.

@epoberezkin
Copy link

Can be related to #821 - essentially multiple connection settings to support any kind of switching in redis

@Mattsi-Jansky
Copy link

We have also been bitten by this. Compose's Redis distribution is doing some maintenance soon, and will be failing back to their slave Redis instance during the outage. They recommend using a host:port,host:port connection string to maintain availability, but it isn't supported.

@samuelt1
Copy link

samuelt1 commented Aug 22, 2019

if I made a fork for this would someone even consider approving it? This has serious consequences for my company.

@stockholmux
Copy link
Contributor

humm.. @Mattsi-Jansky and @samuelt1 could you use the solution outlined #1050 ?

If I'm understanding the solution of just specifying multiple connection strings, I can see cases where not everyone would want this.

@samuelt1
Copy link

yeah, so that is how I am fixing this on my end. I just have my own function that will connect to all of the servers, and then drop the slaves but not the master.

@samuelt1
Copy link

https://github.com/luin/ioredis/#cluster
This repo properly supports clustering I will just use that project.

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

No branches or pull requests

6 participants