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.

gefragt vor 5 Jahren2102 Aufrufe
1 Antwort
0
Akzeptierte Antwort

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

beantwortet vor 5 Jahren

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen