ioredis icon indicating copy to clipboard operation
ioredis copied to clipboard

Support for Elastiche Redis with cluster mode disabled

Open ductran-ms opened this issue 3 years ago • 3 comments

Hello, can someone give a recommendation on how to connect to AWS Elasticache with cluster mode disable? Ideally, all reads should be distributed automatically among the replicas. This is not the case for me. Only the primary node is used for both read and write. Other nodes are idle. Thank you.

ductran-ms avatar Jun 16 '22 00:06 ductran-ms

ioredis doesn't provide built-in support for this. Maybe use a connection pool to do this manually. An example:

const conns = [new Redis(/* replica 1 */ ), new Redis(/* replica 2 */ ), new Redis(/* replica 3 */ )]

_.sample(conns).get('foo')

luin avatar Jun 22 '22 04:06 luin