Skip to content

How to connect to aws elastic cache cluster ? #2768

Closed Answered by leibale
SeyyedKhandon asked this question in Q&A
Discussion options

You must be logged in to vote

I'm not too sure why the dnsLookup function is needed, but using RedisClient, anything that is under the socket option is passed directly to net.connect or tls.connect (see https://github.com/redis/node-redis/blob/master/docs/client-configuration.md), so you can do:

createClient({
  socket: {
    host: 'redis.server',
    port: 6379
    tls: true
  },
  password: 'token'
});

and using RedisCluster, anything under defaults will be passed to all clients created by the cluster (see https://github.com/redis/node-redis/blob/master/docs/clustering.md#createcluster-configuration), so you can do:

createCluster({
  rootNodes: [{
    socket: {
      host: 'redis.server',
      port: 6379
    }
  }],

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@SeyyedKhandon
Comment options

@leibale
Comment options

@SeyyedKhandon
Comment options

@SeyyedKhandon
Comment options

Answer selected by SeyyedKhandon
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants