{"id":186708,"date":"2024-11-11T08:10:19","date_gmt":"2024-11-11T00:10:19","guid":{"rendered":"https:\/\/server.hk\/cnblog\/186708\/"},"modified":"2024-11-11T08:10:20","modified_gmt":"2024-11-11T00:10:20","slug":"%e6%95%b8%e6%93%9a%e5%ba%ab%e9%9b%86%e7%be%a4%e5%90%8c%e6%ad%a5%e6%8a%80%e8%a1%93%e5%8e%9f%e7%90%86%e7%b0%a1%e6%9e%90-%e6%95%b8%e6%93%9a%e5%ba%ab%e9%9b%86%e7%be%a4-%e5%90%8c%e6%ad%a5","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/186708\/","title":{"rendered":"\u6578\u64da\u5eab\u96c6\u7fa4\u540c\u6b65\u6280\u8853\u539f\u7406\u7c21\u6790 (\u6578\u64da\u5eab\u96c6\u7fa4 \u540c\u6b65)"},"content":{"rendered":"<h1 id=\"%e6%95%b8%e6%93%9a%e5%ba%ab%e9%9b%86%e7%be%a4%e5%90%8c%e6%ad%a5%e6%8a%80%e8%a1%93%e5%8e%9f%e7%90%86%e7%b0%a1%e6%9e%90-QXQTEcIgwN\">\u6578\u64da\u5eab\u96c6\u7fa4\u540c\u6b65\u6280\u8853\u539f\u7406\u7c21\u6790<\/h1>\n<p>\u5728\u7576\u4eca\u6578\u64da\u9a45\u52d5\u7684\u4e16\u754c\u4e2d\uff0c\u6578\u64da\u5eab\u7684\u53ef\u7528\u6027\u548c\u4e00\u81f4\u6027\u5c0d\u65bc\u4f01\u696d\u7684\u904b\u71df\u81f3\u95dc\u91cd\u8981\u3002\u96a8\u8457\u696d\u52d9\u9700\u6c42\u7684\u589e\u9577\uff0c\u6578\u64da\u5eab\u96c6\u7fa4\u6210\u70ba\u4e86\u63d0\u5347\u6027\u80fd\u548c\u53ef\u9760\u6027\u7684\u6709\u6548\u89e3\u6c7a\u65b9\u6848\u3002\u672c\u6587\u5c07\u6df1\u5165\u63a2\u8a0e\u6578\u64da\u5eab\u96c6\u7fa4\u540c\u6b65\u6280\u8853\u7684\u539f\u7406\uff0c\u5e6b\u52a9\u8b80\u8005\u7406\u89e3\u5176\u904b\u4f5c\u65b9\u5f0f\u53ca\u5176\u5728\u5be6\u969b\u61c9\u7528\u4e2d\u7684\u91cd\u8981\u6027\u3002<\/p>\n<h2 id=\"%e4%bb%80%e9%ba%bc%e6%98%af%e6%95%b8%e6%93%9a%e5%ba%ab%e9%9b%86%e7%be%a4%e5%90%8c%e6%ad%a5%ef%bc%9f-QXQTEcIgwN\">\u4ec0\u9ebc\u662f\u6578\u64da\u5eab\u96c6\u7fa4\u540c\u6b65\uff1f<\/h2>\n<p>\u6578\u64da\u5eab\u96c6\u7fa4\u540c\u6b65\u662f\u6307\u5728\u591a\u500b\u6578\u64da\u5eab\u5be6\u4f8b\u4e4b\u9593\u4fdd\u6301\u6578\u64da\u4e00\u81f4\u6027\u548c\u53ef\u7528\u6027\u7684\u4e00\u7a2e\u6280\u8853\u3002\u9019\u7a2e\u6280\u8853\u901a\u5e38\u7528\u65bc\u5206\u4f48\u5f0f\u7cfb\u7d71\u4e2d\uff0c\u78ba\u4fdd\u5728\u4e0d\u540c\u7684\u4f3a\u670d\u5668\u4e0a\u904b\u884c\u7684\u6578\u64da\u5eab\u5be6\u4f8b\u80fd\u5920\u5373\u6642\u66f4\u65b0\u548c\u540c\u6b65\u6578\u64da\u3002\u6578\u64da\u5eab\u96c6\u7fa4\u540c\u6b65\u7684\u4e3b\u8981\u76ee\u7684\u662f\u63d0\u9ad8\u7cfb\u7d71\u7684\u5bb9\u932f\u80fd\u529b\u548c\u53ef\u64f4\u5c55\u6027\u3002<\/p>\n<h2 id=\"%e6%95%b8%e6%93%9a%e5%ba%ab%e9%9b%86%e7%be%a4%e5%90%8c%e6%ad%a5%e7%9a%84%e9%a1%9e%e5%9e%8b-QXQTEcIgwN\">\u6578\u64da\u5eab\u96c6\u7fa4\u540c\u6b65\u7684\u985e\u578b<\/h2>\n<ul>\n<li><strong>\u4e3b\u5f9e\u540c\u6b65\uff08Master-Slave Replication\uff09<\/strong>: \u5728\u9019\u7a2e\u6a21\u5f0f\u4e0b\uff0c\u4e00\u500b\u4e3b\u6578\u64da\u5eab\u8ca0\u8cac\u8655\u7406\u6240\u6709\u7684\u5beb\u5165\u8acb\u6c42\uff0c\u800c\u5f9e\u6578\u64da\u5eab\u5247\u7528\u65bc\u8b80\u53d6\u8acb\u6c42\u3002\u4e3b\u6578\u64da\u5eab\u7684\u8b8a\u66f4\u6703\u88ab\u540c\u6b65\u5230\u5f9e\u6578\u64da\u5eab\uff0c\u78ba\u4fdd\u6578\u64da\u7684\u4e00\u81f4\u6027\u3002<\/li>\n<li><strong>\u96d9\u4e3b\u540c\u6b65\uff08Master-Master Replication\uff09<\/strong>: \u5728\u96d9\u4e3b\u6a21\u5f0f\u4e2d\uff0c\u5169\u500b\u6578\u64da\u5eab\u5be6\u4f8b\u90fd\u53ef\u4ee5\u8655\u7406\u8b80\u53d6\u548c\u5beb\u5165\u8acb\u6c42\u3002\u9019\u7a2e\u6a21\u5f0f\u9700\u8981\u66f4\u8907\u96dc\u7684\u885d\u7a81\u89e3\u6c7a\u6a5f\u5236\uff0c\u4ee5\u78ba\u4fdd\u6578\u64da\u7684\u4e00\u81f4\u6027\u3002<\/li>\n<li><strong>\u591a\u4e3b\u540c\u6b65\uff08Multi-Master Replication\uff09<\/strong>: \u6b64\u6a21\u5f0f\u5141\u8a31\u591a\u500b\u6578\u64da\u5eab\u5be6\u4f8b\u540c\u6642\u9032\u884c\u8b80\u5beb\u64cd\u4f5c\uff0c\u4e26\u901a\u904e\u67d0\u7a2e\u5354\u8b70\u4f86\u89e3\u6c7a\u6578\u64da\u885d\u7a81\u3002<\/li>\n<\/ul>\n<h2 id=\"%e6%95%b8%e6%93%9a%e5%ba%ab%e9%9b%86%e7%be%a4%e5%90%8c%e6%ad%a5%e7%9a%84%e6%8a%80%e8%a1%93%e5%8e%9f%e7%90%86-QXQTEcIgwN\">\u6578\u64da\u5eab\u96c6\u7fa4\u540c\u6b65\u7684\u6280\u8853\u539f\u7406<\/h2>\n<p>\u6578\u64da\u5eab\u96c6\u7fa4\u540c\u6b65\u7684\u6838\u5fc3\u5728\u65bc\u6578\u64da\u7684\u8907\u88fd\u548c\u4e00\u81f4\u6027\u5354\u8b70\u3002\u4ee5\u4e0b\u662f\u4e00\u4e9b\u5e38\u898b\u7684\u6280\u8853\u539f\u7406\uff1a<\/p>\n<h3 id=\"1-%e6%97%a5%e8%aa%8c%e5%82%b3%e6%92%ad%ef%bc%88log-shipping%ef%bc%89-QXQTEcIgwN\">1. \u65e5\u8a8c\u50b3\u64ad\uff08Log Shipping\uff09<\/h3>\n<p>\u65e5\u8a8c\u50b3\u64ad\u662f\u4e00\u7a2e\u5c07\u4e3b\u6578\u64da\u5eab\u7684\u4e8b\u52d9\u65e5\u8a8c\u5b9a\u671f\u50b3\u9001\u5230\u5f9e\u6578\u64da\u5eab\u7684\u6280\u8853\u3002\u5f9e\u6578\u64da\u5eab\u901a\u904e\u61c9\u7528\u9019\u4e9b\u65e5\u8a8c\u4f86\u66f4\u65b0\u81ea\u8eab\u7684\u6578\u64da\u3002\u9019\u7a2e\u65b9\u6cd5\u7684\u512a\u9ede\u662f\u7c21\u55ae\u6613\u7528\uff0c\u4f46\u5728\u4e3b\u6578\u64da\u5eab\u6545\u969c\u6642\uff0c\u5f9e\u6578\u64da\u5eab\u7684\u6578\u64da\u53ef\u80fd\u6703\u6eef\u5f8c\u3002<\/p>\n<h3 id=\"2-%e8%a7%b8%e7%99%bc%e5%99%a8%ef%bc%88triggers%ef%bc%89-QXQTEcIgwN\">2. \u89f8\u767c\u5668\uff08Triggers\uff09<\/h3>\n<p>\u89f8\u767c\u5668\u662f\u4e00\u7a2e\u5728\u6578\u64da\u5eab\u4e2d\u81ea\u52d5\u57f7\u884c\u7684\u7a0b\u5e8f\uff0c\u7576\u7279\u5b9a\u4e8b\u4ef6\u767c\u751f\u6642\uff08\u5982\u63d2\u5165\u3001\u66f4\u65b0\u6216\u522a\u9664\u64cd\u4f5c\uff09\uff0c\u89f8\u767c\u5668\u6703\u81ea\u52d5\u57f7\u884c\u76f8\u61c9\u7684\u64cd\u4f5c\u4ee5\u4fdd\u6301\u6578\u64da\u540c\u6b65\u3002\u9019\u7a2e\u65b9\u6cd5\u7684\u9748\u6d3b\u6027\u9ad8\uff0c\u4f46\u53ef\u80fd\u6703\u5f71\u97ff\u6027\u80fd\u3002<\/p>\n<h3 id=\"3-%e5%88%86%e5%b8%83%e5%bc%8f%e5%85%b1%e8%ad%98%e7%ae%97%e6%b3%95%ef%bc%88distributed-consensus-algorithms%ef%bc%89-QXQTEcIgwN\">3. \u5206\u5e03\u5f0f\u5171\u8b58\u7b97\u6cd5\uff08Distributed Consensus Algorithms\uff09<\/h3>\n<p>\u5982Paxos\u548cRaft\u7b49\u7b97\u6cd5\u7528\u65bc\u78ba\u4fdd\u5728\u591a\u500b\u6578\u64da\u5eab\u5be6\u4f8b\u4e4b\u9593\u9054\u6210\u4e00\u81f4\u3002\u9019\u4e9b\u7b97\u6cd5\u80fd\u5920\u8655\u7406\u7db2\u7d61\u5206\u5340\u548c\u6545\u969c\u60c5\u6cc1\uff0c\u78ba\u4fdd\u6578\u64da\u7684\u4e00\u81f4\u6027\u548c\u53ef\u7528\u6027\u3002<\/p>\n<h2 id=\"%e6%95%b8%e6%93%9a%e5%ba%ab%e9%9b%86%e7%be%a4%e5%90%8c%e6%ad%a5%e7%9a%84%e6%8c%91%e6%88%b0-QXQTEcIgwN\">\u6578\u64da\u5eab\u96c6\u7fa4\u540c\u6b65\u7684\u6311\u6230<\/h2>\n<p>\u5118\u7ba1\u6578\u64da\u5eab\u96c6\u7fa4\u540c\u6b65\u6280\u8853\u63d0\u4f9b\u4e86\u8a31\u591a\u512a\u52e2\uff0c\u4f46\u5728\u5be6\u65bd\u904e\u7a0b\u4e2d\u4e5f\u9762\u81e8\u4e00\u4e9b\u6311\u6230\uff1a<\/p>\n<ul>\n<li><strong>\u5ef6\u9072\u554f\u984c<\/strong>: \u5728\u67d0\u4e9b\u540c\u6b65\u6a21\u5f0f\u4e0b\uff0c\u6578\u64da\u53ef\u80fd\u6703\u51fa\u73fe\u5ef6\u9072\uff0c\u5f71\u97ff\u7cfb\u7d71\u7684\u5373\u6642\u6027\u3002<\/li>\n<li><strong>\u885d\u7a81\u89e3\u6c7a<\/strong>: \u5728\u96d9\u4e3b\u6216\u591a\u4e3b\u6a21\u5f0f\u4e2d\uff0c\u6578\u64da\u885d\u7a81\u7684\u89e3\u6c7a\u662f\u4e00\u500b\u8907\u96dc\u7684\u554f\u984c\uff0c\u9700\u8981\u6709\u6548\u7684\u7b56\u7565\u4f86\u8655\u7406\u3002<\/li>\n<li><strong>\u6027\u80fd\u5f71\u97ff<\/strong>: \u6578\u64da\u540c\u6b65\u904e\u7a0b\u53ef\u80fd\u6703\u5c0d\u7cfb\u7d71\u6027\u80fd\u9020\u6210\u5f71\u97ff\uff0c\u7279\u5225\u662f\u5728\u9ad8\u8ca0\u8f09\u60c5\u6cc1\u4e0b\u3002<\/li>\n<\/ul>\n<h2 id=\"%e7%b5%90%e8%ab%96-QXQTEcIgwN\">\u7d50\u8ad6<\/h2>\n<p>\u6578\u64da\u5eab\u96c6\u7fa4\u540c\u6b65\u6280\u8853\u5728\u73fe\u4ee3\u4f01\u696d\u4e2d\u626e\u6f14\u8457\u91cd\u8981\u89d2\u8272\uff0c\u80fd\u5920\u63d0\u9ad8\u6578\u64da\u7684\u53ef\u7528\u6027\u548c\u4e00\u81f4\u6027\u3002\u901a\u904e\u7406\u89e3\u5176\u57fa\u672c\u539f\u7406\u548c\u6311\u6230\uff0c\u4f01\u696d\u53ef\u4ee5\u66f4\u597d\u5730\u8a2d\u8a08\u548c\u5be6\u65bd\u6578\u64da\u5eab\u96c6\u7fa4\u89e3\u6c7a\u65b9\u6848\uff0c\u4ee5\u6eff\u8db3\u4e0d\u65b7\u589e\u9577\u7684\u696d\u52d9\u9700\u6c42\u3002\u5c0d\u65bc\u9700\u8981\u9ad8\u53ef\u7528\u6027\u548c\u9ad8\u6027\u80fd\u7684\u61c9\u7528\uff0c\u9078\u64c7\u5408\u9069\u7684\u6578\u64da\u5eab\u96c6\u7fa4\u540c\u6b65\u6280\u8853\u81f3\u95dc\u91cd\u8981\u3002<\/p>\n<p>\u5982\u9700\u4e86\u89e3\u66f4\u591a\u6709\u95dc <a href=\"https:\/\/server.hk\">\u9999\u6e2fVPS<\/a> \u548c\u6578\u64da\u5eab\u89e3\u6c7a\u65b9\u6848\u7684\u4fe1\u606f\uff0c\u8acb\u8a2a\u554f\u6211\u5011\u7684\u7db2\u7ad9\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u63a2\u8a0e\u6578\u64da\u5eab\u96c6\u7fa4\u540c\u6b65\u6280\u8853\u7684\u539f\u7406\uff0c\u5206\u6790\u5176\u904b\u4f5c\u65b9\u5f0f\u53ca\u61c9\u7528\uff0c\u63d0\u5347\u6578\u64da\u4e00\u81f4\u6027\u8207\u7cfb\u7d71\u6548\u80fd\u3002<\/p>\n","protected":false},"author":0,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[101],"tags":[],"class_list":["post-186708","post","type-post","status-publish","format-standard","hentry","category-database"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/186708","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/types\/post"}],"replies":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/comments?post=186708"}],"version-history":[{"count":1,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/186708\/revisions"}],"predecessor-version":[{"id":186709,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/186708\/revisions\/186709"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=186708"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=186708"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=186708"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}