rsync安装使用中出现的报错
一,查看本地centos的版本:
[root@localhost lib]# cat /etc/redhat-release CentOS Linux release 8.1.1911 (Core)
说明:刘宏缔的架构森林是一个专注架构的博客,
网站:https://blog.imgtouch.com
本文: https://blog.imgtouch.com/index.php/2023/05/17/rsync-an-zhuang-shi-yong-zhong-chu-xian-de-bao-cuo/
对应的源码可以访问这里获取: https://github.com/liuhongdi/
说明:作者:刘宏缔 邮箱: 371125307@qq.com
二,报错一:
@ERROR: access denied to wwwroot from localhost (127.0.0.1) rsync error: error starting client-server protocol (code 5) at main.c(1657) [Receiver=3.1.3]
解决:
说明:rsync配置文件中,wwwroot这个区域没有放开当前的ip,
添加ip后重启服务
三,报错二:
@ERROR: auth failed on module wwwroot rsync error: error starting client-server protocol (code 5) at main.c(1657) [Receiver=3.1.3]
解决:
验证出错,原因是密码错误,检查客户端的密码文件是否正确
此处注意:服务端的密码需要写成: pusher:123456,格式是 用户名:密码,
而客户端的密码是: 123456,也就是密码文件中不需要用户名
四,报错三:
[root@localhost source]# rsync --progress -artuz -R "./abc.txt" pusher@127.0.0.1::wwwroot --password-file=/data/rsync/conf/client.pass sending incremental file list rsync: read error: Connection reset by peer (104) rsync error: error in socket IO (code 10) at io.c(785) [sender=3.1.3]
解决:
上传文件时连接被重置,是因为没有写权限,
修改服务端的配置文件,增加写的权限
[root@localhost source]# vi /etc/rsyncd.conf
说明:
增加内容:
read only = no
五,报错四:
[root@localhost source]# rsync -artuz -R "./laoliu.txt" pusher@127.0.0.1::wwwroot --password-file=/data/rsync/conf/client.pass rsync: failed to connect to 127.0.0.1 (127.0.0.1): Connection refused (111) rsync error: error in socket IO (code 10) at clientserver.c(127) [sender=3.1.3]
解决:
Connection refused,连接被拒绝
说明rsync服务没有正常启动,正常启动rsync服务即可
例如:systemctl start rsyncd
六,报错五:
rsyncd启动失败:
[root@localhost source]# systemctl start rsyncd
发现未能成功启动,用status查看:
[root@localhost source]# systemctl status rsyncd
报:failed to create pid file /data/rsync/run/rsyncd.pid: File exists
处理
[root@localhost source]# rm /data/rsync/run/rsyncd.pid rm:是否删除普通文件 '/data/rsync/run/rsyncd.pid'?y [root@localhost source]# systemctl start rsyncd [root@localhost source]# [root@localhost source]# systemctl status rsyncd ● rsyncd.service - fast remote file copy program daemon Loaded: loaded (/usr/lib/systemd/system/rsyncd.service; disabled; vendor preset: disabled) Active: active (running) since Tue 2020-02-25 13:04:51 CST; 4s ago