Skip to content

Unable to connect to Redis through redis-cli

0

I applied for Redis OSS caches, and I installed redis-cli on my EC2. I cannot connect to redis via the command line: redis-cli -h xxxkuzmtv.serverless.apse1.cache.amazonaws.com -p 6379. This command doesn't respond, it blocks the shell command line and there are no error messages. How can I solve this? Enter image description here

  • please accept the answer if it was helpful

asked 2 years ago2.7K views
2 Answers
1

There are some points:

  • Check if the security group on Redis is open for this EC2 host, port 6379 has to be open.
  • Verify the subnet of the connection, for instance, your EC2 has to be in the same network as Redis.
  • If you configure the Redis property 'Encryption in transit' equals Enabled you have to add to your command line the parameter --tls, like this example :
redis-cli -h redis-hostname.serverless.use2.cache.amazonaws.com -p 6379 --tls
answered 2 years ago
0

No error message means that packages can not reach the target at all

  • check the Security group of the Elasticache instance (Incoming port 6379 from your EC2 security group or IP address)
  • check NACL if EC2 and Elasticache are located in different subnets
  • if EC2 and Elasticache are located in VPCs, configure VPC peering and routing between them as well as NACL and Security Group rules
EXPERT
answered 2 years ago
EXPERT
reviewed 2 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.