#sersync优点:1.c++, can filter temporary files and duplicate file operations2. Simple configuration 3. Use multithreading for synchronization 4. With error handling mechanism, through the failure of the queue to the wrong file resynchronization, if also failed to configure a few hours and then the 5.sersync comes with the Crotab function, only in the XML configuration file to open the 6.sersync self-contained socket and HTTP protocol extension, can be full Two-time development #处理机制 with special needsinotify--Filter Queue--thread group--Invoke rsync thread---remote server1.sersync Installation
Mkdir/server/tools-pwget https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/ SERSYNC/SERSYNC2.5.4_64BIT_BINARY_STABLE_FINAL.TAR.GZTAR-ZXVF sersync2.5.4_64bit_binary_stable_final.tar.gz-c/ USR/LOCALCD/USR/LOCALMV gnu-linux-x86 Sersync
2.sersync Configuration
[[email protected] sersync]# cd/usr/local/sersync/[[email protected] sersync]# mkdir conf bin Logs[[email protected] Sers ync]# MV Confxml.xml conf[[email protected] sersync]# mv SERSYNC2 Bin/sersync[[email protected] sersync]# ll bin/total 176 8-rwxr-xr-x.1 root root 1810128oct26 sersync[[email protected] conf]# Cp/usr/local/sersync/conf/confxml.xml Confxml.xml.bak
3.sersync file Configuration
<?xml version= "1.0" encoding= "iso-8859-1"?> 4. Configure Environment Variables[[email protected] conf]# echo ' Export path= $PATH:/usr/local/sersync/bin ' >>/etc/profile[[email protected] conf] # Source/etc/profile
5. Start command,-R for the first time all synchronization,-D daemon,-o Specify configuration file[Email protected] www]# sersync-r-d-o/usr/local/sersync/conf/confxml.xmlset the system param Execute:echo 50000000 &G T /proc/sys/fs/inotify/max_user_watchesexecute:echo 327679 >/proc/sys/fs/inotify/max_queued_eventsparse the Command paramoption:-R rsync all the local files to the remote servers before the Sersync workoption:-D Run as a Daemono Ption:-o config XML name:/usr/local/sersync/conf/confxml.xmldaemon thread num:10parse XML config filexml parsing error Inside file '/usr/local/sersync/conf/confxml.xml '. Warning:unmatched End Tagat Line, column 15.
6.sersync parameter DescriptionSersync-r first time All sync- o Specify profile- n Specifies the total number of threads- d background service --help Help
7.sersync plug-in (plug-in Settings), plugin is set to True when it takes effect, name is called Plug-in, currently supports command REFRESHCDN socket HTTP four plug-ins, http plugin removed
<plugin start= "true" name= "command"/>
sersync压力测试
[Email protected] ~]# Dmidecode | grep "Product Name" PRODUCTNAME:IBM System x3650 m4:-[7915k3g]-productname:00mv214[[email protected] ~]# grep name/proc/ Cpuinfomodel Name:intel (R) Xeon (r) CPU e5-2609 v2 @2.50ghzmodel Name:intel (R) Xeon (r) CPU e5-2609 v2 Ntel (R) Xeon (r) CPU e5-2609 v2 @2.50ghzmodel Name:intel (R) Xeon (r) CPU e5-2609 v2 @2.50ghz[[email protected] ~]# grep memto tal/proc/meminfomemtotal:32688332 KBTAR-ZXVF WEBBENCH-1.5.TAR.GZCD Webbench-1.5makemake install/usr/local/bin/ Webbench-t 100-c http://blog.xiaoyi.com/
#!/bin/shcount=80while truedofor ((i=1;i<= $count; i++)) do/bin/cp 10k.jpg/backup/test/$i/10k_ ' echo $ (date) $RANDOM |md5sum |cut-c 1-8 '. Jpgdonesleep 1for ((i=1;i<= $count; i++)) do/bin/cp 30k.jpg/backup/test/$i/30k_ ' echo $ (date) $ Random|md5sum |cut-c 1-8 '. Jpgdonesleep 1for ((i=1;i<= $count; i++)) do/bin/cp 50k.jpg/backup/test/$i/50k ' echo $ (date ) $RANDOM |md5sum |cut-c 1-8 '. Jpgdonesleep 1done
Rsync+sersync deployment