QQ登录

只需一步,快速开始

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 1379|回复: 1

rsync同步可以,但是在日志里会有错误

[复制链接]
发表于 2007-12-13 18:47:04 | 显示全部楼层 |阅读模式
服务器端IP 192.168.108.202
rsyncd.conf 的配置
motd file = /etc/rsyncd.motd
read only = yes
list = yes
uid = root
gid = root
hosts allow = 192.168.108.201
#hosts deny = 192.168.0.0/16
max connections = 5
log file = /var/log/rsyncd.log
pid file = /var/run/rsyncd.pid
lock file = /var/run/rsync.lock

[webroot]
        comment = rsync 's directory from 192.168.108.202
        path = /database/webroot
        auth users = rsync
        read only = yes
        secrets file = /etc/rsyncd.secret
[mysql]
        comment = rsync 's directory from 192.168.108.202
        path = /database/mysql
        read only = yes
        auth users = rsync
        secrets file = /etc/rsyncd.secret

rsyncd.secret的配置
rsync:123456

chmod 600 rsyncd.secret

启动:
rsync --daemon --config=/etc/rsyncd.conf

客户端IP192.168.108.201
rsyncd.secret配置
123456
chmod 600 rsyncd.secret
写了一个脚本 202to201.sh
#!/bin/bash
/usr/bin/rsync -vau --delete --progress [[email protected]::webroot][email protected]::webroot[/email] /database/webroot --password-file=/etc/rsyncd.secret
/usr/bin/rsync -vau --delete --progress [[email protected]::mysql][email protected]::mysql[/email] /database/mysql --password-file=/etc/rsyncd.secret

chmod 755 202to201.sh
crontab -e
* * * * * /root/202to201.sh

配置就这些了,运行也行可是我看服务端的日志的会出现下面的提示:

2007/12/13 18:46:00 [8186] rsync: name lookup failed for 192.168.108.201: Name or service not known
2007/12/13 18:46:00 [8186] rsync on webroot from [email=rsync@unknown]rsync@unknown[/email] (192.168.108.201)
2007/12/13 18:46:01 [8186] wrote 58899 bytes  read 110 bytes  total size 32769660
2007/12/13 18:46:01 [8187] rsync: name lookup failed for 192.168.108.201: Name or service not known
2007/12/13 18:46:01 [8187] rsync on mysql from unknown (192.168.108.201)
2007/12/13 18:46:01 [8187] wrote 3969 bytes  read 77 bytes  total size 24169404


请问这是什么问题呢?

[ 本帖最后由 xueleixu 于 2007-12-14 09:28 编辑 ]
 楼主| 发表于 2007-12-14 09:27:42 | 显示全部楼层
没人指教,我就自己解决了,问题是在需要在服务端这台机上上的/etc/hosts里面添加客户端机的ip和机器名,如果有配DNS的话,那就不会有这样的问题了。

问题解决了,真开心!!!
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

GMT+8, 2024-9-21 22:17 , Processed in 0.068836 second(s), 15 queries .

© 2021 Powered by Discuz! X3.5.

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