Coder Social home page Coder Social logo

Redis Cluster cannot be connected. Please provide at least one reachable node. when connecting to cluster about redis-py-cluster HOT 2 CLOSED

horlahlekhon avatar horlahlekhon commented on June 16, 2024
Redis Cluster cannot be connected. Please provide at least one reachable node. when connecting to cluster

from redis-py-cluster.

Comments (2)

Grokzen avatar Grokzen commented on June 16, 2024
  1. Redis-cli is not the same as this client, they work in different ways and are implemented in different ways
  2. If you get this exception, it means that 0 our of your nodes was reachable. You are probably providing wrong connection information, or you are getting into the most common redis cluster issue where the internal cluster tracks a totally different ip that your client do not understand or can route to. Check the output from CLUSTER NODES to see what your internal cluster tracks and sort that out
  3. For the client to work, you must have at least one node reachable that is cluster enabled.
  4. You are misstaking two different operations also. The startup_nodes that you provide is just the entrypoints that you know should be reachable from the client. The client then asks CLUSTER NODES on any of the startup_nodes to get back "where are all the other node in the cluster according to you mister server?" and then you try to build up your client according to that response and that is where you get stuck.

So the most common problem that happens that you probably get stuck at. Is that between redis nodes, redis tries to be smart and use the most optimal ip in order for each node to find any other node. But this do not reflect or mean that a client will be able to use the same and connect with that as well. So in a case of running a cluster inside docker you get one IP from outside docker, and one ip inside docker. And redis will use the internal IP on the inside and in some cases 127.0.0.1 if the nodes is on the same container. But your client from another container will not understand what 127.0.0.1:7001 is or how it should understand that it is on another container. This is the most common issue that people have problems with redis-cluster and clients connecting into it.

from redis-py-cluster.

horlahlekhon avatar horlahlekhon commented on June 16, 2024

Thanks very much for this explanation.
2. I understand that redic-cli and this client works in different ways, i was referencing redis-cli to show that at least 1 node is reachable.
4. This also is not the case because i had an issue caused by this because i was port forwarding one node to my local machine, and i discovered that the client will try to redirect to the rest of the nodes and fixed by attaching an external static ip to all the nodes where they can be directly reachable at.

Thanks nevertheless, i had to destroy the cluster and just use standalone mode for now.

from redis-py-cluster.

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.