We are facing a READONLY You can't write against a read only replica error (followed by a Socket closed unexpectedly error) when we want to write on our AWS ElastiCache Redis cluster (Cluster mode off) when multi-AZ and failover are enabled.
On redis server side :
On client (nodejs) side :
2 persistant connexions, one for the "master" (called Primary Endpoint on AWS), one for the "replica" (called Reader Endpoint on AWS)
No issue with the "replica" connexion when multi-AZ and failover are enabled or disabled
No issue with the "master" connexion when multi-AZ and failover are disabled or when "master" connexion is used as the only connexion (ACTIVATE_READ = false)
When multi-AZ and failover are enable, node-redis seems to go to the wrong client (using the readClient instead of the writeClient).
Questions :
Does node-redis support the AWS failover mode, or did i miss something on the configuration ?
In case of failover, is there an internal mechanism in node-redis that ensure to switch to the good node.
Environment:
Node.js Version: 16 and 18 (at least)
Redis Server Version: AWS ElastiCache Redis 6.2.4 with Multi-AZ + failover enable (2 nodes)
We are facing a
READONLY You can't write against a read only replica
error (followed by aSocket closed unexpectedly
error) when we want to write on our AWS ElastiCache Redis cluster (Cluster mode off) when multi-AZ and failover are enabled.On redis server side :
On client (nodejs) side :
2 persistant connexions, one for the "master" (called Primary Endpoint on AWS), one for the "replica" (called Reader Endpoint on AWS)
Questions :
Environment: