本帖最后由 lyhabc 于 2016-1-7 23:47 编辑
端口使用默认873
iptables,selinux都关了,并且客户端能telnet通服务器的873端口
使用ssh协议的方式没有问题的
rsync -e "ssh -p 22" -avz /root/1.txt root@192.168.2.30:/mydata/bak/192.168.2.60/2.TXT
使用cs模式有问题
rsync -avz /root/1.txt root@192.168.2.30::2_60/2.TXT
配置文件
vi /etc/rsyncd.conf
#port=873
log file=/var/log/rsync.log
pid file=/var/run/rsyncd.pid
#address=192.168.0.10
[2_60]
path=/mydata/bak/2_60/
use chroot=true
max connections=1
read only=no
list=false
#uid=root
#gid=root
#auth users=test
#secrets file=/etc/rsyncd.passwd
hosts allow=192.168.2.60
服务器端的错误日志/var/log/rsync.log
2016/01/07 23:15:31 [953] rsync: connection unexpectedly closed (0 bytes received so far) [receiver]
2016/01/07 23:15:31 [953] rsync error: error in rsync protocol data stream (code 12) at io.c(600) [receiver=3.0.6]
2016/01/07 23:15:44 [954] name lookup failed for 192.168.2.60 Name or service not known
2016/01/07 23:15:44 [954] connect from UNKNOWN (192.168.2.60)
权限检查过没有问题,rsync使用root启动
端口使用默认873
iptables,selinux都关了,并且客户端能telnet通服务器的873端口
使用ssh协议的方式没有问题的
rsync -e "ssh -p 22" -avz /root/1.txt root@192.168.2.30:/mydata/bak/192.168.2.60/2.TXT
使用cs模式有问题
rsync -avz /root/1.txt root@192.168.2.30::2_60/2.TXT
配置文件
vi /etc/rsyncd.conf
#port=873
log file=/var/log/rsync.log
pid file=/var/run/rsyncd.pid
#address=192.168.0.10
[2_60]
path=/mydata/bak/2_60/
use chroot=true
max connections=1
read only=no
list=false
#uid=root
#gid=root
#auth users=test
#secrets file=/etc/rsyncd.passwd
hosts allow=192.168.2.60
服务器端的错误日志/var/log/rsync.log
2016/01/07 23:15:31 [953] rsync: connection unexpectedly closed (0 bytes received so far) [receiver]
2016/01/07 23:15:31 [953] rsync error: error in rsync protocol data stream (code 12) at io.c(600) [receiver=3.0.6]
2016/01/07 23:15:44 [954] name lookup failed for 192.168.2.60 Name or service not known
2016/01/07 23:15:44 [954] connect from UNKNOWN (192.168.2.60)
权限检查过没有问题,rsync使用root启动
0
注释掉端口问题不大,因为默认是873,但是你的日志提示是说你的hosts allow地址有问题,你要不在本地上配一个hosts,就是vim /etc/hosts,将你rsync服务器主机名和ip以及rsync客户端主机名和ip加进去。然后试一下吧。
0
都指定ip了,要host干嘛
wuwenweijuan 发表于 2016-1-8 09:10
注释掉端口问题不大,因为默认是873,但是你的日志提示是说你的hosts allow地址有问题,你要不在本地上配一 ...
都指定ip了,要host干嘛
编辑回复