-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Cluster: automatic nodes discovery not working with remote host #156
Comments
Thats likely a problem with setting up your cluster
|
If anyone has managed to setup ioredis with a cluster on another machine, I'd be happy to know your configuration |
Hi @Adrien-P You can refer to this issue for more details: https://github.com/antirez/redis/pull/1590/files. |
Hi @luin thanks a lot for your answer. now it works well. |
😆 |
My current setup is the following:
I have a machine on IP 10.0.0.6 which hosts a redis cluster with 3 masters (ports 7000, 7001 and 7002) and 3 slaves (ports 7003, 7004, 7005).
The client machine is on IP 10.0.0.7 and I pass the configuration:
the issue is that my redis node on port 7000 keeps receiving an unlimited amount of "info" requests but never receives the actual requests made within the client code. Looking at the code I think I found the source of the issue:
In the method
Cluster.prototype.getInfoFromNode
there is a commandredis.cluster('slots',...
and the results of this command are like this:What happens is that the redis node on 10.0.0.6:7000 replies with the list of nodes that are part of the cluster but it reference them with their localhost address (127.0.0.1 instead of 10.0.0.6). Thus, ioredis tries to connect to theses nodes on 127.0.0.1 and keeps getting ECONNREFUSED (because the client machine does not host any redis instance).
Note: I tried to pass all the nodes to the
Redis.Cluster
constructor and I experienced the same "info" loop issueThe text was updated successfully, but these errors were encountered: