服務器上配置sersync,在同步目標服務器配置rsync,并在目標服務器開啟rsync守候進程,這樣在主服務器產生的文 件,就會被sersync實時同步到多個目標服務器。在centos系統下默認已經安裝了rsync,只需進行配置,并開啟rsync守候進程即可。
在多臺目標服務器上配置如下:
復制代碼 代碼如下:
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
[tongbu1]
path=/opt/tongbu1
comment = xoyo video files
ignore errors = yes
read only = no
hosts allow = 192.168.0.100/24
hosts deny = *
復制代碼 代碼如下:
./sersync -d
復制代碼 代碼如下:
[root@localhost GNU-Linux-x86]# ls
confxml.xml sersync2
[root@localhost GNU-Linux-x86]# ./sersync2 -d
set the system param
execute:echo 50000000 > /proc/sys/fs/inotify/max_user_watches
execute:echo 327679 > /proc/sys/fs/inotify/max_queued_events
parse the command param
daemon thread num: 10
parse xml config file
host ip : localhost host port: 8008
config xml parse success
please set /etc/rsyncd.conf max connections=0 Manually
sersync working thread 12 = 1(primary thread) + 1(fail retry thread) + 10(daemon sub threads)
please according your cpu ,use -n param to adjust the cpu rate
run the sersync:
watch path is: /opt/tongbu
復制代碼 代碼如下:
./sersync -r
復制代碼 代碼如下:
./sersync --help
復制代碼 代碼如下:
./sersync -o XXXX.xml
復制代碼 代碼如下:
./sersync -n num
復制代碼 代碼如下:
./sersync -m pluginName
復制代碼 代碼如下:
./sersync -n 8 -o abc.xml -r -d
復制代碼 代碼如下:
./sersync -d
新聞熱點
疑難解答
圖片精選