我们都是通过错误日志检视
在 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=/etc/rsyncd.conf
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 “/etc/rsyncd.conf”: No such file or directory
xnetid 查询的配置档案位置预设是/etc 下,根据具体情况建立软连结。例如:
ln -s /etc/rsyncd/rsyncd.conf /etc/rsyncd.conf
或者更改指定预设的配置档案路径,在/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)
说明:这是因为你在 rsync.conf 中设定的 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]
说明:原资料目录里没有资料存在
error 总结:
@ERROR: chdir failed
rsync error: error starting client-server protocol (code 5) at main.c(1296) [receiver=2.6.8]
原因及解决办法:
这一般是在站群服务器端没有建立目录
或者是如果有开启 SELinux 只要执行一下命令
SELinux;
setsebool -P rsync_disable_trans on
切记: rsyncd.secrets 的许可权必须为 600
(注意:这个安全设定很重要,如果不这样做客户机连线站群服务器时会提示:
password file must not be other-accessible
rsync error: some files could not be transferred (code 23) at main.c(1298) [generator=2.6.8]
@ERROR: auth failed on module
rsync: connection unexpectedly closed (102 bytes read so far)
rsync error: error in rsync protocol data stream (code 12) at io.c(165)
站群服务器端日志将出现错误提示:
2005/08/23 06:32:01 [8388] secrets file must not be other-accessible (see strict modes option)
2005/08/23 06:32:01 [8388] continuing without secrets file
2005/08/23 06:32:01 [8388] auth failed on module from documentserver
站群服务器端 rsyncd.secrets (使用者: 密码)<使用者必须是系统使用者, 密码尽量不要为系统使用者密码>
客户端 rsyncd.secrets (密码)<站群服务器端密码>
站群服务器和客户端的帐户密码都不可以有空格, 否则会出现
@ERROR: auth failed on module
注意:
如果改变了埠号, 一定要在/etc/services 中把对应的埠改变才能正常执行
如 rsync 873/tcp 改成
rsync 3334/tcp 即可
error3:
rsyncd.secrets 的密码一定要和 Rsync Server 密码设定档案里的密码一样。如果不同 (跟不是 linux 合法使用者错误一样),将会出现如下的错误:
#rsync -azv /home rsync://root@192.168.1.107/hadoop –password-file=/home/rsyncd.secrets
@ERROR: auth failed on module hadoop
rsync error: error starting client-server protocol (code 5) at main.c(1296) [sender=2.6.8]
error4:
在 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
error5:
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
error6:
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 来检视可用空间和已用空间
error7:
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 测试。
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=/etc/rsyncd.conf
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]
6 、 xnetid 启动(linux)
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]