1.报错原因:模块名字配置错误
[root@web01 ~]# rsync -avz rsync_backup@172.16.1.41::backup ./backup @ERROR: Unknown module 'backup' rsync error: error starting client-server protocol (code 5) at main.c(1648) [Receiver=3.1.2]
2.报错原因:关于密码文件错误
[root@web01 ~]# rsync -avz rsync_backup@172.16.1.41::backup ./backup @ERROR: auth failed on module backup rsync error: error starting client-server protocol (code 5) at main.c(1648) [Receiver=3.1.2]
#原因:
1.服务端密码文件不存在(名字写错了/没有创建/配置文件错了)
2.密码文件权限不是600
3.服务端密码文件用户名或密码错误
4.客户端密码输入错误或密码文件内容与服务端不一致
3.报错原因:服务端防火墙开启
[root@web01 ~]# rsync -avz rsync_backup@172.16.1.41::backup ./backup rsync: failed to connect to 172.16.1.41 (172.16.1.41): No route to host (113) rsync error: error in socket IO (code 10) at clientserver.c(125) [Receiver=3.1.2]
4.报错原因:“::”错误
[root@web01 ~]# rsync -avz rsync_backup@172.16.1.41::/backup ./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(1648) [Receiver=3.1.2]
原因:“::”守护进程模式双冒号后面为模块名,不能使用目录
5.报错原因:服务端推送文件的目录权限不足
[root@web01 ~]# rsync -avz ./backup rsync_backup@172.16.1.41::backup sending incremental file list rsync: failed to write xattr user.rsync.%stat for "backup" (in backup): Permission denied (13) rsync: failed to write xattr user.rsync.%stat for "backup/file1" (in backup): Permission denied (13) backup/ sent 215 bytes received 1,099 bytes 2,628.00 bytes/sec total size is 0 speedup is 0.00 rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1178) [sender=3.1.2]
6.报错原因:服务端rsyncd服务没有启动
[root@web01 ~]# rsync -avz ./backup rsync_backup@172.16.1.41::backup rsync: failed to connect to 172.16.1.41 (172.16.1.41): Connection refused (111) rsync error: error in socket IO (code 10) at clientserver.c(125) [sender=3.1.2]
7.报错原因:服务端模块对应的目录不存在
[root@web01 ~]# rsync -avz ./backup rsync_backup@172.16.1.41::backup @ERROR: chdir failed rsync error: error starting client-server protocol (code 5) at main.c(1648) [sender=3.1.2]
8.报错原因:selinux没有关闭
[root@nfs ~]# rsync -avz /data/ rsync_backup@172.16.1.41::data Password: sending incremental file list rsync: failed to read xattr user.rsync.%stat for "." (in data): Permission denied (13) rsync: failed to read xattr user.rsync.%stat for "." (in data): Permission denied (13) rsync: failed to read xattr user.rsync.%stat for "." (in data): Permission denied (13) rsync: recv_generator: failed to stat "11_class.xlsx" (in data): Permission denied (13) rsync: failed to read xattr user.rsync.%stat for "." (in data): Permission denied (13) sent 81 bytes received 476 bytes 222.80 bytes/sec total size is 12,437 speedup is 22.33 rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1178) [sender=3.1.2]
错误一:
password file must not be other-accessible
continuing without password file
Password:
rsync客户端路径是否写错,权限设置不对,需要再次输入密码,客户端和服务端的密码文件都应该是600的权限才可以
错误二:
@ERROR: Unknown module ‘bak’
rsync error: error starting client-server protocol (code 5) at main.c(1522) [receiver= 3.0.3]
服务端server的配置中的[bak]名字和客户端client的10.10.10.10::bak不符
错误三:
rsync: failed to connect to 10.10.10.10: Connection timed out (110)
rsync error: error in socket IO (code 10) at clientserver.c(124) [receiver=3.0.6]
检查服务端server服务是否正常启动,检查端口防火墙,iptables打开873端口
如果服务端是windows server则在防火墙入站规则中增加873端口
如果服务端是Linux则先检查服务是否启动#ps aux | grep rsync
然后开启873端口#iptables -A INPUT -p tcp –dport 873 -j ACCEPT开启873端口
附:
安装rsync yum install rsync
启动服务/usr/bin/rsync –daemon
启动服务错误failed to create pid file /var/rsyncd.pid: File exists
看看提示服务错误的路径(这个路径不一定就是这个,看自己的报错路径)这里是/var/rsyncd.pid所以
rm -rf /var/rsyncd.pid;再重新启动Rsync服务
此时在看一下ps aux | grep rsync启动成功
错误四:
@ERROR: access denied to gmz88down from unknown (10.10.10.10)
rsync error: error starting client-server protocol (code 5) at main.c(1503) [receiver=3.0.6]
看看是不是服务端server hosts allow限制了IP,把这里的IP加入到服务端server的hosts allow白名单中,windows rsync不能写多个allow,可以在一个allow中加多个IP,例:hosts allow=10.10.10.10 20.20.20.20
错误五:
@ERROR: chdir failed
rsync error: error starting client-server protocol (code 5) at main.c(1503) [receiver=3.0.6]
服务端server的目录不存在或者没有权限(要同步的那个文件路径),安装windows rsync时候会创建一个SvcCWRSYNC用户,这个用户对要拷贝的目录没有权限,方法一,将这个用户给权限加入到目录中,方法二,修改这个用户隶属于的组,修改后要在管理中重启服务
问题 @ERROR: chroot failed
@ERROR: chroot failed rsync error: error starting client-server protocol (code 5) at main.c(1503) [receiver=3.0.6]
原因:
服务器端的目录不存在或无权限。
解决办法:
创建目录并修正权限可解决问题。
问题 skipping non-regular file
receiving incremental file list
skipping non-regular file “vendor/bin/doctrine”
skipping non-regular file “vendor/bin/doctrine.php”
sent 1990 bytes received 489209 bytes 327466.00 bytes/sec total size is 182515746 speedup is 371.57
原因:
source源文件有软链接。
解决方法:
修改为 rsync -va,其中 -a == -rlptgoD (no -H,-A,-X) 或者 rsync -rvltOD 也可以。
解决后:
receiving incremental file list
vendor/bin/doctrine -> ../doctrine/orm/bin/doctrine
vendor/bin/doctrine.php -> ../doctrine/orm/bin/doctrine.php
sent 1998 bytes received 489279 bytes 327518.00 bytes/sec total size is 182515746 speedup is 371.51
问题@ERROR: module is read only
sending incremental file list
ERROR: module is read only
rsync error: syntax or usage error (code 1) at main.c(866) [receiver=3.0.6]
rsync: read error: Connection reset by peer (104)
rsync error: error in rsync protocol data stream (code 12) at io.c(759) [sender=3.0.6]
原因:
source源服务器端权限设置read为only只读权限。
解决方法:
read only = false
问题@ERROR: auth failed on module tee
@ERROR: auth failed on module tee rsync error: error starting client-server protocol (code 5) at main.c(1522) [receiver=3.0.6]
原因:
服务器端该模块(tee)需要验证用户名密码,但客户端没有提供正确的用户名密码,认证失败。
解决方法:
提供正确的用户名密码解决此问题。
问题 @ERROR: Unknown module ‘tee_nonexists’
@ERROR: Unknown module ‘tee_nonexists’ rsync error: error starting client-server protocol (code 5) at main.c(1522) [receiver=3.0.6]
原因:
服务器不存在指定模块。
解决方法:
提供正确的模块名或在服务器端修改成你要的模块以解决问题。
问题 password file must not be other-accessible
password file must not be other-accessible
continuing without password file
Password:
原因:
这是因为rsyncd.pwd rsyncd.secrets的权限不对,应该设置为600。
解决方法:
chmod 600 rsyncd.pwd
问题 rsync: failed to connect No route to host
rsync: failed to connect to 192.168.1.10: No route to host (113) rsync error: error in socket IO (code 10) at clientserver.c(104) [receiver=3.0.6]
原因:
对方没开机、防火墙阻挡、通过的网络上有防火墙阻挡,都有可能。
解决方法:
在iptables 中开放该端口,语句如下:
iptables -I INPUT -p tcp –dport 873 -j ACCEPT
rsync默认端口873,其实就是把tcp udp的873端口打开。
问题 rsync error: error starting client-server protocol
rsync error: error starting client-server protocol (code 5) at main.c(1524) [Receiver=3.0.6]
原因:
/etc/rsyncd.conf配置文件内容有错误。请正确核对配置文件。
问题 rsync: chown “” failed: Invalid argument (22)
rsync: chown “” failed: Invalid argument (22)
原因:
权限无法复制。去掉同步权限的参数即可。(这种情况多见于Linux向Windows的时候)
问题 @ERROR: daemon security issue — contact admin
@ERROR: daemon security issue — contact admin rsync error: error starting client-server protocol (code 5) at main.c(1530) [sender=3.0.6]
原因:
同步的目录里面有权限不足的软连接文件,需要服务器端的/etc/rsyncd.conf打开use chroot = yes。
问题 rsync: read error: Connection reset by peer (104)
rsync: read error: Connection reset by peer (104) rsync error: error in rsync protocol data stream (code 12) at io.c(794) [receiver=3.0.6]
解决:很大可能是服务器端没有开启 rsync 服务,开启服务。
问题 @ERROR: failed to open lock file
@ERROR: failed to open lock file rsync error: error starting client-server protocol (code 5) at main.c(1495) [receiver=3.0.6]
解决:配置文件 rsync.conf 中添加 lock file = rsyncd.lock 即可解决。