[Solved] Redis Error: Error condition on socket for SYNC: No route to host

When we set up redis master-slave replication, we may encounter the following problems due to various problems:
error condition on socket for Sync: no route to host


First, modify the related configurations in redis.conf:

#Original configuration
#Modify to
# Although it is said that commenting it out can also solve the above problem, it is not recommended to comment out this method. Because another problem will occur.
#or comment it out

Turn off the firewall of the host. Note: it is the firewall of the host, and then restart the service.

In CentOS 7, systemctl stop firewalld turns off the firewall. Other versions can turn off the firewall through service iptables stop.

Turn off the firewall:

 systemctl stop firewalld

Turn off redis service

ps -ef |grep -i redis # Find a process

kill -9 3667 #Shut down the process

Restart related services

Read More: