sersync2大量小文件实时同步


sersync2可以实现一台机器上的某个目录实时同步到多台机器,非常适合大量小文件如web网页。
1. 配置同步目标服务器
# vi /etc/rsyncd.conf
uid = root
gid = root
max connections = 36000
use chroot = no
log file = /var/log/rsyncd.log
pid file = /var/run/rsyncd.pid
lock file = /var/run/rsyncd.lock
[rsync]         # 同步名
path = /opt/rsync
comment = test files
ignore error = yes
read only = no
hosts allow = 192.168.0.254
hosts deny = *
Note: '/etc/rsyncd.conf' 不存在,要自己创建, 多台目标机器分别进行如上配置。
2. 启动目标服务器rsync准备接收数据
# rsync --daemon
3. 在主服务器上安装配置sersync
# tar xf sersync2.5_64bit_binary_stable_final.tar.gz
# cd GNU-Linux-x86/
# vi confxml.xml, 修改如下行
<sersync>
        <localpath watch="/opt/rsync">  # 本地同步目标
        <remote ip="192.168.0.1" name="rsync"/>  # 目录服务器IP和同步名
        <remote ip="192.168.0.2" name="rsync"/>
</localpath>
4. 运行sersync
# ./sersync2 -d -r

作者“William的记忆碎片”

相关内容

    暂无相关文章