<\/strong><\/a><\/p>\n sersync\u4e3b\u8981\u7528\u4e8e\u670d\u52a1\u5668\u540c\u6b65\uff0cweb\u955c\u50cf\u7b49\u529f\u80fd\u3002\u57fa\u4e8eboost1.41.0,inotify api,rsync command.\u5f00\u53d1\u3002\u76ee\u524d\u4f7f\u7528\u7684\u6bd4\u8f83\u591a\u7684\u540c\u6b65\u89e3\u51b3\u65b9\u6848\u662finotify-tools+rsync \uff0c\u53e6\u5916\u4e00\u4e2a\u662fgoogle\u5f00\u6e90\u9879\u76eeOpenduckbill\uff08\u4f9d\u8d56\u4e8einotify- tools\uff09\uff0c\u8fd9\u4e24\u4e2a\u90fd\u662f\u57fa\u4e8e\u811a\u672c\u8bed\u8a00\u7f16\u5199\u7684\u3002\u76f8\u6bd4\u8f83\u4e0a\u9762\u4e24\u4e2a\u9879\u76ee\uff0c\u672c\u9879\u76ee\u4f18\u70b9\u662f\uff1a<\/strong> <\/a><\/p><\/blockquote>\n <\/strong><\/a> <\/p>\n sersync is mainly used in server synchronization and web mirroring, developed Based on boost1.41.0, inotify api, rsync command. Currently, common synchronous solutions use inotify-tools + rsync,or use google open source project Openduckbill (depends on inotify-tools), which are both written in script languages. Compared to the above two projects, this project has following benefits : <\/strong><\/a><\/p><\/blockquote>\n <\/a><\/p>\n \u5982\u679c\u4f7f\u7528linux \u7cfb\u7edf\uff0c\u4e00\u822c\u60c5\u51b5\u4e0b\uff0c\u4e0d\u9700\u8981\u7f16\u8bd1\uff0c\u76f4\u63a5\u4f7f\u7528bin\u76ee\u5f55\u4e0b\u7684\u53ef\u6267\u884c\u6587\u4ef6\u548cxml\u914d\u7f6e\u6587\u4ef6\u5373\u53ef\u3002 src\u76ee\u5f55\u4e0b\u653e\u7684\u662f\u6e90\u7801 <\/a><\/p>\n lib\u76ee\u5f55\u4e0b\u662f\u9700\u8981\u7684\u9759\u6001\u5e93 <\/a><\/p>\n bin\u76ee\u5f55\u662f\u6700\u540e\u751f\u6210\u7684\u4e8c\u8fdb\u5236\u6587\u4ef6 <\/a><\/p>\n \u5728sersync \u76ee\u5f55\u4e0b\u6267\u884cmake\u547d\u4ee4\uff0c\u5c31\u4f1a\u5c06\u751f\u6210\u76842\u8fdb\u5236\u6587\u4ef6\u653e\u5165bin\u76ee\u5f55\u4e0b\u3002 <\/a><\/p>\n if you are using linux, under normal circumstances, do not need to compile, directly use the executable file and the xml configuration file under the bin directory <\/a> <\/p>\n src directory: the source files. <\/a><\/p>\n include directory: the boost head files(1.41.0). <\/a><\/p>\n lib directory: static libraries. <\/a><\/p>\n bin directory: binary executable file and xml configuration file. <\/a><\/p>\n You can execute make command in sersync directory which will generate binary file into the bin directory. <\/a><\/p>\n \u6ce8\u610f\u5728\u4f7f\u7528\u524d\uff0c\u9700\u8981\u5bf9\u6bcf\u53f0\u670d\u52a1\u5668\u90fd\u914d\u7f6e\u5e76\u5f00\u542frsync\u5b88\u62a4\u8fdb\u7a0b\u3002\u901a\u5e38\u914d\u7f6e\u65b9\u6cd5\u5982\u4e0b\uff1a <\/a><\/p>\n Before use, you need to config rsync and open the rsync daemon on each server. Normally configured as follows: <\/a><\/p>\n \u914d\u7f6e\u53c2\u6570\u8be6\u60c5\uff0c\u8bf7google. <\/a><\/p>\n Configuration parameters, please google. <\/a><\/p>\n \u7136\u540e\u5728\u9700\u8981\u540c\u6b65\u7684\u5404\u670d\u52a1\u5668\u4e0a\u5f00\u542f rsync\u5b88\u62a4\u8fdb\u7a0b\uff1a <\/a><\/p>\n Then open rsync daemon on each server: <\/a><\/p>\n \u7531\u4e8e\u5927\u90e8\u5206\u5e93\u90fd\u662f\u9759\u6001\u7f16\u8bd1\u7684\uff0c\u6240\u4ee5\u5728\u88ab\u76d1\u63a7\u670d\u52a1\u5668\u4e0a\uff0c\u4fee\u6539\u597d\u914d\u7f6e\u6587\u4ef6\u540e\uff0c\u76f4\u63a5\u6267\u884c.\/sersync2.1 \u5373\u53ef\u3002 <\/a><\/p>\n Since most libraries are statically compiled, after modifying the configuration file, you can directly execute .\/sersync2.1 on the server being monitored. <\/a><\/p>\n \u5728\u4f7f\u7528\u524d,\u586b\u5199\u914d\u7f6e\u6587\u4ef6\uff1a <\/a><\/p>\n before using , write the xml configuration file <\/a><\/p>\n \u6839\u636e\u4f7f\u7528\u63d2\u4ef6\u548c\u529f\u80fd\u7684\u4e0d\u540c\uff0c\u9700\u8981\u4fee\u6539\u914d\u7f6e\u6587\u4ef6\u7684\u4e0d\u540c\u90e8\u5206: <\/a><\/p>\n According to the use of different plug-ins and features you need to modify the different parts of the configuration file as follows: <\/a><\/p>\n \u53ea\u9700\u4fee\u6539 sersync\u6807\u7b7e\u4e0b\u7684\u5185\u5bb9\u5982\u4e0b\u5373\u53ef\uff1a <\/a><\/p>\n Just modify the sersync tab as follows: <\/a><\/p>\n\n
\n\n
Design Frame<\/a><\/h1>\n
<\/a><\/p><\/blockquote>\n
Compile<\/a><\/h1>\n
\nInstall<\/a><\/h1>\n
Config Rsync before install<\/a><\/h2>\n
vi <\/span>\/<\/span>etc<\/span>\/<\/span>rsyncd<\/span>.<\/span>conf<\/span><\/a><\/pre>\n
uid<\/span>=<\/span>root
gid<\/span>=<\/span>root
max connections<\/span>=<\/span>36000<\/span>
<\/span>use<\/span> chroot<\/span>=<\/span>no<\/span>
log file<\/span>=<\/span>\/var\/<\/span>log<\/span>\/<\/span>rsyncd<\/span>.<\/span>log
pid file<\/span>=<\/span>\/var\/<\/span>run<\/span>\/<\/span>rsyncd<\/span>.<\/span>pid
<\/span>lock<\/span> file<\/span>=<\/span>\/var\/<\/span>run<\/span>\/<\/span>rsyncd<\/span>.<\/span>lock<\/span>
<\/span>\u3010<\/span>tongbu<\/span>\u3011<\/span>
path<\/span>=<\/span>\/opt\/<\/span>tongbu
comment <\/span>=<\/span> xoyo video files
ignore errors
read only <\/span>=<\/span> <\/span>no<\/span>
hosts allow <\/span>=<\/span> <\/span>192.168<\/span>.<\/span>8.40<\/span>\/<\/span>26<\/span> <\/span>192.168<\/span>.<\/span>138.94<\/span>\/<\/span>24<\/span>
hosts deny <\/span>=<\/span> <\/span>*<\/span><\/a><\/pre>\nrsync <\/span>--<\/span>daemon<\/span><\/a><\/pre>\n
Install sersync<\/a><\/h2>\n
tar zxvf sersync2<\/span>.<\/span>1.tar<\/span>.<\/span>gz
cd sersync<\/span><\/a><\/pre>\nvi confxml<\/span>.<\/span>xml<\/span><\/a><\/pre>\n
synchronization funciton config<\/a><\/h3>\n
<\/span><sersync><\/span>
<\/span><localpath<\/span> <\/span>watch<\/span>=<\/span>\"\/opt\/tongbu\"<\/span>><\/span>
<\/span><remote<\/span> <\/span>ip<\/span>=<\/span>\"192.168.8.42\"<\/span> <\/span>name<\/span>=<\/span>\"tongbu\"<\/span>\/><\/span>
<\/span><remote<\/span> <\/span>ip<\/span>=<\/span>\"192.168.8.39\"<\/span> <\/span>name<\/span>=<\/span>\"tongbu\"<\/span>\/><\/span>
<\/span><\/localpath><\/span>
<\/span><crontab<\/span> <\/span>start<\/span>=<\/span>\"true\"<\/span> <\/span>schedule<\/span>=<\/span>\"30\"<\/span>\/><\/span>
<\/span><plugin<\/span> <\/span>name<\/span>=<\/span>\"refreshCDN\"<\/span>