Giter Club home page Giter Club logo

Comments (5)

mna avatar mna commented on August 24, 2024

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.

mna avatar mna commented on August 24, 2024

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.

mna avatar mna commented on August 24, 2024

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.

abraithwaite avatar abraithwaite commented on August 24, 2024

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.

mna avatar mna commented on August 24, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.