rsync常见错误与解决方法整理
rsync常见错误与解决⽅法整理
我们都是通过错误⽇志查看
在rsyncd.log⾥⾯或.err⽂件⾥⾯,⼤家可以⽤记事本打开查看。
注意windows下⾯我们需要给SvcwRsync⽤户,管理同步⽬录的所有权限,基本上这样就可以了
问题⼀:
@ERROR: chroot failed
rsync error: error starting client-server protocol (code 5) at main.c(1522) [receiver=3.0.3]
原因:
服务器端的⽬录不存在或⽆权限,创建⽬录并修正权限可解决问题。
问题⼆:
@ERROR: auth failed on module tee
rsync error: error starting client-server protocol (code 5) at main.c(1522) [receiver=3.0.3]
原因:
服务器端该模块(tee)需要验证⽤户名密码,但客户端没有提供正确的⽤户名密码,认证失败。
提供正确的⽤户名密码解决此问题。
问题三:
@ERROR: Unknown module ‘tee_nonexists'
rsync error: error starting client-server protocol (code 5) at main.c(1522) [receiver=3.0.3]
原因:
服务器不存在指定模块。提供正确的模块名或在服务器端修改成你要的模块以解决问题。
问题1:
在client上遇到问题:
rsync -auzv --progress --password-file=/etc/rsync.pas root@192.168.133.128::backup /home/
rsync: could not open password file "/etc/rsync.pas": No such file or directory (2)
Password:
@ERROR: auth failed on module backup
rsync error: error starting client-server protocol (code 5) at main.c(1506) [Receiver=3.0.7]
遇到这个问题:client端没有设置/etc/rsync.pas这个⽂件,⽽在使⽤rsync命令的时候,加了这个参数-- password-file=/etc/rsync.pas
问题2:
rsync -auzv --progress --password-file=/etc/rsync.pas root@192.168.133.128::backup /home/
@ERROR: auth failed on module backup
rsync error: error starting client-server protocol (code 5) at main.c(1506) [Receiver=3.0.7]
遇到这个问题:client端已经设置/etc/rsync.pas这个⽂件,⾥⾯也设置了密码111111,和服务器⼀致,但是服务器段设置有错误,服务器端应该设置/etc/rsync.pas ,⾥⾯内容root:111111 ,这⾥登陆名不可缺少
问题3:
rsync -auzv --progress --password-file=/etc/rsync.pas root@192.168.133.128::backup /home/
@ERROR: chdir failed
rsync error: error starting client-server protocol (code 5) at main.c(1506) [Receiver=3.0.7]
遇到这个问题,是因为服务器端的/home/backup 其中backup这个⽬录并没有设置,所以提⽰:chdir failed
问题4:
rsync: write failed on "/home/backup2010/wensong": No space left on device (28)
rsync error: error in file IO (code 11) at receiver.c(302) [receiver=3.0.7]
rsync: connection unexpectedly closed (2721 bytes received so far) [generator]
rsync error: error in rsync protocol data stream (code 12) at io.c(601) [generator=3.0.7]
磁盘空间不够,所以⽆法操作。
可以通过df /home/backup2010 来查看可⽤空间和已⽤空间
问题5:⽹络收集问题
1、权限问题
类似如下的提⽰:rsync: opendir "/kexue" (in dtsChannel) failed: Permission denied (13)注意查看同步的⽬录权限是否为755 2、time out
rsync: failed to connect to 203.100.192.66: Connection timed out (110)
奶粉质量排行榜rsync error: error in socket IO (code 10) at clientserver.c(124) [receiver=3.0.5]
检查服务器的端⼝netstat –tunlp,远程telnet测试。
可能因为客户端或者服务端的防⽕墙开启导致⽆法通信,可以设置规则放⾏ rsync(873端⼝)或者直接关闭防⽕墙。
还有⼀种在同步过程中可能会提⽰没有权限(将同步⽬录加上SvcwRsync全部权限即可,更简单的⽅法就是将SvcwRsync设为管理员即可)
3、服务未启动
rsync: failed to connect to 10.10.10.170: Connection refused (111)
rsync error: error in socket IO (code 10) at clientserver.c(124) [receiver=3.0.5]圆通快递查询订单号
启动服务:rsync --daemon --config=/f
4、磁盘空间满
rsync: recv_generator: mkdir "/teacherclubBackup/rsync……" failed: No space left on device (28)
*** Skipping any contents from this failed directory ***
5、Ctrl+C或者⼤量⽂件
rsync error: received SIGINT, SIGTERM, or SIGHUP (code 20) at rsync.c(544) [receiver=3.0.5]
rsync error: received SIGINT, SIGTERM, or SIGHUP (code 20) at rsync.c(544) [generator=3.0.5]
拍一拍怎么设置?说明:导致此问题多半是服务端服务没有被正常启动,到服务器上去查查服务是否有启动,然后查看下 /var/run/rsync.pid ⽂件是否存在,最⼲脆的⽅法是杀死已经启动了服务,然后再次启动服务或者让脚本加⼊系统启动服务级别然后shutdown -r now服务器
6、xnetid启动
rsync: read error: Connection reset by peer (104)
rsync error: error in rsync protocol data stream (code 12) at io.c(759) [receiver=3.0.5]
查看rsync⽇志
rsync: unable to open configuration file "/f": No such file or directory
xnetid查的配置⽂件位置默认是/etc下,根据具体情况创建软链接。例如:
ln -s /etc/f /f
或者更改指定默认的配置⽂件路径,在/etc/xinetd.d/rsync配置⽂件中。
Rsync configure:
配置⼀:
ignore errors
说明:这个选项最好加上,否则再很多crontab的时候往往发⽣错误你也未可知,因为你不可能天天去看每时每刻去看log,不加上这个出现错误的⼏率相对会很⾼,因为任何⼤点的项⽬和系统,磁盘IO都是⼀个瓶颈
Rsync error:
错误⼀:
@ERROR: auth failed on module xxxxx
rsync: connection unexpectedly closed (90 bytes read so far)
rsync error: error in rsync protocol data stream (code 12) at io.c(150)
说明:这是因为密码设置错了,⽆法登⼊成功,检查⼀下rsync.pwd,看客服是否匹配。还有服务器端没启动rsync 服务也会出现这种情况。
错误⼆:
password file must not be other-accessible
continuing without password file
Password:
说明:这是因为rsyncd.pwd rsyncd.sec的权限不对,应该设置为600。如:chmod 600 rsyncd.pwd
错误三:
@ERROR: chroot failed
rsync: connection unexpectedly closed (75 bytes read so far)
rsync error: error in rsync protocol data stream (code 12) at io.c(150)
说明:这是因为你在 f 中设置的 path 路径不存在,要新建⽬录才能开启同步
错误四:
rsync: failed to connect to 218.107.243.2: No route to host (113)
rsync error: error in socket IO (code 10) at clientserver.c(104) [receiver=2.6.9]
说明:防⽕墙问题导致,这个最好先彻底关闭防⽕墙,排错的基本法就是这样,⽆论是S还是C,还有ignore errors选项问题也会导致
错误五:
@ERROR: access denied to www from unknown (192.168.1.123)
rsync: connection unexpectedly closed (0 bytes received so far) [receiver]
rsync error: error in rsync protocol data stream (code 12) at io.c(359)
说明:此问题很明显,是配置选项host allow的问题,初学者喜欢⼀个允许段做成⼀个配置,然后模块⼜是同⼀个,致使导致错误六:
rsync error: received SIGINT, SIGTERM, or SIGHUP (code 20) at rsync.c(244) [generator=2.6.9]
rsync error: received SIGUSR1 (code 19) at main.c(1182) [receiver=2.6.9]
说明:导致此问题多半是服务端服务没有被正常启动,到服务器上去查查服务是否有启动,然后查看下 /var/run/rsync.pid ⽂件是否存在,最⼲脆的⽅法是杀死已经启动了服务,然后再次启动服务或者让脚本加⼊系统启动服务级别然后shutdown -r now服务器
错误七:
rsync: read error: Connection reset by peer (104)
rsync error: error in rsync protocol data stream (code 12) at io.c(604) [sender=2.6.9]
说明:原数据⽬录⾥没有数据存在
rsync 错误与解决⽅法整理补充篇
由于我们经常使⽤rsync进⾏服务器⽂件的同步⼯作,但在配置过程中,会出现很多问题,下⾯的错误基本上都是通过客户端返回的错误进⾏分析。
另外查错误过程中也学到了⼀个查看错误的⽅法-查看系统⽇志,我们操作的每步都会在⽇志上有说明,有时候报错看不懂,⽇志上都写的清清楚楚。
命令:cat /var/log/messages
问题⼀:
@ERROR: auth failed on module bachup
rsync error: error starting client-server protocol (code 5) at main.c(1522) [receiver=3.0.3]
原因:服务器端该模块(backup)需要验证⽤户名密码,但客户端没有提供正确的⽤户名密码,认证失败。提供正确的⽤户名密码解决此问题。
这个问题⽐较蠢,如果可能你和我⼀样明明在模块⾥写了密码⽂件,怎么都不通,这个时候我劝你先检查⼀下所写模块中是不是和下图⼀样。⽐如,某处多了个s。
问题⼆:110错误 -time out
rsync: failed to connect to 203.100.192.66: Connection timed out (110)
rsync error: error in socket IO (code 10) at clientserver.c(124) [receiver=3.0.5]
原因:
检查服务器的端⼝netstat –tunlp,远程telnet测试。可能因为客户端或者服务端的防⽕墙开启导致⽆法通信,可以设置规则放⾏ rsync(873端⼝)或者直接关闭防⽕墙。
在这⾥博主是重启过服务器,然后就报110了,直接开启rsync服务就⾏。
命令:service rsyncd start
一亩地是多少平方米问题三:113错误 -防⽕墙
文化产业管理专业rsync: failed to connect to 218.107.243.2: No route to host (113) rsync error: error in socket IO (code 10) at clientserver.c(104) [receiver=2.6.9]
原因:
防⽕墙问题导致,这个很简单,关闭防⽕墙就可以。不过博主还是被困在这⾥⼏个⼩时,因为linux防⽕墙分两种:
-iptable和-firewall
认识到这个问题⾸先查看系统的防⽕墙种类,查看防⽕墙状态即可
service iptable status星座血型生肖
firewall-cmd --state
确定防⽕墙种类后再按对应⽅法将防⽕墙关闭即可。
问题四:1516错误
@ERROR: auth failed on module backup
rsync error: error starting client-server protocol (code 5) at main.c(1516) [Receiver=3.0.9]
解决:这个问题错误差别很⼤,可查看系统⽇志查看错误,再搜索解决⽅法。
注意:⼀般这种情况都建⽴在可以连通的基础。去服务端查看系统⽇志,可以查看相关错误。
命令:cat /var/log/massages
cat /var/log/rsyncd.log

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。