Keep the same/www/mingxiao data in 192.168.1.5 and 192.168.1.6
Here are two ways to achieve this, please refer to my other blog post: http://mingxiao.blog.51cto.com/8124243/1641385
Into 192.168.1.5
Installing Sersync and INotify
# yum Install inotify-tools# tar xf sersync2.5.4_64bit_binary_stable_final.tar.gz-c/usr/local/sersync# cd/usr/local/ Sersync
edit confxml.xml
Edit/etc/rsync.pass, add the following:
Xiaoming
#chmod 600/etc/rsync.pass
Into 192.168.1.6
# Useradd xiaoming# echo xiaoming | passwd--stdin Xiaoming
Provide the configuration file for rsync, edit/etc/rsyncd.conf
Uid=nobodygid=nobodyuse chroot = Nomax connections =10strict modes = yespid File =/var/run/rsyncd.pidlock File =/var/run /rsync.locklog file =/var/log/rsyncd.log[xiaoming]path =/www/mingxiaocomment = Xiaoming Fileignore errorsread only = Now Rite = nohost Allow = 192.168.1.5list = Falseuid = Rootgid = Rootauth user = Xiaomingsecrets File =/etc/server.pass
Edit/etc/server.pass
Xiaoming
# chmod 600/etc/server.pass
#chkconfig rsync on# Service xinetd start
Into 192.168.1.5
/usr/local/sersync/sersync2-r-o/usr/local/sersync/confxml.xml-n 5-d
The configuration is complete at this time.
This article is from the "on the Road" blog, please be sure to keep this source http://mingxiao.blog.51cto.com/8124243/1641387
Sersync+inotify+rsync synchronizing data between different hosts