免费注册 查看新帖 |

Chinaunix

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

关于rsync的问题 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2008-10-27 10:34 |只看该作者 |倒序浏览
5可用积分
最近的项目里要用到rsync,以前没有用过,现在用的时候遇到了些问题,想请大家帮忙看下

环境是这样的:
【server端】
ip:10.1.3.114
rsync.conf:

uid=unmboc
gid=unmboc
max connections=20
use chroot=true
pid file=/opt/aspire/product/unmboc/rsync/log/rsyncd.pid
lock file=/opt/aspire/product/unmboc/rsync/log/rsyncd.lock
log file=/opt/aspire/product/unmboc/rsync/log/rsyncd.log
timeout=20

[webapps]
path=/opt/aspire/product/unmboc/apache-tomcat-5.5.26/webapps/wicp/WEB-INF/classes/conf/index
comment= rsync to m2,m3
ignore errors
read only=true
list=false
auth users=impptest
hosts allow=127.0.0.1 10.1.3.78 10.1.3.114
secrets file=/opt/aspire/product/unmboc/rsync/rsync.pass

rsync.pass:

impptest:impptest


启动server端 :

rsync --daemon  --config=/opt/aspire/product/unmboc/rsync/rsync.conf --port=11113 &

【client】
ip: 10.1.3.78

rsync.pass:
impptest

启动client:

rsync -rtp unmboc@10.1.3.114::webapps /opt/aspire/product/impptest/maodh/impp/apache-tomcat-5.5.26/webapps/wicp/WEB-INF/classes/conf/index --password-file=/opt/aspire/product/impptest/maodh/rsync/rsync.pass &


总的来说 ,就是要把114的目录/opt/aspire/product/unmboc/apache-tomcat-5.5.26/webapps/wicp/WEB-INF/classes/conf/index下的文件同步到78的/opt/aspire/product/impptest/maodh/impp/apache-tomcat-5.5.26/webapps/wicp/WEB-INF/classes/conf/index 目录下。

但运行client时,总是报错:
rsync: failed to connect to 10.1.3.114: Connection refused (111)
rsync error: error in socket IO (code 10) at clientserver.c(122) [receiver=3.0.4
server端的rsync是启动了的,使用指定端口的命令启动client:rsync -rtp rsync://impptest@10.1.3.114:11113/webapps /opt/aspire/product/impptest/maodh/impp/apache-tomcat-5.5.26/webapps/wicp/WEB-INF/classes/conf/index --password-file=/opt/aspire/product/impptest/maodh/rsync/rsync.pass也报同样的错误。
请高手帮忙看下,多谢啦!!

最佳答案

查看完整内容

client 端没有加端口,加上端口试试rsync -rtp ::webapps /opt/aspire/product/impptest/maodh/impp/apache-tomcat-5.5.26/webapps/wicp/WEB-INF/classes/conf/index --password-file=/opt/aspire/product/impptest/maodh/rsync/rsync.pass &改为rsync -rtpz --port=11113 ::webapps /opt/aspire/product/impptest/maodh/impp/apache-tomcat-5.5.26/webapps/wicp/WEB-INF/classes/conf/index --password-file=/opt/aspire/produc ...

论坛徽章:
0
2 [报告]
发表于 2008-10-27 10:34 |只看该作者
client 端没有加端口,加上端口试试
rsync -rtp unmboc@10.1.3.114::webapps /opt/aspire/product/impptest/maodh/impp/apache-tomcat-5.5.26/webapps/wicp/WEB-INF/classes/conf/index --password-file=/opt/aspire/product/impptest/maodh/rsync/rsync.pass &

改为
rsync -rtpz --port=11113   unmboc@10.1.3.114::webapps /opt/aspire/product/impptest/maodh/impp/apache-tomcat-5.5.26/webapps/wicp/WEB-INF/classes/conf/index --password-file=/opt/aspire/product/impptest/maodh/rsync/rsync.pass &

论坛徽章:
0
3 [报告]
发表于 2008-10-28 17:23 |只看该作者
1、在10.1.3.114上netstat -ntpl看一下是否11113在listen,在10.1.3.78上telnet 10.1.3.114 11113是否能open这个port
2、在10.1.3.114上看一下/opt/aspire/product/unmboc/rsync/log/rsyncd.log有什么输出。

论坛徽章:
0
4 [报告]
发表于 2008-10-28 17:50 |只看该作者
原帖由 ttyr123 于 2008-10-27 10:34 发表
最近的项目里要用到rsync,以前没有用过,现在用的时候遇到了些问题,想请大家帮忙看下

环境是这样的:
【server端】
ip:10.1.3.114
rsync.conf:

uid=unmboc
gid=unmboc
max connections=20 ...

rsync.pass:
impptest:impptest
看下你得这个文件得属主chmod 600(该文件只能是root用户可读写的,否则rsyncd启动时会出错)所以最好就是楼上说得判断服务是否确认启动了,可以查看进程和日志。也可以telnet你的端口看有反映否
另外你有rsync: failed to connect to 10.1.3.114: Connection refused (111)这个报错
看看你得
10.1.3.114上面是否启了防火墙 是否容许到11113端口得访问。测试得话可以关闭防火墙看看

论坛徽章:
0
5 [报告]
发表于 2008-10-31 15:17 |只看该作者
873端口不是很好吗
为什么要改呢

并且你服务端改了监听端口后,客户端却没有指定连接端口,那怎么能连接的上呢
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP