BUG: Could not connect to Redis No route to host (redis cluster reports an error)

Redis cluster is enabled to report an error

Insert picture description here
After all the clusters are configured, the ports of each cluster are modified, and an error occurs when preparing to start the cluster

Don't panic at this time

This BUG occurs because of the system's iptables setting problem, because redis does not open the 6379 port to the outside.


Solution:

(1) Open ports to IP
iptables -N REDIS
iptables -A REDIS -s 192.168.90.20 -j ACCEPT
iptables -A REDIS -s 192.168.90.30 -j ACCEPT
iptables -A REDIS -j LOG --log-prefix "unauth-redis-access"
iptables -A REDIS -j REJECT --reject-with icmp-port-unreachable
iptables -I INPUT -p tcp --dport 6379 -j REDIS
(2) Simplified method
sudo iptables -F

Result: Successfully opened

Insert picture description here


Guess you like

Origin blog.csdn.net/weixin_51468875/article/details/114269711