7

I have created AWS ElastiCache redis server and configured with EC2 instance, but somehow I am not able to connect Redis via EC2 instance.

I have assigned the same security group as well.

here is my configuration

EC2

Redis

Error I am facing is Redis::CannotConnectError: Error connecting to Redis on some-prod.dhgdjw.0001.usw2.cache.amazonaws.com:6379 (Redis::TimeoutError)

Any help will be highly appreciated.

1
  • did you tried proposed answer? or let me know if still issue exist
    – Adiii
    Sep 17, 2018 at 9:50

1 Answer 1

8

As you mention the same security group where you do not need such a setting. You Redis SG should be different it just suggestion as you need it on your local VPC.

Verify Few things...

Go you ElastiCache Dashboard

Select the Redis and click on the cluster then click on modify

enter image description here

then you will see security group attach with this Cluster You can attach one or many group with this cluster.

enter image description here

click on the edit icon and verify does it allow trafic on 6379 from 10.0.0.1/16 If instance and redis in same VPC, if not then allow public IP of instance in redis SG.

enter image description here

and you can allow also your public IP to check if it accessible. Install redis-client and try this command.

redis-cli -h some-prod.dhgdjw.0001.usw2.cache.amazonaws.com ping

PONG

If ping pong working its mean SG allow traffic.

6
  • 1
    Hey, @Adiii Thanks for reply Sep 17, 2018 at 15:28
  • 1
    I followed your steps but issue is still there. Sep 17, 2018 at 16:10
  • 1
    I am accepting this answer as your answer did the trick. finally 0.0.0.0/0 on port 6379 work for me. Sep 17, 2018 at 16:31
  • @HardikUpadhyay welcome bro but do not make it public 0.0.0.0/0 at production its not good practice. try to figure out ec2 IP and whitelist that IP only.
    – Adiii
    Sep 17, 2018 at 17:43
  • 1
    Yes, you are right. I will figure it out and do same. again thanks for your support. Sep 18, 2018 at 6:00

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.