{"id":1698,"date":"2023-03-25T22:31:41","date_gmt":"2023-03-25T14:31:41","guid":{"rendered":"https:\/\/www.appblog.cn\/?p=1698"},"modified":"2023-04-23T21:49:08","modified_gmt":"2023-04-23T13:49:08","slug":"alibaba-open-source-mysql-synchronization-component-canal","status":"publish","type":"post","link":"https:\/\/www.appblog.cn\/index.php\/2023\/03\/25\/alibaba-open-source-mysql-synchronization-component-canal\/","title":{"rendered":"\u963f\u91cc\u5df4\u5df4\u5f00\u6e90 MySQL\u540c\u6b65\u7ec4\u4ef6Canal"},"content":{"rendered":"<p>\u963f\u91cc\u5df4\u5df4 MySQL binlog \u589e\u91cf\u8ba2\u9605&amp;\u6d88\u8d39\u7ec4\u4ef6\uff1a<a target=\"_blank\" rel=\"noopener\" href=\"https:\/\/github.com\/alibaba\/canal\">https:\/\/github.com\/alibaba\/canal<\/a><\/p>\n<h2>\u7b80\u4ecb<\/h2>\n<p>canal [k\u0259&#8217;n\u00e6l]\uff0c\u8bd1\u610f\u4e3a\u6c34\u9053\/\u7ba1\u9053\/\u6c9f\u6e20\uff0c\u4e3b\u8981\u7528\u9014\u662f\u57fa\u4e8e MySQL \u6570\u636e\u5e93\u589e\u91cf\u65e5\u5fd7\u89e3\u6790\uff0c\u63d0\u4f9b\u589e\u91cf\u6570\u636e\u8ba2\u9605\u548c\u6d88\u8d39<\/p>\n<p><!-- more --><\/p>\n<p>\u65e9\u671f\u963f\u91cc\u5df4\u5df4\u56e0\u4e3a\u676d\u5dde\u548c\u7f8e\u56fd\u53cc\u673a\u623f\u90e8\u7f72\uff0c\u5b58\u5728\u8de8\u673a\u623f\u540c\u6b65\u7684\u4e1a\u52a1\u9700\u6c42\uff0c\u5b9e\u73b0\u65b9\u5f0f\u4e3b\u8981\u662f\u57fa\u4e8e\u4e1a\u52a1 trigger \u83b7\u53d6\u589e\u91cf\u53d8\u66f4\u3002\u4ece 2010 \u5e74\u5f00\u59cb\uff0c\u4e1a\u52a1\u9010\u6b65\u5c1d\u8bd5\u6570\u636e\u5e93\u65e5\u5fd7\u89e3\u6790\u83b7\u53d6\u589e\u91cf\u53d8\u66f4\u8fdb\u884c\u540c\u6b65\uff0c\u7531\u6b64\u884d\u751f\u51fa\u4e86\u5927\u91cf\u7684\u6570\u636e\u5e93\u589e\u91cf\u8ba2\u9605\u548c\u6d88\u8d39\u4e1a\u52a1\u3002<\/p>\n<p>\u57fa\u4e8e\u65e5\u5fd7\u589e\u91cf\u8ba2\u9605\u548c\u6d88\u8d39\u7684\u4e1a\u52a1\u5305\u62ec<\/p>\n<ul>\n<li>\u6570\u636e\u5e93\u955c\u50cf<\/li>\n<li>\u6570\u636e\u5e93\u5b9e\u65f6\u5907\u4efd<\/li>\n<li>\u7d22\u5f15\u6784\u5efa\u548c\u5b9e\u65f6\u7ef4\u62a4(\u62c6\u5206\u5f02\u6784\u7d22\u5f15\u3001\u5012\u6392\u7d22\u5f15\u7b49)<\/li>\n<li>\u4e1a\u52a1 cache \u5237\u65b0<\/li>\n<li>\u5e26\u4e1a\u52a1\u903b\u8f91\u7684\u589e\u91cf\u6570\u636e\u5904\u7406<\/li>\n<\/ul>\n<p>\u5f53\u524d\u7684 canal \u652f\u6301\u6e90\u7aef MySQL \u7248\u672c\u5305\u62ec 5.1.x , 5.5.x , 5.6.x , 5.7.x , 8.0.x<\/p>\n<h2>\u5de5\u4f5c\u539f\u7406<\/h2>\n<h3>MySQL\u4e3b\u5907\u590d\u5236\u539f\u7406<\/h3>\n<ul>\n<li>MySQL master \u5c06\u6570\u636e\u53d8\u66f4\u5199\u5165\u4e8c\u8fdb\u5236\u65e5\u5fd7( binary log, \u5176\u4e2d\u8bb0\u5f55\u53eb\u505a\u4e8c\u8fdb\u5236\u65e5\u5fd7\u4e8b\u4ef6binary log events\uff0c\u53ef\u4ee5\u901a\u8fc7 show binlog events \u8fdb\u884c\u67e5\u770b)<\/li>\n<li>MySQL slave \u5c06 master \u7684 binary log events \u62f7\u8d1d\u5230\u5b83\u7684\u4e2d\u7ee7\u65e5\u5fd7(relay log)<\/li>\n<li>MySQL slave \u91cd\u653e relay log \u4e2d\u4e8b\u4ef6\uff0c\u5c06\u6570\u636e\u53d8\u66f4\u53cd\u6620\u5b83\u81ea\u5df1\u7684\u6570\u636e<\/li>\n<\/ul>\n<h3>canal \u5de5\u4f5c\u539f\u7406<\/h3>\n<ul>\n<li>canal \u6a21\u62df MySQL slave \u7684\u4ea4\u4e92\u534f\u8bae\uff0c\u4f2a\u88c5\u81ea\u5df1\u4e3a MySQL slave \uff0c\u5411 MySQL master \u53d1\u9001dump \u534f\u8bae<\/li>\n<li>MySQL master \u6536\u5230 dump \u8bf7\u6c42\uff0c\u5f00\u59cb\u63a8\u9001 binary log \u7ed9 slave (\u5373 canal )<\/li>\n<li>canal \u89e3\u6790 binary log \u5bf9\u8c61(\u539f\u59cb\u4e3a byte \u6d41)<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>\u963f\u91cc\u5df4\u5df4 MySQL binlog \u589e\u91cf\u8ba2\u9605&amp;\u6d88\u8d39\u7ec4\u4ef6\uff1ahttps:\/\/github.com\/alib [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[417],"tags":[],"class_list":["post-1698","post","type-post","status-publish","format-standard","hentry","category-canal"],"_links":{"self":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts\/1698","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/comments?post=1698"}],"version-history":[{"count":0,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts\/1698\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/media?parent=1698"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/categories?post=1698"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/tags?post=1698"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}