首页>>帮助中心>>香港云服务器rsync配置实例 (包括问题解决方案)

香港云服务器rsync配置实例 (包括问题解决方案)

2024/9/9 71次

香港云服务器rsync配置实例 (包括问题解决方案)



香港服务器配置分为2个部分service第一步 安装rsync-3.0.7.tar.gztar xvzf rsync-3.0.7.tar.gz./configuremakemake install 启动rsync/etc/init.d/xinetd start 配置/etc/rsyncd.confvi /etc/rsyncd.confuid = rootgid = rootuse chroot = nomax connections = 10strict modes = yesport = 873address = 192.168.133.128
[backup]path = /home/backup/comment = this is a testignore errorsread only = yeslist = noauth users = rootsecrets file = /etc/rsync.pashosts allow = 192.168.133.150hosts deny = 0.0.0.0/0pid file = /var/run/rsyncd.pidlock file = /var/run/rsync.locklog file = /var/log/rsyncd.log 配置/etc/rsync.pas 在服务器端,必须加入登陆名和密码,在client上,只需要输入密码[root@bogon test]# vi /etc/rsync.pasroot:111111 配置/etc/rsync.motd[root@bogon test11]# vi /etc/rsyncd.motdwelcome to use the rsync services!
client 安装sync-3.0.7.tar.gztar xvzf rsync-3.0.7.tar.gz./configuremakemake install 启动rsync/etc/init.d/xinetd start然后在客户端输入命令同步:rsync -auzv --progress --password-file=/etc/rsync.pas root@192.168.133.128::backup1 /home/test 请注意backup1 /home/test这个就是client端备份的地址
如果需要系统自动同步1客户端必须配置密码文件 /etc/rsync.pas 给与相关权限chmod 600 /etc/rsync.pas2在crontab中增加一条命令,设置多久自?执行一次。3为了安全,建议增加一条iptables命令
如果需要多个不同目录支持同步,再增加一个[backup1]path = /home/testcomment = this is a testignore errorsread only = yeslist = noauth users = rootsecrets file = /etc/rsync.pashosts allow = 192.168.133.150hosts deny = 0.0.0.0/0pid file = /var/run/rsyncd.pidlock file = /var/run/rsync.locklog file = /var/log/rsyncd.log然后在客户端输入命令同步rsync -auzv --progress --password-file=/etc/rsync.pas root@192.168.133.128::backup /home/
配置过程问题:问题1:在client上遇到问题:rsync -auzv --progress --password-file=/etc/rsync.pas root@192.168.133.128::backup /home/rsync: could not open password file "/etc/rsync.pas": No such file or directory (2)Password: @ERROR: auth failed on module backuprsync error: error starting client-server protocol (code 5) at main.c(1506) [Receiver=3.0.7]遇到这个问题:client端没有设置/etc/rsync.pas这个文件,而在使用rsync命令的时候,加了这个参数--password-file=/etc/rsync.pas
问题2:rsync -auzv --progress --password-file=/etc/rsync.pas root@192.168.133.128::backup /home/@ERROR: auth failed on module backuprsync error: error starting client-server protocol (code 5) at main.c(1506) [Receiver=3.0.7]遇到这个问题:client端已经设置/etc/rsync.pas这个文件,里面也设置了密码111111,和服务器一致,但是服务器段设置有错误,服务器端应该设置/etc/rsync.pas ,里面内容root:111111 ,这里登陆名不可缺少
问题3:rsync -auzv --progress --password-file=/etc/rsync.pas root@192.168.133.128::backup /home/@ERROR: chdir failedrsync error: error starting client-server protocol (code 5) at main.c(1506) [Receiver=3.0.7]遇到这个问题,是因为服务器端的/home/backup 其中backup这个目录并没有设置,所以提示:chdir failed
问题4:rsync: write failed on "/home/backup2010/wensong": No space left on device (28)rsync error: error in file IO (code 11) at receiver.c(302) [receiver=3.0.7]rsync: connection unexpectedly closed (2721 bytes received so far) [generator]rsync error: error in rsync protocol data stream (code 12) at io.c(601) [generator=3.0.7]磁盘空间不够,所以无法操作。可以通过df /home/backup2010 来查看可用空间和已用空间
问题5:网络收集问题1、权限问题类似如下的提示:rsync: opendir "/kexue" (in dtsChannel) failed: Permission denied (13)注意查看同步的目录权限是否为7552、time outrsync: failed to connect to 203.100.192.66: Connection timed out (110)rsync error: error in socket IO (code 10) at clientserver.c(124) [receiver=3.0.5]检查服务器的端口netstat –tunlp,远程telnet测试。3、服务未启动rsync: failed to connect to 10.10.10.170: Connection refused (111)rsync error: error in socket IO (code 10) at clientserver.c(124) [receiver=3.0.5]启动服务:rsync --daemon --config=/etc/rsyncd.conf4、磁盘空间满rsync: recv_generator: mkdir "/teacherclubBackup/rsync……" failed: No space left on device (28)*** Skipping any contents from this failed directory ***5、Ctrl+C或者大量文件rsync error: received SIGINT, SIGTERM, or SIGHUP (code 20) at rsync.c(544) [receiver=3.0.5]rsync error: received SIGINT, SIGTERM, or SIGHUP (code 20) at rsync.c(544) [generator=3.0.5]6、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 directoryxnetid查找的配置文件位置默认是/etc下,根据具体情况创建软链接。例如:ln -s /etc/rsyncd/rsyncd.conf /etc/rsyncd.conf或者更改指定默认的配置文件路径,在/etc/xinetd.d/rsync配置文件中

购买使用一诺网络香港服务器,可以极大降低初创企业、中小企业以及个人开发者等用户群体的整体IT使用成本,无需亲自搭建基础设施、简化了运维和管理的日常工作量,使用户能够更专注于自身的业务发展和创新。香港服务器低至29元/月,购买链接:https://www.enuoidc.com/vps.html?typeid=2

版权声明

    声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们996811936@qq.com进行处理。