EC2 with Redis - connection refused although all ports are opened.

0

I've create to EC2 instances ubuntu 18.04. installed Redis on both following this guide:
https://www.digitalocean.com/community/tutorials/how-to-install-and-secure-redis-on-ubuntu-18-04.

I've disabled ufw firewall on one of them, on that same one i've assigned an allow all connection security group - just for testing.

When i try connecting to the redis server from the second instance using:

redis-cli -h 13.59.136.252 -p 6379

I keep getting connection refused. Not sure where to go next
Both EC2 instances are on the same VPC.

asked 5 years ago2084 views
1 Answer
0
Accepted Answer

Hi,
You might have missed the following steps. Note: these are NOT specified in this document.

sudo nano /etc/redis/redis.conf

Then change the localhost binding (comment it out) and specify the IP address of the EC2 instance:

bind 127.0.0.1 ::1

To:

#bind 127.0.0.1 ::1
bind 34.209.249.149 ::1

Save the results and run

sudo systemctl restart redis

For the security Group for 34.209.249.149, make sure the Inbound allows port 6379.
Then connect from your other machine with:

redis-cli -h 34.209.249.149 -p 6379

Hope this helps!
-randy

answered 5 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.

Guidelines for Answering Questions