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.

질문됨 5년 전2101회 조회
1개 답변
0
수락된 답변

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

답변함 5년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인