rsync同步遇到的報錯和解決辦法


rsync同步遇到的報錯和解決辦法

 
科技小能手  2017-11-12 18:27:00 瀏覽1125
 

在同步的客戶端操作:

[root@www1 dbbackup]# /usr/bin/rsync  -avzP  --password-file=/tmp/passwd.txt  zytbuser@192.168.10.11::dbdata /data/backup/6.100.25.07/dbbackup

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]

 

解決方法:

在rsyncd.conf的服務端操作:

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配置文件中。 

[root@localhost rsyncd]# ln -s /etc/rsyncd/rsyncd.conf /etc/rsyncd.conf

[root@localhost rsyncd]# ll /etc/rsyncd.conf 

lrwxrwxrwx 1 root root 23 8月   1 13:25 /etc/rsyncd.conf -> /etc/rsyncd/rsyncd.conf

 

 

rsync權限問題:

[root@localhost 20170807]# /usr/bin/rsync -avH --port=873 --progress ppwxtbuser@192.168.10.98::ppwxweb /data/backup/14.203.190.21 --password-file=/tmp/passwdwx.txt

receiving incremental file list

rsync: send_files failed to open "root" (in ppwxweb): Permission denied (13)

sent 83 bytes  received 480 bytes  1126.00 bytes/sec

total size is 88142423  speedup is 156558.48

rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1505) [generator=3.0.6]

 

一開始權限是:www.www 現在修改為root,從此不再報錯:

[root@localhost backup]# egrep "uid|gid|read" /etc/rsyncd.conf

uid = root

gid = root

read only = no

rsync同步報錯:

 

[root@localhost 104.203.190.21]# /usr/bin/rsync -avH --port=873 --progress ppwxtbuser@192.168.10.98::ppwxdb /data/backup/14.203.190.21/dbbackup --password-file=/tmp/passwdwx.txt

 

@ERROR: chdir failed

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

原因是:

[root@localhost dbackup]# grep pat /etc/rsyncd.conf|tail -1

path = /data/backup/dbackup

 

/data/backup/dbackup 寫成了/data/backup/dbbackup

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM