我們都是透過錯誤日誌檢視
在 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]