天天看點

rsync常見問題及解決辦法

rsync在使用中往往會報錯誤,綜合自己親身經驗,總結幾條錯誤的解決方案(IP以10.10.10.10代替):

錯誤一:

password file must not be other-accessible

continuing without password file

Password:

rsync用戶端路徑是否寫錯,權限設定不對,需要再次輸入密碼,用戶端和服務端的密碼檔案都應該是600的權限才可以

錯誤二:

@ERROR: Unknown module ‘bak’

rsync error: error starting client-server protocol (code 5) at main.c(1522) [receiver= 3.0.3]

服務端server的配置中的[bak]名字和用戶端client的10.10.10.10::bak不符

錯誤三:

rsync: failed to connect to 10.10.10.10: Connection timed out (110)

rsync error: error in socket IO (code 10) at clientserver.c(124) [receiver=3.0.6]

檢查服務端server服務是否正常啟動,檢查端口防火牆,iptables打開873端口

如果服務端是windows server則在防火牆入站規則中增加873端口

如果服務端是Linux則先檢查服務是否啟動#ps aux | grep rsync

然後開啟873端口#iptables -A INPUT -p tcp --dport 873 -j ACCEPT開啟873端口

附:

安裝rsync yum install rsync

啟動服務/usr/bin/rsync --daemon

啟動服務錯誤failed to create pid file /var/rsyncd.pid: File exists

看看提示服務錯誤的路徑(這個路徑不一定就是這個,看自己的報錯路徑)這裡是/var/rsyncd.pid是以

rm -rf /var/rsyncd.pid;再重新啟動Rsync服務

此時在看一下ps aux | grep rsync啟動成功

錯誤四:

@ERROR: access denied to gmz88down from unknown (10.10.10.10)

rsync error: error starting client-server protocol (code 5) at main.c(1503) [receiver=3.0.6]

看看是不是服務端server hosts allow限制了IP,把這裡的IP加入到服務端server的hosts allow白名單中,windows rsync不能寫多個allow,可以在一個allow中加多個IP,例:hosts allow=10.10.10.10 20.20.20.20

錯誤五:

@ERROR: chdir failed

服務端server的目錄不存在或者沒有權限(要同步的那個檔案路徑),安裝windows rsync時候會建立一個SvcCWRSYNC使用者,這個使用者對要拷貝的目錄沒有權限,方法一,将這個使用者給權限加入到目錄中,方法二,修改這個使用者隸屬于的組,修改後要在管理中重新開機服務

錯誤六:

rsync error: error starting clie

nt-server protocol (code 5) at main.c(1524) [Receiver= 3.0.7 ]

/etc/rsyncd.conf配置檔案内容有錯誤,檢查下配置檔案

錯誤七:

rsync: ch

own "" failed: Invalid argument (22)

權限無法複制,去掉同步權限的參數即可

錯誤八:

@ERROR: auth failed on module bak

rsync error: error starting client-server protocol (code 5) at main.c(1530) [receiver=3.0.6]

密碼錯誤或伺服器上是否有bak子產品

錯誤九:

rsync: connection unexpectedly closed (5 bytes received so far) [sender]

rsync error: error in rsync protocol data stream (code 12) at io.c(600) [sender=3.0.6]

子產品read only = no設定為no false

錯誤十:

@ERROR: invalid uid nobody

rsync error: error starting client-server protocol (code 5) at main.c(1503) [sender=3.0.6]

設定

uid =0

gid = 0

錯誤十一:

rsync: failed to connect to 10.10.10.10: No route to host (113)

防火牆原因

錯誤十二:

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.6]

/etc/rsyncd.conf配置檔案不存在

錯誤十三:

rsync: Failed to exec ssh: No such file or directory (2)

rsync error: error in IPC code (code 14) at pipe.c(84) [receiver=3.0.6]

rsync: connection unexpectedly closed (0 bytes received so far) [receiver]

rsync error: error in IPC code (code 14) at io.c(600) [receiver=3.0.6]

需要在用戶端安裝yum install -y openssh-clients即可

繼續閱讀