Does not work cluster mode if I use single ip address of k8s? #392
-
Hello, I am currently utilizing k8s to deploy and manage multiple Redis pods. In the current development environment, we have about three Redis pods running, all connected via a single endpoint. That is, within k8s, we have a host named 'redis'. When accessing this single endpoint, k8s handles the load balancing across the various Redis pods. Therefore, when using rueidis, I've been specifying only the single endpoint in InitAddress. However, it seems there are occasional issues when invoking operations like HSet. For debugging purposes, I utilized the Nodes method of rueidis's ClusterClient, and found that the number of Redis nodes being output is four instead of three. Among these, one appears to be registered with the endpoint address instead of the actual Redis IP. To illustrate, if the actual IPs of the Redis pods are 1.2.3.4:6379, 1.2.3.5:6379, and 1.2.3.6:6379, and the endpoint set to access them is redis:6379, then when registering []host{"redis:6379"} in InitAddress, the keys in the map output from the client's Nodes are 1.2.3.4:6379, 1.2.3.5:6379, 1.2.3.6:6379, and redis:6379. Could this be the reason certain operations like HSet are not functioning properly? I would greatly appreciate it if you could check this for me. Thank you! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 11 replies
-
Hi @simonprickett, The address appeared in the .Nodes() output is excepted and it is only used for refreshing shard information. So that can’t be the reason for certain operations that are not working properly. What kind of errors you saw when doing HSet? |
Beta Was this translation helpful? Give feedback.
Hi @Park-KwonSoo, is there any update?