1、每个都要安装rsync
yum -y install rsync
2、配置从
vi /etc/rsyncd.confv
- uid = root
- gid = root
- use chroot = yes
- max connections = 100
- pid file = /var/run/rsyncd.pid
- log file = /var/log/rsync
- secrets file = /etc/rsyncd.secrets
- list = no
- strict modes = no
- [wwwroot]
- path=/home/wwwroot/
- host allow=10.105.55.91
- read only=no
- uid=www
- gid=www
root:123456
/usr/bin/rsync --daemon --config=/etc/rsyncd.conf
2、配置主
vi /etc/rsyncd.conf 同从
vi /etc/rsyncd.secrets
123456
3、主 安装sersync
wget http://sersync.googlecode.com/files/sersync2.5_64bit_binary_stable_final.tar.gz
解压并拷贝到安装目录
tar xzvf sersync2.5_64bit_binary_stable_final.tar.gz
mv GNU-Linux-x86 /usr/local/sersync
4、配置sersync
vi confxml.xml
- <sersync>
- <localpath watch="/opt/tongbu">
- <remote ip="192.168.8.42" name="tongbu"/>
- <remote ip="192.168.8.39" name="tongbu"/>
- </localpath>
- <crontab start="true" schedule="30"/>
- <plugin name="refreshCDN" start="true"/>
- </sersync>
5、运行
/usr/bin/rsync --daemon --config=/etc/rsyncd.conf
/usr/local/sersync/sersync2 -d -r -o /usr/local/sersync/confxml.xml