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.

preguntada hace 5 años2101 visualizaciones
1 Respuesta
0
Respuesta aceptada

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

respondido hace 5 años

No has iniciado sesión. Iniciar sesión para publicar una respuesta.

Una buena respuesta responde claramente a la pregunta, proporciona comentarios constructivos y fomenta el crecimiento profesional en la persona que hace la pregunta.

Pautas para responder preguntas