咱們都是經過錯誤日誌查看
在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:網絡收集問題
一、權限問題
相似以下的提示:rsync: opendir "/kexue" (in dtsChannel) failed: Permission denied (13)注意查看同步的目錄權限是否爲755
二、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設爲管理員便可)
三、服務未啓動
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
四、磁盤空間滿
rsync: recv_generator: mkdir "/teacherclubBackup/rsync……" failed: No space left on device (28)
*** Skipping any contents from this failed directory ***
五、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]
六、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配置文件中。 html
安裝完 cwRsync客戶端後,開始寫bat 執行文件,遇到的第一件事情就是就同步到本地時 目錄不認識,報錯以下:
The source and destination cannot both be remote.
rsync error: syntax or usage error (code 1) at main.c(1138) [Receiver=3.0.7]
主要緣由是cwRsync 不能直接認識本地盤,必須加上 /cygdrive/g/test
意思爲g:\test目錄
客戶端密碼文件報錯以下:
rsync password file must be owned by root when running as root
萬能的GOOGLE告訴我,能夠用一個變通的方式解決就是
@echo off
"C:\Program Files (x86)\cwRsync\bin\rsync" -rlptDzv --progress --delete "backup@192.88.88.128::test" /cygdrive/g/test --password-file=/cygdrive/g/rsync/passws.ps<g:\rsync\passwd.txt
在g:\rsync 下創建了一個文件,寫入密碼,而後同步密碼最後在這個文件中輸入便可。如上所例。windows
rsync問題小結
在用rsync同步數據的時候,常常會出現一些問題,我將遇到的總結以下:
一、權限問題
相似以下的提示:rsync: opendir "/kexue" (in dtsChannel) failed: Permission denied (13)注意查看同步的目錄權限是否爲755
二、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: 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
四、磁盤空間滿
rsync: recv_generator: mkdir "/teacherclubBackup/rsync……" failed: No space left on device (28)
*** Skipping any contents from this failed directory ***
五、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]
六、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服務器
常見錯誤:
錯誤一
rsync: failed to connect to 96.44.169.178 (*inet_ntop failed*): Connection timed
out (116)
1 [main] rsync 3468 exception::handle: Exception: STATUS_ACCESS_VIOLATION
740 [main] rsync 3468 open_stackdumpfile: Dumping stack trace to rsync.exe.s
tackdump
1,防火牆問題
2,端口不對
錯誤二
@ERROR: auth failed on module www
rsync error: error starting client-server protocol (code 5) at main.c(1516) [Rec
eiver=3.0.8]
密碼不對
錯誤三
@ERROR: invalid uid nobody
rsync error: error starting client-server protocol (code 5) at main.c(1516) [Rec
eiver=3.0.8]
UID不對,默認是nobody
解決方法:
uid = 0
gid = 0
錯誤四
receiving incremental file list
rsync: read error: Connection reset by peer (104)
rsync error: error in rsync protocol data stream (code 12) at io.c(769) [receive
r=3.0.8]
rsync: connection unexpectedly closed (60 bytes received so far) [generator]
rsync error: error in rsync protocol data stream (code 12) at io.c(610) [generat
or=3.0.8]
可能緣由:
1,磁盤掛載是用異步的(async)
而後,檢查了/etc/fstab ,去掉async參數。
2,我在服務器上查看日誌,看到有這麼一行:
rsync: unable to open configuration file "/etc/rsyncd.conf": No such file or directory
因而我:
ln -s /etc/rsyncd/rsyncd.conf /etc/rsyncd.conf
3,同步文件數較多的目錄出錯
有個子目錄中文件較多,也就8000來個吧,老是同步一半便退出。在批處理中加上-v參數,看到錯誤信息以下:
rsync: writefd_unbuffered failed to write 4 bytes to socket [sender]: 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(768) [sender=
3.0.6]
這個問題有點頭疼,在www.itefix.no網站論壇上也沒能查出個因此然。
不過最終仍是在samba.org上找到解決方案:
在客戶端命令行中加上--no-iconv參數就能夠了。
原覺得是文件太多,緩衝區不夠引發,但看這個解決方案,彷佛是轉換編碼方面的bug了。
在rsync的文檔中描述以下:
http://rsync.samba.org/ftp/rsync/rsync.html
--iconv=CONVERT_SPEC
Rsync can convert filenames between character sets using this option. Using a CONVERT_SPEC of "." tells rsync to look up the default character-set via the locale setting. Alternately, you can fully specify what conversion to do by giving a local and a remote charset separated by a comma in the order --iconv=LOCAL,REMOTE, e.g. --iconv=utf8,iso88591. This order ensures that the option will stay the same whether you're pushing or pulling files. Finally, you can specify either --no-iconv or a CONVERT_SPEC of "-" to turn off any conversion. The default setting of this option is site-specific, and can also be affected via the RSYNC_ICONV environment variable.網絡
在window上,rsync同步數據報錯:異步
rsync error: some files/attrs were not transferred (see previous errors) (code 2 3) at main.c(1052) [sender=3.0.8]socket
緣由:
async