When configuring rsync downlink synchronization
Article Directory
1. When executing synchronization commands
#rsync -az --delete --password-file=/etc/server.pass [email protected]::wwwroot /opt/abc
1. The error is as follows
rsync: failed to connect to 192.168.2.4 (192.168.2.4): No route to host (113)
rsync error: error in socket IO (code 10) at clientserver.c(125) [Receiver=3.1.2]
2. The cause of the error
1) The main server is not powered on.
2) The firewall is blocked (firewalld).
3) The passing network is blocked by the firewall (iptables).
1) Exclude the first one. Although I can't connect to the host, but my master is still on, temporarily rule out the first reason
2) Firewall blocking (firewalld)
Master(192.168.2.4)
systemctl stop firewalld.service
setenforce 0
Slave(192.168.2.5)
[root@slave opt]#rsync -az --delete --password-file=/etc/server.pass [email protected]::wwwroot /opt/abc
[root@slave opt]#ls
abc rh
[root@slave opt]#ls abc
1.html
3) There is a firewall blocking on the passing network (iptables)
The reason for the error: the firewall on the server side has set filtering rules
Solution: Use iptables to turn off the firewall on the server side
1. Temporarily closed
$sudo service iptables stop
2. Open
$sudo service iptables start
3. Permanently open and close
$sudo chkconfig iptables on
$sudo chkconfig iptables off