rsync同步报错原因以及解决方案:

[root@NFS data]# rsync -avz rsync://back@192.168.17.13/www /data
rsync: failed to connect to 192.168.17.13: Connection refused (111)
rsync error: error in socket IO (code 10) at clientserver.c(124) [receiver=3.0.6]

NFS存储服务器在使用使用命令备份NFS存储服务器时,报连接失败错误。
我登录BACKUP服务器进行查看,发现rsync配置文件并没有问题,检查后发现rsync服务并未开启,造成客户端访问报错。

[root@BACKUP data]# lsof -i :873
[root@BACKUP data]# netstat -lntup|grep rsync
[root@BACKUP data]# ps aux|grep rsync
root      10104  0.0  0.1 103324   852 pts/0    S+   10:50   0:00 grep --color rsync

lsof -i :PORT 查看端口是否开启
netstat -lntup|grep rsync 查看服务是否开启
ps aux|grep rsync 查看是否有进程存在

[root@Backup data]# rsync --daemon
[root@Backup data]# lsof -i :873
COMMAND  PID USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
rsync   7934 root    4u  IPv4  54565      0t0  TCP *:rsync (LISTEN)
rsync   7934 root    5u  IPv6  54566      0t0  TCP *:rsync (LISTEN)

使用rsync --daemon以守护进程的方式启动rsync。
lsof -i :873查看是否开启。

[root@NFS ~]# rsync -avz /root/a.sh rsync://back@192.168.17.13/www --password-file=/etc/rsync.password 
sending incremental file list
a.sh

sent 164 bytes  received 27 bytes  382.00 bytes/sec
total size is 124  speedup is 0.65
[root@NFS data]# rsync -avz rsync://back@192.168.17.13/www /data --password-file=/etc/rsync.password 
receiving incremental file list

sent 56 bytes  received 454 bytes  1020.00 bytes/sec
total size is 4471  speedup is 8.77

存储服务器测试。
完成!!!

  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值