{"id":94757,"date":"2026-08-15T07:49:00","date_gmt":"2026-08-14T23:49:00","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/94757.html"},"modified":"2026-08-15T07:49:00","modified_gmt":"2026-08-14T23:49:00","slug":"%e5%bd%bb%e5%ba%95%e8%a7%a3%e5%86%b3%e6%95%b0%e6%8d%ae%e5%ba%93%e5%8d%95%e7%82%b9%e6%95%85%e9%9a%9c%ef%bc%81keepalivedlvsdrmariadb%e4%b8%bb%e4%b8%bb%e9%ab%98%e5%8f%af%e7%94%a8%e6%9e%b6%e6%9e%84","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/94757.html","title":{"rendered":"\u5f7b\u5e95\u89e3\u51b3\u6570\u636e\u5e93\u5355\u70b9\u6545\u969c\uff01Keepalived+LVS(DR)+MariaDB\u4e3b\u4e3b\u9ad8\u53ef\u7528\u67b6\u6784\u5b9e\u6218"},"content":{"rendered":"<h2>\u5f7b\u5e95\u89e3\u51b3\u6570\u636e\u5e93\u5355\u70b9\u6545\u969c&#xff01;Keepalived&#043;LVS(DR)&#043;MariaDB\u4e3b\u4e3b\u9ad8\u53ef\u7528\u67b6\u6784\u5b9e\u6218<\/h2>\n<h2>\u4e00\u3001\u9879\u76ee\u80cc\u666f<\/h2>\n<h3>1.1 \u4e1a\u52a1\u573a\u666f\u4e0e\u6570\u636e\u5e93\u6838\u5fc3\u8bc9\u6c42<\/h3>\n<p>\u5728\u4f01\u4e1a\u7ea7\u5e94\u7528\u4e2d&#xff0c;\u6570\u636e\u5e93\u4f5c\u4e3a\u4e1a\u52a1\u6570\u636e\u7684\u201c\u6838\u5fc3\u8f7d\u4f53\u201d&#xff0c;\u5176\u9ad8\u53ef\u7528\u6027\u3001\u8bfb\u5199\u6027\u80fd\u3001\u6570\u636e\u4e00\u81f4\u6027\u76f4\u63a5\u51b3\u5b9a\u4e1a\u52a1\u80fd\u5426\u7a33\u5b9a\u8fd0\u884c\u3002\u65e0\u8bba\u662f\u7535\u5546\u4ea4\u6613\u7cfb\u7edf&#xff08;\u8ba2\u5355\u751f\u6210\u3001\u5e93\u5b58\u6263\u51cf&#xff09;\u3001\u91d1\u878d\u652f\u4ed8\u5e73\u53f0&#xff08;\u4ea4\u6613\u5bf9\u8d26\u3001\u8d44\u91d1\u6d41\u8f6c&#xff09;&#xff0c;\u8fd8\u662f\u653f\u52a1\u7ba1\u7406\u7cfb\u7edf&#xff08;\u6570\u636e\u4e0a\u62a5\u3001\u4e1a\u52a1\u5ba1\u6279&#xff09;&#xff0c;\u5747\u5bf9\u6570\u636e\u5e93\u63d0\u51fa\u4ee5\u4e0b\u521a\u6027\u9700\u6c42&#xff1a;<\/p>\n<h4>&#xff08;1&#xff09;\u65e0\u95f4\u65ad\u670d\u52a1&#xff08;\u9ad8\u53ef\u7528&#xff09;<\/h4>\n<p>\u6570\u636e\u5e93\u9700\u5b9e\u73b024\u00d77\u5c0f\u65f6\u4e0d\u95f4\u65ad\u8fd0\u884c&#xff0c;\u907f\u514d\u56e0\u5355\u70b9\u6545\u969c&#xff08;\u5982\u6570\u636e\u5e93\u670d\u52a1\u5668\u5b95\u673a\u3001\u78c1\u76d8\u635f\u574f\u3001\u7f51\u7edc\u4e2d\u65ad&#xff09;\u5bfc\u81f4\u4e1a\u52a1\u4e2d\u65ad\u3002\u4f8b\u5982&#xff1a;\u7535\u5546\u5e73\u53f0\u79d2\u6740\u6d3b\u52a8\u4e2d&#xff0c;\u82e5\u6570\u636e\u5e93\u4e0d\u53ef\u7528&#xff0c;\u5c06\u76f4\u63a5\u5bfc\u81f4\u8ba2\u5355\u65e0\u6cd5\u751f\u6210&#xff0c;\u6bcf\u4e2d\u65ad1\u5206\u949f\u53ef\u80fd\u9020\u6210\u6570\u4e07\u5143\u8425\u6536\u635f\u5931&#xff1b;\u91d1\u878d\u7cfb\u7edf\u4e2d&#xff0c;\u6570\u636e\u5e93\u6545\u969c\u53ef\u80fd\u5f15\u53d1\u4ea4\u6613\u5bf9\u8d26\u5f02\u5e38&#xff0c;\u751a\u81f3\u89e6\u53d1\u5408\u89c4\u98ce\u9669\u3002<\/p>\n<h4>&#xff08;2&#xff09;\u9ad8\u5e76\u53d1\u627f\u8f7d&#xff08;\u8bfb\u5199\u6027\u80fd&#xff09;<\/h4>\n<p>\u968f\u7740\u7528\u6237\u89c4\u6a21\u589e\u957f&#xff0c;\u6570\u636e\u5e93\u9762\u4e34\u7684\u8bfb\u5199\u8bf7\u6c42\u5448\u6307\u6570\u7ea7\u4e0a\u5347&#xff08;\u5982\u65e5\u5747SQL\u6267\u884c\u91cf\u4ece100\u4e07\u6b21\u589e\u81f31\u4ebf\u6b21&#xff09;\u3002\u5355\u53f0\u6570\u636e\u5e93\u670d\u52a1\u5668\u7684CPU\u3001\u5185\u5b58\u3001IO\u80fd\u529b\u6613\u6210\u4e3a\u74f6\u9888&#xff1a;\u8bfb\u8bf7\u6c42\u8fc7\u591a\u4f1a\u5bfc\u81f4\u67e5\u8be2\u5ef6\u8fdf&#xff08;\u5982\u7528\u6237\u67e5\u8be2\u8ba2\u5355\u5217\u8868\u8d85\u65f6&#xff09;&#xff0c;\u5199\u8bf7\u6c42\u96c6\u4e2d\u4f1a\u9020\u6210\u4e8b\u52a1\u963b\u585e&#xff08;\u5982\u591a\u7528\u6237\u540c\u65f6\u63d0\u4ea4\u8ba2\u5355\u5bfc\u81f4\u5e93\u5b58\u66f4\u65b0\u6392\u961f&#xff09;\u3002<\/p>\n<h4>&#xff08;3&#xff09;\u6570\u636e\u96f6\u4e22\u5931&#xff08;\u53ef\u9760\u6027&#xff09;<\/h4>\n<p>\u4e1a\u52a1\u6570\u636e\u9700\u5177\u5907\u201c\u6297\u4e22\u5931\u201d\u80fd\u529b&#xff0c;\u5373\u4f7f\u906d\u9047\u786c\u4ef6\u6545\u969c\u6216\u8f6f\u4ef6\u5f02\u5e38&#xff0c;\u4e5f\u9700\u4fdd\u8bc1\u6570\u636e\u4e0d\u635f\u574f\u3001\u4e0d\u4e22\u5931\u3002\u4f8b\u5982&#xff1a;\u7528\u6237\u5145\u503c\u8bb0\u5f55\u3001\u8ba2\u5355\u4fe1\u606f\u82e5\u56e0\u6570\u636e\u5e93\u6545\u969c\u4e22\u5931&#xff0c;\u5c06\u76f4\u63a5\u5f15\u53d1\u7528\u6237\u6295\u8bc9\u4e0e\u4fe1\u4efb\u5371\u673a&#xff1b;\u540c\u65f6&#xff0c;\u591a\u8282\u70b9\u95f4\u7684\u6570\u636e\u9700\u5b9e\u65f6\u540c\u6b65&#xff0c;\u907f\u514d\u51fa\u73b0\u201c\u4e3b\u5e93\u6570\u636e\u5df2\u66f4\u65b0&#xff0c;\u4ece\u5e93\u4ecd\u5c55\u793a\u65e7\u6570\u636e\u201d\u7684\u4e00\u81f4\u6027\u95ee\u9898\u3002<\/p>\n<h4>&#xff08;4&#xff09;\u7075\u6d3b\u6269\u5c55&#xff08;\u53ef\u6269\u5c55\u6027&#xff09;<\/h4>\n<p>\u4e1a\u52a1\u589e\u957f\u8fc7\u7a0b\u4e2d&#xff0c;\u9700\u652f\u6301\u201c\u6309\u9700\u6269\u5c55\u201d\u6570\u636e\u5e93\u80fd\u529b&#xff1a;\u8bfb\u538b\u529b\u589e\u5927\u65f6\u53ef\u5feb\u901f\u65b0\u589e\u8bfb\u8282\u70b9&#xff0c;\u5199\u538b\u529b\u4e0a\u5347\u65f6\u53ef\u4f18\u5316\u5199\u5206\u53d1\u7b56\u7565&#xff0c;\u907f\u514d\u56e0\u67b6\u6784\u50f5\u5316\u5bfc\u81f4\u201c\u4e1a\u52a1\u5012\u903c\u91cd\u6784\u201d\u7684\u88ab\u52a8\u5c40\u9762\u3002<\/p>\n<h3>1.2 \u4f20\u7edf\u6570\u636e\u5e93\u67b6\u6784\u7684\u75db\u70b9\u4e0e\u5c40\u9650<\/h3>\n<p>\u5728\u91c7\u7528\u300aKeepalived &#043; LVS&#xff08;DR&#xff09;&#043; MariaDB \u4e3b\u4e3b\u300b\u65b9\u6848\u524d&#xff0c;\u591a\u6570\u4f01\u4e1a\u66fe\u4f7f\u7528\u201c\u5355\u8282\u70b9\u6570\u636e\u5e93\u201d\u6216\u201c\u7b80\u5355\u4e3b\u4ece\u67b6\u6784\u201d&#xff0c;\u4f46\u9762\u4e34\u4ee5\u4e0b\u96be\u4ee5\u7a81\u7834\u7684\u74f6\u9888&#xff1a;<\/p>\n<h4>&#xff08;1&#xff09;\u5355\u8282\u70b9\u6570\u636e\u5e93&#xff1a;\u5355\u70b9\u6545\u969c\u98ce\u9669\u81f4\u547d<\/h4>\n<p>\u95ee\u9898\u6838\u5fc3&#xff1a;\u6570\u636e\u5e93\u4ec5\u90e8\u7f72\u5728\u4e00\u53f0\u670d\u52a1\u5668\u4e0a&#xff0c;\u4e00\u65e6\u670d\u52a1\u5668\u786c\u4ef6\u6545\u969c&#xff08;\u5982\u7535\u6e90\u635f\u574f\u3001\u78c1\u76d8\u574f\u9053&#xff09;\u6216\u8f6f\u4ef6\u5d29\u6e83&#xff08;\u5982MariaDB\u8fdb\u7a0b\u5f02\u5e38\u9000\u51fa&#xff09;&#xff0c;\u5c06\u5bfc\u81f4\u5168\u91cf\u4e1a\u52a1\u4e2d\u65ad\u3002<\/p>\n<p>\u6062\u590d\u6548\u7387\u4f4e&#xff1a;\u4f9d\u8d56\u4eba\u5de5\u5e72\u9884\u6062\u590d&#xff08;\u5982\u66f4\u6362\u670d\u52a1\u5668\u3001\u91cd\u5efa\u6570\u636e\u5e93\u3001\u6062\u590d\u5907\u4efd&#xff09;&#xff0c;\u5e73\u5747\u6062\u590d\u65f6\u95f4&#xff08;MTTR&#xff09;\u901a\u5e38\u8d85\u8fc730\u5206\u949f&#xff0c;\u8fdc\u65e0\u6cd5\u6ee1\u8db3\u201c\u79d2\u7ea7\u5207\u6362\u201d\u7684\u4e1a\u52a1\u9700\u6c42&#xff1b;\u82e5\u5907\u4efd\u6570\u636e\u4e0d\u5b8c\u6574&#xff0c;\u8fd8\u53ef\u80fd\u5bfc\u81f4\u90e8\u5206\u4e1a\u52a1\u6570\u636e\u6c38\u4e45\u4e22\u5931\u3002<\/p>\n<h4>&#xff08;2&#xff09;\u7b80\u5355\u4e3b\u4ece\u67b6\u6784&#xff08;\u4e00\u4e3b\u4e00\u4ece&#xff09;&#xff1a;\u8bfb\u5199\u74f6\u9888\u4e0e\u5207\u6362\u7f3a\u9677<\/h4>\n<p>\u8bfb\u6027\u80fd\u5c40\u9650&#xff1a;\u867d\u7136\u901a\u8fc7\u201c\u4e3b\u5e93\u5199\u3001\u4ece\u5e93\u8bfb\u201d\u5206\u644a\u8bfb\u538b\u529b&#xff0c;\u4f46\u4ece\u5e93\u4ec5\u80fd\u6269\u5c55\u8bfb\u80fd\u529b&#xff0c;\u65e0\u6cd5\u7f13\u89e3\u4e3b\u5e93\u7684\u5199\u538b\u529b&#xff08;\u5982\u5927\u91cf\u8ba2\u5355\u5199\u5165\u4ecd\u96c6\u4e2d\u5728\u4e3b\u5e93&#xff09;&#xff1b;\u4e14\u4ece\u5e93\u6570\u91cf\u589e\u591a\u65f6&#xff0c;\u7f3a\u4e4f\u7edf\u4e00\u7684\u8bfb\u8bf7\u6c42\u5206\u53d1\u673a\u5236&#xff0c;\u6613\u5bfc\u81f4\u90e8\u5206\u4ece\u5e93\u8fc7\u8f7d&#xff08;\u5982\u67d0\u53f0\u4ece\u5e93\u627f\u62c580%\u8bfb\u8bf7\u6c42&#xff09;\u3001\u90e8\u5206\u4ece\u5e93\u7a7a\u95f2\u3002<\/p>\n<p>\u9ad8\u53ef\u7528\u7f3a\u9677&#xff1a;\u4e3b\u5e93\u6545\u969c\u65f6&#xff0c;\u9700\u624b\u52a8\u5c06\u4ece\u5e93\u63d0\u5347\u4e3a\u65b0\u4e3b\u5e93&#xff0c;\u518d\u4fee\u6539\u4e1a\u52a1\u7cfb\u7edf\u7684\u6570\u636e\u5e93\u8fde\u63a5\u5730\u5740&#xff0c;\u5207\u6362\u8fc7\u7a0b\u8017\u65f6\u4e14\u6613\u51fa\u9519&#xff08;\u5982\u5fd8\u8bb0\u540c\u6b65\u4ece\u5e93\u672a\u5e94\u7528\u7684binlog\u5bfc\u81f4\u6570\u636e\u4e0d\u4e00\u81f4&#xff09;&#xff1b;\u540c\u65f6&#xff0c;\u4ece\u5e93\u4ec5\u4f5c\u4e3a\u201c\u5907\u7528\u8282\u70b9\u201d&#xff0c;\u5199\u8bf7\u6c42\u59cb\u7ec8\u4f9d\u8d56\u4e3b\u5e93&#xff0c;\u4e3b\u5e93\u5199\u74f6\u9888\u65e0\u6cd5\u7a81\u7834\u3002<\/p>\n<h4>&#xff08;3&#xff09;\u65e0\u8d1f\u8f7d\u5747\u8861&#xff1a;\u8bf7\u6c42\u5206\u53d1\u6df7\u4e71<\/h4>\n<p>\u90e8\u5206\u4f01\u4e1a\u5c1d\u8bd5\u7528\u201c\u4e1a\u52a1\u5c42\u786c\u7f16\u7801\u8fde\u63a5\u5730\u5740\u201d\u5b9e\u73b0\u8bfb\u5199\u5206\u79bb&#xff08;\u5982\u8bfb\u8bf7\u6c42\u8fde\u4ece\u5e93IP&#xff0c;\u5199\u8bf7\u6c42\u8fde\u4e3b\u5e93IP&#xff09;&#xff0c;\u4f46\u5b58\u5728\u4e24\u5927\u95ee\u9898&#xff1a;<\/p>\n<p>\u2460 \u7f3a\u4e4f\u6545\u969c\u68c0\u6d4b\u673a\u5236&#xff1a;\u82e5\u67d0\u53f0\u4ece\u5e93\u5b95\u673a&#xff0c;\u4e1a\u52a1\u5c42\u65e0\u6cd5\u5b9e\u65f6\u611f\u77e5&#xff0c;\u4ecd\u4f1a\u5c06\u8bfb\u8bf7\u6c42\u5206\u53d1\u81f3\u6545\u969c\u8282\u70b9&#xff0c;\u5bfc\u81f4\u90e8\u5206\u8bfb\u4e1a\u52a1\u5931\u8d25&#xff1b;<\/p>\n<p>\u2461 \u6269\u5c55\u6027\u5dee&#xff1a;\u65b0\u589e\u8bfb\u8282\u70b9\u65f6&#xff0c;\u9700\u4fee\u6539\u4e1a\u52a1\u4ee3\u7801\u4e2d\u7684\u8fde\u63a5\u5730\u5740\u5217\u8868&#xff0c;\u91cd\u542f\u670d\u52a1\u624d\u80fd\u751f\u6548&#xff0c;\u4e0d\u7b26\u5408\u201c\u65e0\u611f\u77e5\u6269\u5c55\u201d\u7684\u8fd0\u7ef4\u9700\u6c42\u3002<\/p>\n<h4>&#xff08;4&#xff09;\u6570\u636e\u540c\u6b65\u4e0e\u4e00\u81f4\u6027\u98ce\u9669<\/h4>\n<p>\u4f20\u7edf\u4e3b\u4ece\u67b6\u6784\u4f9d\u8d56MariaDB\u539f\u751f\u7684binlog\u540c\u6b65&#xff0c;\u82e5\u7f51\u7edc\u5ef6\u8fdf\u6216\u4e3b\u5e93binlog\u4e22\u5931&#xff0c;\u4f1a\u5bfc\u81f4\u4ece\u5e93\u6570\u636e\u6ede\u540e\u6216\u540c\u6b65\u5931\u8d25&#xff1b;\u4e14\u4e3b\u5e93\u6545\u969c\u65f6&#xff0c;\u82e5\u4ece\u5e93\u672a\u5b8c\u5168\u540c\u6b65\u4e3b\u5e93\u6570\u636e&#xff0c;\u5f3a\u5236\u5207\u6362\u4f1a\u9020\u6210\u201c\u6570\u636e\u65ad\u5c42\u201d&#xff08;\u5982\u4e3b\u5e93\u5df2\u63d0\u4ea4\u7684\u8ba2\u5355&#xff0c;\u4ece\u5e93\u672a\u8bb0\u5f55&#xff09;\u3002<\/p>\n<h3>1.3 \u6280\u672f\u65b9\u6848\u9009\u578b\u903b\u8f91<\/h3>\n<p>\u9488\u5bf9\u4e0a\u8ff0\u4f20\u7edf\u67b6\u6784\u75db\u70b9&#xff0c;\u672c\u6b21\u91c7\u7528 Keepalived &#043; LVS(DR) &#043; MariaDB\u4e3b\u4e3b \u4f01\u4e1a\u7ea7\u9ad8\u53ef\u7528\u7ec4\u5408&#xff0c;\u5404\u7ec4\u4ef6\u5206\u5de5\u660e\u786e\u3001\u4e92\u8865\u9002\u914d&#xff0c;\u5f7b\u5e95\u89e3\u51b3\u5355\u70b9\u6545\u969c\u3001\u8bfb\u5199\u74f6\u9888\u3001\u6570\u636e\u4e0d\u4e00\u81f4\u3001\u6269\u5bb9\u56f0\u96be\u7b49\u95ee\u9898\u3002<\/p>\n<h4>&#xff08;1&#xff09;MariaDB \u4e3b\u4e3b\u53cc\u6d3b\u67b6\u6784<\/h4>\n<p>\u6452\u5f03\u4f20\u7edf\u201c\u5355\u4e3b\u5199\u3001\u591a\u4ece\u8bfb\u201d\u67b6\u6784&#xff0c;\u91c7\u7528\u53cc\u8282\u70b9\u53cc\u5411\u4e92\u4e3a\u4e3b\u4ece&#xff0c;\u4e24\u53f0\u6570\u636e\u5e93\u5747\u652f\u6301\u8bfb\u5199\u63a5\u5165\u3002\u4e00\u65b9\u9762\u7a81\u7834\u5355\u4e3b\u5199\u5165\u6027\u80fd\u74f6\u9888&#xff0c;\u5199\u5e76\u53d1\u80fd\u529b\u7ffb\u500d&#xff1b;\u53e6\u4e00\u65b9\u9762\u53cc\u8282\u70b9\u5b9e\u65f6binlog\u53cc\u5411\u540c\u6b65&#xff0c;\u4efb\u610f\u8282\u70b9\u5b95\u673a\u5747\u65e0\u6570\u636e\u4e22\u5931&#xff0c;\u5929\u7136\u5b9e\u73b0\u6570\u636e\u5e93\u5c42\u53cc\u6d3b\u5bb9\u707e\u3002<\/p>\n<h4>&#xff08;2&#xff09;LVS-DR \u56db\u5c42\u8d1f\u8f7d\u5747\u8861<\/h4>\n<p>LVS\u5de5\u4f5c\u5728\u56db\u5c42\u4f20\u8f93\u5c42&#xff0c;\u57fa\u4e8eIP&#043;\u7aef\u53e3\u8f6c\u53d1\u8bf7\u6c42&#xff0c;\u8f6c\u53d1\u6027\u80fd\u3001\u5e76\u53d1\u627f\u8f7d\u80fd\u529b\u8fdc\u8d85Nginx\u7b49\u4e03\u5c42\u8d1f\u8f7d\u5747\u8861&#xff0c;\u5355\u673a\u53ef\u652f\u649110\u4e07&#043;\u5e76\u53d1\u8fde\u63a5\u3002DR\u76f4\u63a5\u8def\u7531\u6a21\u5f0f\u6838\u5fc3\u4f18\u52bf&#xff1a;\u8bf7\u6c42\u7ecf\u8fc7LVS\u8c03\u5ea6\u8f6c\u53d1&#xff0c;\u540e\u7aef\u6570\u636e\u5e93\u54cd\u5e94\u6d41\u91cf\u76f4\u63a5\u56de\u5305\u5ba2\u6237\u7aef&#xff0c;\u4e0d\u7ecf\u8fc7LVS\u56de\u7a0b&#xff0c;\u65e0\u5e26\u5bbd\u74f6\u9888&#xff0c;\u8f6c\u53d1\u6548\u7387\u63a5\u8fd1\u7269\u7406\u76f4\u8fde\u3002\u540c\u65f6\u81ea\u5e26\u5b9e\u65f6\u8282\u70b9\u5065\u5eb7\u68c0\u67e5&#xff0c;\u81ea\u52a8\u5254\u9664\u6545\u969c\u6570\u636e\u5e93\u8282\u70b9\u3002<\/p>\n<h4>&#xff08;3&#xff09;Keepalived \u9ad8\u53ef\u7528\u8c03\u5ea6<\/h4>\n<p>\u89e3\u51b3LVS\u8c03\u5ea6\u5668\u81ea\u8eab\u5355\u70b9\u6545\u969c\u95ee\u9898&#xff0c;\u57fa\u4e8eVRRP\u534f\u8bae\u5b9e\u73b0LVS\u4e3b\u5907\u8282\u70b9\u79d2\u7ea7\u6545\u969c\u8f6c\u79fb\u3002\u4e3b\u8282\u70b9\u6545\u969c\u540e&#xff0c;\u5907\u8282\u70b91-3\u79d2\u81ea\u52a8\u63a5\u7ba1VIP\u865a\u62dfIP&#xff0c;\u4e1a\u52a1\u65e0\u611f\u77e5\u3001\u65e0\u9700\u4eba\u5de5\u5e72\u9884&#xff0c;\u5b9e\u73b0\u8d1f\u8f7d\u5747\u8861\u5c42100%\u9ad8\u53ef\u7528\u3002<\/p>\n<h3>1.4 \u9879\u76ee\u4ef7\u503c\u4e0e\u9884\u671f\u76ee\u6807<\/h3>\n<p>\u901a\u8fc7\u6574\u5957\u67b6\u6784\u843d\u5730&#xff0c;\u5b9e\u73b0\u6280\u672f\u3001\u8fd0\u7ef4\u3001\u4e1a\u52a1\u5168\u65b9\u4f4d\u5347\u7ea7&#xff1a;<\/p>\n<p>1. \u9ad8\u53ef\u7528\u5347\u7ea7&#xff1a;\u6570\u636e\u5e93\u670d\u52a1\u53ef\u7528\u6027\u4ece99.9%\u63d0\u5347\u81f399.99%&#xff0c;\u5e74\u5747\u6545\u969c\u4e2d\u65ad\u65f6\u95f4\u5927\u5e45\u7f29\u51cf&#xff0c;\u6838\u5fc3\u4e1a\u52a1\u5b9e\u73b0\u79d2\u7ea7\u5bb9\u707e&#xff1b;<\/p>\n<p>2. \u6027\u80fd\u5927\u5e45\u63d0\u5347&#xff1a;\u7a81\u7834\u5355\u4e3b\u5199\u5165\u74f6\u9888&#xff0c;\u53cc\u4e3b\u5199TPS\u7ffb\u500d&#xff0c;\u8bfb\u8282\u70b9\u53ef\u65e0\u9650\u6a2a\u5411\u6269\u5bb9&#xff0c;SQL\u67e5\u8be2\u54cd\u5e94\u5ef6\u8fdf\u5927\u5e45\u964d\u4f4e&#xff1b;<\/p>\n<p>3. \u6570\u636e\u5b89\u5168\u53ef\u9760&#xff1a;\u53cc\u4e3b\u53cc\u5411\u5b9e\u65f6\u540c\u6b65&#xff0c;\u89c4\u907f\u6570\u636e\u65ad\u5c42\u3001\u6570\u636e\u4e22\u5931\u95ee\u9898&#xff0c;\u6545\u969c\u81ea\u52a8\u8f6c\u79fb&#xff0c;\u5168\u7a0b\u81ea\u52a8\u5316\u5bb9\u707e&#xff1b;<\/p>\n<p>4. \u8fd0\u7ef4\u6781\u7b80\u9ad8\u6548&#xff1a;\u65b0\u589e\u6570\u636e\u5e93\u8282\u70b9\u4ec5\u9700\u63a5\u5165LVS\u96c6\u7fa4&#xff0c;\u65e0\u9700\u4fee\u6539\u4e1a\u52a1\u4ee3\u7801\u3001\u65e0\u9700\u91cd\u542f\u4e1a\u52a1\u670d\u52a1&#xff0c;\u5b9e\u73b0\u65e0\u611f\u6269\u5bb9\u3002<\/p>\n<h2>\u4e8c\u3001MariaDB \u4e3b\u4ece\/\u4e3b\u4e3b\u540c\u6b65\u6838\u5fc3\u539f\u7406<\/h2>\n<h3>2.1 \u6838\u5fc3\u7ec4\u4ef6\u8bf4\u660e<\/h3>\n<p>MariaDB\u4e3b\u4ece\u590d\u5236\u57fa\u4e8ebinlog\u65e5\u5fd7\u5b9e\u73b0&#xff0c;\u6838\u5fc3\u4f9d\u8d56\u65e5\u5fd7\u6587\u4ef6\u4e0e\u4e13\u5c5e\u540c\u6b65\u7ebf\u7a0b&#xff1a;<\/p>\n<p>1. binlog&#xff08;\u4e3b\u5e93\u4e8c\u8fdb\u5236\u65e5\u5fd7&#xff09;&#xff1a;\u6570\u636e\u5e93\u6838\u5fc3\u65e5\u5fd7&#xff0c;\u8bb0\u5f55\u6240\u6709\u589e\u5220\u6539\u3001\u8868\u7ed3\u6784\u53d8\u66f4\u7b49\u6570\u636e\u53d8\u66f4\u64cd\u4f5c&#xff0c;\u662f\u6570\u636e\u540c\u6b65\u7684\u552f\u4e00\u6570\u636e\u6e90&#xff1b;<\/p>\n<p>2. relay log&#xff08;\u4ece\u5e93\u4e2d\u7ee7\u65e5\u5fd7&#xff09;&#xff1a;\u4ece\u5e93\u672c\u5730\u4e34\u65f6\u65e5\u5fd7&#xff0c;\u7528\u4e8e\u7f13\u5b58\u4ece\u4e3b\u5e93\u62c9\u53d6\u7684binlog\u6570\u636e&#xff0c;\u907f\u514d\u7f51\u7edc\u6ce2\u52a8\u5bfc\u81f4\u6570\u636e\u540c\u6b65\u4e2d\u65ad\u3001\u4e22\u5931&#xff1b;<\/p>\n<p>3. \u6838\u5fc3\u540c\u6b65\u7ebf\u7a0b&#xff1a;\u4e3b\u5e93binlog dump\u7ebf\u7a0b&#xff08;\u63a8\u9001\u65e5\u5fd7&#xff09;\u3001\u4ece\u5e93IO\u7ebf\u7a0b&#xff08;\u62c9\u53d6\u65e5\u5fd7&#xff09;\u3001\u4ece\u5e93SQL\u7ebf\u7a0b&#xff08;\u56de\u653e\u65e5\u5fd7&#xff09;\u3002<\/p>\n<h3>2.2 \u6807\u51c6\u4e3b\u4ece\u540c\u6b65\u6d41\u7a0b<\/h3>\n<p>1. \u4e3b\u5e93\u6267\u884c\u6570\u636e\u589e\u5220\u6539\u64cd\u4f5c&#xff0c;\u4e8b\u52a1\u63d0\u4ea4\u540e&#xff0c;\u6709\u5e8f\u5c06\u64cd\u4f5c\u4e8b\u4ef6\u5199\u5165binlog\u65e5\u5fd7&#xff1b;<\/p>\n<p>2. \u4ece\u5e93IO\u7ebf\u7a0b\u4e3b\u52a8\u8fde\u63a5\u4e3b\u5e93&#xff0c;\u643a\u5e26\u65e5\u5fd7\u6587\u4ef6\u540d\u3001\u540c\u6b65\u70b9\u4f4d&#xff0c;\u8bf7\u6c42\u589e\u91cf\u65e5\u5fd7\u6570\u636e&#xff1b;<\/p>\n<p>3. \u4e3b\u5e93binlog dump\u7ebf\u7a0b\u54cd\u5e94\u8bf7\u6c42&#xff0c;\u63a8\u9001\u5bf9\u5e94\u589e\u91cfbinlog\u4e8b\u4ef6\u81f3\u4ece\u5e93&#xff1b;<\/p>\n<p>4. \u4ece\u5e93IO\u7ebf\u7a0b\u63a5\u6536\u65e5\u5fd7&#xff0c;\u5199\u5165\u672c\u5730relay\u4e2d\u7ee7\u65e5\u5fd7&#xff0c;\u5e76\u66f4\u65b0\u540c\u6b65\u70b9\u4f4d\u8bb0\u5f55&#xff1b;<\/p>\n<p>5. \u4ece\u5e93SQL\u7ebf\u7a0b\u5b9e\u65f6\u8bfb\u53d6\u4e2d\u7ee7\u65e5\u5fd7&#xff0c;\u987a\u5e8f\u56de\u653eSQL\u4e8b\u4ef6&#xff0c;\u5b8c\u6210\u6570\u636e\u540c\u6b65&#xff0c;\u6700\u7ec8\u5b9e\u73b0\u4e3b\u4ece\u6570\u636e\u4e00\u81f4\u3002<\/p>\n<h3>2.3 \u4e3b\u4e3b\u590d\u5236\u5b9e\u73b0\u539f\u7406<\/h3>\n<p>\u4e3b\u4e3b\u590d\u5236\u672c\u8d28\u662f\u53cc\u5411\u4e3b\u4ece\u590d\u5236&#xff1a;\u5c06\u4e24\u53f0\u6570\u636e\u5e93\u8282\u70b9\u4e92\u76f8\u914d\u7f6e\u4e3a\u5bf9\u65b9\u7684\u4e3b\u5e93\u548c\u4ece\u5e93&#xff0c;db1\u540c\u6b65db2\u65e5\u5fd7\u3001db2\u540c\u6b65db1\u65e5\u5fd7&#xff0c;\u53cc\u5411\u5b9e\u65f6\u540c\u6b65\u6570\u636e&#xff0c;\u6700\u7ec8\u5b9e\u73b0\u53cc\u8282\u70b9\u6570\u636e\u5b8c\u5168\u4e00\u81f4\u3001\u5747\u53ef\u8bfb\u5199\u63a5\u5165\u3002<\/p>\n<h2>\u4e09\u3001\u9879\u76ee\u5b9e\u9a8c\u73af\u5883<\/h2>\n<p>\u672c\u6b21\u90e8\u7f72\u6240\u6709\u4e3b\u673a\u7edf\u4e00\u7f51\u6bb5\u89c4\u5212\u3001\u89d2\u8272\u660e\u786e&#xff0c;\u9002\u914d\u4f01\u4e1a\u6d4b\u8bd5\/\u751f\u4ea7\u6a21\u62df\u73af\u5883&#xff1a;<br \/>\n<img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/08\/20260814234859-6a7fa96b05b5c.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<table>\n<tr>\u4e3b\u673a\u540dIP \u5730\u5740\u7f51\u5173DNSVIP \u5730\u5740\u670d\u52a1\u5668\u89d2\u8272<\/tr>\n<tbody>\n<tr>\n<td>client2.fb.cloud<\/td>\n<td>10.1.1.21 (vmnet1)<\/td>\n<td>10.1.1.20<\/td>\n<td>223.5.5.5<\/td>\n<td>\u65e0<\/td>\n<td>\u5ba2\u6237\u7aef<\/td>\n<\/tr>\n<tr>\n<td>client1.fb.cloud<\/td>\n<td>10.1.8.21 (vmnet8)<\/td>\n<td>10.1.8.20<\/td>\n<td>223.5.5.5<\/td>\n<td>\u65e0<\/td>\n<td>\u5ba2\u6237\u7aef<\/td>\n<\/tr>\n<tr>\n<td>router.fb.cloud<\/td>\n<td>10.1.8.20 (vmnet8)10.1.1.20 (vmnet1)<\/td>\n<td>10.1.8.2\u65e0\u7f51\u5173<\/td>\n<td>223.5.5.5\u65e0 DNS<\/td>\n<td>\u65e0<\/td>\n<td>\u8def\u7531\u5668<\/td>\n<\/tr>\n<tr>\n<td>ha1.fb.cloud<\/td>\n<td>10.1.8.13 (vmnet8)<\/td>\n<td>10.1.8.20<\/td>\n<td>223.5.5.5<\/td>\n<td>10.1.8.100<\/td>\n<td>LVS&#043;keepalived \u670d\u52a1\u5668<\/td>\n<\/tr>\n<tr>\n<td>ha2.fb.cloud<\/td>\n<td>10.1.8.14 (vmnet8)<\/td>\n<td>10.1.8.20<\/td>\n<td>223.5.5.5<\/td>\n<td>10.1.8.100<\/td>\n<td>LVS&#043;keepalived \u670d\u52a1\u5668<\/td>\n<\/tr>\n<tr>\n<td>db1.fb.cloud<\/td>\n<td>10.1.8.11 (vmnet8)<\/td>\n<td>10.1.8.20<\/td>\n<td>223.5.5.5<\/td>\n<td>10.1.8.100<\/td>\n<td>db \u670d\u52a1\u5668<\/td>\n<\/tr>\n<tr>\n<td>db2.fb.cloud<\/td>\n<td>10.1.8.12 (vmnet8)<\/td>\n<td>10.1.8.20<\/td>\n<td>223.5.5.5<\/td>\n<td>10.1.8.100<\/td>\n<td>db \u670d\u52a1\u5668<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2>\u56db\u3001\u5168\u5c40\u57fa\u7840\u73af\u5883\u914d\u7f6e<\/h2>\n<h3>4.1 \u6240\u6709\u8282\u70b9\u4e3b\u673a\u540d\u4e0eIP\u914d\u7f6e<\/h3>\n<p>\u7edf\u4e00\u914d\u7f6e\u5404\u8282\u70b9\u9759\u6001IP\u3001\u4e3b\u673a\u540d\u3001\u7f51\u5173\u4e0eDNS&#xff0c;\u4fdd\u8bc1\u5185\u7f51\u4e92\u901a&#xff1a;<\/p>\n<p><span class=\"token comment\"># client1 \u914d\u7f6e<\/span><br \/>\nhostnamectl set-hostname client1.fb.cloud<br \/>\nnmcli connection modify ens33 ipv4.method manual ipv4.addresses <span class=\"token number\">10.1<\/span>.8.21\/24 ipv4.gateway <span class=\"token number\">10.1<\/span>.8.20 ipv4.dns <span class=\"token number\">223.5<\/span>.5.5 autoconnect <span class=\"token function\">yes<\/span><br \/>\nnmcli connection up ens33<\/p>\n<p><span class=\"token comment\"># client2 \u914d\u7f6e<\/span><br \/>\nhostnamectl set-hostname client2.fb.cloud<br \/>\nnmcli connection modify ens33 ipv4.method manual ipv4.addresses <span class=\"token number\">10.1<\/span>.1.21\/24 ipv4.gateway <span class=\"token number\">10.1<\/span>.1.20 ipv4.dns <span class=\"token number\">223.5<\/span>.5.5 autoconnect <span class=\"token function\">yes<\/span><br \/>\nnmcli connection up ens33<\/p>\n<p><span class=\"token comment\"># router:<\/span><br \/>\nhostnamectl set-hostname router.fb.cloud<br \/>\nnmcli connection modify ens33 ipv4.method manual ipv4.addresses <span class=\"token number\">10.1<\/span>.8.20\/24 ipv4.gateway <span class=\"token number\">10.1<\/span>.8.2 ipv4.dns <span class=\"token number\">223.5<\/span>.5.5 autoconnect <span class=\"token function\">yes<\/span><br \/>\nnmcli connection up ens33<br \/>\nnmcli connection <span class=\"token function\">add<\/span> <span class=\"token builtin class-name\">type<\/span> ethernet con-name ens36 ifname ens36 ipv4.method manual ipv4.addresses <span class=\"token number\">10.1<\/span>.1.20\/24 autoconnect <span class=\"token function\">yes<\/span><br \/>\nnmcli connection up ens36<\/p>\n<p><span class=\"token comment\"># ha1 \u914d\u7f6e<\/span><br \/>\nhostnamectl set-hostname ha1.fb.cloud<br \/>\nnmcli connection modify ens33 ipv4.method manual ipv4.addresses <span class=\"token number\">10.1<\/span>.8.13\/24 ipv4.gateway <span class=\"token number\">10.1<\/span>.8.20 ipv4.dns <span class=\"token number\">223.5<\/span>.5.5 autoconnect <span class=\"token function\">yes<\/span><br \/>\nnmcli connection up ens33<\/p>\n<p><span class=\"token comment\"># ha2 \u914d\u7f6e<\/span><br \/>\nhostnamectl set-hostname ha2.fb.cloud<br \/>\nnmcli connection modify ens33 ipv4.method manual ipv4.addresses <span class=\"token number\">10.1<\/span>.8.14\/24 ipv4.gateway <span class=\"token number\">10.1<\/span>.8.20 ipv4.dns <span class=\"token number\">223.5<\/span>.5.5 autoconnect <span class=\"token function\">yes<\/span><br \/>\nnmcli connection up ens33<\/p>\n<p><span class=\"token comment\"># db1 \u914d\u7f6e<\/span><br \/>\nhostnamectl set-hostname db1.fb.cloud<br \/>\nnmcli connection modify ens33 ipv4.method manual ipv4.addresses <span class=\"token number\">10.1<\/span>.8.11\/24 ipv4.gateway <span class=\"token number\">10.1<\/span>.8.20 ipv4.dns <span class=\"token number\">223.5<\/span>.5.5 autoconnect <span class=\"token function\">yes<\/span><br \/>\nnmcli connection up ens33<\/p>\n<p><span class=\"token comment\"># db2 \u914d\u7f6e<\/span><br \/>\nhostnamectl set-hostname db2.fb.cloud<br \/>\nnmcli connection modify ens33 ipv4.method manual ipv4.addresses <span class=\"token number\">10.1<\/span>.8.12\/24 ipv4.gateway <span class=\"token number\">10.1<\/span>.8.20 ipv4.dns <span class=\"token number\">223.5<\/span>.5.5 autoconnect <span class=\"token function\">yes<\/span><br \/>\nnmcli connection up ens33<\/p>\n<h3>4.2 \u8def\u7531\u7f51\u5173\u8f6c\u53d1\u914d\u7f6e<\/h3>\n<p>\u8def\u7531\u8282\u70b9\u5f00\u542f\u5185\u6838\u8f6c\u53d1\u3001\u914d\u7f6e\u9632\u706b\u5899\u4f2a\u88c5&#xff0c;\u5b9e\u73b0\u8de8\u7f51\u6bb5\u4e92\u901a&#xff1a;<\/p>\n<p><span class=\"token comment\"># \u5f00\u542f\u5185\u6838IP\u8f6c\u53d1<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;router ~ <span class=\"token number\">22<\/span>:08:06<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># echo &#034;net.ipv4.ip_forward&#061;1&#034; &gt;&gt; \/etc\/sysctl.conf <\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;router ~ <span class=\"token number\">22<\/span>:08:58<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># sysctl -p<\/span><br \/>\nnet.ipv4.ip_forward <span class=\"token operator\">&#061;<\/span> <span class=\"token number\">1<\/span><\/p>\n<p><span class=\"token comment\"># \u9632\u706b\u5899\u914d\u7f6e&#xff0c;\u653e\u884c\u6240\u6709\u6d41\u91cf&#xff0c;\u4e14\u5f00\u542fNAT\u5730\u5740\u4f2a\u88c5\u529f\u80fd<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;router ~ <span class=\"token number\">22<\/span>:09:51<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># systemctl enable firewalld.service &#8211;now<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;router ~ <span class=\"token number\">22<\/span>:10:19<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># firewall-cmd &#8211;set-default-zone&#061;trusted <\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;router ~ <span class=\"token number\">22<\/span>:10:49<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># firewall-cmd &#8211;add-masquerade <\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;router ~ <span class=\"token number\">22<\/span>:11:01<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># firewall-cmd &#8211;add-masquerade &#8211;permanent<\/span><\/p>\n<h2>\u4e94\u3001MariaDB \u5b89\u88c5\u3001\u521d\u59cb\u5316\u4e0e\u4e3b\u4e3b\u540c\u6b65\u90e8\u7f72<\/h2>\n<h3>5.1 db1\u3001db2 \u5b89\u88c5\u6570\u636e\u5e93<\/h3>\n<p><span class=\"token comment\"># \u5b89\u88c5\u670d\u52a1<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;db1-2 ~ <span class=\"token number\">22<\/span>:03:05<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># yum -y install mariadb-server<\/span><\/p>\n<p><span class=\"token comment\"># \u542f\u52a8\u670d\u52a1&#xff0c;\u5e76\u8bbe\u7f6e\u5f00\u673a\u81ea\u542f<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;db1-2 ~ <span class=\"token number\">22<\/span>:13:29<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># systemctl enable mariadb &#8211;now<\/span><\/p>\n<p><span class=\"token comment\"># \u67e5\u770b\u72b6\u6001<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;db1-2 ~ <span class=\"token number\">22<\/span>:13:48<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># systemctl status mariadb<\/span><\/p>\n<p><span class=\"token comment\"># \u5173\u95ed\u9632\u706b\u5899<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;db1-2 ~ <span class=\"token number\">22<\/span>:14:23<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># systemctl disable firewalld &#8211;now<\/span><\/p>\n<h3>5.2 \u6570\u636e\u5e93\u914d\u7f6e\u6587\u4ef6\u4fee\u6539<\/h3>\n<p>db1 \u914d\u7f6e \/etc\/my.cnf.d\/server.cnf<\/p>\n<p><span class=\"token punctuation\">[<\/span>root&#064;db1 ~ <span class=\"token number\">22<\/span>:14:03<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># vim \/etc\/my.cnf.d\/server.cnf<\/span><br \/>\n<span class=\"token comment\"># \u5728\u4e0b\u9762\u65b0\u589e3\u884c<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>mysqld<span class=\"token punctuation\">]<\/span><br \/>\nserver-id<span class=\"token operator\">&#061;<\/span><span class=\"token number\">1<\/span><br \/>\n<span class=\"token assign-left variable\">log_bin<\/span><span class=\"token operator\">&#061;<\/span>mysql-bin<br \/>\n<span class=\"token assign-left variable\">relay_log<\/span><span class=\"token operator\">&#061;<\/span>mysql-relay-bin<\/p>\n<p>db2 \u914d\u7f6e \/etc\/my.cnf.d\/server.cnf<\/p>\n<p><span class=\"token punctuation\">[<\/span>root&#064;db2 ~ <span class=\"token number\">22<\/span>:18:09<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># vim \/etc\/my.cnf.d\/server.cnf<\/span><br \/>\n<span class=\"token comment\"># \u5728\u4e0b\u9762\u65b0\u589e3\u884c<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>mysqld<span class=\"token punctuation\">]<\/span><br \/>\nserver-id<span class=\"token operator\">&#061;<\/span><span class=\"token number\">2<\/span><br \/>\n<span class=\"token assign-left variable\">log_bin<\/span><span class=\"token operator\">&#061;<\/span>mysql-bin<br \/>\n<span class=\"token assign-left variable\">relay_log<\/span><span class=\"token operator\">&#061;<\/span>mysql-relay-bin<\/p>\n<p>\u914d\u7f6e\u5b8c\u6210\u91cd\u542f\u670d\u52a1&#xff1a;<\/p>\n<p><span class=\"token punctuation\">[<\/span>root&#064;db1-2 ~ <span class=\"token number\">22<\/span>:18:15<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># systemctl restart mariadb<\/span><\/p>\n<h3>5.3 \u6570\u636e\u5e93\u5b89\u5168\u521d\u59cb\u5316&#xff08;\u53cc\u8282\u70b9\u4e00\u81f4&#xff09;<\/h3>\n<p><span class=\"token punctuation\">[<\/span>root&#064;db1-2 ~ <span class=\"token number\">22<\/span>:19:09<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># mysql_secure_installation<\/span><\/p>\n<p>\u4ea4\u4e92\u6d41\u7a0b&#xff1a;\u9ed8\u8ba4\u56de\u8f66\u65e0\u5bc6\u7801\u767b\u5f55 &#8211; \u8bbe\u7f6e\u5bc6\u7801\u4e3a huawei &#8211; \u5168\u7a0b\u56de\u8f66\u9ed8\u8ba4\u5220\u9664\u533f\u540d\u7528\u6237\u3001\u7981\u6b62\u8fdc\u7a0broot\u767b\u5f55\u3001\u5220\u9664test\u5e93\u3001\u5237\u65b0\u6743\u9650\u3002<\/p>\n<h3>5.4 \u642d\u5efa\u53cc\u5411\u4e3b\u4e3b\u540c\u6b65<\/h3>\n<h4>5.4.1 db1\u6388\u6743\u540c\u6b65\u7528\u6237\u3001\u67e5\u770b\u4e3b\u5e93\u72b6\u6001<\/h4>\n<p><span class=\"token comment\"># # 1\u3001\u521b\u5efa\u590d\u5236\u7528\u6237repl&#xff0c;\u4ec5\u5141\u8bb8\u4ece10.1.8.12\u8fde\u63a5&#xff0c;\u5bc6\u7801huawei&#xff0c;2\u3001\u6388\u4e88\u590d\u5236\u4ece\u5e93\u3001\u590d\u5236\u5ba2\u6237\u7aef\u6743\u9650&#xff0c;*.*\u5bf9\u5168\u90e8\u5e93\u8868\u751f\u6548<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;db1 ~ <span class=\"token number\">22<\/span>:21:31<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># mysql -uroot -phuawei -e &#034;grant replication slave, replication client on *.* to &#039;repl&#039;&#064;&#039;10.1.8.12&#039; identified by &#039;huawei&#039;;&#034;<\/span><\/p>\n<p><span class=\"token comment\"># \u5237\u65b0\u6743\u9650<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;db1 ~ <span class=\"token number\">22<\/span>:26:46<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># mysql -uroot -phuawei -e &#034;flush privileges;&#034;<\/span><\/p>\n<p><span class=\"token comment\"># \u8f93\u51faFile(\u65e5\u5fd7\u6587\u4ef6\u540d)\u3001Position(\u65e5\u5fd7\u504f\u79fb\u4f4d\u7f6e)&#xff0c;\u7528\u4e8e\u4ece\u5e93\u914d\u7f6e\u590d\u5236\u8d77\u70b9<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;db1 ~ <span class=\"token number\">22<\/span>:28:10<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># mysql -uroot -phuawei -e &#034;show master status;&#034;<\/span><br \/>\n&#043;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#043;&#8212;&#8212;&#8212;-&#043;&#8212;&#8212;&#8212;&#8212;&#8211;&#043;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#043;<br \/>\n<span class=\"token operator\">|<\/span> File             <span class=\"token operator\">|<\/span> Position <span class=\"token operator\">|<\/span> Binlog_Do_DB <span class=\"token operator\">|<\/span> Binlog_Ignore_DB <span class=\"token operator\">|<\/span><br \/>\n&#043;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#043;&#8212;&#8212;&#8212;-&#043;&#8212;&#8212;&#8212;&#8212;&#8211;&#043;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#043;<br \/>\n<span class=\"token operator\">|<\/span> mysql-bin.000001 <span class=\"token operator\">|<\/span>     <span class=\"token number\">1728<\/span> <span class=\"token operator\">|<\/span>              <span class=\"token operator\">|<\/span>                  <span class=\"token operator\">|<\/span><br \/>\n&#043;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#043;&#8212;&#8212;&#8212;-&#043;&#8212;&#8212;&#8212;&#8212;&#8211;&#043;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#043;<\/p>\n<h4>5.4.2 db2\u914d\u7f6e\u540c\u6b65\u6307\u5411db1<\/h4>\n<p>mysql <span class=\"token parameter variable\">-uroot<\/span> <span class=\"token parameter variable\">-phuawei<\/span> <span class=\"token operator\">&lt;&lt;<\/span> <span class=\"token string\">EOF<br \/>\nchange master to<br \/>\nmaster_host&#061;&#039;10.1.8.11&#039;,            # \u4e3b\u5e93IP\u5730\u5740(db1.fb.cloud)<br \/>\nmaster_user&#061;&#039;repl&#039;,                 # \u4e3b\u5e93\u6388\u6743\u7684\u590d\u5236\u8d26\u53f7<br \/>\nmaster_password&#061;&#039;huawei&#039;,           # \u590d\u5236\u8d26\u53f7repl\u7684\u5bc6\u7801<br \/>\nmaster_port&#061;3306,                   # \u4e3b\u5e93MySQL\u670d\u52a1\u7aef\u53e3&#xff0c;\u9ed8\u8ba43306<br \/>\nmaster_log_file&#061;&#039;mysql-bin.000001&#039;, # \u4e3b\u5e93show master status\u83b7\u53d6\u7684binlog\u65e5\u5fd7\u6587\u4ef6\u540d<br \/>\nmaster_log_pos&#061;1728,                # binlog\u65e5\u5fd7\u504f\u79fb\u4f4d\u7f6e&#xff0c;\u4ece\u8be5\u70b9\u4f4d\u5f00\u59cb\u540c\u6b65\u6570\u636e<br \/>\nmaster_connect_retry&#061;30;            # \u8fde\u63a5\u4e3b\u5e93\u5931\u8d25\u540e&#xff0c;\u95f4\u969430\u79d2\u91cd\u8bd5\u8fde\u63a5<br \/>\nstart slave;                        # \u542f\u52a8\u4ece\u5e93IO\u7ebf\u7a0b\u3001SQL\u7ebf\u7a0b&#xff0c;\u5f00\u542f\u4e3b\u4ece\u590d\u5236<br \/>\nEOF<\/span><\/p>\n<p><span class=\"token comment\"># \u7ad6\u884c\u5c55\u793a\u8f93\u51fa&#xff0c;\u91cd\u70b9\u770b Slave_IO_Running\u3001Slave_SQL_Running \u5747\u4e3a Yes<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;db2 ~ <span class=\"token number\">22<\/span>:39:10<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># mysql -uroot -phuawei -e &#034;show slave status\\\\G;&#034;<\/span><\/p>\n<p><span class=\"token comment\"># \u6ce8\u610f\u5982\u679c\u4ece\u5e93\u6709\u65e7\u590d\u5236\u6b8b\u7559&#xff0c;\u6267\u884c\u4e0b\u9762\u547d\u4ee4&#xff0c;\u505c\u6b62\u5e76\u6e05\u7a7a\u65e7\u590d\u5236\u914d\u7f6e<\/span><br \/>\nmysql <span class=\"token parameter variable\">-uroot<\/span> <span class=\"token parameter variable\">-phuawei<\/span> <span class=\"token parameter variable\">-e<\/span> <span class=\"token string\">&#034;stop slave;reset slave all;&#034;<\/span>  <span class=\"token comment\"># \u505c\u6b62\u5e76\u6e05\u7a7a\u65e7\u590d\u5236\u914d\u7f6e<\/span><\/p>\n<p>\u6821\u9a8c&#xff1a;Slave_IO_Running&#061;Yes\u3001Slave_SQL_Running&#061;Yes\u5373\u4e3a\u6b63\u5e38\u3002<\/p>\n<h4>5.4.3 db2\u6388\u6743\u540c\u6b65\u7528\u6237\u3001\u67e5\u770b\u4e3b\u5e93\u72b6\u6001<\/h4>\n<p><span class=\"token punctuation\">[<\/span>root&#064;db2 ~ <span class=\"token number\">22<\/span>:40:05<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># mysql -uroot -phuawei -e &#034;grant replication slave, replication client on *.* to &#039;repl&#039;&#064;&#039;10.1.8.11&#039; identified by &#039;huawei&#039;;&#034;<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;db2 ~ <span class=\"token number\">22<\/span>:45:41<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># mysql -uroot -phuawei -e &#034;flush privileges;&#034;<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;db2 ~ <span class=\"token number\">22<\/span>:45:59<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># mysql -uroot -phuawei -e &#034;show master status&#034;<\/span><br \/>\n&#043;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#043;&#8212;&#8212;&#8212;-&#043;&#8212;&#8212;&#8212;&#8212;&#8211;&#043;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#043;<br \/>\n<span class=\"token operator\">|<\/span> File             <span class=\"token operator\">|<\/span> Position <span class=\"token operator\">|<\/span> Binlog_Do_DB <span class=\"token operator\">|<\/span> Binlog_Ignore_DB <span class=\"token operator\">|<\/span><br \/>\n&#043;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#043;&#8212;&#8212;&#8212;-&#043;&#8212;&#8212;&#8212;&#8212;&#8211;&#043;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#043;<br \/>\n<span class=\"token operator\">|<\/span> mysql-bin.000001 <span class=\"token operator\">|<\/span>     <span class=\"token number\">1728<\/span> <span class=\"token operator\">|<\/span>              <span class=\"token operator\">|<\/span>                  <span class=\"token operator\">|<\/span><br \/>\n&#043;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#043;&#8212;&#8212;&#8212;-&#043;&#8212;&#8212;&#8212;&#8212;&#8211;&#043;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#043;<\/p>\n<h4>5.4.4 db1\u914d\u7f6e\u540c\u6b65\u6307\u5411db2<\/h4>\n<p>mysql <span class=\"token parameter variable\">-uroot<\/span> <span class=\"token parameter variable\">-phuawei<\/span> <span class=\"token operator\">&lt;&lt;<\/span> <span class=\"token string\">EOF<br \/>\nchange master to<br \/>\nmaster_host&#061;&#039;10.1.8.12&#039;,<br \/>\nmaster_user&#061;&#039;repl&#039;,<br \/>\nmaster_password&#061;&#039;huawei&#039;,<br \/>\nmaster_port&#061;3306,<br \/>\nmaster_log_file&#061;&#039;mysql-bin.000001&#039;,<br \/>\nmaster_log_pos&#061;1728,<br \/>\nmaster_connect_retry&#061;30;<br \/>\nstart slave;<br \/>\nEOF<\/span><\/p>\n<p><span class=\"token comment\"># \u7ad6\u884c\u5c55\u793a\u8f93\u51fa&#xff0c;\u91cd\u70b9\u770b Slave_IO_Running\u3001Slave_SQL_Running \u5747\u4e3a Yes<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;db1 ~ <span class=\"token number\">22<\/span>:48:28<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># mysql -uroot -phuawei -e &#034;show slave status\\\\G;&#034;<\/span><\/p>\n<h3>5.5 \u4e3b\u4e3b\u540c\u6b65\u6570\u636e\u9a8c\u8bc1<\/h3>\n<p>db1\u521b\u5efa\u6d4b\u8bd5\u5e93\u8868\u5199\u5165\u6570\u636e&#xff1a;<\/p>\n<p><span class=\"token comment\"># db1\u521b\u5efa<\/span><br \/>\nmysql <span class=\"token parameter variable\">-uroot<\/span> <span class=\"token parameter variable\">-phuawei<\/span> <span class=\"token operator\">&lt;&lt;<\/span> <span class=\"token string\">EOF<br \/>\ncreate database test;<br \/>\nuse test;<br \/>\ncreate table linux(username varchar(15) not null,password varchar(15) not null);<br \/>\ninsert into linux values (&#039;fb1&#039;, &#039;huawei&#039;),(&#039;fb2&#039;, &#039;huawei&#039;),(&#039;fb3&#039;, &#039;huawei&#039;);<br \/>\ncommit;<br \/>\nEOF<\/span><\/p>\n<p><span class=\"token comment\"># db2\u67e5\u770b<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;db2 ~ <span class=\"token number\">22<\/span>:47:28<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># mysql -uroot -phuawei -e &#034;show databases;&#034;<\/span><br \/>\n&#043;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;&#043;<br \/>\n<span class=\"token operator\">|<\/span> Database           <span class=\"token operator\">|<\/span><br \/>\n&#043;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;&#043;<br \/>\n<span class=\"token operator\">|<\/span> information_schema <span class=\"token operator\">|<\/span><br \/>\n<span class=\"token operator\">|<\/span> mysql              <span class=\"token operator\">|<\/span><br \/>\n<span class=\"token operator\">|<\/span> performance_schema <span class=\"token operator\">|<\/span><br \/>\n<span class=\"token operator\">|<\/span> <span class=\"token builtin class-name\">test<\/span>               <span class=\"token operator\">|<\/span><br \/>\n&#043;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;&#043;<\/p>\n<p>db2\u67e5\u8be2\u53ef\u6b63\u5e38\u540c\u6b65\u6570\u636e&#xff1b;\u53cd\u5411\u5728db2\u521b\u5efa\u5e93\u8868&#xff0c;db1\u540c\u6837\u53ef\u540c\u6b65&#xff0c;\u53cc\u5411\u4e3b\u4e3b\u642d\u5efa\u5b8c\u6210\u3002<\/p>\n<h2>\u516d\u3001LVS-DR \u540e\u7aef\u6570\u636e\u5e93\u8282\u70b9\u914d\u7f6e&#xff08;db1\/db2&#xff09;<\/h2>\n<p>DR\u6a21\u5f0f\u6838\u5fc3\u914d\u7f6e&#xff1a;\u4e24\u53f0DB\u8282\u70b9\u5747\u9700\u7ed1\u5b9aVIP\u81f3\u672c\u5730\u865a\u62df\u7f51\u5361&#xff0c;\u5173\u95edARP\u89e3\u6790&#xff0c;\u9632\u6b62IP\u51b2\u7a81\u3001\u56de\u5305\u5f02\u5e38\u3002<\/p>\n<p><span class=\"token comment\"># \u642d\u5efa\u865a\u62df\u7f51\u5361\u627f\u8f7dVIP&#xff08;\u63a9\u7801\u4e3a32\u4f4d&#xff09;&#xff0c;\u5e76\u67e5\u770b\u662f\u5426\u751f\u6210<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;db1 ~ <span class=\"token number\">22<\/span>:49:56<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># nmcli connection add type dummy ifname dummy con-name dummy ipv4.method manual ipv4.addresses 10.1.8.100\/32 autoconnect yes <\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;db1 ~ <span class=\"token number\">22<\/span>:55:51<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># nmcli connection up dummy <\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;db1 ~ <span class=\"token number\">22<\/span>:56:01<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># ip -br a<\/span><br \/>\nlo               UNKNOWN        <span class=\"token number\">127.0<\/span>.0.1\/8 ::1\/128<br \/>\nens33            UP             <span class=\"token number\">10.1<\/span>.8.11\/24 fe80::504c:83ce:f971:1b56\/64 fe80::274b:8373:f96a:1c30\/64 fe80::2a57:8681:577b:52f8\/64<br \/>\ndummy0           DOWN<br \/>\ndummy            UNKNOWN        <span class=\"token number\">10.1<\/span>.8.100\/32 fe80::376e:1fb1:af89:a20c\/64 <\/p>\n<p><span class=\"token comment\"># \u5173\u95edARP\u89e3\u6790\u51b2\u7a81<\/span><br \/>\n<span class=\"token function\">cat<\/span> <span class=\"token operator\">&gt;&gt;<\/span> \/etc\/sysctl.conf <span class=\"token operator\">&lt;&lt;<\/span> <span class=\"token string\">EOF<br \/>\nnet.ipv4.conf.all.arp_ignore &#061; 1<br \/>\nnet.ipv4.conf.all.arp_announce &#061; 2<br \/>\nnet.ipv4.conf.dummy.arp_ignore &#061; 1<br \/>\nnet.ipv4.conf.dummy.arp_announce &#061; 2<br \/>\nEOF<\/span><\/p>\n<p><span class=\"token comment\"># \u751f\u6548\u914d\u7f6e<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;db1 ~ <span class=\"token number\">23<\/span>:01:25<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># sysctl -p<\/span><br \/>\nnet.ipv4.conf.all.arp_ignore <span class=\"token operator\">&#061;<\/span> <span class=\"token number\">1<\/span><br \/>\nnet.ipv4.conf.all.arp_announce <span class=\"token operator\">&#061;<\/span> <span class=\"token number\">2<\/span><br \/>\nnet.ipv4.conf.dummy.arp_ignore <span class=\"token operator\">&#061;<\/span> <span class=\"token number\">1<\/span><br \/>\nnet.ipv4.conf.dummy.arp_announce <span class=\"token operator\">&#061;<\/span> <span class=\"token number\">2<\/span><\/p>\n<h2>\u4e03\u3001Keepalived&#043;LVS \u8c03\u5ea6\u5c42\u90e8\u7f72&#xff08;ha1\/ha2&#xff09;<\/h2>\n<h3>7.1 \u5b89\u88c5\u4f9d\u8d56\u7ec4\u4ef6<\/h3>\n<p><span class=\"token comment\"># \u5b89\u88c5\u8f6f\u4ef6<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;ha1-2 ~ <span class=\"token number\">22<\/span>:03:05<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># yum -y install keepalived ipvsadm<\/span><\/p>\n<p><span class=\"token comment\"># \u5907\u4efd\u914d\u7f6e\u6587\u4ef6<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;ha1-2 ~ <span class=\"token number\">23<\/span>:04:08<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># cp \/etc\/keepalived\/keepalived.conf{,.ori}<\/span><\/p>\n<h3>7.2 ha1 \u4e3b\u8282\u70b9\u914d\u7f6e<\/h3>\n<p><span class=\"token punctuation\">[<\/span>root&#064;ha1 ~ <span class=\"token number\">23<\/span>:05:36<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># vim \/etc\/keepalived\/keepalived.conf<\/span><br \/>\n<span class=\"token operator\">!<\/span> Configuration File <span class=\"token keyword\">for<\/span> keepalived<br \/>\nglobal_defs <span class=\"token punctuation\">{<\/span><br \/>\n   router_id ha1                      <span class=\"token comment\"># \u8bbe\u5907\u552f\u4e00\u6807\u8bc6&#xff0c;\u4e3b\u8282\u70b9\u5199ha1&#xff0c;\u5907\u8282\u70b9ha2<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><\/p>\n<p>vrrp_instance db <span class=\"token punctuation\">{<\/span>                    <span class=\"token comment\"># \u5b9a\u4e49VRRP\u5b9e\u4f8b&#xff0c;\u5b9e\u4f8b\u540d\u79f0\u81ea\u5b9a\u4e49\u4e3adb<\/span><br \/>\n    state MASTER                      <span class=\"token comment\"># \u8282\u70b9\u89d2\u8272&#xff0c;MASTER\u4e3b\u8282\u70b9&#xff1b;\u5907\u8282\u70b9\u8981\u6539\u6210BACKUP<\/span><br \/>\n    interface ens33                   <span class=\"token comment\"># \u7ed1\u5b9a\u7f51\u5361&#xff0c;VIP\u6f02\u79fb\u5230\u8fd9\u5757\u7f51\u5361\u4e0a<\/span><br \/>\n    virtual_router_id <span class=\"token number\">51<\/span>              <span class=\"token comment\"># VRRP\u7ec4ID&#xff0c;\u4e3b\u5907\u8282\u70b9\u5fc5\u987b\u5b8c\u5168\u4e00\u81f4(0\u2011255)<\/span><br \/>\n    priority <span class=\"token number\">110<\/span>                      <span class=\"token comment\"># \u4f18\u5148\u7ea7&#xff0c;\u6570\u503c\u8d8a\u5927\u4f18\u5148\u7ea7\u8d8a\u9ad8&#xff1b;\u5907\u8282\u70b9\u8bbe\u7f6e\u5c0f\u4e8e110&#xff0c;\u4f8b100<\/span><br \/>\n    advert_int <span class=\"token number\">1<\/span>                      <span class=\"token comment\"># VRRP\u901a\u544a\u62a5\u6587\u53d1\u9001\u95f4\u9694&#xff0c;\u5355\u4f4d\u79d2&#xff0c;\u6bcf\u79d2\u53d1\u4e00\u6b21\u5fc3\u8df3<\/span><br \/>\n    authentication <span class=\"token punctuation\">{<\/span>                  <span class=\"token comment\"># VRRP\u901a\u4fe1\u8ba4\u8bc1&#xff0c;\u4e3b\u5907\u5bc6\u7801\u5fc5\u987b\u76f8\u540c<\/span><br \/>\n        auth_type PASS                <span class=\"token comment\"># \u8ba4\u8bc1\u7c7b\u578b&#xff1a;\u5bc6\u7801\u660e\u6587\u8ba4\u8bc1<\/span><br \/>\n        auth_pass <span class=\"token number\">1111<\/span>                <span class=\"token comment\"># VRRP\u7ec4\u5bc6\u7801&#xff0c;\u4e3b\u5907\u8282\u70b9\u5fc5\u987b\u4e00\u6a21\u4e00\u6837<\/span><br \/>\n    <span class=\"token punctuation\">}<\/span><br \/>\n    virtual_ipaddress <span class=\"token punctuation\">{<\/span>               <span class=\"token comment\"># \u914d\u7f6eVIP\u865a\u62dfIP\u5730\u5740<\/span><br \/>\n        <span class=\"token number\">10.1<\/span>.8.100\/24                 <span class=\"token comment\"># VIP\u5730\u5740&#xff0c;24\u4f4d\u5b50\u7f51\u63a9\u7801&#xff0c;\u4f1a\u6f02\u79fb\u5728\u4e3b\u5907\u8282\u70b9\u4e4b\u95f4<\/span><br \/>\n    <span class=\"token punctuation\">}<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><\/p>\n<p>virtual_server <span class=\"token number\">10.1<\/span>.8.100 <span class=\"token number\">3306<\/span> <span class=\"token punctuation\">{<\/span>      <span class=\"token comment\"># LVS\u865a\u62df\u670d\u52a1&#xff0c;VIP&#043;\u7aef\u53e3&#xff0c;\u5bf9\u5916\u63d0\u4f9bmysql\u8bbf\u95ee<\/span><br \/>\n    delay_loop <span class=\"token number\">6<\/span>                      <span class=\"token comment\"># \u540e\u7aefreal_server\u5065\u5eb7\u68c0\u67e5\u5faa\u73af\u95f4\u9694&#xff0c;\u5355\u4f4d\u79d2&#xff0c;\u6bcf6\u79d2\u68c0\u67e5\u4e00\u6b21<\/span><br \/>\n    lb_algo rr                        <span class=\"token comment\"># \u8d1f\u8f7d\u5747\u8861\u8c03\u5ea6\u7b97\u6cd5&#xff0c;rr&#061;\u8f6e\u8be2<\/span><br \/>\n    lb_kind DR                        <span class=\"token comment\"># LVS\u5de5\u4f5c\u6a21\u5f0f&#xff0c;DR\u76f4\u63a5\u8def\u7531\u6a21\u5f0f<\/span><br \/>\n    persistence_timeout <span class=\"token number\">50<\/span>            <span class=\"token comment\"># \u4f1a\u8bdd\u4fdd\u6301\u65f6\u95f450\u79d2&#xff0c;\u540c\u4e00\u5ba2\u6237\u7aef50\u79d2\u5185\u8c03\u5ea6\u5230\u540c\u4e00\u540e\u7aef<\/span><br \/>\n    protocol TCP                      <span class=\"token comment\"># \u8d1f\u8f7d\u5747\u8861\u534f\u8bae&#xff0c;MySQL\u4f7f\u7528TCP<\/span><\/p>\n<p>    real_server <span class=\"token number\">10.1<\/span>.8.11 <span class=\"token number\">3306<\/span> <span class=\"token punctuation\">{<\/span>      <span class=\"token comment\"># \u540e\u7aef\u771f\u5b9e\u670d\u52a1\u5668db1&#xff0c;IP&#043;mysql\u7aef\u53e3<\/span><br \/>\n        weight <span class=\"token number\">1<\/span>                      <span class=\"token comment\"># \u6743\u91cd&#xff0c;\u8c03\u5ea6\u6743\u91cd&#xff0c;\u4e24\u53f0\u6743\u91cd\u4e00\u6837\u4ee3\u8868\u5747\u5206\u6d41\u91cf<\/span><br \/>\n        TCP_CHECK <span class=\"token punctuation\">{<\/span>                   <span class=\"token comment\"># \u4f7f\u7528TCP\u65b9\u5f0f\u505a\u540e\u7aef\u670d\u52a1\u5065\u5eb7\u68c0\u6d4b<\/span><br \/>\n            connect_timeout <span class=\"token number\">3<\/span>         <span class=\"token comment\"># \u8fde\u63a5\u8d85\u65f6\u65f6\u95f43\u79d2&#xff0c;\u8fde\u4e0d\u4e0a\u5224\u5b9a\u670d\u52a1\u6545\u969c<\/span><br \/>\n            retry <span class=\"token number\">3<\/span>                   <span class=\"token comment\"># \u5931\u8d25\u91cd\u8bd5\u6b21\u6570&#xff0c;\u6700\u591a\u91cd\u8bd53\u6b21<\/span><br \/>\n            delay_before_retry <span class=\"token number\">3<\/span>      <span class=\"token comment\"># \u6bcf\u6b21\u91cd\u8bd5\u4e4b\u95f4\u7b49\u5f85\u95f4\u96943\u79d2<\/span><br \/>\n        <span class=\"token punctuation\">}<\/span><br \/>\n    <span class=\"token punctuation\">}<\/span><br \/>\n    real_server <span class=\"token number\">10.1<\/span>.8.12 <span class=\"token number\">3306<\/span> <span class=\"token punctuation\">{<\/span>      <span class=\"token comment\"># \u540e\u7aef\u771f\u5b9e\u670d\u52a1\u5668db2&#xff0c;IP&#043;mysql\u7aef\u53e3<\/span><br \/>\n        weight <span class=\"token number\">1<\/span>                      <span class=\"token comment\"># \u8c03\u5ea6\u6743\u91cd<\/span><br \/>\n        TCP_CHECK <span class=\"token punctuation\">{<\/span>                   <span class=\"token comment\"># TCP\u5065\u5eb7\u68c0\u67e5<\/span><br \/>\n            connect_timeout <span class=\"token number\">3<\/span>         <span class=\"token comment\"># TCP\u8fde\u63a5\u8d85\u65f63\u79d2<\/span><br \/>\n            retry <span class=\"token number\">3<\/span>                   <span class=\"token comment\"># \u5931\u8d25\u91cd\u8bd53\u6b21<\/span><br \/>\n            delay_before_retry <span class=\"token number\">3<\/span>      <span class=\"token comment\"># \u91cd\u8bd5\u524d\u7b49\u5f853\u79d2<\/span><br \/>\n        <span class=\"token punctuation\">}<\/span><br \/>\n    <span class=\"token punctuation\">}<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><\/p>\n<h3>7.3 ha2 \u5907\u8282\u70b9\u914d\u7f6e<\/h3>\n<p><span class=\"token punctuation\">[<\/span>root&#064;ha2 ~ <span class=\"token number\">23<\/span>:08:30<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># vim \/etc\/keepalived\/keepalived.conf<\/span><br \/>\n<span class=\"token operator\">!<\/span> Configuration File <span class=\"token keyword\">for<\/span> keepalived<\/p>\n<p>global_defs <span class=\"token punctuation\">{<\/span><br \/>\n   router_id ha2<br \/>\n<span class=\"token punctuation\">}<\/span><\/p>\n<p>vrrp_instance db <span class=\"token punctuation\">{<\/span><br \/>\n    state BACKUP<br \/>\n    interface ens33<br \/>\n    virtual_router_id <span class=\"token number\">51<\/span><br \/>\n    priority <span class=\"token number\">100<\/span><br \/>\n    advert_int <span class=\"token number\">1<\/span><br \/>\n    authentication <span class=\"token punctuation\">{<\/span><br \/>\n        auth_type PASS<br \/>\n        auth_pass <span class=\"token number\">1111<\/span><br \/>\n    <span class=\"token punctuation\">}<\/span><br \/>\n    virtual_ipaddress <span class=\"token punctuation\">{<\/span><br \/>\n        <span class=\"token number\">10.1<\/span>.8.100\/24<br \/>\n    <span class=\"token punctuation\">}<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><\/p>\n<p>virtual_server <span class=\"token number\">10.1<\/span>.8.100 <span class=\"token number\">3306<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n    delay_loop <span class=\"token number\">6<\/span><br \/>\n    lb_algo rr<br \/>\n    lb_kind DR<br \/>\n    persistence_timeout <span class=\"token number\">50<\/span><br \/>\n    protocol TCP<\/p>\n<p>    real_server <span class=\"token number\">10.1<\/span>.8.11 <span class=\"token number\">3306<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n        weight <span class=\"token number\">1<\/span><br \/>\n        TCP_CHECK <span class=\"token punctuation\">{<\/span><br \/>\n            connect_timeout <span class=\"token number\">3<\/span><br \/>\n            retry <span class=\"token number\">3<\/span><br \/>\n            delay_before_retry <span class=\"token number\">3<\/span><br \/>\n        <span class=\"token punctuation\">}<\/span><br \/>\n    <span class=\"token punctuation\">}<\/span><br \/>\n    real_server <span class=\"token number\">10.1<\/span>.8.12 <span class=\"token number\">3306<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n        weight <span class=\"token number\">1<\/span><br \/>\n        TCP_CHECK <span class=\"token punctuation\">{<\/span><br \/>\n            connect_timeout <span class=\"token number\">3<\/span><br \/>\n            retry <span class=\"token number\">3<\/span><br \/>\n            delay_before_retry <span class=\"token number\">3<\/span><br \/>\n        <span class=\"token punctuation\">}<\/span><br \/>\n    <span class=\"token punctuation\">}<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><\/p>\n<h3>7.4 \u542f\u52a8\u9ad8\u53ef\u7528\u670d\u52a1<\/h3>\n<p><span class=\"token comment\"># ha1\u548cha2\u542f\u52a8\u670d\u52a1&#xff0c;\u5e76\u5f00\u542f\u5f00\u673a\u81ea\u542f<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;ha1-2 ~ <span class=\"token number\">23<\/span>:20:07<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># systemctl enable keepalived &#8211;now<\/span><\/p>\n<p><span class=\"token comment\"># ha1\u548cha2\u5173\u95ed\u9632\u706b\u5899<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;ha1-2 ~ <span class=\"token number\">23<\/span>:20:42<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># systemctl disable firewalld &#8211;now<\/span><\/p>\n<p><span class=\"token comment\"># ha1\u67e5\u770b\u751f\u6548\u60c5\u51b5<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;ha1 ~ <span class=\"token number\">23<\/span>:20:30<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># ip -br a<\/span><br \/>\nlo               UNKNOWN        <span class=\"token number\">127.0<\/span>.0.1\/8 ::1\/128<br \/>\nens33            UP             <span class=\"token number\">10.1<\/span>.8.13\/24 <span class=\"token number\">10.1<\/span>.8.100\/24 <\/p>\n<h2>\u516b\u3001\u4e1a\u52a1\u6d4b\u8bd5\u7528\u6237\u6388\u6743\u4e0e\u8fde\u901a\u6027\u6d4b\u8bd5<\/h2>\n<h3>8.1 \u6570\u636e\u5e93\u6388\u6743\u8fdc\u7a0b\u6d4b\u8bd5\u8d26\u53f7<\/h3>\n<p><span class=\"token punctuation\">[<\/span>root&#064;db1 ~ <span class=\"token number\">23<\/span>:01:33<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># mysql -uroot -phuawei -e &#034;grant ALL PRIVILEGES on *.* to &#039;fb&#039;&#064;&#039;%&#039; identified by &#039;huawei&#039;;&#034;<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;db1 ~ <span class=\"token number\">23<\/span>:31:01<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># mysql -uroot -phuawei -e &#034;FLUSH PRIVILEGES;&#034;<\/span><\/p>\n<h3>8.2 \u5ba2\u6237\u7aef\u8fde\u63a5\u6d4b\u8bd5<\/h3>\n<p><span class=\"token comment\"># \u5ba2\u6237\u7aefmariadb\u5de5\u5177<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;client1 ~ <span class=\"token number\">22<\/span>:03:04<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># yum -y install mariadb<\/span><\/p>\n<p><span class=\"token comment\"># \u901a\u8fc7VIP\u865a\u62df\u5165\u53e3\u8fde\u63a5\u6570\u636e\u5e93\u96c6\u7fa4<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;client1 ~ <span class=\"token number\">23<\/span>:32:35<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># mysql -ufb -phuawei -h 10.1.8.100<\/span><br \/>\nWelcome to the MariaDB monitor.  Commands end with <span class=\"token punctuation\">;<\/span> or <span class=\"token punctuation\">\\\\<\/span>g.<br \/>\nYour MariaDB connection <span class=\"token function\">id<\/span> is <span class=\"token number\">299<\/span><br \/>\nServer version: <span class=\"token number\">5.5<\/span>.68-MariaDB MariaDB Server<\/p>\n<p>Copyright <span class=\"token punctuation\">(<\/span>c<span class=\"token punctuation\">)<\/span> <span class=\"token number\">2000<\/span>, <span class=\"token number\">2018<\/span>, Oracle, MariaDB Corporation Ab and others.<\/p>\n<p>Type <span class=\"token string\">&#039;help;&#039;<\/span> or <span class=\"token string\">&#039;\\\\h&#039;<\/span> <span class=\"token keyword\">for<\/span> help. Type <span class=\"token string\">&#039;\\\\c&#039;<\/span> to <span class=\"token function\">clear<\/span> the current input statement.<\/p>\n<p>MariaDB <span class=\"token punctuation\">[<\/span><span class=\"token punctuation\">(<\/span>none<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">]<\/span><span class=\"token operator\">&gt;<\/span> <\/p>\n<p><span class=\"token comment\"># \u5f53\u524d\u8bbf\u95ee\u7684\u662fdb2\u6570\u636e\u5e93<\/span><br \/>\nMariaDB <span class=\"token punctuation\">[<\/span><span class=\"token punctuation\">(<\/span>none<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">]<\/span><span class=\"token operator\">&gt;<\/span> <span class=\"token keyword\">select<\/span> &#064;&#064;hostname<span class=\"token punctuation\">;<\/span><br \/>\n&#043;&#8212;&#8212;&#8212;&#8212;&#8211;&#043;<br \/>\n<span class=\"token operator\">|<\/span> &#064;&#064;hostname   <span class=\"token operator\">|<\/span><br \/>\n&#043;&#8212;&#8212;&#8212;&#8212;&#8211;&#043;<br \/>\n<span class=\"token operator\">|<\/span> db2.fb.cloud <span class=\"token operator\">|<\/span><br \/>\n&#043;&#8212;&#8212;&#8212;&#8212;&#8211;&#043;<br \/>\n<span class=\"token number\">1<\/span> row <span class=\"token keyword\">in<\/span> <span class=\"token builtin class-name\">set<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token number\">0.01<\/span> sec<span class=\"token punctuation\">)<\/span><\/p>\n<p>MariaDB <span class=\"token punctuation\">[<\/span><span class=\"token punctuation\">(<\/span>none<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">]<\/span><span class=\"token operator\">&gt;<\/span> <\/p>\n<h2>\u4e5d\u3001\u5168\u573a\u666f\u9ad8\u53ef\u7528\u6545\u969c\u6a21\u62df\u6d4b\u8bd5<\/h2>\n<p>\u9a8c\u8bc1\u96c6\u7fa4\u5bb9\u707e\u80fd\u529b&#xff0c;\u6a21\u62df\u751f\u4ea7\u5e38\u89c1\u6545\u969c&#xff1a;<\/p>\n<h3>9.1 \u8c03\u5ea6\u5668\u4e3b\u8282\u70b9\u6545\u969c\u8f6c\u79fb<\/h3>\n<p><span class=\"token comment\"># \u505c\u6b62\u4e3b\u8282\u70b9ha1 keepalived<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;ha1 ~ <span class=\"token number\">23<\/span>:24:34<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># systemctl stop keepalived<\/span><\/p>\n<p><span class=\"token comment\"># ha2\u6210\u4e86\u4e3b\u8282\u70b9<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;ha2 ~ <span class=\"token number\">23<\/span>:24:45<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># ip -br a<\/span><br \/>\nlo               UNKNOWN        <span class=\"token number\">127.0<\/span>.0.1\/8 ::1\/128<br \/>\nens33            UP             <span class=\"token number\">10.1<\/span>.8.14\/24 <span class=\"token number\">10.1<\/span>.8.100\/24 <\/p>\n<p><span class=\"token comment\"># \u5ba2\u6237\u7aef\u53ef\u4ee5\u6b63\u5e38\u8bbf\u95ee<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;client1 ~ <span class=\"token number\">23<\/span>:36:27<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># mysql -ufb -phuawei -h 10.1.8.100<\/span><br \/>\nWelcome to the MariaDB monitor.  Commands end with <span class=\"token punctuation\">;<\/span> or <span class=\"token punctuation\">\\\\<\/span>g.<br \/>\nYour MariaDB connection <span class=\"token function\">id<\/span> is <span class=\"token number\">357<\/span><br \/>\nServer version: <span class=\"token number\">5.5<\/span>.68-MariaDB MariaDB Server<\/p>\n<p>Copyright <span class=\"token punctuation\">(<\/span>c<span class=\"token punctuation\">)<\/span> <span class=\"token number\">2000<\/span>, <span class=\"token number\">2018<\/span>, Oracle, MariaDB Corporation Ab and others.<\/p>\n<p>Type <span class=\"token string\">&#039;help;&#039;<\/span> or <span class=\"token string\">&#039;\\\\h&#039;<\/span> <span class=\"token keyword\">for<\/span> help. Type <span class=\"token string\">&#039;\\\\c&#039;<\/span> to <span class=\"token function\">clear<\/span> the current input statement.<\/p>\n<p>MariaDB <span class=\"token punctuation\">[<\/span><span class=\"token punctuation\">(<\/span>none<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">]<\/span><span class=\"token operator\">&gt;<\/span> <\/p>\n<p>\u73b0\u8c61&#xff1a;VIP\u81ea\u52a8\u6f02\u79fb\u81f3ha2\u5907\u8282\u70b9&#xff0c;\u5ba2\u6237\u7aef\u6570\u636e\u5e93\u8fde\u63a5\u65e0\u4e2d\u65ad\u3001\u65e0\u62a5\u9519&#xff0c;\u4e1a\u52a1\u6b63\u5e38\u8fd0\u884c\u3002<\/p>\n<h3>9.2 \u540e\u7aef\u6570\u636e\u5e93\u8282\u70b9\u6545\u969c\u5254\u9664<\/h3>\n<p><span class=\"token comment\"># \u505c\u6b62db2\u6570\u636e\u5e93\u670d\u52a1<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;db2 ~ <span class=\"token number\">23<\/span>:01:33<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># systemctl stop mariadb<\/span><\/p>\n<p><span class=\"token comment\"># \u5ba2\u6237\u7aef\u8bbf\u95ee\u6b63\u5e38&#xff0c;\u8bbf\u95ee\u7684\u662fdb1\u6570\u636e\u5e93<\/span><br \/>\nMariaDB <span class=\"token punctuation\">[<\/span><span class=\"token punctuation\">(<\/span>none<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">]<\/span><span class=\"token operator\">&gt;<\/span> <span class=\"token keyword\">select<\/span> &#064;&#064;hostname<span class=\"token punctuation\">;<\/span><br \/>\n&#043;&#8212;&#8212;&#8212;&#8212;&#8211;&#043;<br \/>\n<span class=\"token operator\">|<\/span> &#064;&#064;hostname   <span class=\"token operator\">|<\/span><br \/>\n&#043;&#8212;&#8212;&#8212;&#8212;&#8211;&#043;<br \/>\n<span class=\"token operator\">|<\/span> db1.fb.cloud <span class=\"token operator\">|<\/span><br \/>\n&#043;&#8212;&#8212;&#8212;&#8212;&#8211;&#043;<br \/>\n<span class=\"token number\">1<\/span> row <span class=\"token keyword\">in<\/span> <span class=\"token builtin class-name\">set<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token number\">0.01<\/span> sec<span class=\"token punctuation\">)<\/span><\/p>\n<p>MariaDB <span class=\"token punctuation\">[<\/span><span class=\"token punctuation\">(<\/span>none<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">]<\/span><span class=\"token operator\">&gt;<\/span> <\/p>\n<p>\u73b0\u8c61&#xff1a;LVS\u5065\u5eb7\u68c0\u67e5\u68c0\u6d4b\u8282\u70b9\u5931\u6548&#xff0c;\u81ea\u52a8\u5254\u9664db1&#xff0c;\u6240\u6709\u8bf7\u6c42\u81ea\u52a8\u8c03\u5ea6\u81f3db2&#xff0c;\u4e1a\u52a1\u8bfb\u5199\u6b63\u5e38\u3002<\/p>\n<h3>9.3 \u6545\u969c\u8282\u70b9\u6062\u590d\u81ea\u6108<\/h3>\n<p><span class=\"token comment\"># \u91cd\u542f\u6545\u969c\u8282\u70b9\u670d\u52a1<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;db2 ~ <span class=\"token number\">23<\/span>:37:56<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># systemctl start mariadb<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;ha1 ~ <span class=\"token number\">23<\/span>:34:32<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># systemctl start keepalived<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;ha1 ~ <span class=\"token number\">23<\/span>:41:56<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># ip -br a<\/span><br \/>\nlo               UNKNOWN        <span class=\"token number\">127.0<\/span>.0.1\/8 ::1\/128<br \/>\nens33            UP             <span class=\"token number\">10.1<\/span>.8.13\/24 <span class=\"token number\">10.1<\/span>.8.100\/24 <\/p>\n<p>\u73b0\u8c61&#xff1a;\u8282\u70b9\u6062\u590d\u540e&#xff0c;LVS\u81ea\u52a8\u91cd\u65b0\u7eb3\u5165\u96c6\u7fa4&#xff0c;\u91cd\u65b0\u53c2\u4e0e\u8d1f\u8f7d\u5747\u8861\u8c03\u5ea6&#xff0c;\u96c6\u7fa4\u81ea\u6108\u5b8c\u6210\u3002<\/p>\n<h2>\u5341\u3001\u751f\u4ea7\u6838\u5fc3\u6ce8\u610f\u4e8b\u9879&#xff08;\u907f\u5751\u6307\u5357&#xff09;<\/h2>\n<h3>10.1 LVS\u914d\u7f6e\u786c\u6027\u9650\u5236<\/h3>\n<p>Keepalived \u7684 real_server\u4ec5\u652f\u6301IP\u5730\u5740&#xff0c;\u4e0d\u652f\u6301\u57df\u540d\u3002\u56e0\u4e3aLVS\u5de5\u4f5c\u5728\u56db\u5c42\u4f20\u8f93\u5c42&#xff0c;\u65e0DNS\u89e3\u6790\u80fd\u529b&#xff0c;\u586b\u5199\u57df\u540d\u4f1a\u76f4\u63a5\u62a5\u9519\u542f\u52a8\u5931\u8d25&#xff0c;\u751f\u4ea7\u73af\u5883\u5fc5\u987b\u5199\u6b7b\u540e\u7aef\u771f\u5b9eIP\u3002<\/p>\n<h3>10.2 DR\u6a21\u5f0f\u5fc5\u914d\u9879<\/h3>\n<p>\u6240\u6709\u540e\u7aefRS\u8282\u70b9\u5fc5\u987b\u914d\u7f6e\u865a\u62df\u7f51\u5361\u7ed1\u5b9aVIP\u3001\u5173\u95edARP\u89e3\u6790&#xff0c;\u5426\u5219\u4f1a\u51fa\u73b0IP\u5730\u5740\u51b2\u7a81\u3001\u56de\u5305\u8def\u7531\u5f02\u5e38&#xff0c;\u5bfc\u81f4\u6570\u636e\u5e93\u8fde\u63a5\u65f6\u901a\u65f6\u65ad\u3002<\/p>\n<h3>10.3 \u4e3b\u4e3b\u590d\u5236\u751f\u4ea7\u4f18\u5316<\/h3>\n<p>\u6d4b\u8bd5\u73af\u5883\u65e0\u4e3b\u952e\u51b2\u7a81\u95ee\u9898&#xff0c;\u751f\u4ea7\u73af\u5883\u5fc5\u987b\u914d\u7f6e\u81ea\u589eID\u504f\u79fb&#xff0c;\u907f\u514d\u53cc\u4e3b\u540c\u65f6\u5199\u5165\u4ea7\u751f\u4e3b\u952e\u91cd\u590d\u3001\u6570\u636e\u5199\u5165\u5931\u8d25\u3002<\/p>\n<h3>10.4 \u5065\u5eb7\u68c0\u67e5\u4f18\u5316<\/h3>\n<p>\u9ed8\u8ba4\u4ec5\u68c0\u6d4b3306\u7aef\u53e3\u5b58\u6d3b&#xff0c;\u65e0\u6cd5\u5224\u65ad\u6570\u636e\u5e93\u771f\u5b9e\u8bfb\u5199\u72b6\u6001\u3002\u751f\u4ea7\u5efa\u8bae\u81ea\u5b9a\u4e49shell\u811a\u672c&#xff0c;\u68c0\u6d4b\u6570\u636e\u5e93\u67e5\u8be2\u3001\u5199\u5165\u53ef\u7528\u6027&#xff0c;\u5b9e\u73b0\u7cbe\u51c6\u6545\u969c\u5254\u9664\u3002<\/p>\n<h3>10.5 \u6743\u9650\u4e0e\u5b89\u5168\u52a0\u56fa<\/h3>\n<p>\u6d4b\u8bd5\u73af\u5883\u5168\u6743\u9650\u5f00\u653e&#xff0c;\u751f\u4ea7\u9700\u4e25\u683c\u6536\u7d27\u6570\u636e\u5e93\u8fdc\u7a0b\u6743\u9650\u3001\u7981\u7528\u4e0d\u5fc5\u8981\u8d26\u53f7\u3001\u4fee\u6539\u9ed8\u8ba4\u5bc6\u7801\u3001\u5f00\u542f\u9632\u706b\u5899\u7aef\u53e3\u767d\u540d\u5355&#xff0c;\u89c4\u907f\u5b89\u5168\u98ce\u9669\u3002<\/p>\n<h2>\u5341\u4e00\u3001\u67b6\u6784\u603b\u7ed3<\/h2>\n<p>Keepalived&#043;LVS(DR)&#043;MariaDB\u4e3b\u4e3b \u662f\u4e2d\u5c0f\u4f01\u4e1a\u6027\u4ef7\u6bd4\u6781\u9ad8\u7684\u6570\u636e\u5e93\u9ad8\u53ef\u7528\u89e3\u51b3\u65b9\u6848&#xff0c;\u5f7b\u5e95\u89e3\u51b3\u4f20\u7edf\u67b6\u6784\u56db\u5927\u75db\u70b9&#xff1a;<\/p>\n<p>1. \u5f7b\u5e95\u6d88\u9664\u5355\u70b9\u6545\u969c&#xff1a;\u8c03\u5ea6\u5c42\u4e3b\u5907\u6f02\u79fb\u3001\u6570\u636e\u5e93\u5c42\u53cc\u6d3b\u5197\u4f59&#xff0c;\u5168\u7a0b\u81ea\u52a8\u5bb9\u707e&#xff1b;<\/p>\n<p>2. \u6027\u80fd\u5927\u5e45\u63d0\u5347&#xff1a;\u56db\u5c42LVS\u9ad8\u5e76\u53d1\u8f6c\u53d1\u3001\u53cc\u4e3b\u5206\u62c5\u5199\u5165\u538b\u529b&#xff0c;\u7a81\u7834\u5355\u5e93\u6027\u80fd\u74f6\u9888&#xff1b;<\/p>\n<p>3. \u6570\u636e\u5b89\u5168\u53ef\u63a7&#xff1a;\u53cc\u5411\u5b9e\u65f6\u540c\u6b65&#xff0c;\u89c4\u907f\u6570\u636e\u5ef6\u8fdf\u3001\u4e22\u5931\u3001\u65ad\u5c42\u95ee\u9898&#xff1b;<\/p>\n<p>4. \u8fd0\u7ef4\u6781\u7b80&#xff1a;\u7edf\u4e00VIP\u5165\u53e3\u3001\u65e0\u611f\u6269\u5bb9\u3001\u81ea\u52a8\u6545\u969c\u8f6c\u79fb&#xff0c;\u5927\u5e45\u964d\u4f4e\u8fd0\u7ef4\u6210\u672c\u3002<\/p>\n<p>\u6574\u5957\u67b6\u6784\u7a33\u5b9a\u53ef\u9760\u3001\u53ef\u76f4\u63a5\u843d\u5730\u751f\u4ea7&#xff0c;\u9002\u5408\u7535\u5546\u3001\u91d1\u878d\u3001\u653f\u52a1\u7b49\u6838\u5fc3\u4e1a\u52a1\u6570\u636e\u5e93\u9ad8\u53ef\u7528\u573a\u666f\u90e8\u7f72\u3002<br \/>\n\u542f\u52a8\u5931\u8d25&#xff0c;\u751f\u4ea7\u73af\u5883\u5fc5\u987b\u5199\u6b7b\u540e\u7aef\u771f\u5b9eIP\u3002<\/p>\n<h3>10.2 DR\u6a21\u5f0f\u5fc5\u914d\u9879<\/h3>\n<p>\u6240\u6709\u540e\u7aefRS\u8282\u70b9\u5fc5\u987b\u914d\u7f6e\u865a\u62df\u7f51\u5361\u7ed1\u5b9aVIP\u3001\u5173\u95edARP\u89e3\u6790&#xff0c;\u5426\u5219\u4f1a\u51fa\u73b0IP\u5730\u5740\u51b2\u7a81\u3001\u56de\u5305\u8def\u7531\u5f02\u5e38&#xff0c;\u5bfc\u81f4\u6570\u636e\u5e93\u8fde\u63a5\u65f6\u901a\u65f6\u65ad\u3002<\/p>\n<h3>10.3 \u4e3b\u4e3b\u590d\u5236\u751f\u4ea7\u4f18\u5316<\/h3>\n<p>\u6d4b\u8bd5\u73af\u5883\u65e0\u4e3b\u952e\u51b2\u7a81\u95ee\u9898&#xff0c;\u751f\u4ea7\u73af\u5883\u5fc5\u987b\u914d\u7f6e\u81ea\u589eID\u504f\u79fb&#xff0c;\u907f\u514d\u53cc\u4e3b\u540c\u65f6\u5199\u5165\u4ea7\u751f\u4e3b\u952e\u91cd\u590d\u3001\u6570\u636e\u5199\u5165\u5931\u8d25\u3002<\/p>\n<h3>10.4 \u5065\u5eb7\u68c0\u67e5\u4f18\u5316<\/h3>\n<p>\u9ed8\u8ba4\u4ec5\u68c0\u6d4b3306\u7aef\u53e3\u5b58\u6d3b&#xff0c;\u65e0\u6cd5\u5224\u65ad\u6570\u636e\u5e93\u771f\u5b9e\u8bfb\u5199\u72b6\u6001\u3002\u751f\u4ea7\u5efa\u8bae\u81ea\u5b9a\u4e49shell\u811a\u672c&#xff0c;\u68c0\u6d4b\u6570\u636e\u5e93\u67e5\u8be2\u3001\u5199\u5165\u53ef\u7528\u6027&#xff0c;\u5b9e\u73b0\u7cbe\u51c6\u6545\u969c\u5254\u9664\u3002<\/p>\n<h3>10.5 \u6743\u9650\u4e0e\u5b89\u5168\u52a0\u56fa<\/h3>\n<p>\u6d4b\u8bd5\u73af\u5883\u5168\u6743\u9650\u5f00\u653e&#xff0c;\u751f\u4ea7\u9700\u4e25\u683c\u6536\u7d27\u6570\u636e\u5e93\u8fdc\u7a0b\u6743\u9650\u3001\u7981\u7528\u4e0d\u5fc5\u8981\u8d26\u53f7\u3001\u4fee\u6539\u9ed8\u8ba4\u5bc6\u7801\u3001\u5f00\u542f\u9632\u706b\u5899\u7aef\u53e3\u767d\u540d\u5355&#xff0c;\u89c4\u907f\u5b89\u5168\u98ce\u9669\u3002<\/p>\n<h2>\u5341\u4e00\u3001\u67b6\u6784\u603b\u7ed3<\/h2>\n<p>Keepalived&#043;LVS(DR)&#043;MariaDB\u4e3b\u4e3b \u662f\u4e2d\u5c0f\u4f01\u4e1a\u6027\u4ef7\u6bd4\u6781\u9ad8\u7684\u6570\u636e\u5e93\u9ad8\u53ef\u7528\u89e3\u51b3\u65b9\u6848&#xff0c;\u5f7b\u5e95\u89e3\u51b3\u4f20\u7edf\u67b6\u6784\u56db\u5927\u75db\u70b9&#xff1a;<\/p>\n<p>1. \u5f7b\u5e95\u6d88\u9664\u5355\u70b9\u6545\u969c&#xff1a;\u8c03\u5ea6\u5c42\u4e3b\u5907\u6f02\u79fb\u3001\u6570\u636e\u5e93\u5c42\u53cc\u6d3b\u5197\u4f59&#xff0c;\u5168\u7a0b\u81ea\u52a8\u5bb9\u707e&#xff1b;<\/p>\n<p>2. \u6027\u80fd\u5927\u5e45\u63d0\u5347&#xff1a;\u56db\u5c42LVS\u9ad8\u5e76\u53d1\u8f6c\u53d1\u3001\u53cc\u4e3b\u5206\u62c5\u5199\u5165\u538b\u529b&#xff0c;\u7a81\u7834\u5355\u5e93\u6027\u80fd\u74f6\u9888&#xff1b;<\/p>\n<p>3. \u6570\u636e\u5b89\u5168\u53ef\u63a7&#xff1a;\u53cc\u5411\u5b9e\u65f6\u540c\u6b65&#xff0c;\u89c4\u907f\u6570\u636e\u5ef6\u8fdf\u3001\u4e22\u5931\u3001\u65ad\u5c42\u95ee\u9898&#xff1b;<\/p>\n<p>4. \u8fd0\u7ef4\u6781\u7b80&#xff1a;\u7edf\u4e00VIP\u5165\u53e3\u3001\u65e0\u611f\u6269\u5bb9\u3001\u81ea\u52a8\u6545\u969c\u8f6c\u79fb&#xff0c;\u5927\u5e45\u964d\u4f4e\u8fd0\u7ef4\u6210\u672c\u3002<\/p>\n<p>\u6574\u5957\u67b6\u6784\u7a33\u5b9a\u53ef\u9760\u3001\u53ef\u76f4\u63a5\u843d\u5730\u751f\u4ea7&#xff0c;\u9002\u5408\u7535\u5546\u3001\u91d1\u878d\u3001\u653f\u52a1\u7b49\u6838\u5fc3\u4e1a\u52a1\u6570\u636e\u5e93\u9ad8\u53ef\u7528\u573a\u666f\u90e8\u7f72\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5f7b\u5e95\u89e3\u51b3\u6570\u636e\u5e93\u5355\u70b9\u6545\u969c&#xff01;KeepalivedLVS(DR)MariaDB\u4e3b\u4e3b\u9ad8\u53ef\u7528\u67b6\u6784\u5b9e\u6218<br \/>\n\u4e00\u3001\u9879\u76ee\u80cc\u666f<br \/>\n1.1 \u4e1a\u52a1\u573a\u666f\u4e0e\u6570\u636e\u5e93\u6838\u5fc3\u8bc9\u6c42<br \/>\n\u5728\u4f01\u4e1a\u7ea7\u5e94\u7528\u4e2d&#xff0c;\u6570\u636e\u5e93\u4f5c\u4e3a\u4e1a\u52a1\u6570\u636e\u7684\u201c\u6838\u5fc3\u8f7d\u4f53\u201d&#xff0c;\u5176\u9ad8\u53ef\u7528\u6027\u3001\u8bfb\u5199\u6027\u80fd\u3001\u6570\u636e\u4e00\u81f4\u6027\u76f4\u63a5\u51b3\u5b9a\u4e1a\u52a1\u80fd\u5426\u7a33\u5b9a\u8fd0\u884c\u3002\u65e0\u8bba\u662f\u7535\u5546\u4ea4\u6613\u7cfb\u7edf&#xff08;\u8ba2\u5355\u751f\u6210\u3001\u5e93\u5b58\u6263\u51cf&#xff09;\u3001\u91d1\u878d\u652f\u4ed8\u5e73\u53f0&#xff08;\u4ea4\u6613\u5bf9\u8d26\u3001\u8d44\u91d1\u6d41\u8f6c&#xff09;&#xff0c;\u8fd8\u662f\u653f\u52a1\u7ba1\u7406\u7cfb\u7edf&#xff08;\u6570\u636e\u4e0a\u62a5\u3001<\/p>\n","protected":false},"author":2,"featured_media":94756,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[2016,937,100],"topic":[],"class_list":["post-94757","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-lvs","tag-mariadb","tag-100"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u5f7b\u5e95\u89e3\u51b3\u6570\u636e\u5e93\u5355\u70b9\u6545\u969c\uff01Keepalived+LVS(DR)+MariaDB\u4e3b\u4e3b\u9ad8\u53ef\u7528\u67b6\u6784\u5b9e\u6218 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/94757.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u5f7b\u5e95\u89e3\u51b3\u6570\u636e\u5e93\u5355\u70b9\u6545\u969c\uff01Keepalived+LVS(DR)+MariaDB\u4e3b\u4e3b\u9ad8\u53ef\u7528\u67b6\u6784\u5b9e\u6218 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u5f7b\u5e95\u89e3\u51b3\u6570\u636e\u5e93\u5355\u70b9\u6545\u969c&#xff01;KeepalivedLVS(DR)MariaDB\u4e3b\u4e3b\u9ad8\u53ef\u7528\u67b6\u6784\u5b9e\u6218 \u4e00\u3001\u9879\u76ee\u80cc\u666f 1.1 \u4e1a\u52a1\u573a\u666f\u4e0e\u6570\u636e\u5e93\u6838\u5fc3\u8bc9\u6c42 \u5728\u4f01\u4e1a\u7ea7\u5e94\u7528\u4e2d&#xff0c;\u6570\u636e\u5e93\u4f5c\u4e3a\u4e1a\u52a1\u6570\u636e\u7684\u201c\u6838\u5fc3\u8f7d\u4f53\u201d&#xff0c;\u5176\u9ad8\u53ef\u7528\u6027\u3001\u8bfb\u5199\u6027\u80fd\u3001\u6570\u636e\u4e00\u81f4\u6027\u76f4\u63a5\u51b3\u5b9a\u4e1a\u52a1\u80fd\u5426\u7a33\u5b9a\u8fd0\u884c\u3002\u65e0\u8bba\u662f\u7535\u5546\u4ea4\u6613\u7cfb\u7edf&#xff08;\u8ba2\u5355\u751f\u6210\u3001\u5e93\u5b58\u6263\u51cf&#xff09;\u3001\u91d1\u878d\u652f\u4ed8\u5e73\u53f0&#xff08;\u4ea4\u6613\u5bf9\u8d26\u3001\u8d44\u91d1\u6d41\u8f6c&#xff09;&#xff0c;\u8fd8\u662f\u653f\u52a1\u7ba1\u7406\u7cfb\u7edf&#xff08;\u6570\u636e\u4e0a\u62a5\u3001\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/94757.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-08-14T23:49:00+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/08\/20260814234859-6a7fa96b05b5c.png\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"10 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/94757.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/94757.html\",\"name\":\"\u5f7b\u5e95\u89e3\u51b3\u6570\u636e\u5e93\u5355\u70b9\u6545\u969c\uff01Keepalived+LVS(DR)+MariaDB\u4e3b\u4e3b\u9ad8\u53ef\u7528\u67b6\u6784\u5b9e\u6218 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-08-14T23:49:00+00:00\",\"dateModified\":\"2026-08-14T23:49:00+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/94757.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/94757.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/94757.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u5f7b\u5e95\u89e3\u51b3\u6570\u636e\u5e93\u5355\u70b9\u6545\u969c\uff01Keepalived+LVS(DR)+MariaDB\u4e3b\u4e3b\u9ad8\u53ef\u7528\u67b6\u6784\u5b9e\u6218\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u5f7b\u5e95\u89e3\u51b3\u6570\u636e\u5e93\u5355\u70b9\u6545\u969c\uff01Keepalived+LVS(DR)+MariaDB\u4e3b\u4e3b\u9ad8\u53ef\u7528\u67b6\u6784\u5b9e\u6218 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/94757.html","og_locale":"zh_CN","og_type":"article","og_title":"\u5f7b\u5e95\u89e3\u51b3\u6570\u636e\u5e93\u5355\u70b9\u6545\u969c\uff01Keepalived+LVS(DR)+MariaDB\u4e3b\u4e3b\u9ad8\u53ef\u7528\u67b6\u6784\u5b9e\u6218 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u5f7b\u5e95\u89e3\u51b3\u6570\u636e\u5e93\u5355\u70b9\u6545\u969c&#xff01;KeepalivedLVS(DR)MariaDB\u4e3b\u4e3b\u9ad8\u53ef\u7528\u67b6\u6784\u5b9e\u6218 \u4e00\u3001\u9879\u76ee\u80cc\u666f 1.1 \u4e1a\u52a1\u573a\u666f\u4e0e\u6570\u636e\u5e93\u6838\u5fc3\u8bc9\u6c42 \u5728\u4f01\u4e1a\u7ea7\u5e94\u7528\u4e2d&#xff0c;\u6570\u636e\u5e93\u4f5c\u4e3a\u4e1a\u52a1\u6570\u636e\u7684\u201c\u6838\u5fc3\u8f7d\u4f53\u201d&#xff0c;\u5176\u9ad8\u53ef\u7528\u6027\u3001\u8bfb\u5199\u6027\u80fd\u3001\u6570\u636e\u4e00\u81f4\u6027\u76f4\u63a5\u51b3\u5b9a\u4e1a\u52a1\u80fd\u5426\u7a33\u5b9a\u8fd0\u884c\u3002\u65e0\u8bba\u662f\u7535\u5546\u4ea4\u6613\u7cfb\u7edf&#xff08;\u8ba2\u5355\u751f\u6210\u3001\u5e93\u5b58\u6263\u51cf&#xff09;\u3001\u91d1\u878d\u652f\u4ed8\u5e73\u53f0&#xff08;\u4ea4\u6613\u5bf9\u8d26\u3001\u8d44\u91d1\u6d41\u8f6c&#xff09;&#xff0c;\u8fd8\u662f\u653f\u52a1\u7ba1\u7406\u7cfb\u7edf&#xff08;\u6570\u636e\u4e0a\u62a5\u3001","og_url":"https:\/\/www.wsisp.com\/helps\/94757.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-08-14T23:49:00+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/08\/20260814234859-6a7fa96b05b5c.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"10 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/94757.html","url":"https:\/\/www.wsisp.com\/helps\/94757.html","name":"\u5f7b\u5e95\u89e3\u51b3\u6570\u636e\u5e93\u5355\u70b9\u6545\u969c\uff01Keepalived+LVS(DR)+MariaDB\u4e3b\u4e3b\u9ad8\u53ef\u7528\u67b6\u6784\u5b9e\u6218 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-08-14T23:49:00+00:00","dateModified":"2026-08-14T23:49:00+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/94757.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/94757.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/94757.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u5f7b\u5e95\u89e3\u51b3\u6570\u636e\u5e93\u5355\u70b9\u6545\u969c\uff01Keepalived+LVS(DR)+MariaDB\u4e3b\u4e3b\u9ad8\u53ef\u7528\u67b6\u6784\u5b9e\u6218"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/94757","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=94757"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/94757\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/94756"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=94757"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=94757"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=94757"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=94757"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}