-
The error phenomenon of the iptables firewall
client opened by the rsync server: No route to host
[root@nfs01 tmp]# rsync -avz /etc/hosts [email protected]::backup
rsync: failed to connect to 172.16.1.41: No route to host (113)
rsync error: error in socket IO (code 10) at clientserver.c(124) [sender=3.0.6]
Abnormal problem solving:
close the firewall service (iptables) of the rsync server
[root@backup mnt]# /etc/init.d/iptables stop
iptables: Setting chains to policy ACCEPT: filter [ OK ]
iptables: Flushing firewall rules: [ OK ]
iptables: Unloading modules: [ OK ]
[root@backup mnt]# /etc/init. d/iptables status
iptables: Firewall is not running. -
The rsync client executes the rsync command error:
The client's error phenomenon:
[root@nfs01 tmp]# rsync -avz /etc/hosts [email protected]::/backup
ERROR: The remote path must start with a module name not a /
rsync error: error starting client-server protocol (code 5) at main.c(1503) [sender=3.0.6]
Abnormal problem solving:
The rsync command syntax is misunderstood, ::/backup is the wrong syntax, it should be :: backup (rsync module) -
@ERROR: auth failed on module Oldboy
client error phenomenon:
[root@nfs01 tmp]# rsync -avz /etc/hosts [email protected]::backup
Password:
@ERROR: auth failed on module backup
rsync error: error starting client-server protocol (code 5) at main.c(1503) [sender=3.0.6]
Abnormal problem solving:- The password is really wrong, the username is really wrong
- secrets file = The password file specified by /etc/rsync.password is inconsistent with the actual password file name
- /etc/rsync.password file permissions are not 600
- rsync_backup:123456 Be careful not to have spaces after the password configuration file
- Only enter the password information in the rsync client password file, do not enter the virtual authentication user name
-
Unknown module 'backup'
[root@nfs01 tmp]# rsync -avz /etc/hosts [email protected]::backup
@ERROR: Unknown module 'backup'
rsync error: error starting client-server protocol (code 5) at main.c(1503) [sender=3.0.6]
异常问题解决:- /etc/rsyncd.conf configuration file module name writing error
- Permission denied
[root@nfs01 tmp]# rsync -avz /etc/hosts [email protected]::backup
Password:
sending incremental file list
hosts
rsync: mkstemp ".hosts.5z3AOA" (in backup) failed: Permission denied (13)
sent 196 bytes received 27 bytes 63.71 bytes/sec
total size is 349 speedup is 1.57
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1039) [sender=3.0.6]
异常问题解决:
- Incorrect owner and group of shared directory, not rsync
- Incorrect permissions on shared directory, not 755
-
chdir failed
[root@nfs01 tmp]# rsync -avz /etc/hosts [email protected]::backup
Password:
@ERROR: chdir failed
rsync error: error starting client-server protocol (code 5) at main.c(1503) [sender=3.0.6]
异常问题解决:- Backup storage directory not created
- The created backup storage directory is inconsistent with the configuration file definition
[root@backup backup]# /etc/init.d/xinetd restart
shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
Stopping xinetd: [ OK ]
Starting xinetd: shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
[ OK ]
Note: If the storage directory is not backed up, the xinetd service cannot be started correctly
-
invalid uid rsync
[root@nfs01 tmp]# rsync -avz /etc/hosts [email protected]::backup
Password:
@ERROR: invalid uid rsync
rsync error: error starting client-server protocol (code 5) at main.c (1503) [sender=3.0.6]
Abnormal problem solved:
The rsync virtual user corresponding to the rsync service no longer exists - The client has already configured a password file, but the keyless login method still needs to enter the password
password file must not be other-accessible
[root@nfs01 tmp]# rsync -avz /etc/hosts [email protected]::backup - -password-file=/etc/rsync.password
password file must not be other-accessible
continuing without password file
Password:
sending incremental file list
sent 26 bytes received 8 bytes 5.23 bytes/sec
total size is 349 speedup is 10.26
Abnormal problem solved:
The key file of the rsync client must also have 600 permissions
- rsync客户端连接慢问题
错误日志输出
2017/03/08 20:14:43 [3422] params.c:Parameter() - Ignoring badly formed line in configuration file: ignore errors
2017/03/08 20:14:43 [3422] name lookup failed for 172.16.1.31: Name or service not known
2017/03/08 20:14:43 [3422] connect from UNKNOWN (172.16.1.31)
2017/03/08 20:14:43 [3422] rsync to backup/ from rsync_backup@unknown (172.16.1.31)
2017/03/08 20:14:43 [3422] receiving file list
2017/03/08 20:14:43 [3422] sent 76 bytes received 83 bytes total size 349
正确日志输出
2017/03/08 20:16:45 [3443] params.c:Parameter() - Ignoring badly formed line in configuration file: ignore errors
2017/03/08 20:16:45 [3443] connect from nfs02 (172.16.1.31)
2017/03/08 20:16:45 [3443] rsync to backup/ from rsync_backup@nfs02 (172.16.1.31)
2017/03/08 20:16:45 [3443] receiving file list
2017/03/08 20:16 :45 [3443] sent 76 bytes received 83 bytes total size 349
Abnormal problem solution:
view the log for analysis
10 rsync服务没有正确启动
Connection refused (111)
[root@oldboy-muban ~]# rsync -avz /etc/hosts [email protected]::backup
rsync: failed to connect to 172.16.1.41: Connection refused (111)
rsync error: error in socket IO (code 10) at clientserver.c(124) [sender=3.0.6]
解决 rsync服务没开启
[root@oldboy-muban ~]# rsync --daemon
[root@oldboy-muban ~]# ss -lntup |grep rsync
tcp LISTEN 0 5 :::873 ::: users:(("rsync",1434,5))
tcp LISTEN 0 5 :873 : users:(("rsync",1434,4))
[root@oldboy-muban ~]# rsync -avz /etc/hosts [email protected]::backup
Password:
sending incremental file list
hosts
sent 196 bytes received 27 bytes 49.56 bytes/sec
total size is 349 speedup is 1.57