免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
12下一页
最近访问板块 发新帖
查看: 6909 | 回复: 17
打印 上一主题 下一主题

rsync连接报错 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2011-05-11 18:19 |只看该作者 |倒序浏览
我的/etc/rsyncd.conf(服务器端)如下:
#[globale]
strict modes= yes  #check passwd file
port= 10200
max connections= 4
#[modules]
[testlink]   
uid= root
gid= root
path= /home/ST13648/backup  
read only= no
host allow= *
auth users= ST13648
secrets file= /home/ST13648/etc/rsync.scrt


rsync.scrt:
ST13648:password

在客户端也使用同样的rsync.crt,login的时候用的是root用户,调用:rsync -avz --password-file=/etc/rsync.scrt /home/ST13648/kurt/data3.txt ST13648@10.34.4.132::testlink来请求发送数据到服务器的时候,报错:
rsync: failed to connect to 10.34.4.132: Connection refused (111)
rsync error: error in socket IO (code 10) at clientserver.c(107) [sender=2.6.8]


不知什么原因,服务器端刚开始用873端口启动时,启动后发现并未使用这个端口,怀疑被封,于是换成10200,再启动时,端口已经被使用了,说明启动了。另外,我客户端没有启动rsync服务就直接调那个命令了,能是这个原因?下班了,搞得我头大。

论坛徽章:
0
2 [报告]
发表于 2011-05-11 18:48 |只看该作者
客户端的rsync.crt里面应该只有密码,不需要用户名

论坛徽章:
0
3 [报告]
发表于 2011-05-11 18:49 |只看该作者
还有你服务端使用的10200端口? 那客户端也要指定连接服务端的10200端口

论坛徽章:
0
4 [报告]
发表于 2011-05-11 23:30 |只看该作者
用873 没启动起来你怀疑的有根据吗?
把log写出来看一看。
用yanu说的试试。

论坛徽章:
0
5 [报告]
发表于 2011-05-11 23:43 |只看该作者
客户端的rsync.crt里面应该只有密码,不需要用户名
yanu 发表于 2011-05-11 18:48

客户端也需要把服务启走来吗?

论坛徽章:
0
6 [报告]
发表于 2011-05-11 23:45 |只看该作者
回复 5# fxbird


    不启动怎么同步?

论坛徽章:
0
7 [报告]
发表于 2011-05-12 09:27 |只看该作者
客户端的配置如下:
strict modes= yes  #check passwd file
port= 10200 #default port
max connections= 4
logfile= /var/log/rsyncd.log
#[modules]
[testlink]  
uid= root
gid= root
path= /home/ST13648/backup
read only= no
host allow= *
auth users= ST13648
secrets file= /home/ST13648/etc/rsync.scrt

scrt文件保持为:ST13648,去掉冒号和密码,正常启动后,还是报这个错,而且日志文件并不存在。

论坛徽章:
0
8 [报告]
发表于 2011-05-12 09:38 |只看该作者
回复 7# fxbird


    仔细看2楼

论坛徽章:
0
9 [报告]
发表于 2011-05-12 10:06 |只看该作者
回复  fxbird


    仔细看2楼
taojie2000 发表于 2011-05-12 09:38


是看错了,改成只有密码的,报错依旧,日志文件找不到依旧。难道客户端的conf也要完全一致?

论坛徽章:
0
10 [报告]
发表于 2011-05-12 10:07 |只看该作者


客户端不需要起服务

给演示个最简单的
  1. [root@RHEL4 ~]# cat /etc/rsyncd.conf
  2. [test]
  3. path = /test
  4. auth users = username
  5. secrets file = /etc/rsyncd.scrt


  6. [root@RHEL4 ~]# ls -l /etc/rsyncd.scrt
  7. -rw-------  1 root root 18 May 12 09:51 /etc/rsyncd.scrt



  8. [root@RHEL4 ~]# cat /etc/rsyncd.scrt
  9. username:password

  10. [root@RHEL4 ~]# rsync --daemon

  11. [root@RHEL4 ~]# ls -l
  12. total 4
  13. -rw-------  1 root root 9 May 12 09:53 rsync.pwd

  14. [root@RHEL4 ~]# cat rsync.pwd
  15. password


  16. [root@RHEL4 ~]# rsync  -av --password-file=rsync.pwd  username@127.0.0.1::test  ./
  17. receiving file list ... done
  18. ./
  19. file

  20. sent 117 bytes  received 159 bytes  552.00 bytes/sec
  21. total size is 0  speedup is 0.00
复制代码
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP