Skip to content

Redis Cluster Doesn't Recover from Node Changes #3252

@trev-dev

Description

@trev-dev

Description

This was not a problem with Redis version 7 and our cluster config with ioredis so far as I can tell. The long story short is if you have 6 pods in a kube cluster, node-redis initially connects to the nodes fine via DNS, but then stubbornly sticks to IP addresses for the discovered nodes. Kubernetes being what it is will dunk on pods once in a while. Eventually all 3 of my master nodes change IP addresses and the entire app fails catastrophically.

Node.js Version

22.17.1

Redis Server Version

8.4.0

Node Redis Version

5.10.0

Platform

Alpine 3.22

Logs

2026-04-23 08:25:25.866 - error: A Redis cluster node has encountered an error connect EHOSTUNREACH 10.97.55.161:6379 
Error: connect EHOSTUNREACH 10.97.55.161:6379
    at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1637:16)
2026-04-23 08:25:28.033 - info: A Redis cluster node is attempting to re-connect to a node. 
{ host: '10.97.55.161', port: 6379 }
2026-04-23 08:25:28.938 - error: A Redis cluster node has encountered an error connect EHOSTUNREACH 10.97.55.161:6379 
Error: connect EHOSTUNREACH 10.97.55.161:6379
    at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1637:16)
2026-04-23 08:25:31.056 - info: A Redis cluster node is attempting to re-connect to a node. 
{ host: '10.97.55.161', port: 6379 }

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions