skip to Main Content

I had a problem connecting to aws elasticache, I found some solutions but couldn’t solve the problem. Hope anyone can help.

const redis = createClient({
  socket: {
    host: process.env.REDIS_HOST,
    port: Number(process.env.REDIS_PORT),
    tls: true,
    connectTimeout: 30000,
  },
});



error logs

Redis Client Error Error: connect ETIMEDOUT

2

Answers


  1. The ETIMEDOUT error typically occurs when the connection to the AWS ElastiCache (Redis) cluster cannot be established within the specified timeout. Check the connectivity, security groups, make sure the host name is correct.
    Simple debug step: try to connect with cli command from the same security group, networking, and see wether you can connect or no.

    Login or Signup to reply.
  2. "this code is running local"

    ElastiCache servers don’t get public IP addresses. If you do a DNS lookup of that hostname you are trying to connect to, you will see it is a private IP address that will only work within your VPC.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search