{"id":1090,"date":"2010-03-30T10:32:00","date_gmt":"2010-03-30T02:32:00","guid":{"rendered":"\/?p=1090"},"modified":"2010-03-30T10:32:00","modified_gmt":"2010-03-30T10:32:00","slug":"1090","status":"publish","type":"post","link":"https:\/\/blog.vimge.com\/archives\/architecture\/1090.html","title":{"rendered":"Sersync \u5f00\u6e90\u670d\u52a1\u5668\u6587\u4ef6\u5b9e\u65f6\u540c\u6b65\u5de5\u5177"},"content":{"rendered":"

        \u8fd9\u662f\u91d1\u5c71\u900d\u9065\u56e2\u961f\u8d21\u732e\u7684\u4e00\u4e2a\u5f00\u6e90\u8f6f\u4ef6sersync\uff0c\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<\/p>\n

\u6d4b\u8bd5\u73af\u5883 <\/strong>CentOS\uff0cubuntu\u3002<\/p>\n

\u6e90\u7801\u5730\u5740:<\/strong><\/p>\n

http:\/\/code.google.com\/p\/sersync\/<\/a>
    \u76ee\u524d\u4f7f\u7528\u7684\u6bd4\u8f83\u591a\u7684\u540c\u6b65\u7a0b\u5e8f\u7248\u672c\u662finotify-tools\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\uff0c\u5176\u8bbe\u8ba1\u601d\u8def\u540c\u6837\u662f\u91c7\u7528inotify\u4e0ersync\u547d\u4ee4\u3002 \u76f8\u6bd4\u8f83\u4e0a\u9762\u4e24\u4e2a\u9879\u76ee\uff0c\u672c\u9879\u76ee\u4f18\u70b9\u662f\uff1a
1.sersync\u662f\u4f7f\u7528c++\u7f16\u5199\uff0c\u800c\u4e14\u5bf9linux\u7cfb\u7edf\u6587\u4ef6\u7cfb\u7edf\u4ea7\u751f\u7684\u4e34\u65f6\u6587\u4ef6\u548c\u91cd\u590d\u7684\u6587\u4ef6\u64cd\u4f5c\u8fdb\u884c\u8fc7\u6ee4\uff08\u6211\u7a0d\u540e\u4f1a\u63d0\u5230\uff09\uff0c\u6240\u4ee5\u5728\u7ed3\u5408rsync\u540c\u6b65\u7684\u65f6\u5019\uff0c\u8282\u7701\u4e86\u8fd0\u884c\u65f6\u8017\u548c\u7f51\u7edc\u8d44\u6e90\u3002\u56e0\u6b64\u66f4\u5feb\u3002
2.\u76f8\u6bd4\u8f83\u4e0a\u9762\u4e24\u4e2a\u9879\u76ee\uff0csersync\u914d\u7f6e\u8d77\u6765\u5f88\u7b80\u5355:\u5728
http:\/\/code.google.com\/p\/sersync\/downloads<\/a> \/list \u5904\u4e0b\u8f7d\u6e90\u7801\uff08\u5206\u4e3a32\u7248\u672c\uff0c\u4e0e64\u4f4d\u7248\u672c\uff09\uff0c\u5176\u4e2dbin\u76ee\u5f55\u4e0b\u5df2\u7ecf\u6709\u6211\u7f16\u8bd1\u597d\u76842\u8fdb\u5236\u6587\u4ef6\uff0c\u914d\u5408bin\u76ee\u5f55\u4e0b\u7684xml\u6587\u4ef6\u76f4\u63a5\u4f7f\u7528\u5373\u53ef\u3002
3.\u53e6\u5916\u672c\u9879\u76ee\u76f8\u6bd4\u8f83\u5176\u4ed6\u811a\u672c\u5f00\u6e90\u9879\u76ee\uff0c\u4f7f\u7528\u591a\u7ebf\u7a0b\u8fdb\u884c\u540c\u6b65\uff0c\u5c24\u5176\u5728\u540c\u6b65\u8f83\u5927\u6587\u4ef6\u65f6\uff0c\u80fd\u591f\u4fdd\u8bc1\u591a\u4e2a\u670d\u52a1\u5668\u5b9e\u65f6\u4fdd\u6301\u540c\u6b65\u72b6\u6001\u3002
4.\u672c\u9879\u76ee\u81ea\u5e26\u51fa\u9519\u5904\u7406\u673a\u5236\uff0c\u901a\u8fc7\u5931\u8d25\u961f\u5217\u5bf9\u51fa\u9519\u7684\u6587\u4ef6\u91cd\u65b0\u51fa\u9519\uff0c\u5982\u679c\u4ecd\u65e7\u5931\u8d25\uff0c\u5219\u6bcf10\u4e2a\u5c0f\u65f6\u5bf9\u540c\u6b65\u5931\u8d25\u7684\u6587\u4ef6\u91cd\u65b0\u540c\u6b65\u3002
5.\u672c\u9879\u76ee\u81ea\u5e26crontab\u529f\u80fd\uff0c\u53ea\u9700\u5728xml\u914d\u7f6e\u6587\u4ef6\u4e2d\u5f00\u542f\uff0c\u5373\u53ef\u6309\u60a8\u7684\u8981\u6c42\uff0c\u9694\u4e00\u6bb5\u65f6\u95f4\u6574\u4f53\u540c\u6b65\u4e00\u6b21\u3002
6.\u672c\u9879\u76ee\u81ea\u5e26socket\u4e0ehttp\u534f\u8bae\u6269\u5c55\uff0c\u6ee1\u8db3\u60a8\u4e8c\u6b21\u5f00\u53d1\u7684\u9700\u8981\u3002<\/p>\n

\u57fa\u672c\u67b6\u6784\uff1a<\/strong><\/p>\n

   \u5229\u7528inotify\u4e0ersync\u5bf9\u670d\u52a1\u5668\u8fdb\u884c\u5b9e\u65f6\u540c\u6b65\uff0c\u5176\u4e2dinotify\u7528\u4e8e\u76d1\u63a7\u6587\u4ef6\u7cfb\u7edf\u4e8b\u4ef6\uff0crsync\u662f\u76ee\u524d\u5e7f\u6cdb\u4f7f\u7528\u7684\u540c\u6b65\u7b97\u6cd5\uff0c\u5176\u4f18\u70b9\u662f\u53ea\u5bf9\u6587\u4ef6\u4e0d\u540c\u7684\u90e8\u5206\u8fdb\u884c\u64cd\u4f5c\uff0c\u6240\u4ee5\u5176\u4f18\u52bf\u5927\u5927\u8d85\u8fc7\u4f7f\u7528\u6302\u63a5\u6587\u4ef6\u7cfb\u7edf\u7684\u65b9\u5f0f\u8fdb\u884c\u955c\u50cf\u540c\u6b65\u3002<\/p>\n


<\/span>  <\/p>\n

\u8bbe\u8ba1\u7b80\u6790 <\/strong><\/p>\n

   \u5982\u4e0a\u56fe\u6240\u793a\uff0c\u7ebf\u7a0b\u7ec4\u7ebf\u7a0b\u662f\u7b49\u5f85\u7ebf\u7a0b\u961f\u5217\u7684\u5b88\u62a4\u7ebf\u7a0b\uff0c\u5f53\u961f\u5217\u4e2d\u6709\u6570\u636e\u7684\u65f6\u5019\uff0c\u7ebf\u7a0b\u7ec4\u5b88\u62a4\u7ebf\u7a0b\u9010\u4e2a\u5524\u9192\uff0c\u5f53\u961f\u5217\u4e2dinotify\u4e8b\u4ef6\u4ea4\u591a\u7684\u65f6\u5019\u5c31\u4f1a\u88ab\u5168\u90e8\u5524\u9192\u4e00\u8d77\u5de5\u4f5c\u3002\u8fd9\u6837\u8bbe\u8ba1\u7684\u76ee\u7684\u662f\u80fd\u591f\u540c\u65f6\u5904\u7406\u591a\u4e2ainotify\u4e8b\u4ef6\uff0c\u91cd\u53d1\u5229\u7528\u670d\u52a1\u5668\u7684\u5e76\u53d1\u80fd\u529b\uff08\u6838\u6570*2+2\uff09\u3002<\/p>\n

   \u4e4b\u6240\u4ee5\u79f0\u4e4b\u4e3a\u7ebf\u7a0b\u7ec4\u7ebf\u7a0b\uff0c\u662f\u56e0\u4e3a\u6bcf\u4e2a\u7ebf\u7a0b\u5728\u5de5\u4f5c\u7684\u65f6\u5019\uff0c\u4f1a\u6839\u636e\u670d\u52a1\u5668\u7684\u6570\u91cf\u5efa\u7acb\u5b50\u7ebf\u7a0b\uff0c\u5b50\u7ebf\u7a0b\u53ef\u4ee5\u4fdd\u8bc1\u6240\u6709\u7684\u6587\u4ef6\u4e0e\u5404\u4e2a\u670d\u52a1\u5668\u540c\u65f6\u540c\u6b65\uff0c\u5f53\u8981\u540c\u6b65\u7684\u6587\u4ef6\u8f83\u5927\u7684\u65f6\u5019\uff0c\u8fd9\u6837\u8bbe\u8ba1\u53ef\u4ee5\u4fdd\u8bc1\u5404\u4e2a\u8fdc\u7a0b\u670d\u52a1\u5668\u53ef\u4ee5\u540c\u65f6\u83b7\u5f97\u8981\u540c\u6b65\u7684\u6587\u4ef6\u3002<\/p>\n

   \u670d\u52a1\u7ebf\u7a0b \u7684\u4f5c\u7528\u6709\u4e09\u4e2a\uff0c\u9996\u5148\u662f\u5904\u7406\u540c\u6b65\u5931\u8d25\u7684\u6587\u4ef6\uff0c\u5c06\u8fd9\u4e9b\u6587\u4ef6\u518d\u6b21\u540c\u6b65\uff0c\u5bf9\u4e8e\u518d\u6b21\u540c\u6b65\u5931\u8d25\u7684\u6587\u4ef6\u4f1a\u751f\u6210rsync_fail_log.sh\u811a\u672c\uff0c\u8bb0\u5f55\u5931\u8d25\u7684\u4e8b\u4ef6\u3002 \u540c\u65f6\u6bcf\u969410\u4e2a\u5c0f\u65f6\u6267\u884c\u811a\u672c\u4e00\u6b21\uff0c\u540c\u65f6\u6e05\u7a7a\u811a\u672c\u3002\u670d\u52a1\u7ebf\u7a0b\u7684\u7b2c\u4e09\u4e2a\u4f5c\u7528\u662fcrontab\u529f\u80fd\uff0c\u53ef\u4ee5\u6bcf\u9694\u4e00\u5b9a\u65f6\u95f4\uff0c\u5c06\u6240\u6709\u8def\u5f84\u6574\u4f53\u540c\u6b65\u4e00\u6b21\u3002<\/p>\n

   \u8fc7\u6ee4\u961f\u5217\u7684\u5efa\u7acb\u662f\u4e3a\u4e86\u8fc7\u6ee4\u77ed\u65f6\u95f4\u5185\u4ea7\u751f\u7684\u91cd\u590d\u7684inotify\u4fe1\u606f\uff0c\u4f8b\u5982\u5728\u5220\u9664\u6587\u4ef6\u5939\u5f97\u65f6\u5019\uff0cinotify\u5c31\u4f1a\u540c\u65f6\u4ea7\u751f\u5220\u9664\u6587\u4ef6\u5939\u91cc\u7684\u6587\u4ef6\u4e0e\u5220\u9664\u6587\u4ef6\u5939 \u5f97\u4e8b\u4ef6\uff0c\u901a\u8fc7\u8fc7\u6ee4\u961f\u5217\u5f53\u5220\u9664\u6587\u4ef6\u5939\u4e8b\u4ef6\u4ea7\u751f\u7684\u65f6\u5019\uff0c\u4f1a\u5c06\u4e4b\u524d\u52a0\u5165\u961f\u5217\u7684\u5220\u9664\u6587\u4ef6\u7684\u4e8b\u4ef6\u5168\u90e8\u8fc7\u6ee4\u6389\uff0c\u8fd9\u6837\u53ea\u4ea7\u751f\u4e00\u6761\u4e8b\u4ef6\u51cf\u8f7b\u4e86\u540c\u6b65\u7684\u8d1f\u62c5\u3002\u540c\u65f6\u5bf9\u4e8e\u4fee\u6539\u6587\u4ef6 \u7684\u64cd\u4f5c\u7684\u65f6\u5019\uff0c\u4f1a\u4ea7\u751f\u4e34\u65f6\u6587\u4ef6\u4e0e\u91cd\u590d\u64cd\u4f5c\u3002<\/p>\n

\u539f\u6587\uff1a<\/strong>http:\/\/blog.csdn.net\/zhoukunta\/archive\/2010\/01\/27\/5261800.aspx<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"

        \u8fd9\u662f\u91d1\u5c71\u900d\u9065\u56e2\u961f\u8d21\u732e\u7684\u4e00\u4e2a\u5f00\u6e90\u8f6f\u4ef6sersync\uff0c\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<\/p>\n

\u6d4b\u8bd5\u73af\u5883 <\/strong>CentOS\uff0cubuntu\u3002<\/p>\n

\u6e90\u7801\u5730\u5740:<\/strong><\/p>\n

http:\/\/code.google.com\/p\/sersync\/<\/a>
    \u76ee\u524d\u4f7f\u7528\u7684\u6bd4\u8f83\u591a\u7684\u540c\u6b65\u7a0b\u5e8f\u7248\u672c\u662finotify-tools\uff0c\u53e6\u5916\u4e00\u4e2a\u662fgoogle\u5f00\u6e90\u9879\u76eeOpenduckbill\uff08\u4f9d\u8d56\u4e8einotify- tools\uff09\uff0c\u8fd9\u4e24\u4e2a\u90fd<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[5],"tags":[],"_links":{"self":[{"href":"https:\/\/blog.vimge.com\/wp-json\/wp\/v2\/posts\/1090"}],"collection":[{"href":"https:\/\/blog.vimge.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.vimge.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.vimge.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.vimge.com\/wp-json\/wp\/v2\/comments?post=1090"}],"version-history":[{"count":0,"href":"https:\/\/blog.vimge.com\/wp-json\/wp\/v2\/posts\/1090\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.vimge.com\/wp-json\/wp\/v2\/media?parent=1090"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.vimge.com\/wp-json\/wp\/v2\/categories?post=1090"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.vimge.com\/wp-json\/wp\/v2\/tags?post=1090"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}