马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?开始注册
x
在rsyncd.log里面或.err文件里面,大家可以用记事本打开查看。 注意windows下面我们需要给SvcwRsync用户,管理同步目录的所有权限,基本上这样就可以了 问题一:
6 c9 O3 }6 K3 p8 x4 z3 j@ERROR: chroot failed T/ n7 X; }' G& M! l. Y4 k. K
rsync error: error starting client-server protocol (code 5) at main.c(1522) [receiver=3.0.3] 2 `1 V" P9 T% E
# A9 u: |" Q2 l; h% V
原因:
0 ?" ]6 d7 q5 ?& ^服务器端的目录不存在或无权限,创建目录并修正权限可解决问题。
3 `# w h; v% k5 N/ \
" M& ?& T2 _, w9 e" [5 a% R4 w' ]问题二: ( Y: c/ ^& V7 F0 H5 {+ k
@ERROR: auth failed on module tee 2 k& _7 u- N: Y. i4 V
rsync error: error starting client-server protocol (code 5) at main.c(1522) [receiver=3.0.3] ' ~4 O5 @1 O. X6 b+ ]: X) R
7 k: q% B2 c) t. c% o原因: - e7 j' P/ h7 d) a+ K: @
服务器端该模块(tee)需要验证用户名密码,但客户端没有提供正确的用户名密码,认证失败。 . s" T" [2 d9 e
提供正确的用户名密码解决此问题。
4 X. J# [. R1 u4 M) K
; p i& I* Y R& T+ A' ?7 X问题三: + Y6 k8 p& f* S, V }. y1 i
@ERROR: Unknown module ‘tee_nonexists' 2 `. g' B/ _. P' P( u1 @) T$ }2 t
rsync error: error starting client-server protocol (code 5) at main.c(1522) [receiver=3.0.3] & I9 e6 Z3 g5 ~8 z
8 }! B+ N8 \' R) [" o g# ^原因: 4 w6 l8 j6 J4 r& b, Q* q3 ?
服务器不存在指定模块。提供正确的模块名或在服务器端修改成你要的模块以解决问题。 # |+ o: F- h; ~! u; s/ S- b; W
; n6 G. y4 y+ u& W, J/ f y* w! y: O/ z5 w- O: o. ^8 I" H
问题1: % D- X4 Q7 q2 h/ J l
在client上遇到问题: & J9 i) o+ y6 Y$ ~3 Z* X6 o( r: H
rsync -auzv --progress --password-file=/etc/rsync.pas root@192.168.133.128::backup /home/ 7 O0 k& C- Z0 d& I2 j: W4 w
rsync: could not open password file "/etc/rsync.pas": No such file or directory (2)
, l% a& q$ t, Z1 L4 oPassword: / ?1 R2 ]9 b' b/ W+ m
@ERROR: auth failed on module backup
0 G9 |. q4 l* I! E: z1 P5 irsync error: error starting client-server protocol (code 5) at main.c(1506) [Receiver=3.0.7] 5 l; Z5 u4 j9 J3 a, \
遇到这个问题:client端没有设置/etc/rsync.pas这个文件,而在使用rsync命令的时候,加了这个参数-- # M' x6 N% y/ z) m9 w k
password-file=/etc/rsync.pas $ i- Q' |: Z2 d% I+ x8 V
' I# {5 L3 P' q5 q7 h$ b1 C
问题2: $ m; H& {* v4 o* _0 Q/ B9 C
rsync -auzv --progress --password-file=/etc/rsync.pas root@192.168.133.128::backup /home/
! O3 z5 H1 x1 w4 b2 {+ {' ~$ [@ERROR: auth failed on module backup 8 k9 l7 w% H5 P
rsync error: error starting client-server protocol (code 5) at main.c(1506) [Receiver=3.0.7]
9 b1 D O3 R7 _4 H遇到这个问题:client端已经设置/etc/rsync.pas这个文件,里面也设置了密码111111,和服务器一致,但是 $ q) u0 S8 G9 I. A6 t, ^9 k3 X! [. T/ ]
服务器段设置有错误,服务器端应该设置/etc/rsync.pas ,里面内容root:111111 ,这里登陆名不可缺少
1 K6 m: s' }4 X8 W3 ^5 E5 _& I/ g+ E' k0 S
问题3: 4 o, O3 u; H1 I# o( {- P
rsync -auzv --progress --password-file=/etc/rsync.pas root@192.168.133.128::backup /home/ - a" A1 X6 Y, {' e
@ERROR: chdir failed 0 D0 o* P9 d1 ~, E
rsync error: error starting client-server protocol (code 5) at main.c(1506) [Receiver=3.0.7] ; |" Z3 k# i9 A! h9 F
遇到这个问题,是因为服务器端的/home/backup 其中backup这个目录并没有设置,所以提示:chdir failed 1 Z* I. [4 {2 v5 E8 S3 l
* L4 y4 X7 ?4 A8 Z5 j4 S/ [ b
问题4: 5 Y+ G" S d: k& l' C) J6 ]7 V
rsync: write failed on "/home/backup2010/wensong": No space left on device (28) & N e6 [$ Z& T: x k5 r R( j
rsync error: error in file IO (code 11) at receiver.c(302) [receiver=3.0.7]
3 N8 ~- H. c2 v8 j3 c7 mrsync: connection unexpectedly closed (2721 bytes received so far) [generator] $ U8 I0 D* g" _8 n4 J& z* k
rsync error: error in rsync protocol data stream (code 12) at io.c(601) [generator=3.0.7]
& v2 K9 l6 |( b磁盘空间不够,所以无法操作。
* b4 s( Y7 T9 M" E V可以通过df /home/backup2010 来查看可用空间和已用空间
8 A9 S% E: ]9 @8 t8 V; g! i; s' m2 K4 W& [3 m6 h) [' A( o
问题5:网络收集问题
1 t9 X2 C2 u6 X' h3 W1、权限问题 : g1 ~# N' A6 N5 q* O
类似如下的提示:rsync: opendir "/kexue" (in dtsChannel) failed: Permission denied (13)注意查看同步的目录权限是否为755
8 j8 h6 b7 a2 J) I. J" V2、time out % B- J, c T3 s1 q5 u& H
rsync: failed to connect to 203.100.192.66: Connection timed out (110) 4 n, W. V7 Z2 Q' ^: }
rsync error: error in socket IO (code 10) at clientserver.c(124) [receiver=3.0.5] , P4 I' D$ j* F$ { O+ m
检查服务器的端口netstat –tunlp,远程telnet测试。
2 }- @' `8 U1 S8 {$ m2 K可能因为客户端或者服务端的防火墙开启 导致无法通信,可以设置规则放行 rsync(873端口) 或者直接关闭防火墙。
! I! i! c3 f4 b5 b1 I4 K) B5 w/ U5 c
还有一种在同步过程中可能会提示没有权限 (将同步目录加上SvcwRsync全部权限即可,更简单的方法就是将SvcwRsync设为管理员即可); @! d& n$ l( ^" K
3 q% C1 Y% P3 W4 X: ^4 I* p* @7 x8 b) r' |) o5 t( I) a) @4 E
3、服务未启动 : `4 q# O1 l" z1 u3 z# A
rsync: failed to connect to 10.10.10.170: Connection refused (111) , I' X5 f/ U1 t' U: P7 P2 P" y: O0 V6 R
rsync error: error in socket IO (code 10) at clientserver.c(124) [receiver=3.0.5] 5 L* H8 @! ]1 o ?% B
启动服务:rsync --daemon --config=/etc/rsyncd.conf
$ r/ L# X& c+ O* _" V. |4、磁盘空间满
, S" |8 ~$ {5 [rsync: recv_generator: mkdir "/teacherclubBackup/rsync……" failed: No space left on device (28) : Q9 X' t; D4 r, {$ e
*** Skipping any contents from this failed directory ***
- k% l. |! d6 C0 R5、Ctrl+C或者大量文件
" d M/ p, i+ P9 ~7 l1 xrsync error: received SIGINT, SIGTERM, or SIGHUP (code 20) at rsync.c(544) [receiver=3.0.5]
' T/ P' W1 k3 M, m- E3 v) Xrsync error: received SIGINT, SIGTERM, or SIGHUP (code 20) at rsync.c(544) [generator=3.0.5] 3 a$ B N: x/ ?# S+ {! ^* t
说明:导致此问题多半是服务端服务没有被正常启动,到服务器上去查查服务是否有启动,然后查看下 /var/run/rsync.pid 文件是否存在,最干脆的方法是杀死已经启动了服务,然后再次启动服务或者让脚本加入系统启动服务级别然后shutdown -r now服务器
& \" X# w8 Y6 P; H$ `) o J8 ]* d7 B! k; ]3 P
6、xnetid启动 / [& F) ?6 V: r' C* E; |" b
rsync: read error: Connection reset by peer (104) 9 A6 n) p& p+ U) w) s
rsync error: error in rsync protocol data stream (code 12) at io.c(759) [receiver=3.0.5] 6 F) N. p* e3 ~$ t
查看rsync日志
) J- d% C3 r Z" brsync: unable to open configuration file "/etc/rsyncd.conf": No such file or directory
' w$ r# \! g0 i% X8 o' W( rxnetid查找的配置文件位置默认是/etc下,根据具体情况创建软链接。例如: $ V/ n* P* }6 a
ln -s /etc/rsyncd/rsyncd.conf /etc/rsyncd.conf
5 ~) d1 G4 I6 \: F' T3 e1 H+ {! w或者更改指定默认的配置文件路径,在/etc/xinetd.d/rsync配置文件中。
! \! Y( l; R6 q Rsync configure:
( E' q: {1 A+ V' `配置一:; b" C |6 d# Q# r# K
ignore errors
. a' G0 T7 c$ {% g说明:这个选项最好加上,否则再很多crontab的时候往往发生错误你也未可知,因为你不可能天天去看每时每刻去看log,不加上这个出现错误的几率相对会很高,因为任何大点的项目和系统,磁盘IO都是一个瓶颈
: d( p. u9 d0 n% {& n6 {0 q Y9 r6 a% @4 ?
Rsync error: 5 V: j5 i. {* B4 J! N; p
错误一:
+ w1 h" C4 O( t1 v6 I, u/ K@ERROR: auth failed on module xxxxx
; `/ k: M+ n) `0 brsync: connection unexpectedly closed (90 bytes read so far)
0 t) a% y Y& H0 X C# r+ x8 x: Q2 mrsync error: error in rsync protocol data stream (code 12) at io.c(150)
$ \4 p$ l4 l( n9 G0 l4 R说明:这是因为密码设置错了,无法登入成功,检查一下rsync.pwd,看客服是否匹配。还有服务器端没启动rsync 服务也会出现这种情况。 错误二:
# w# H5 ^9 |. `3 H0 K& l$ R$ kpassword file must not be other-accessible
4 z& j. h" h6 K$ {continuing without password file
3 S& I. R$ a. w( E* g1 z2 `) B5 \Password:
) m8 l8 V3 W$ E0 H说明:这是因为rsyncd.pwd rsyncd.sec的权限不对,应该设置为600。如:chmod 600 rsyncd.pwd 错误三:
% m; \ _% u9 q* w4 ^@ERROR: chroot failed - [, F; l& O+ `, B, F# k0 Z& B6 v
rsync: connection unexpectedly closed (75 bytes read so far)
# F/ P3 |9 x+ Rrsync error: error in rsync protocol data stream (code 12) at io.c(150)
1 M8 ]: z* _- B/ U6 {/ B说明:这是因为你在 rsync.conf 中设置的 path 路径不存在,要新建目录才能开启同步 错误四: / \! z% [1 o* z( \
rsync: failed to connect to 218.107.243.2: No route to host (113)
+ t- E8 q% w' }( mrsync error: error in socket IO (code 10) at clientserver.c(104) [receiver=2.6.9] ( a$ O5 w, J+ v/ K9 A
说明:防火墙问题导致,这个最好先彻底关闭防火墙,排错的基本法就是这样,无论是S还是C,还有ignore errors选项问题也会导致' K; m( Q. W3 j+ }
; A, t3 g; k( p7 F错误五:
9 l# ~* c( b- ~, p. I* V@ERROR: access denied to www from unknown (192.168.1.123)
& U4 v# `/ {8 O$ Lrsync: connection unexpectedly closed (0 bytes received so far) [receiver]
! F/ b2 _( q5 E% Xrsync error: error in rsync protocol data stream (code 12) at io.c(359)
2 B ?- @& A; b" b% M7 t说明:此问题很明显,是配置选项host allow的问题,初学者喜欢一个允许段做成一个配置,然后模块又是同一个,致使导致 错误六:( s0 W/ t' t% ^
rsync error: received SIGINT, SIGTERM, or SIGHUP (code 20) at rsync.c(244) [generator=2.6.9]
- i+ }3 _" {. nrsync error: received SIGUSR1 (code 19) at main.c(1182) [receiver=2.6.9]/ S4 j& Q" J, f" g! k
说明:导致此问题多半是服务端服务没有被正常启动,到服务器上去查查服务是否有启动,然后查看下 /var/run/rsync.pid 文件是否存在,最干脆的方法是杀死已经启动了服务,然后再次启动服务或者让脚本加入系统启动服务级别然后shutdown -r now服务器 错误七:4 ~3 t6 M6 H% r {
rsync: read error: Connection reset by peer (104)/ `) d$ y, v. |; s
rsync error: error in rsync protocol data stream (code 12) at io.c(604) [sender=2.6.9]
e& p5 f1 R# N; [( ~' b说明:原数据目录里没有数据存在- V6 M: X. j- D. _+ |) M. R
rsync 错误与解决方法整理补充篇 由于我们经常使用rsync进行服务器文件的同步工作,但在配置过程中,会出现很多问题,下面的错误基本上都是通过客户端返回的错误进行分析。 另外查找错误过程中也学到了一个查看错误的方法-查看系统日志,我们操作的每步都会在日志上有说明,有时候报错看不懂,日志上都写的清清楚楚。 命令:cat /var/log/messages 问题一: @ERROR: auth failed on module bachup" n3 h( V3 b1 U
rsync error: error starting client-server protocol (code 5) at main.c(1522) [receiver=3.0.3] 原因:服务器端该模块(backup)需要验证用户名密码,但客户端没有提供正确的用户名密码,认证失败。 提供正确的用户名密码解决此问题。
/ R. D8 g' L9 [: |这个问题比较蠢,如果可能你和我一样明明在模块里写了密码文件,怎么都不通,这个时候我劝你先检查一下所写模块中是不是和下图一样。比如,某处多了个s。
( W; N2 t/ Y3 n% }( P) ?( C 微信图片_20210306223602.p ... 问题二:110错误 -time out rsync: failed to connect to 203.100.192.66: Connection timed out (110) . P6 U* }1 ~9 m/ x7 j$ Q" g6 ?
rsync error: error in socket IO (code 10) at clientserver.c(124) [receiver=3.0.5] 原因: 检查服务器的端口netstat –tunlp,远程telnet测试。 可能因为客户端或者服务端的防火墙开启 导致无法通信,可以设置规则放行 rsync(873端口) 或者直接关闭防火墙。
. v4 L$ Y5 _& l) Y @. `# h在这里博主是重启过服务器,然后就报110了,直接开启rsync服务就行。 命令:service rsyncd start 问题三:113错误 -防火墙
2 E. H2 L1 v4 s% F8 y3 a9 Krsync: 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]7 ^% |; z7 \7 ]+ p( W1 Q; ?( z
原因:" B' L S6 t6 S* i* p
防火墙问题导致,这个很简单,关闭防火墙就可以。不过博主还是被困在这里几个小时,因为linux防火墙分两种: -iptable和-firewall
1 p$ k1 I2 o, ~ V2 Z1 H: E" C认识到这个问题首先查看系统的防火墙种类,查看防火墙状态即可& ^ ^" ], h7 |9 O$ V3 ~, r
service iptable status# I$ f1 ` [3 J
firewall-cmd --state 确定防火墙种类后再按对应方法将防火墙关闭即可。 问题四:1516错误 @ERROR: auth failed on module backup
/ q4 V$ ?8 H. x7 X: Ursync error: error starting client-server protocol (code 5) at main.c(1516) [Receiver=3.0.9]
) W: z. D$ R: K* i 2 p& {: M) N+ J; J' o$ n- m# M
) }" ?+ y% Z( `% U6 M
; X" n5 o% f! u/ i, V, h2 m' N7 U微信图片_20210306223651.p ...
, f9 ?. r! J8 V1 u2 J
; \" M8 ^2 F. U" @- `1 g! @/ g9 o" ], {
解决:这个问题错误差别很大,可查看系统日志查看错误,再搜索解决方法。 注意:一般这种情况都建立在可以连通的基础。去服务端查看系统日志,可以查看相关错误。 命令:cat /var/log/massages cat /var/log/rsyncd.log |