rsync同步遇到的报错和解决办法

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了rsync同步遇到的报错和解决办法相关的知识,希望对你有一定的参考价值。

在同步的客户端操作:

[[email protected] dbbackup]# /usr/bin/rsync  -avzP  --password-file=/tmp/passwd.txt  [email protected]::dbdata /data/backup/61.160.245.70/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配置文件中。 

[[email protected] rsyncd]# ln -s /etc/rsyncd/rsyncd.conf /etc/rsyncd.conf

[[email protected] rsyncd]# ll /etc/rsyncd.conf 

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



rsync权限问题:

[[email protected] 20170807]# /usr/bin/rsync -avH --port=873 --progress [email protected]::ppwxweb /data/backup/104.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,从此不再报错:

[[email protected] backup]# egrep "uid|gid|read" /etc/rsyncd.conf

uid = root

gid = root

read only = no

rsync同步报错:


[[email protected] 104.203.190.21]# /usr/bin/rsync -avH --port=873 --progress [email protected]::ppwxdb /data/backup/104.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]

原因是:

[[email protected] dbackup]# grep pat /etc/rsyncd.conf|tail -1

path = /data/backup/dbackup


/data/backup/dbackup 写成了/data/backup/dbbackup


本文出自 “10931853” 博客,转载请与作者联系!

以上是关于rsync同步遇到的报错和解决办法的主要内容,如果未能解决你的问题,请参考以下文章

Rsync服务器搭建遇到的报错解决办法

20170514002Oracle 11g R2安装过程中遇到的报错及解决办法

MySQL主从同步常见报错的解决办法

python已写内容中可能的报错及解决办法

关于tensorboard --logdir=logs的报错解决办法记录

JS 调试中常见的报错的解决办法