设为首页 收藏本站
查看: 915|回复: 0

[经验分享] 在redhat5.4/5.5/5.6中默认的rsync出现的bug

[复制链接]

尚未签到

发表于 2018-5-12 14:30:50 | 显示全部楼层 |阅读模式
  测试环境为:
  Client(192.168.1.3)--------------------àdaemon(192.168.1.2)
  
  -----------------------配置过的先略过,直接看测试过程----------------
  服务端配置:
  /etc/rsyncd/Rsyncd.conf配置
  # Minimal configuration file for rsync daemon
  # See rsync(1) and rsyncd.conf(5) man pages for help
  
  # This line is required by the /etc/init.d/rsyncd script
  pid file = /var/run/rsyncd.pid
  port = 873
  address = 192.168.1.2
  uid = test
  gid = test
  auth users = test
  secrets file = /etc/rsyncd/rsyncd.secrets
  #incoming chmod = u+rwx,g+rwx,o+rx
  use chroot = yes
  read only = no
  
  #limit access to private LANs
  hosts allow=192.168.1.3/255.255.255.255
  hosts deny=*
  max connections = 500
  
  #This will give you a separate log file
  log file = /var/log/rsync.log
  
  #This will log every file transferred - up to 85,000+ per user, per sync
  #transfer logging = yes
  
  log format = %t %a %m %f %b
  syslog facility = local3
  timeout = 300
  
[app]

  path = /app/test(目标目录)
  list=yes
  #ignore errors
  
  /etc/rsyncd/rsyncd.secrets 配置
  test:123456(密码)
  
  启动服务端/usr/bin/rsync --daemon --config=/etc/rsyncd/rsyncd.conf
  
  客户端配置
  客户端:
  /etc/rsync_client.pass
  123456(密码)
  rsync -av --password-file=/etc/rsync_client.pass /boot test@192.168.1.2::app
  
  -------------------------------------------------------------配置完成-------------------------------------------------
  
  测试过程:
  rsync -av --password-file=/etc/rsync_client.pass /boot test@192.168.1.2::app
  结果正确,没有出现问题
  再进行
  rsync -av --password-file=/etc/rsync_client.pass /home test@192.168.1.2::app
  结果也正确,没有出现问题
  再进行
  rsync -av --password-file=/etc/rsync_client.pass /etc test@192.168.1.2::app
  这回报错了
  出现如下错误:
  unexpected tag 3 [sender]
  rsync error: error in rsync protocol data stream (code 12) at io.c(828)
[sender=2.6.8]

  
  而此时服务端的错误日志如下:
  
  2008/11/12 00:25:42 [12657] rsync: read error: Connection reset by peer (104)
  2008/11/12 00:25:42 [12657] rsync error: error in rsync protocol data stream
  (code 12) at io.c(614) [receiver=2.6.8]
  2008/11/12 00:25:42 [12657] rsync: connection unexpectedly closed (486 bytes
  received so far) [generator]
  2008/11/12 00:25:42 [12657] rsync error: error in rsync protocol data stream
  (code 12) at io.c(463) [generator=2.6.8]
  再同步一次就成功。
  
  把服务端下已经同步的文件删除,再不尝试一次
  rsync -av --password-file=/etc/rsync_client.pass /etc test@192.168.1.2::app
  还是报错。文件只同步了部分文件,发现在同步的源文件中如果文件数太多,或者子目录太多,就经常会出现这一种情况。
  
  根据多次查找发现在2.6.8上会出现这一个问题,在2.6.9上已经解决,经查看在redhat5.4,5.5和5.6的发行版中都是使用rsync-2.6.8的版本。
  
  http://rsync.samba.org/ftp/rsync/src/rsync-2.6.9-NEWS在官方上看到了更新日志
  
  - Fixed a bug where a deferred info/error/log message could get sent directly to the sender instead of being handled by rwrite() in the generator. This fixes an "unexpected tag 3" fatal error, and should also fix a potential problem where a deferred info/error message from the receiver might bypass the log file and get sent only to the client process. (These problems could only affect an rsync daemon that was receiving files.)
  
  Redhat上的bug报告文件如下:
  https://bugzilla.redhat.com/show_bug.cgi?id=471182
  
  
  解决方法:
  升级rsync到2.6.9以上,只需要升级服务器端就可以了!因为这一个bug只会影响服务端的接收。
  在redhat5.7中已经默认修复了这一个问题。

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-459204-1-1.html 上篇帖子: redhat5_X86_64+Oracle_RAC 下篇帖子: redhat安装memcacheQ
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表