{"id":75980,"date":"2024-10-16T02:51:17","date_gmt":"2024-10-15T18:51:17","guid":{"rendered":"https:\/\/server.hk\/cnblog\/75980\/"},"modified":"2024-10-16T02:51:17","modified_gmt":"2024-10-15T18:51:17","slug":"mysql-%e9%ab%98%e5%8f%af%e7%94%a8%e6%96%b9%e6%a1%88mha%e7%9a%84%e4%b8%80%e4%ba%9b%e7%b8%bd%e7%b5%90%e5%92%8c%e6%80%9d%e8%80%83","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/75980\/","title":{"rendered":"MySQL \u9ad8\u53ef\u7528\u65b9\u6848MHA\u7684\u4e00\u4e9b\u7e3d\u7d50\u548c\u601d\u8003"},"content":{"rendered":"<h1 id=\"mysql-%e9%ab%98%e5%8f%af%e7%94%a8%e6%96%b9%e6%a1%88mha%e7%9a%84%e4%b8%80%e4%ba%9b%e7%b8%bd%e7%b5%90%e5%92%8c%e6%80%9d%e8%80%83-kgjkLuxQiP\">MySQL \u9ad8\u53ef\u7528\u65b9\u6848MHA\u7684\u4e00\u4e9b\u7e3d\u7d50\u548c\u601d\u8003<\/h1>\n<p>\u5728\u7576\u4eca\u6578\u64da\u9a45\u52d5\u7684\u4e16\u754c\u4e2d\uff0c\u6578\u64da\u5eab\u7684\u9ad8\u53ef\u7528\u6027\u5c0d\u65bc\u4f01\u696d\u7684\u904b\u71df\u81f3\u95dc\u91cd\u8981\u3002MySQL\u4f5c\u70ba\u4e00\u500b\u5ee3\u6cdb\u4f7f\u7528\u7684\u958b\u6e90\u6578\u64da\u5eab\u7cfb\u7d71\uff0c\u5176\u9ad8\u53ef\u7528\u6027\u89e3\u6c7a\u65b9\u6848MHA\uff08Master High Availability Manager and tools\uff09\u9010\u6f38\u53d7\u5230\u91cd\u8996\u3002\u672c\u6587\u5c07\u5c0dMHA\u7684\u7279\u9ede\u3001\u67b6\u69cb\u53ca\u5176\u5728\u5be6\u969b\u61c9\u7528\u4e2d\u7684\u601d\u8003\u9032\u884c\u7e3d\u7d50\u3002<\/p>\n<h2 id=\"mha%e7%9a%84%e5%9f%ba%e6%9c%ac%e6%a6%82%e5%bf%b5-kgjkLuxQiP\">MHA\u7684\u57fa\u672c\u6982\u5ff5<\/h2>\n<p>MHA\u662f\u4e00\u500b\u7528\u65bcMySQL\u7684\u9ad8\u53ef\u7528\u6027\u7ba1\u7406\u5de5\u5177\uff0c\u65e8\u5728\u5be6\u73fe\u4e3b\u5f9e\u6578\u64da\u5eab\u7684\u81ea\u52d5\u6545\u969c\u8f49\u79fb\u3002\u7576\u4e3b\u6578\u64da\u5eab\u51fa\u73fe\u6545\u969c\u6642\uff0cMHA\u80fd\u5920\u81ea\u52d5\u5c07\u5f9e\u6578\u64da\u5eab\u63d0\u5347\u70ba\u65b0\u7684\u4e3b\u6578\u64da\u5eab\uff0c\u5f9e\u800c\u6700\u5c0f\u5316\u7cfb\u7d71\u7684\u505c\u6a5f\u6642\u9593\u3002<\/p>\n<h2 id=\"mha%e7%9a%84%e6%9e%b6%e6%a7%8b-kgjkLuxQiP\">MHA\u7684\u67b6\u69cb<\/h2>\n<p>MHA\u7684\u67b6\u69cb\u4e3b\u8981\u7531\u4ee5\u4e0b\u5e7e\u500b\u7d44\u4ef6\u7d44\u6210\uff1a<\/p>\n<ul>\n<li><strong>Master<\/strong>\uff1a\u7576\u524d\u7684\u4e3b\u6578\u64da\u5eab\uff0c\u8ca0\u8cac\u8655\u7406\u6240\u6709\u7684\u5beb\u5165\u8acb\u6c42\u3002<\/li>\n<li><strong>Slave<\/strong>\uff1a\u5f9e\u6578\u64da\u5eab\uff0c\u8ca0\u8cac\u8907\u88fd\u4e3b\u6578\u64da\u5eab\u7684\u6578\u64da\uff0c\u4e26\u5728\u4e3b\u6578\u64da\u5eab\u6545\u969c\u6642\u63a5\u7ba1\u5176\u89d2\u8272\u3002<\/li>\n<li><strong>MHA Manager<\/strong>\uff1a\u8ca0\u8cac\u76e3\u63a7\u4e3b\u5f9e\u6578\u64da\u5eab\u7684\u72c0\u614b\uff0c\u4e26\u5728\u6545\u969c\u767c\u751f\u6642\u57f7\u884c\u81ea\u52d5\u6545\u969c\u8f49\u79fb\u3002<\/li>\n<li><strong>MHA Node<\/strong>\uff1a\u5b89\u88ddMHA\u7684\u6bcf\u4e00\u53f0\u6578\u64da\u5eab\u670d\u52d9\u5668\uff0c\u8ca0\u8cac\u57f7\u884cMHA\u7684\u76f8\u95dc\u64cd\u4f5c\u3002<\/li>\n<\/ul>\n<h2 id=\"mha%e7%9a%84%e5%b7%a5%e4%bd%9c%e6%b5%81%e7%a8%8b-kgjkLuxQiP\">MHA\u7684\u5de5\u4f5c\u6d41\u7a0b<\/h2>\n<p>MHA\u7684\u5de5\u4f5c\u6d41\u7a0b\u53ef\u4ee5\u5206\u70ba\u4ee5\u4e0b\u5e7e\u500b\u6b65\u9a5f\uff1a<\/p>\n<ol>\n<li>\u76e3\u63a7\uff1aMHA Manager\u5b9a\u671f\u6aa2\u67e5\u4e3b\u6578\u64da\u5eab\u7684\u5065\u5eb7\u72c0\u614b\u3002<\/li>\n<li>\u6545\u969c\u6aa2\u6e2c\uff1a\u7576\u4e3b\u6578\u64da\u5eab\u7121\u6cd5\u97ff\u61c9\u6642\uff0cMHA Manager\u6703\u5224\u65b7\u5176\u662f\u5426\u6545\u969c\u3002<\/li>\n<li>\u6545\u969c\u8f49\u79fb\uff1a\u5982\u679c\u78ba\u5b9a\u4e3b\u6578\u64da\u5eab\u6545\u969c\uff0cMHA Manager\u6703\u9078\u64c7\u4e00\u500b\u5065\u5eb7\u7684\u5f9e\u6578\u64da\u5eab\uff0c\u5c07\u5176\u63d0\u5347\u70ba\u65b0\u7684\u4e3b\u6578\u64da\u5eab\u3002<\/li>\n<li>\u91cd\u65b0\u914d\u7f6e\uff1aMHA\u6703\u81ea\u52d5\u66f4\u65b0\u61c9\u7528\u7a0b\u5e8f\u7684\u914d\u7f6e\uff0c\u78ba\u4fdd\u5176\u6307\u5411\u65b0\u7684\u4e3b\u6578\u64da\u5eab\u3002<\/li>\n<\/ol>\n<h2 id=\"mha%e7%9a%84%e5%84%aa%e5%8b%a2-kgjkLuxQiP\">MHA\u7684\u512a\u52e2<\/h2>\n<p>MHA\u7684\u4e3b\u8981\u512a\u52e2\u5305\u62ec\uff1a<\/p>\n<ul>\n<li><strong>\u81ea\u52d5\u5316<\/strong>\uff1aMHA\u80fd\u5920\u81ea\u52d5\u6aa2\u6e2c\u6545\u969c\u4e26\u57f7\u884c\u6545\u969c\u8f49\u79fb\uff0c\u6e1b\u5c11\u4eba\u5de5\u5e72\u9810\u3002<\/li>\n<li><strong>\u5feb\u901f\u6062\u5fa9<\/strong>\uff1a\u6545\u969c\u8f49\u79fb\u904e\u7a0b\u901a\u5e38\u5728\u5e7e\u79d2\u9418\u5167\u5b8c\u6210\uff0c\u6700\u5927\u9650\u5ea6\u5730\u6e1b\u5c11\u4e86\u7cfb\u7d71\u7684\u505c\u6a5f\u6642\u9593\u3002<\/li>\n<li><strong>\u7c21\u55ae\u6613\u7528<\/strong>\uff1aMHA\u7684\u914d\u7f6e\u548c\u4f7f\u7528\u76f8\u5c0d\u7c21\u55ae\uff0c\u9069\u5408\u5404\u7a2e\u898f\u6a21\u7684\u4f01\u696d\u3002<\/li>\n<\/ul>\n<h2 id=\"%e5%af%a6%e9%9a%9b%e6%87%89%e7%94%a8%e4%b8%ad%e7%9a%84%e6%8c%91%e6%88%b0-kgjkLuxQiP\">\u5be6\u969b\u61c9\u7528\u4e2d\u7684\u6311\u6230<\/h2>\n<p>\u5118\u7ba1MHA\u6709\u8a31\u591a\u512a\u52e2\uff0c\u4f46\u5728\u5be6\u969b\u61c9\u7528\u4e2d\u4e5f\u9762\u81e8\u4e00\u4e9b\u6311\u6230\uff1a<\/p>\n<ul>\n<li><strong>\u6578\u64da\u4e00\u81f4\u6027<\/strong>\uff1a\u5728\u6545\u969c\u8f49\u79fb\u904e\u7a0b\u4e2d\uff0c\u53ef\u80fd\u6703\u51fa\u73fe\u6578\u64da\u4e0d\u4e00\u81f4\u7684\u60c5\u6cc1\uff0c\u7279\u5225\u662f\u5728\u4e3b\u6578\u64da\u5eab\u548c\u5f9e\u6578\u64da\u5eab\u4e4b\u9593\u7684\u5ef6\u9072\u8f03\u5927\u6642\u3002<\/li>\n<li><strong>\u76e3\u63a7\u548c\u7dad\u8b77<\/strong>\uff1a\u9700\u8981\u5b9a\u671f\u76e3\u63a7MHA\u7684\u904b\u884c\u72c0\u614b\uff0c\u4e26\u9032\u884c\u5fc5\u8981\u7684\u7dad\u8b77\uff0c\u4ee5\u78ba\u4fdd\u5176\u6b63\u5e38\u904b\u884c\u3002<\/li>\n<li><strong>\u5b78\u7fd2\u66f2\u7dda<\/strong>\uff1a\u5c0d\u65bc\u4e0d\u719f\u6089MySQL\u548c\u9ad8\u53ef\u7528\u6027\u67b6\u69cb\u7684\u5718\u968a\uff0cMHA\u7684\u5b78\u7fd2\u548c\u914d\u7f6e\u53ef\u80fd\u9700\u8981\u4e00\u5b9a\u7684\u6642\u9593\u3002<\/li>\n<\/ul>\n<h2 id=\"%e7%b8%bd%e7%b5%90-kgjkLuxQiP\">\u7e3d\u7d50<\/h2>\n<p>\u7e3d\u7684\u4f86\u8aaa\uff0cMHA\u4f5c\u70baMySQL\u7684\u4e00\u500b\u9ad8\u53ef\u7528\u6027\u89e3\u6c7a\u65b9\u6848\uff0c\u63d0\u4f9b\u4e86\u81ea\u52d5\u6545\u969c\u8f49\u79fb\u548c\u5feb\u901f\u6062\u5fa9\u7684\u80fd\u529b\uff0c\u5c0d\u65bc\u9700\u8981\u9ad8\u53ef\u7528\u6027\u7684\u61c9\u7528\u5834\u666f\u975e\u5e38\u9069\u5408\u3002\u7136\u800c\uff0c\u5728\u5be6\u969b\u61c9\u7528\u4e2d\uff0c\u4f01\u696d\u4ecd\u9700\u8003\u616e\u6578\u64da\u4e00\u81f4\u6027\u3001\u76e3\u63a7\u7dad\u8b77\u7b49\u6311\u6230\u3002\u5c0d\u65bc\u5e0c\u671b\u5728\u9999\u6e2f\u5c0b\u627e\u7a69\u5b9a\u7684\u6578\u64da\u5eab\u89e3\u6c7a\u65b9\u6848\u7684\u4f01\u696d\uff0c\u9078\u64c7\u5408\u9069\u7684<a href=\"https:\/\/server.hk\">\u9999\u6e2fVPS<\/a>\u6216<a href=\"https:\/\/server.hk\">\u9999\u6e2f\u4f3a\u670d\u5668<\/a>\uff0c\u80fd\u5920\u70baMHA\u7684\u90e8\u7f72\u63d0\u4f9b\u826f\u597d\u7684\u57fa\u790e\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u63a2\u7d22MySQL\u9ad8\u53ef\u7528\u65b9\u6848MHA\u7684\u7e3d\u7d50\u8207\u601d\u8003\uff0c\u4e86\u89e3\u5176\u512a\u52e2\u3001\u6311\u6230\u53ca\u6700\u4f73\u5be6\u8e10\uff0c\u63d0\u5347\u6578\u64da\u5eab\u7a69\u5b9a\u6027\u8207\u53ef\u9760\u6027\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-75980","post","type-post","status-publish","format-standard","hentry","category-database"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/75980","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=75980"}],"version-history":[{"count":1,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/75980\/revisions"}],"predecessor-version":[{"id":75981,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/75980\/revisions\/75981"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=75980"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=75980"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=75980"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}