双台服务器rsync同步报错(code 5) at main.c(1503) [sender=3.0.6]

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了双台服务器rsync同步报错(code 5) at main.c(1503) [sender=3.0.6]相关的知识,希望对你有一定的参考价值。


环境:某某项目的代码机器70配置有双网卡:232.182.23.70(联通)61.10.45.70(电信)


另一台代码机器是沧州联通的代码机器102,配置单网卡:121.15.1.102(联通)


rsync服务端服务器121.15.1.102上的配置文件rsyncd.conf

一开始/etc/rsyncd.conf 里面配置的允许ip:为61.10.45.70

[[email protected] tmp]# cat /etc/rsyncd.conf 

##rsyncd.conf start##

uid = root

gid = root

port=873

use chroot = no 

read only = no 

list = no 

max connections = 200

timeout = 300

auth users = stuser

hosts allow =  61.10.45.70

#hosts deny = *

pid file = /var/run/rsyncd.pid

lock file = /var/run/rsync.lock

log file = /var/log/rsyncd.log

secrets file = /etc/rsync.pass

motd file = /etc/rsyncd.Motd


[sdkdhcode]

path = /data/www/sdkdhcode/

comment = sdkdhcode



看似一切正常,但是这样在配置好的rsync的同步环境就出问题了:

(61.10.45.70机器推送数据到121.15.1.102机器上)

[[email protected] tmp]# rsync -avH --port=873 --progress  /opt/biao-framedb_backup.sh  [email protected]::sdkdhcode --password-file=/tmp/lmpasswd.txt 

@ERROR: Unknown module ‘sdkdhcode‘

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


原因是:rsync在同步中两台服务器的网卡寻找线路是联通找联通,电信的找电信的,而上面个的配置文件中添加的是的电信的ip地址:61.10.45.70,这样会导致61.10.45.70机器进行rsync传顺数据包到121.15.1.102机器上出问题,


于是把上面的rsyncd.conf配置文件中的 地址改为112.82.223.70(联通ip)就没问题了


解决上面的问题是从报错日志文件中发现:

tail -100f /var/log/rsyncd.log

2017/09/08 22:54:36 [85284] rsync denied on module code from unknown (232.182.23.70)

2017/09/08 22:56:37 [85314] name lookup failed for 232.182.23.70: Name or service not known

2017/09/08 22:56:37 [85314] connect from UNKNOWN (232.182.23.70)

2017/09/08 22:56:37 [85314] rsync denied on module code from unknown (232.182.23.70)

2017/09/08 22:57:03 [85318] name lookup failed for 232.182.23.70: Name or service not known

2017/09/08 22:57:03 [85318] connect from UNKNOWN (232.182.23.70)

本文出自 “10931853” 博客,请务必保留此出处http://wujianwei.blog.51cto.com/10931853/1964029

以上是关于双台服务器rsync同步报错(code 5) at main.c(1503) [sender=3.0.6]的主要内容,如果未能解决你的问题,请参考以下文章

@ERROR: auth failed on module wwwroot rsync error: error starting client-server protocol (code 5) at

@ERROR: auth failed on module wwwroot rsync error: error starting client-server protocol (code 5) at

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

@ERROR: auth failed on module wwwroot rsync error: error starting client-server protocol (code 5) at

rsync同步报错

Linux之RSYNC文件同步服务