sersync的安装配置

来源:互联网 发布:软件测试系统 编辑:程序博客网 时间:2024/04/28 18:29

一 、在目标服务器上安装rsync,xinetd
(1) yum -y install rsync
(2) vi /etc/xinetd.d/rsync
(3) vi /etc/rsyncd.conf
Global Settings
uid = root #以什么身份运行rsync
gid = root
use chroot = no #不使用chroot
max connections = 80 #最大连接数
secrets file = /etc/rsyncd.pwd #密码文件位置,认证文件设置,设置用户名和密码
log file = /var/log/rsyncd.log #指定rsync的日志文件,而不将日志发送给syslog
pid file = /var/run/rsyncd.pid #指定rsync的pid文件
lock file = /var/run/rsync.lock #指定支持max connections参数的锁文件,默认值是/var/run/rsyncd.lock
#comment = hello world
#motd file = /etc/rsyncd.motd #欢迎信息文件名称和存放位置(此文件没有,可以自行添加)

[backup] # 这里是认证的模块名,在client端需要指定
path = /titan24/www/repos # 需要做镜像的目录
auth users = beauty_rsync # 授权帐号。认证的用户名,如果没有这行,则表明是匿名,多个用户用,分隔
read only = no # yes只读 值为NO意思为可读可写模式,数据恢复用NO
hosts allow = 211.78.86.148 #允许访问的服务器IP
hosts deny = * #黑名单
list = true # 允许列文件
ignore errors # 可以忽略一些无关的IO错误
#exclude =  #忽略的目录

 

以xinet的方式去调用,不需要这样用,开启启动,xinet ,rsync --daemon --config=/etc/rsync/rsyncd.conf
/etc/xinetd/rsync里面配置 增加config文件的路径即可,如独立运行,可能会冲突

二、主服务器上安装 sersync ,主服务器上也要安装rsync,且安装xinetd

从google code 里面下载

解压缩,上传到服务器

配置confxml.xml,
运行 ./sersyc2 -r -d

参数 -r 是整体同步的意思

如果重启了主服务器,开机后需要执行 cd /etc/serync

./sersync2 -d


 

 

原创粉丝点击