Error set: When configuring rsync downlink synchronization: rsync: failed to connect to 192.168.2.4: No route to host (113)

When configuring rsync downlink synchronization

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]

Insert picture description here

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

Insert picture description here

2) Firewall blocking (firewalld)

Master(192.168.2.4)

systemctl stop firewalld.service 
setenforce 0

Insert picture description here
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

Insert picture description here

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

Guess you like

Origin blog.csdn.net/qq_35456705/article/details/114640041