Comments (5)
Hello Alan,
Thanks for raising this, I wasn't familiar with how AWS handles Redis cluster. I guess the source of the confusion is this comment that mentions that only master nodes should be specified:
// StartupNodes is the list of initial nodes that make up
// the cluster. The values are expected as "address:port"
// (e.g.: "127.0.0.1:6379"). Only master nodes should be
// specified.
That strikes me as odd and I can't remember why I added that. I don't think it's reasonable to expect the caller to know what are the current master nodes, and I can't see why specifying replicas wouldn't work. I'll give it a closer look and come back at you.
I took a look at AWS doc, and it seems like each node in the cluster would get its own endpoint? That's from that page: https://docs.aws.amazon.com/AmazonElastiCache/latest/UserGuide/Endpoints.html#Endpoints.Find.RedisCluster
That would seem more reliable to me than resolving the IP beforehand, if that's for a long-running process (e.g. in case AWS takes a node down then back up with a different IP).
Martin
from redisc.
That would seem more reliable to me than resolving the IP beforehand, if that's for a long-running process (e.g. in case AWS takes a node down then back up with a different IP).
Hmm scratch that as Redis will return the IP addresses when requesting the CLUSTER SLOTS
anyway, so yeah what you proposed would make sense.
from redisc.
I added a test of a Cluster
started with a replica address, it works fine as expected. I also removed the erroneous mention in StartupNodes
documentation.
from redisc.
Neat. Now that I understand the lib better, I think that should be sufficient. We're just passing in the primary endpoint with the list of 12 nodes in our cluster (4shard x 3way replication) and it's doing fine.
I think one issue I see is if it fails to dial the first result in the DNS response, but we can solve that with a custom dialer if it becomes a problem (I think).
Thanks!
from redisc.
Cool, I'll close this issue but let me know if you think of anything that could be done to improve the support for the AWS scenario.
from redisc.
Related Issues (20)
- Send PSUBSCRIBE failed HOT 1
- concurrent map iteration and map write HOT 3
- Refresh failed: redisc: all nodes failed HOT 2
- Connection failes if cluster consists only from one master HOT 5
- Separate pool for masters and slaves? HOT 9
- is HMSET operation supported, when using redis clustermode enabled? HOT 1
- Does it support pipeline in cluster mode HOT 5
- High Connection Churn HOT 25
- does it handle nodes master-slave failover? HOT 6
- Pls Help HOT 1
- Add support for Pipeline and multi operation commands HOT 5
- Proposal: add `Cluster` method to wait for stable Redis cluster HOT 1
- Proposal: add `Cluster` method to split keys by nodes
- Proposal: relax the constraints on pipeline for the `RetryConn`
- Proposal: support Redis 7+ Cluster changes
- READONLY command on every requests HOT 3
- Proposal: improve handling of read-only connections HOT 3
- Does it support redis module command? HOT 2
- Support address mapping for nodes HOT 7
- Can redisc recover from master-slave node failover? HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from redisc.