{"id":5060,"date":"2021-12-17T02:00:00","date_gmt":"2021-12-17T10:00:00","guid":{"rendered":"https:\/\/www.xh86.me\/?p=5060"},"modified":"2021-12-18T17:52:22","modified_gmt":"2021-12-19T01:52:22","slug":"%e3%80%90%e9%a1%b9%e7%9b%ae%e6%a1%88%e4%be%8b%e3%80%91%e8%b6%85%e8%af%a6%e7%bb%86%e7%9a%84%e9%ab%98%e5%8f%af%e7%94%a8%e7%bd%91%e7%bb%9c%e6%9e%b6%e6%9e%84%e7%9a%84%e9%83%a8%e7%bd%b2%e6%96%b9%e6%a1%88","status":"publish","type":"post","link":"https:\/\/www.xh86.me\/?p=5060","title":{"rendered":"\u8be6\u7ec6\u7684\u9ad8\u53ef\u7528\u7f51\u7edc\u67b6\u6784\u7684\u90e8\u7f72\u65b9\u6848"},"content":{"rendered":"<div class=\"wxsyncmain\">\n<section style=\"box-sizing: border-box; font-size: 16px;\">\n<section style=\"text-align: center; margin-top: 10px; margin-bottom: 10px; box-sizing: border-box;\"><\/section>\n<section style=\"text-align: unset; font-size: 15px; line-height: 2; letter-spacing: 1.75px; padding-right: 5px; padding-left: 5px; color: #867f7f; box-sizing: border-box;\">\n<p style=\"box-sizing: border-box;\"><strong style=\"box-sizing: border-box;\">\u7f51\u7ad9\u67b6\u6784\u6f14\u53d8<\/strong><\/p>\n<\/section>\n<section style=\"box-sizing: border-box;\">\n<section style=\"display: flex; flex-flow: row nowrap; margin-right: 0%; margin-bottom: 10px; margin-left: 0%; box-sizing: border-box;\">\n<section style=\"display: inline-block; width: auto; vertical-align: top; flex: 100 100 0%; align-self: flex-start; height: auto; line-height: 0; background-color: rgba(86, 61, 227, 0.04); box-sizing: border-box;\">\n<section style=\"box-sizing: border-box;\">\n<section style=\"display: flex; flex-flow: row nowrap; text-align: left; justify-content: flex-start; margin-right: 0%; margin-left: 0%; box-sizing: border-box;\">\n<section style=\"display: inline-block; vertical-align: bottom; width: auto; flex: 0 0 0%; height: auto; align-self: flex-end; box-sizing: border-box;\">\n<section style=\"justify-content: flex-start; box-sizing: border-box;\">\n<section style=\"display: inline-block; width: 8px; height: 8px; vertical-align: top; overflow: hidden; background-color: #375072; box-sizing: border-box;\">\n<section><\/section>\n<\/section>\n<\/section>\n<\/section>\n<section style=\"display: inline-block; vertical-align: bottom; width: auto; flex: 0 0 0%; align-self: flex-end; height: auto; box-sizing: border-box;\">\n<section style=\"justify-content: flex-start; box-sizing: border-box;\">\n<section style=\"display: inline-block; width: 8px; height: 8px; vertical-align: top; overflow: hidden; background-color: #8ec965; box-sizing: border-box;\">\n<section><\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<section style=\"text-align: unset; font-size: 15px; line-height: 2; letter-spacing: 1.75px; padding-right: 5px; padding-left: 5px; box-sizing: border-box;\">\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\"><span style=\"color: #867f7f; font-size: 16px; box-sizing: border-box;\"><strong style=\"box-sizing: border-box;\">1. \u95ee\u9898<\/strong><\/span><\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\"><strong style=\"box-sizing: border-box;\">\u5b66\u4e60\u4ece\u5355\u673a\u67b6\u6784\u5230\u96c6\u7fa4\u67b6\u6784\u7684\u6f14\u53d8\u4e4b\u8def\uff1a<\/strong><\/p>\n<ul class=\"list-paddingleft-2\">\n<li style=\"box-sizing: border-box;\">\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\u5355\u673a\u7248LNMP<\/p>\n<\/li>\n<li style=\"box-sizing: border-box;\">\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\u72ec\u7acb\u6570\u636e\u5e93\u670d\u52a1\u5668<\/p>\n<\/li>\n<li style=\"box-sizing: border-box;\">\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">Web\u670d\u52a1\u5668\u96c6\u7fa4\u4e0eSession\u4fdd\u6301<\/p>\n<\/li>\n<li style=\"box-sizing: border-box;\">\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\u52a8\u9759\u5206\u79bb\u3001\u6570\u636e\u5e93\u96c6\u7fa4<\/p>\n<\/li>\n<li style=\"box-sizing: border-box;\">\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\u5404\u79cd\u7f13\u5b58\u670d\u52a1\u5668 \u4e1a\u52a1\u6a21\u578b<\/p>\n<\/li>\n<\/ul>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\"><span style=\"font-size: 16px; color: #867f7f; box-sizing: border-box;\"><strong style=\"box-sizing: border-box;\">2. \u6b65\u9aa4<\/strong><\/span><\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\u6b64\u6848\u4f8b\u4e3b\u8981\u662f\u5b66\u4e60\u7f51\u7ad9\u67b6\u6784\u6f14\u53d8\u7684\u8fc7\u7a0b\uff0c\u4ee5\u62d3\u6251\u56fe\u548c\u7406\u8bba\u4e3a\u4e3b\uff0c\u5177\u4f53\u5b9e\u73b0\u8fd8\u9700\u8981\u7ed3\u5408\u5177\u4f53\u7684\u8f6f\u4ef6\u3002<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\"><strong style=\"box-sizing: border-box;\">\u6b65\u9aa4\u4e00\uff1a\u5355\u673a\u7248LNMP<\/strong><\/p>\n<p style=\"box-sizing: border-box;\">\u5355\u673a\u7248\u7f51\u7ad9\uff0c\u62d3\u6251\u5982\u56fe-1\u6240\u793a\u3002<\/p>\n<\/section>\n<section style=\"box-sizing: border-box;\">\n<section style=\"max-width: 100%; vertical-align: middle; display: inline-block; line-height: 0; box-sizing: border-box;\"><div class='fancybox-wrapper lazyload-container-unload' data-fancybox='post-images' href='https:\/\/www.xh86.me\/wp-content\/uploads\/2021\/12\/wxsync-2021-12-9b83d9083c50d06a8f55aa83b3ce66d8.png'><img class=\"lazyload lazyload-style-1\" src=\"data:image\/svg+xml;base64,PCEtLUFyZ29uTG9hZGluZy0tPgo8c3ZnIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3Ryb2tlPSIjZmZmZmZmMDAiPjxnPjwvZz4KPC9zdmc+\"  decoding=\"async\" class=\"rich_pages wxw-img\" style=\"vertical-align: middle; box-sizing: border-box; display: inline;\" data-original=\"https:\/\/www.xh86.me\/wp-content\/uploads\/2021\/12\/wxsync-2021-12-9b83d9083c50d06a8f55aa83b3ce66d8.png\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB\/AAffA0nNPuCLAAAAAElFTkSuQmCC\" data-ratio=\"0.5342163\" data-type=\"png\" data-w=\"453\" \/><\/div><\/section>\n<\/section>\n<section style=\"text-align: unset; font-size: 15px; line-height: 2; letter-spacing: 1.75px; padding-right: 5px; padding-left: 5px; box-sizing: border-box;\">\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\u7528\u6237\u91cf\u5c11\u65f6\u4f7f\u7528\uff0c\u7b80\u5355\u3001\u6210\u672c\u4f4e\u3001\u5b58\u5728\u5355\u70b9\u6545\u969c\u3002<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\"><strong style=\"box-sizing: border-box;\">\u6b65\u9aa4\u4e8c\uff1a\u72ec\u7acb\u6570\u636e\u5e93\u670d\u52a1\u5668<\/strong><\/p>\n<p style=\"box-sizing: border-box;\">\u72ec\u7acb\u6570\u636e\u5e93\u670d\u52a1\u5668\u662f\u5c06\u7f51\u7ad9\u9759\u6001\u6587\u4ef6\u3001\u4ee3\u7801\u6587\u4ef6\u7b49\u8d44\u6599\u4e0e\u6570\u636e\u5e93\u5206\u79bb\u7684\u67b6\u6784\uff0c\u5f53\u7528\u6237\u91cf\u589e\u52a0\u65f6\u5355\u673a\u7684\u5904\u7406\u80fd\u529b\u6709\u9650\uff0cPHP\u6216JAVA\u4ee3\u7801\u7684\u6267\u884c\u9700\u8981\u6d88\u8017\u5927\u91cfCPU\u8d44\u6e90\uff0c\u6570\u636e\u5e93\u7684\u589e\u5220\u6539\u67e5\u9700\u8981\u8c03\u7528\u5927\u91cf\u7684\u5185\u5b58\u8d44\u6e90\uff0c\u5c06\u4e24\u8005\u5206\u79bb\u53ef\u4ee5\u51cf\u8f7b\u670d\u52a1\u5668\u7684\u538b\u529b\uff0c\u5176\u62d3\u6251\u7ed3\u6784\u5982\u56fe-2\u6240\u793a\u3002<\/p>\n<\/section>\n<section style=\"box-sizing: border-box;\">\n<section style=\"max-width: 100%; vertical-align: middle; display: inline-block; line-height: 0; box-sizing: border-box;\"><div class='fancybox-wrapper lazyload-container-unload' data-fancybox='post-images' href='https:\/\/www.xh86.me\/wp-content\/uploads\/2021\/12\/wxsync-2021-12-06ef5886dc9e2f04e59115637139a237.png'><img class=\"lazyload lazyload-style-1\" src=\"data:image\/svg+xml;base64,PCEtLUFyZ29uTG9hZGluZy0tPgo8c3ZnIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3Ryb2tlPSIjZmZmZmZmMDAiPjxnPjwvZz4KPC9zdmc+\"  decoding=\"async\" class=\"rich_pages wxw-img\" style=\"vertical-align: middle; box-sizing: border-box;\" data-original=\"https:\/\/www.xh86.me\/wp-content\/uploads\/2021\/12\/wxsync-2021-12-06ef5886dc9e2f04e59115637139a237.png\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB\/AAffA0nNPuCLAAAAAElFTkSuQmCC\" data-ratio=\"0.4711191\" data-type=\"png\" data-w=\"554\" \/><\/div><\/section>\n<\/section>\n<section style=\"text-align: unset; font-size: 15px; line-height: 2; letter-spacing: 1.75px; padding-right: 5px; padding-left: 5px; box-sizing: border-box;\">\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">Web\u670d\u52a1\u5668\u548c\u6570\u636e\u5e93\u670d\u52a1\u5668\u7684\u538b\u529b\u90fd\u53ef\u4ee5\u5f97\u5230\u6709\u6548\u6539\u5584\uff0c\u8bbf\u95ee\u91cf\u6709\u6240\u589e\u52a0\u3002\u4f46\u662f\u670d\u52a1\u5668\u4f9d\u7136\u5b58\u5728\u5355\u70b9\u6545\u969c\u95ee\u9898\u3002<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\"><strong style=\"box-sizing: border-box;\">\u6b65\u9aa4\u4e09\uff1aWeb\u670d\u52a1\u5668\u96c6\u7fa4\u4e0eSession\u4fdd\u6301<\/strong><\/p>\n<p style=\"box-sizing: border-box;\">\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7Nginx\u3001Haproxy\u4ee3\u7406\u670d\u52a1\u5668\u5b9e\u73b0Web\u8d1f\u8f7d\u5747\u8861\u96c6\u7fa4\uff0c\u4e5f\u53ef\u4ee5\u4f7f\u7528LVS\u8c03\u5ea6\u5668\u5b9e\u73b0Web\u8d1f\u8f7d\u5747\u8861\u96c6\u7fa4\u3002\u90e8\u7f72\u5b8cWeb\u96c6\u7fa4\u540e\u8fd8\u9700\u8981\u8003\u8651\u5982\u4f55\u8fdb\u884cSession\u4f1a\u8bdd\u4fdd\u6301\uff0c\u65b9\u6cd5\u5f88\u591a\uff0c\u5982\uff1a\u6839\u636e\u6e90IP\u4fdd\u6301\uff0c\u4ee3\u7406\u670d\u52a1\u5668\u91cd\u5199Cookie\u4fe1\u606f\uff0c\u5171\u4eab\u6587\u4ef6\u7cfb\u7edf\u4fdd\u5b58session\uff0c\u4f7f\u7528\u6570\u636e\u5e93\u5171\u4eabsession\u7b49\u7b49\u3002\u8be5\u67b6\u6784\u62d3\u6251\u5982\u56fe-3\u6240\u793a\u3002<\/p>\n<\/section>\n<section style=\"box-sizing: border-box;\">\n<section style=\"max-width: 100%; vertical-align: middle; display: inline-block; line-height: 0; box-sizing: border-box;\"><div class='fancybox-wrapper lazyload-container-unload' data-fancybox='post-images' href='https:\/\/www.xh86.me\/wp-content\/uploads\/2021\/12\/wxsync-2021-12-23c2737b83c492ba7cac3d43c587cfc1.png'><img class=\"lazyload lazyload-style-1\" src=\"data:image\/svg+xml;base64,PCEtLUFyZ29uTG9hZGluZy0tPgo8c3ZnIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3Ryb2tlPSIjZmZmZmZmMDAiPjxnPjwvZz4KPC9zdmc+\"  decoding=\"async\" class=\"rich_pages wxw-img\" style=\"vertical-align: middle; box-sizing: border-box;\" data-original=\"https:\/\/www.xh86.me\/wp-content\/uploads\/2021\/12\/wxsync-2021-12-23c2737b83c492ba7cac3d43c587cfc1.png\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB\/AAffA0nNPuCLAAAAAElFTkSuQmCC\" data-ratio=\"0.4404332\" data-type=\"png\" data-w=\"554\" \/><\/div><\/section>\n<\/section>\n<section style=\"text-align: unset; font-size: 15px; line-height: 2; letter-spacing: 1.75px; padding-right: 5px; padding-left: 5px; box-sizing: border-box;\">\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\n<p style=\"box-sizing: border-box;\">\u4f46\u662f\u5982\u679c\u53ea\u6709\u4e00\u53f0\u8c03\u5ea6\u5668\u4f9d\u7136\u4f1a\u5bfc\u81f4\u5355\u70b9\u6545\u969c\u7684\u95ee\u9898\uff0c\u56e0\u6b64\u8fd8\u9700\u8981\u4f7f\u7528Keepalived\u6216Heartbeat\u4e4b\u7c7b\u7684\u8f6f\u4ef6\u8fdb\u884c\u9ad8\u53ef\u7528\u914d\u7f6e\uff0c\u5982\u56fe-4\u6240\u793a\u3002<\/p>\n<\/section>\n<section style=\"box-sizing: border-box;\">\n<section style=\"max-width: 100%; vertical-align: middle; display: inline-block; line-height: 0; box-sizing: border-box;\"><div class='fancybox-wrapper lazyload-container-unload' data-fancybox='post-images' href='https:\/\/www.xh86.me\/wp-content\/uploads\/2021\/12\/wxsync-2021-12-7246658c5d4c720fd45a67e4fa3dbc7f.png'><img class=\"lazyload lazyload-style-1\" src=\"data:image\/svg+xml;base64,PCEtLUFyZ29uTG9hZGluZy0tPgo8c3ZnIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3Ryb2tlPSIjZmZmZmZmMDAiPjxnPjwvZz4KPC9zdmc+\"  decoding=\"async\" class=\"rich_pages wxw-img\" style=\"vertical-align: middle; box-sizing: border-box;\" data-original=\"https:\/\/www.xh86.me\/wp-content\/uploads\/2021\/12\/wxsync-2021-12-7246658c5d4c720fd45a67e4fa3dbc7f.png\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB\/AAffA0nNPuCLAAAAAElFTkSuQmCC\" data-ratio=\"0.4314079\" data-type=\"png\" data-w=\"554\" \/><\/div><\/section>\n<\/section>\n<section style=\"text-align: unset; font-size: 15px; line-height: 2; letter-spacing: 1.75px; padding-right: 5px; padding-left: 5px; box-sizing: border-box;\">\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\n<p style=\"box-sizing: border-box;\">\u5bf9\u4e8e\u7f51\u7ad9\u5185\u5bb9\u800c\u8a00\u53ef\u4ee5\u5206\u79bb\u4e3a\u52a8\u6001\u9875\u9762\u548c\u9759\u6001\u9875\u9762\uff0c\u9759\u6001\u9875\u9762\u5c31\u9700\u8981\u6570\u636e\u6587\u4ef6\uff0c\u52a8\u6001\u9875\u9762\u5219\u9700\u8981CPU\u89e3\u6790\u4ee3\u7801\uff0c\u9700\u8981\u6d88\u8017\u5927\u91cf\u7684CPU\u8d44\u6e90\uff0c\u56e0\u6b64\u53ef\u4ee5\u5c06\u9759\u6001\u548c\u52a8\u6001\u5206\u79bb\u4e3a\u4e24\u7ec4\u670d\u52a1\u5668\uff0c\u52a8\u6001\u9875\u9762\u6709\u811a\u672c\u4ee3\u7801\u7ec4\u6210\uff0c\u662f\u4e00\u79cd\u57fa\u4e8e\u7f51\u9875\u7684\u5e94\u7528\u7a0b\u5e8f\uff0c\u56e0\u6b64\u8fd9\u4e00\u7ec4\u670d\u52a1\u5668\u4e5f\u79f0\u4e3a\u5e94\u7528\u670d\u52a1\u5668\uff0c\u5176\u67b6\u6784\u5982\u56fe-5\u6240\u793a\u3002<\/p>\n<\/section>\n<section style=\"box-sizing: border-box;\">\n<section style=\"max-width: 100%; vertical-align: middle; display: inline-block; line-height: 0; box-sizing: border-box;\"><div class='fancybox-wrapper lazyload-container-unload' data-fancybox='post-images' href='https:\/\/www.xh86.me\/wp-content\/uploads\/2021\/12\/wxsync-2021-12-87a478d0485402930555511ba66cd567.png'><img class=\"lazyload lazyload-style-1\" src=\"data:image\/svg+xml;base64,PCEtLUFyZ29uTG9hZGluZy0tPgo8c3ZnIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3Ryb2tlPSIjZmZmZmZmMDAiPjxnPjwvZz4KPC9zdmc+\"  decoding=\"async\" class=\"rich_pages wxw-img\" style=\"vertical-align: middle; box-sizing: border-box; display: inline;\" data-original=\"https:\/\/www.xh86.me\/wp-content\/uploads\/2021\/12\/wxsync-2021-12-87a478d0485402930555511ba66cd567.png\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB\/AAffA0nNPuCLAAAAAElFTkSuQmCC\" data-ratio=\"0.341637\" data-type=\"png\" data-w=\"562\" \/><\/div><\/section>\n<\/section>\n<section style=\"text-align: unset; font-size: 15px; line-height: 2; letter-spacing: 1.75px; padding-right: 5px; padding-left: 5px; box-sizing: border-box;\">\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\"><strong style=\"box-sizing: border-box;\">\u6b65\u9aa4\u56db\uff1a\u52a8\u9759\u5206\u79bb\u3001\u6570\u636e\u5e93\u96c6\u7fa4<\/strong><\/p>\n<p style=\"box-sizing: border-box;\">\u968f\u7740\u670d\u52a1\u5668\u7684\u589e\u52a0\uff0c\u867d\u7136\u6027\u80fd\u4e0e\u5e76\u53d1\u91cf\u5f97\u5230\u4e86\u660e\u663e\u7684\u63d0\u5347\uff0c\u4f46\u662f\u6570\u636e\u7684\u4e00\u81f4\u6027\u3001\u7ba1\u7406\u7684\u4fbf\u5229\u6027\u6210\u4e3a\u4e86\u65b0\u7684\u95ee\u9898\uff0c\u56e0\u6b64\u5c31\u9700\u8981\u589e\u52a0\u7edf\u4e00\u7684\u5b58\u50a8\u670d\u52a1\u5668\uff0c\u5b9e\u73b0\u6570\u636e\u7684\u540c\u6b65\u4e00\u81f4\uff0c\u53ef\u4ee5\u4f7f\u7528NFS\uff0cGlusterFS\u3001Ceph\u7b49\u8f6f\u4ef6\u5b9e\u73b0\u8be5\u529f\u80fd\uff0c\u5176\u67b6\u6784\u5982\u56fe-6\u6240\u793a\u3002<\/p>\n<\/section>\n<section style=\"box-sizing: border-box;\">\n<section style=\"max-width: 100%; vertical-align: middle; display: inline-block; line-height: 0; box-sizing: border-box;\"><div class='fancybox-wrapper lazyload-container-unload' data-fancybox='post-images' href='https:\/\/www.xh86.me\/wp-content\/uploads\/2021\/12\/wxsync-2021-12-c7958a236a103027f59ea1f2b2f21125.png'><img class=\"lazyload lazyload-style-1\" src=\"data:image\/svg+xml;base64,PCEtLUFyZ29uTG9hZGluZy0tPgo8c3ZnIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3Ryb2tlPSIjZmZmZmZmMDAiPjxnPjwvZz4KPC9zdmc+\"  decoding=\"async\" class=\"rich_pages wxw-img\" style=\"vertical-align: middle; box-sizing: border-box;\" data-original=\"https:\/\/www.xh86.me\/wp-content\/uploads\/2021\/12\/wxsync-2021-12-c7958a236a103027f59ea1f2b2f21125.png\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB\/AAffA0nNPuCLAAAAAElFTkSuQmCC\" data-ratio=\"0.3592058\" data-type=\"png\" data-w=\"554\" \/><\/div><\/section>\n<\/section>\n<section style=\"text-align: unset; font-size: 15px; line-height: 2; letter-spacing: 1.75px; padding-right: 5px; padding-left: 5px; box-sizing: border-box;\">\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\n<p style=\"box-sizing: border-box;\">\u6b64\u65f6\u6240\u6709\u5e94\u7528\u670d\u52a1\u5668\u90fd\u8fde\u63a5\u4e00\u53f0\u6570\u636e\u5e93\u670d\u52a1\u5668\u8fdb\u884c\u8bfb\u5199\u64cd\u4f5c\uff0c\u800c\u4e14\u540e\u671f\u968f\u7740\u6570\u636e\u5e93\u4e2d\u7684\u6570\u636e\u4e0d\u65ad\u589e\u52a0\uff0c\u4f1a\u5bfc\u81f4\u6570\u636e\u5e93\u6210\u4e3a\u6574\u4e2a\u7f51\u7ad9\u7684\u74f6\u9888\uff01\u8fd9\u5c31\u9700\u8981\u6211\u4eec\u5bf9\u6570\u636e\u8fdb\u884c\u5206\u5e93\u5206\u8868\uff0c\u521b\u5efa\u6570\u636e\u5e93\u4e3b\u4ece\u6216\u8005\u6570\u636e\u5e93\u96c6\u7fa4\uff0c\u5b9e\u73b0\u8bfb\u5199\u5206\u79bb\uff0c\u5176\u62d3\u6251\u5982\u56fe-7\u6240\u793a\u3002<\/p>\n<\/section>\n<section style=\"box-sizing: border-box;\">\n<section style=\"max-width: 100%; vertical-align: middle; display: inline-block; line-height: 0; box-sizing: border-box;\"><div class='fancybox-wrapper lazyload-container-unload' data-fancybox='post-images' href='https:\/\/www.xh86.me\/wp-content\/uploads\/2021\/12\/wxsync-2021-12-f40b706ccabcfff1dda17b02a0991905.png'><img class=\"lazyload lazyload-style-1\" src=\"data:image\/svg+xml;base64,PCEtLUFyZ29uTG9hZGluZy0tPgo8c3ZnIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3Ryb2tlPSIjZmZmZmZmMDAiPjxnPjwvZz4KPC9zdmc+\"  decoding=\"async\" class=\"rich_pages wxw-img\" style=\"vertical-align: middle; box-sizing: border-box; display: inline;\" data-original=\"https:\/\/www.xh86.me\/wp-content\/uploads\/2021\/12\/wxsync-2021-12-f40b706ccabcfff1dda17b02a0991905.png\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB\/AAffA0nNPuCLAAAAAElFTkSuQmCC\" data-ratio=\"0.3592058\" data-type=\"png\" data-w=\"554\" \/><\/div><\/section>\n<\/section>\n<section style=\"text-align: unset; font-size: 15px; line-height: 2; letter-spacing: 1.75px; padding-right: 5px; padding-left: 5px; box-sizing: border-box;\">\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\"><strong style=\"box-sizing: border-box;\">\u6b65\u9aa4\u4e94\uff1a\u7f13\u5b58\u670d\u52a1\u5668\u4e0e\u4e1a\u52a1\u6a21\u578b<\/strong><\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\u5bf9\u4e8e\u9759\u6001\u6570\u636e\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7varnish\u3001squid\u6216\u8005nginx\u8fdb\u884c\u7f13\u5b58\uff0c\u5c06\u6570\u636e\u7f13\u5b58\u5230\u8ddd\u79bb\u7528\u6237\u66f4\u8fd1\u7684\u4f4d\u7f6e\uff0c\u6784\u5efaCDN\uff08\u5185\u5bb9\u5206\u53d1\u7f51\u7edc\uff09\u67b6\u6784\u3002<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\u5bf9\u4e8e\u4f20\u7edf\u7684SQL\u6570\u636e\u5e93\u800c\u8a00\uff0c\u6211\u4eec\u4e5f\u53ef\u4ee5\u901a\u8fc7\u589e\u52a0NoSQL\u6570\u636e\u5e93\uff0c\u5b9e\u73b0\u6570\u636e\u7f13\u5b58\u7684\u529f\u80fd\uff0c\u63d0\u5347\u6570\u636e\u5e93\u7684\u8bbf\u95ee\u901f\u5ea6\u3002<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\u5907\u6ce8\uff1a\u6570\u636e\u5e93\u76f8\u5173\u77e5\u8bc6\u5728\u7b2c\u4e09\u9636\u6bb5\u8bfe\u7a0b\u6709\u8be6\u7ec6\u4ecb\u7ecd\uff0c\u7b2c\u4e8c\u9636\u6bb5\u9879\u76ee\u6682\u65f6\u4e0d\u505a\u6570\u636e\u5e93\u4f18\u5316\u3002<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\n<p style=\"box-sizing: border-box;\">\u6700\u540e\uff0c\u57fa\u4e8e\u524d\u9762\u7684\u67b6\u6784\uff0c\u6211\u4eec\u8fd8\u53ef\u4ee5\u5c06\u7f51\u7ad9\u6309\u7167\u516c\u53f8\u7684\u4e1a\u52a1\u8fdb\u884c\u5206\u79bb\uff0c\u6bcf\u4e2a\u4e1a\u52a1\u90fd\u53ef\u4ee5\u662f\u4e00\u4e2a\u72ec\u7acb\u7684\u96c6\u7fa4\uff0c\u5982\u56fe-8\u6240\u793a\u3002<\/p>\n<\/section>\n<section style=\"box-sizing: border-box;\">\n<section style=\"max-width: 100%; vertical-align: middle; display: inline-block; line-height: 0; box-sizing: border-box;\"><div class='fancybox-wrapper lazyload-container-unload' data-fancybox='post-images' href='https:\/\/www.xh86.me\/wp-content\/uploads\/2021\/12\/wxsync-2021-12-e3d47e1b67406f5fef2e7653e1aed802.png'><img class=\"lazyload lazyload-style-1\" src=\"data:image\/svg+xml;base64,PCEtLUFyZ29uTG9hZGluZy0tPgo8c3ZnIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3Ryb2tlPSIjZmZmZmZmMDAiPjxnPjwvZz4KPC9zdmc+\"  decoding=\"async\" class=\"rich_pages wxw-img\" style=\"vertical-align: middle; box-sizing: border-box;\" data-original=\"https:\/\/www.xh86.me\/wp-content\/uploads\/2021\/12\/wxsync-2021-12-e3d47e1b67406f5fef2e7653e1aed802.png\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB\/AAffA0nNPuCLAAAAAElFTkSuQmCC\" data-ratio=\"0.4133574\" data-type=\"png\" data-w=\"554\" \/><\/div><\/section>\n<\/section>\n<section style=\"text-align: unset; box-sizing: border-box;\">\n<p style=\"box-sizing: border-box;\">\n<\/section>\n<section style=\"margin-top: 10px; margin-right: 0%; margin-left: 0%; box-sizing: border-box;\">\n<section style=\"font-family: Optima-Regular, PingFangTC-light; color: #3e3e3e; font-size: 18px; line-height: 1; letter-spacing: 1px; box-sizing: border-box;\">\n<p style=\"box-sizing: border-box;\"><strong style=\"box-sizing: border-box;\">LNP+Mariadb\u6570\u636e\u5e93\u5206\u79bb<\/strong><\/p>\n<\/section>\n<\/section>\n<section style=\"box-sizing: border-box;\">\n<section style=\"display: flex; flex-flow: row nowrap; margin-right: 0%; margin-bottom: 10px; margin-left: 0%; box-sizing: border-box;\">\n<section style=\"display: inline-block; width: auto; vertical-align: top; flex: 100 100 0%; align-self: flex-start; height: auto; line-height: 0; background-color: rgba(86, 61, 227, 0.04); box-sizing: border-box;\">\n<section style=\"box-sizing: border-box;\">\n<section style=\"display: flex; flex-flow: row nowrap; text-align: left; justify-content: flex-start; margin-right: 0%; margin-left: 0%; box-sizing: border-box;\">\n<section style=\"display: inline-block; vertical-align: bottom; width: auto; flex: 0 0 0%; height: auto; align-self: flex-end; box-sizing: border-box;\">\n<section style=\"justify-content: flex-start; box-sizing: border-box;\">\n<section style=\"display: inline-block; width: 8px; height: 8px; vertical-align: top; overflow: hidden; background-color: #375072; box-sizing: border-box;\">\n<section><\/section>\n<\/section>\n<\/section>\n<\/section>\n<section style=\"display: inline-block; vertical-align: bottom; width: auto; flex: 0 0 0%; align-self: flex-end; height: auto; box-sizing: border-box;\">\n<section style=\"justify-content: flex-start; box-sizing: border-box;\">\n<section style=\"display: inline-block; width: 8px; height: 8px; vertical-align: top; overflow: hidden; background-color: #8ec965; box-sizing: border-box;\">\n<section><\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<section style=\"text-align: unset; font-size: 15px; line-height: 2; letter-spacing: 1.75px; padding-right: 5px; padding-left: 5px; box-sizing: border-box;\">\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\"><span style=\"color: #867f7f; font-size: 16px; box-sizing: border-box;\"><strong style=\"box-sizing: border-box;\">1. \u95ee\u9898<\/strong><\/span><\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\u90e8\u7f72LNP+Mariadb\u5b9e\u73b0\u6570\u636e\u5e93\u4e0eWeb\u670d\u52a1\u5668\u5206\u79bb\uff0c\u5b9e\u73b0\u4ee5\u4e0b\u76ee\u6807\uff1a<span style=\"font-size: 14px; box-sizing: border-box;\">\u5c06\u65e7\u7684\u6570\u636e\u5e93\u5907\u4efd\uff0c\u8fc1\u79fb\u5230\u65b0\u7684\u670d\u52a1\u5668<\/span><span style=\"font-size: 14px; box-sizing: border-box;\">\u4fee\u6539\u914d\u7f6e\u8c03\u7528\u65b0\u7684\u6570\u636e\u5e93\u670d\u52a1\u5668\u3002<\/span><\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\"><strong style=\"box-sizing: border-box;\"><span style=\"font-size: 16px; color: #867f7f; box-sizing: border-box;\">2.\u65b9\u6848<\/span><\/strong><\/p>\n<p style=\"box-sizing: border-box;\">\u5b9e\u9a8c\u62d3\u6251\u5982\u56fe-9\u6240\u793a\uff0c\u505a\u5177\u4f53\u5b9e\u9a8c\u524d\u8bf7\u5148\u914d\u7f6e\u597d\u73af\u5883\u3002<\/p>\n<\/section>\n<section style=\"box-sizing: border-box;\">\n<section style=\"max-width: 100%; vertical-align: middle; display: inline-block; line-height: 0; box-sizing: border-box;\"><div class='fancybox-wrapper lazyload-container-unload' data-fancybox='post-images' href='https:\/\/www.xh86.me\/wp-content\/uploads\/2021\/12\/wxsync-2021-12-4a2399beefc7d4bad416531ee478cf75.png'><img class=\"lazyload lazyload-style-1\" src=\"data:image\/svg+xml;base64,PCEtLUFyZ29uTG9hZGluZy0tPgo8c3ZnIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3Ryb2tlPSIjZmZmZmZmMDAiPjxnPjwvZz4KPC9zdmc+\"  decoding=\"async\" class=\"rich_pages wxw-img\" style=\"vertical-align: middle; box-sizing: border-box;\" data-original=\"https:\/\/www.xh86.me\/wp-content\/uploads\/2021\/12\/wxsync-2021-12-4a2399beefc7d4bad416531ee478cf75.png\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB\/AAffA0nNPuCLAAAAAElFTkSuQmCC\" data-ratio=\"0.1803279\" data-type=\"png\" data-w=\"488\" \/><\/div><\/section>\n<\/section>\n<section style=\"text-align: unset; font-size: 15px; line-height: 2; letter-spacing: 1.75px; padding-right: 5px; padding-left: 5px; box-sizing: border-box;\">\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\n<p style=\"box-sizing: border-box;\">\u4e3b\u673a\u914d\u7f6e\u5982\u8868-1\u6240\u793a\u3002<\/p>\n<\/section>\n<section style=\"box-sizing: border-box;\">\n<section style=\"max-width: 100%; vertical-align: middle; display: inline-block; line-height: 0; box-sizing: border-box;\"><div class='fancybox-wrapper lazyload-container-unload' data-fancybox='post-images' href='https:\/\/www.xh86.me\/wp-content\/uploads\/2021\/12\/wxsync-2021-12-c8a1e25ec41c137ead04d042d17cfe5e.png'><img class=\"lazyload lazyload-style-1\" src=\"data:image\/svg+xml;base64,PCEtLUFyZ29uTG9hZGluZy0tPgo8c3ZnIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3Ryb2tlPSIjZmZmZmZmMDAiPjxnPjwvZz4KPC9zdmc+\"  decoding=\"async\" class=\"rich_pages wxw-img\" style=\"vertical-align: middle; box-sizing: border-box;\" data-original=\"https:\/\/www.xh86.me\/wp-content\/uploads\/2021\/12\/wxsync-2021-12-c8a1e25ec41c137ead04d042d17cfe5e.png\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB\/AAffA0nNPuCLAAAAAElFTkSuQmCC\" data-ratio=\"0.1853147\" data-type=\"png\" data-w=\"572\" \/><\/div><\/section>\n<\/section>\n<section style=\"text-align: unset; font-size: 15px; line-height: 2; letter-spacing: 1.75px; padding-right: 5px; padding-left: 5px; box-sizing: border-box;\">\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\"><span style=\"color: #867f7f; font-size: 16px; box-sizing: border-box;\"><strong style=\"box-sizing: border-box;\">3. \u6b65\u9aa4<\/strong><\/span><\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\u5b9e\u73b0\u6b64\u6848\u4f8b\u9700\u8981\u6309\u7167\u5982\u4e0b\u6b65\u9aa4\u8fdb\u884c\u3002<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\"><strong style=\"box-sizing: border-box;\">\u6b65\u9aa4\u4e00\uff1a\u90e8\u7f72\u6570\u636e\u5e93\u670d\u52a1\u5668<\/strong><\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">1\uff09\u51c6\u5907\u4e00\u53f0\u72ec\u7acb\u7684\u670d\u52a1\u5668\uff0c\u5b89\u88c5\u6570\u636e\u5e93\u8f6f\u4ef6\u5305<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@database ~]# yum -y install mariadb mariadb-server mariadb-devel<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@database ~]# systemctl start mariadb<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@database ~]# systemctl enable mariadb<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">2)\u5c06\u4e4b\u524d\u5355\u673a\u7248LNMP\u7f51\u7ad9\u4e2d\u7684\u6570\u636e\u5e93\u8fc1\u79fb\u5230\u65b0\u7684\u6570\u636e\u5e93\u670d\u52a1\u5668\u3002<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\u767b\u9646192.168.2.11\u4e3b\u673a\uff0c\u5907\u4efd\u6570\u636e\u5e93\u5e76\u62f7\u8d1d\u7ed9\u65b0\u7684\u670d\u52a1\u5668\uff0c\u5173\u95ed\u65e7\u7684\u6570\u636e\u5e93\u670d\u52a1\u3002<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@centos7 ~]# mysqldump wordpress &gt; wordpress.bak<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@centos7 ~]# scp wordpress.bak 192.168.2.21:\/root\/<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@centos7 ~]# systemctl stop mariadb<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@centos7 ~]# systemctl disable mariadb<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\u767b\u9646192.168.2.21\u4e3b\u673a\uff0c\u4f7f\u7528\u5907\u4efd\u6587\u4ef6\u8fd8\u539f\u6570\u636e\u5e93\u3002<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\u521b\u5efa\u7a7a\u6570\u636e\u5e93\uff1a<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@database ~]# mysql<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">MariaDB [(none)]&gt; create database wordpress character set utf8mb4;<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">MariaDB [(none)]&gt; exit<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\u4f7f\u7528\u5907\u4efd\u6587\u4ef6\u8fd8\u539f\u6570\u636e\uff1a<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@database ~]# mysql wordpress &lt; wordpress.bak<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\u91cd\u65b0\u521b\u5efa\u8d26\u6237\u5e76\u6388\u6743\u8bbf\u95ee\uff1a<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@database ~]# mysql<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">MariaDB [(none)]&gt; grant all on wordpress.* to wordpress@&#8217;%&#8217; identified by &#8216;wordpress&#8217;;<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">MariaDB [(none)]&gt; flush privileges;<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">MariaDB [(none)]&gt; exit<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">3\uff09\u4fee\u6539wordpress\u7f51\u7ad9\u914d\u7f6e\u6587\u4ef6\uff0c\u8c03\u7528\u65b0\u7684\u6570\u636e\u5e93\u670d\u52a1\u5668\u3002<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">WordPress\u5728\u7b2c\u4e00\u6b21\u521d\u59cb\u5316\u64cd\u4f5c\u65f6\u4f1a\u81ea\u52a8\u751f\u4ea7\u914d\u7f6e\u6587\u4ef6\uff1awp-config.php\uff0c\u767b\u9646192.168.2.11\u4fee\u6539\u8be5\u6587\u4ef6\u5373\u53ef\u8c03\u7528\u65b0\u7684\u6570\u636e\u5e93\u670d\u52a1\u3002<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@centos7 ~]# vim \/usr\/local\/nginx\/html\/wp-config.php<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\u4fee\u6539\u524d\u5185\u5bb9\u5982\u4e0b\uff1a<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">define(&#8216;DB_HOST&#8217;, &#8216;192.168.2.11&#8217;);<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\u4fee\u6539\u540e\u5185\u5bb9\u5982\u4e0b\uff1a<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">define(&#8216;DB_HOST&#8217;, &#8216;192.168.2.21&#8217;);<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\"><strong style=\"box-sizing: border-box;\">\u6b65\u9aa4\u4e8c\uff1a\u5ba2\u6237\u7aef\u6d4b\u8bd5<\/strong><\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">1\uff09\u5ba2\u6237\u7aef\u4f7f\u7528\u6d4f\u89c8\u5668\u8bbf\u95eewordpress\u7f51\u7ad9\u3002<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@client ~]# firefox http:\/\/192.168.2.11<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\n<\/section>\n<section style=\"margin-top: 10px; margin-right: 0%; margin-left: 0%; box-sizing: border-box;\">\n<section style=\"font-family: Optima-Regular, PingFangTC-light; color: #3e3e3e; font-size: 18px; line-height: 1; letter-spacing: 1px; box-sizing: border-box;\">\n<p style=\"box-sizing: border-box;\"><strong style=\"box-sizing: border-box;\">Web\u670d\u52a1\u5668\u96c6\u7fa4<\/strong><\/p>\n<\/section>\n<\/section>\n<section style=\"box-sizing: border-box;\">\n<section style=\"display: flex; flex-flow: row nowrap; margin-right: 0%; margin-bottom: 10px; margin-left: 0%; box-sizing: border-box;\">\n<section style=\"display: inline-block; width: auto; vertical-align: top; flex: 100 100 0%; align-self: flex-start; height: auto; line-height: 0; background-color: rgba(86, 61, 227, 0.04); box-sizing: border-box;\">\n<section style=\"box-sizing: border-box;\">\n<section style=\"display: flex; flex-flow: row nowrap; text-align: left; justify-content: flex-start; margin-right: 0%; margin-left: 0%; box-sizing: border-box;\">\n<section style=\"display: inline-block; vertical-align: bottom; width: auto; flex: 0 0 0%; height: auto; align-self: flex-end; box-sizing: border-box;\">\n<section style=\"justify-content: flex-start; box-sizing: border-box;\">\n<section style=\"display: inline-block; width: 8px; height: 8px; vertical-align: top; overflow: hidden; background-color: #375072; box-sizing: border-box;\">\n<section><\/section>\n<\/section>\n<\/section>\n<\/section>\n<section style=\"display: inline-block; vertical-align: bottom; width: auto; flex: 0 0 0%; align-self: flex-end; height: auto; box-sizing: border-box;\">\n<section style=\"justify-content: flex-start; box-sizing: border-box;\">\n<section style=\"display: inline-block; width: 8px; height: 8px; vertical-align: top; overflow: hidden; background-color: #8ec965; box-sizing: border-box;\">\n<section><\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<section style=\"box-sizing: border-box;\">\n<p style=\"white-space: normal; box-sizing: border-box;\">\n<\/section>\n<section style=\"text-align: unset; font-size: 15px; line-height: 2; letter-spacing: 1.75px; padding-right: 5px; padding-left: 5px; box-sizing: border-box;\">\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\"><strong style=\"box-sizing: border-box;\"><span style=\"font-size: 16px; color: #867f7f; box-sizing: border-box;\">1. \u95ee\u9898<\/span><\/strong><\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\u4f7f\u7528HAProxy\u90e8\u7f72Web\u670d\u52a1\u5668\u96c6\u7fa4\uff0c\u5b9e\u73b0\u4ee5\u4e0b\u76ee\u6807\uff1a<\/p>\n<ul class=\"list-paddingleft-2\">\n<li style=\"box-sizing: border-box;\">\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\u90e8\u7f72\u4e09\u53f0Web\u670d\u52a1\u5668<\/p>\n<\/li>\n<li style=\"box-sizing: border-box;\">\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\u8fc1\u79fb\u7f51\u7ad9\u6570\u636e\uff0c\u4f7f\u7528NFS\u5b9e\u73b0\u6570\u636e\u5171\u4eab<\/p>\n<\/li>\n<li style=\"box-sizing: border-box;\">\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\u90e8\u7f72HAProxy\u4ee3\u7406\u670d\u52a1\u5668\u5b9e\u73b0\u8d1f\u8f7d\u5747\u8861<\/p>\n<\/li>\n<li style=\"box-sizing: border-box;\">\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\u90e8\u7f72DNS\u57df\u540d\u89e3\u6790\u670d\u52a1\u5668<\/p>\n<\/li>\n<\/ul>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\"><span style=\"font-size: 16px; color: #867f7f; box-sizing: border-box;\"><strong style=\"box-sizing: border-box;\">2. \u65b9\u6848<\/strong><\/span><\/p>\n<p style=\"box-sizing: border-box;\">\u5b9e\u9a8c\u62d3\u6251\u5982\u56fe-10\u6240\u793a\uff0c\u505a\u5177\u4f53\u5b9e\u9a8c\u524d\u8bf7\u5148\u914d\u7f6e\u597d\u73af\u5883\u3002<\/p>\n<\/section>\n<section style=\"box-sizing: border-box;\">\n<section style=\"max-width: 100%; vertical-align: middle; display: inline-block; line-height: 0; box-sizing: border-box;\"><div class='fancybox-wrapper lazyload-container-unload' data-fancybox='post-images' href='https:\/\/www.xh86.me\/wp-content\/uploads\/2021\/12\/wxsync-2021-12-d909c86cf37971f34e47a087e1e0b608.png'><img class=\"lazyload lazyload-style-1\" src=\"data:image\/svg+xml;base64,PCEtLUFyZ29uTG9hZGluZy0tPgo8c3ZnIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3Ryb2tlPSIjZmZmZmZmMDAiPjxnPjwvZz4KPC9zdmc+\"  decoding=\"async\" class=\"rich_pages wxw-img\" style=\"vertical-align: middle; box-sizing: border-box; display: inline;\" data-original=\"https:\/\/www.xh86.me\/wp-content\/uploads\/2021\/12\/wxsync-2021-12-d909c86cf37971f34e47a087e1e0b608.png\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB\/AAffA0nNPuCLAAAAAElFTkSuQmCC\" data-ratio=\"0.5758157\" data-type=\"png\" data-w=\"521\" \/><\/div><\/section>\n<\/section>\n<section style=\"text-align: unset; font-size: 15px; line-height: 2; letter-spacing: 1.75px; padding-right: 5px; padding-left: 5px; box-sizing: border-box;\">\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\n<p style=\"box-sizing: border-box;\">\u5907\u6ce8\uff1a\u5b9e\u9645\u64cd\u4f5c\u4e2dDNS\u670d\u52a1\u4ee3\u7406\u670d\u52a1\u5668\u90e8\u7f72\u5728\u540c\u4e00\u53f0\u4e3b\u673a\u4e0a\uff08\u8282\u7ea6\u865a\u62df\u673a\u8d44\u6e90\uff09\u3002\u4e3b\u673a\u914d\u7f6e\u5982\u8868-2\u6240\u793a\u3002<\/p>\n<\/section>\n<section style=\"box-sizing: border-box;\">\n<section style=\"max-width: 100%; vertical-align: middle; display: inline-block; line-height: 0; box-sizing: border-box;\"><div class='fancybox-wrapper lazyload-container-unload' data-fancybox='post-images' href='https:\/\/www.xh86.me\/wp-content\/uploads\/2021\/12\/wxsync-2021-12-707460bb7cb897db2ba8b019526b04a5.png'><img class=\"lazyload lazyload-style-1\" src=\"data:image\/svg+xml;base64,PCEtLUFyZ29uTG9hZGluZy0tPgo8c3ZnIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3Ryb2tlPSIjZmZmZmZmMDAiPjxnPjwvZz4KPC9zdmc+\"  decoding=\"async\" class=\"rich_pages wxw-img\" style=\"vertical-align: middle; box-sizing: border-box;\" data-original=\"https:\/\/www.xh86.me\/wp-content\/uploads\/2021\/12\/wxsync-2021-12-707460bb7cb897db2ba8b019526b04a5.png\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB\/AAffA0nNPuCLAAAAAElFTkSuQmCC\" data-ratio=\"0.3723776\" data-type=\"png\" data-w=\"572\" \/><\/div><\/section>\n<\/section>\n<section style=\"text-align: unset; font-size: 15px; line-height: 2; letter-spacing: 1.75px; padding-right: 5px; padding-left: 5px; box-sizing: border-box;\">\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\"><span style=\"font-size: 16px; color: #867f7f; box-sizing: border-box;\"><strong style=\"box-sizing: border-box;\">3. \u6b65\u9aa4<\/strong><\/span><\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\u5b9e\u73b0\u6b64\u6848\u4f8b\u9700\u8981\u6309\u7167\u5982\u4e0b\u6b65\u9aa4\u8fdb\u884c\u3002<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\"><strong style=\"box-sizing: border-box;\">\u6b65\u9aa4\u4e00\uff1a\u90e8\u7f72web2\u548cweb3\u670d\u52a1\u5668<\/strong><\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">1\uff09\u5b89\u88c5LNP\u8f6f\u4ef6\u5305<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@web2 ~]# yum -y install gcc pcre-devel openssl-devel<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@web2 lnmp_soft]# tar -xf nginx-1.12.2.tar.gz<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@web2 lnmp_soft]# cd nginx-1.12.2\/<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@web2 nginx-1.12.2]# .\/configure<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">&#8211;with-http_ssl_module<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">&#8211;with-http_stub_status_module<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@web2 nginx-1.12.2]# make &amp;&amp; make instal<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@web2 ~]# yum -y install php php-fpm php-mysql mariadb-devel<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@web3 ~]# yum -y install gcc pcre-devel openssl-devel<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@web3 lnmp_soft]# tar -xf nginx-1.12.2.tar.gz<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@web3 lnmp_soft]# cd nginx-1.12.2\/<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@web3 nginx-1.12.2]# .\/configure<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">&#8211;with-http_ssl_module<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">&#8211;with-http_stub_status_module<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@web3 nginx-1.12.2]# make &amp;&amp; make instal<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@web3 ~]# yum -y install php php-fpm php-mysql mariadb-devel<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">2\uff09\u4fee\u6539nginx\u914d\u7f6e\u5b9e\u73b0\u52a8\u9759\u5206\u79bb\uff08web2\u548cweb3\u64cd\u4f5c\uff09<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">web2\u4fee\u6539\u9ed8\u8ba4\u9996\u9875index.php\uff0c\u914d\u7f6e\u4e24\u4e2alocation\u5b9e\u73b0\u52a8\u9759\u5206\u79bb\u3002<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@web2 ~]# vim \/usr\/local\/nginx\/conf\/nginx.conf<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">location \/ {<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">root html;<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">index index.php index.html index.htm;<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">}<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">location ~ .php$ {<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">root html;<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">fastcgi_pass 127.0.0.1:9000;<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">fastcgi_index index.php;<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">include fastcgi.conf;<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">}<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">web3\u4fee\u6539\u9ed8\u8ba4\u9996\u9875index.php\uff0c\u914d\u7f6e\u4e24\u4e2alocation\u5b9e\u73b0\u52a8\u9759\u5206\u79bb\u3002<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@web3 ~]# vim \/usr\/local\/nginx\/conf\/nginx.conf<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">location \/ {<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">root html;<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">index index.php index.html index.htm;<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">}<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">location ~ .php$ {<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">root html;<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">fastcgi_pass 127.0.0.1:9000;<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">fastcgi_index index.php;<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">include fastcgi.conf; }<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">3\uff09\u542f\u52a8\u76f8\u5173\u670d\u52a1<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@web2 ~]# echo &#8220;\/usr\/local\/nginx\/sbin\/nginx&#8221; &gt;&gt; \/etc\/rc.local<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@web2 ~]# chmod +x \/etc\/rc.local<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@web2 ~]# \/usr\/local\/nginx\/sbin\/nginx<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@web2 ~]# systemctl start php-fpm #\u542f\u52a8php-fpm\u670d\u52a1<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@web2 ~]# systemctl enable php-fpm<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@web3 ~]# echo &#8220;\/usr\/local\/nginx\/sbin\/nginx&#8221; &gt;&gt; \/etc\/rc.local<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@web3 ~]# chmod +x \/etc\/rc.local<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@web3 ~]# \/usr\/local\/nginx\/sbin\/nginx<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@web3 ~]# systemctl start php-fpm #\u542f\u52a8php-fpm\u670d\u52a1<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@web3 ~]# systemctl enable php-fpm<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\u9644\u52a0\u77e5\u8bc6\uff1asystemd\uff01\uff01\uff01<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\u6e90\u7801\u5b89\u88c5\u7684\u8f6f\u4ef6\u9ed8\u8ba4\u65e0\u6cd5\u4f7f\u7528systemd\u7ba1\u7406\uff0c\u5982\u679c\u9700\u8981\u4f7f\u7528systemd\u7ba1\u7406\u6e90\u7801\u5b89\u88c5\u7684\u8f6f\u4ef6\u9700\u8981\u624b\u52a8\u7f16\u5199\u670d\u52a1\u7684service\u6587\u4ef6\uff08\u7f16\u5199\u662f\u53ef\u4ee5\u53c2\u8003\u5176\u4ed6\u670d\u52a1\u7684\u6a21\u677f\u6587\u4ef6\uff09\u3002\u4ee5\u4e0b\u662fnginx\u670d\u52a1\u6700\u7ec8\u7f16\u8f91\u597d\u7684\u6a21\u677f\u3002<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">Service\u6587\u4ef6\u5b58\u50a8\u8def\u5f84\u4e3a\/usr\/lib\/system\/system\/\u76ee\u5f55\u3002<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@centos7 ~]# vim \/usr\/lib\/systemd\/system\/nginx.service<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[Unit]<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">Description=The Nginx HTTP Server<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">#\u63cf\u8ff0\u4fe1\u606f<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">After=network.target remote-fs.target nss-lookup.target<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">#\u6307\u5b9a\u542f\u52a8nginx\u4e4b\u524d\u9700\u8981\u5176\u4ed6\u7684\u5176\u4ed6\u670d\u52a1\uff0c\u5982network.target\u7b49<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[Service]<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">Type=forking<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">#Type\u4e3a\u670d\u52a1\u7684\u7c7b\u578b\uff0c\u4ec5\u542f\u52a8\u4e00\u4e2a\u4e3b\u8fdb\u7a0b\u7684\u670d\u52a1\u4e3asimple\uff0c\u9700\u8981\u542f\u52a8\u82e5\u5e72\u5b50\u8fdb\u7a0b\u7684\u670d\u52a1\u4e3aforking<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">ExecStart=\/usr\/local\/nginx\/sbin\/nginx<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">#\u8bbe\u7f6e\u6267\u884csystemctl start nginx\u540e\u9700\u8981\u542f\u52a8\u7684\u5177\u4f53\u547d\u4ee4.<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">ExecReload=\/usr\/local\/nginx\/sbin\/nginx -s reload<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">#\u8bbe\u7f6e\u6267\u884csystemctl reload nginx\u540e\u9700\u8981\u6267\u884c\u7684\u5177\u4f53\u547d\u4ee4.<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">ExecStop=\/bin\/kill -s QUIT ${MAINPID}<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">#\u8bbe\u7f6e\u6267\u884csystemctl stop nginx\u540e\u9700\u8981\u6267\u884c\u7684\u5177\u4f53\u547d\u4ee4.<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[Install] WantedBy=multi-user.target<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\"><strong style=\"box-sizing: border-box;\">\u6b65\u9aa4\u4e8c\uff1a\u90e8\u7f72NFS\uff0c\u5c06\u7f51\u7ad9\u6570\u636e\u8fc1\u79fb\u81f3NFS\u5171\u4eab\u670d\u52a1\u5668<\/strong><\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">1\uff09\u90e8\u7f72NFS\u5171\u4eab\u670d\u52a1\u5668<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@nfs ~]# yum install nfs-utils<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@nfs ~]# mkdir \/web_share<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@nfs ~]# vim \/etc\/exports<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\/web_share 192.168.2.0\/24(rw,no_root_squash)<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@nfs ~]# systemctl restart rpcbind<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@nfs ~]# systemctl eanble rpcbind<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">NFS\u4f7f\u7528\u7684\u662f\u968f\u673a\u7aef\u53e3\uff0c\u6bcf\u6b21\u542f\u52a8NFS\u90fd\u9700\u8981\u5c06\u81ea\u5df1\u7684\u968f\u673a\u7aef\u53e3\u6ce8\u518c\u5230rpcbind\u670d\u52a1\uff0c\u8fd9\u6837\u5ba2\u6237\u7aef\u8bbf\u95eeNFS\u65f6\u5148\u5230rpcbind\u67e5\u8be2\u7aef\u53e3\u4fe1\u606f\uff0c\u5f97\u5230\u7aef\u53e3\u4fe1\u606f\u540e\u518d\u8bbf\u95eeNFS\u670d\u52a1\u3002<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@nfs ~]# systemctl restart nfs<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@nfs ~]# systemctl enable nfs<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">2\uff09\u8fc1\u79fb\u65e7\u7684\u7f51\u7ad9\u6570\u636e\u5230NFS\u5171\u4eab\u670d\u52a1\u5668<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\u5c06web1\uff08192.168.2.11\uff09\u4e0a\u7684wordpress\u4ee3\u7801\u62f7\u8d1d\u5230NFS\u5171\u4eab\u3002<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@web1 ~]# cd \/usr\/local\/nginx\/<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@web1 nginx]# tar -czpf html.tar.gz html\/<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@web1 nginx]# scp html.tar.gz 192.168.2.31:\/web_share\/<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\u767b\u9646nfs\u670d\u52a1\u5668\uff0c\u5c06\u538b\u7f29\u5305\u89e3\u538b<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@nfs ~]# cd \/web_share\/<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@nfs web_share]# tar -xf html.tar.gz<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">3)\u6240\u6709web\u670d\u52a1\u5668\u8bbf\u95ee\u6302\u8f7dNFS\u5171\u4eab\u6570\u636e\u3002<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@web1 ~]# rm -rf \/usr\/local\/nginx\/html\/*<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@web1 ~]# yum -y install nfs-utils<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@web1 ~]# echo &#8220;192.168.2.31:\/web_share\/html \/usr\/local\/nginx\/html\/ nfs defaults 0 0&#8221; &gt;&gt; \/etc\/fstab<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@web1 ~]# mount -a<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@web2 ~]# yum -y install nfs-utils<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@web2 ~]# echo &#8220;192.168.2.31:\/web_share\/html \/usr\/local\/nginx\/html\/ nfs defaults 0 0&#8221; &gt;&gt; \/etc\/fstab<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@web2 ~]# mount -a<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@web3 ~]# yum -y install nfs-utils<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@web3 ~]# echo &#8220;192.168.2.31:\/web_share\/html \/usr\/local\/nginx\/html\/ nfs defaults 0 0&#8221; &gt;&gt; \/etc\/fstab<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@web3 ~]# mount -a<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\"><strong style=\"box-sizing: border-box;\">\u6b65\u9aa4\u4e09\uff1a\u90e8\u7f72HAProxy\u4ee3\u7406\u670d\u52a1\u5668<\/strong><\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">1\uff09\u90e8\u7f72HAProxy<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\u5b89\u88c5\u8f6f\u4ef6\uff0c\u624b\u52a8\u4fee\u6539\u914d\u7f6e\u6587\u4ef6\uff0c\u6dfb\u52a0\u5982\u4e0b\u5185\u5bb9\u3002<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@proxy ~]# yum -y install haproxy<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@proxy ~]# vim \/etc\/haproxy\/haproxy.cfg<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">listen wordpress *:80<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">balance roundrobin<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">server web1 192.168.2.11:80 check inter 2000 rise 2 fall 3<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">server web2 192.168.2.12:80 check inter 2000 rise 2 fall 3 s<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">erver web3 192.168.2.13:80 check inter 2000 rise 2 fall 3<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@proxy ~]# systemctl start haproxy<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@proxy ~]# systemctl enable haproxy<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\"><strong style=\"box-sizing: border-box;\">\u6b65\u9aa4\u4e09\uff1a\u90e8\u7f72DNS\u57df\u540d\u670d\u52a1\u5668<\/strong><\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">1\uff09\u5b89\u88c5DNS\u76f8\u5173\u8f6f\u4ef6\uff08192.168.4.5\u64cd\u4f5c\uff09\u3002<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@proxy ~]# yum -y install bind bind-chroot<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">2\uff09\u4fee\u6539\u4e3b\u914d\u7f6e\u6587\u4ef6\uff0c\u6dfb\u52a0zone\u3002<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@proxy ~]# vim \/etc\/named.conf<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">options {<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">listen-on port 53 { any; }; #\u670d\u52a1\u76d1\u542c\u7684\u5730\u5740\u4e0e\u7aef\u53e3<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">directory &#8220;\/var\/named&#8221;; #\u6570\u636e\u6587\u4ef6\u8def\u5f84<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">allow-query { any; }; #\u5141\u8bb8\u4efb\u4f55\u4e3b\u673a\u8bbf\u95eeDNS\u670d\u52a1<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">&#8230; &#8230;<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">};<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">zone &#8220;lab.com&#8221; IN { #\u5b9a\u4e49\u6b63\u5411\u533a\u57df<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">type master;<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">file &#8220;lab.com.zone&#8221;;<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">};<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">#include &#8220;\/etc\/named.rfc1912.zones&#8221;;<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">#\u6ce8\u91ca\u6389\u6539\u884c #include &#8220;\/etc\/named.root.key&#8221;; #\u6ce8\u91ca\u6389\u6539\u884c<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@proxy ~]# named-checkconf \/etc\/named.conf #\u68c0\u67e5\u8bed\u6cd5<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">3\uff09\u4fee\u6539\u6b63\u5411\u89e3\u6790\u8bb0\u5f55\u6587\u4ef6\u3002<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\u6ce8\u610f\uff1a\u4fdd\u7559\u6587\u4ef6\u6743\u9650\u3002<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@proxy named]# cp -p \/var\/named\/named.localhost \/var\/named\/lab.com.zone<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@proxy named]# vim \/var\/named\/lab.zone<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">$TTL 1D @<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">IN SOA @ rname.invalid. (<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">0 ; serial<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">1D ; refresh<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">1H ; retry<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">1W ; expire<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">3H ) ; minimum<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">@ NS dns.lab.com.<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">dns A 192.168.4.5 www A 192.168.4.5<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">4\uff09\u542f\u52a8\u670d\u52a1<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@proxy named]# systemctl start named<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@proxy named]# systemctl enable named<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">5\uff09\u5ba2\u6237\u7aef\u4fee\u6539DNS\u89e3\u6790\u6587\u4ef6<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\u63d0\u793a\uff1a\u505a\u5b8c\u5b9e\u9a8c\u4fee\u6539\u56de\u539f\u59cb\u5185\u5bb9\u3002<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@room9pc01 data]# cat \/etc\/resolv.conf<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\"># Generated by NetworkManager<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">search tedu.cn<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">nameserver 192.168.4.5<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">nameserver 172.40.1.10<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">nameserver 192.168.0.220<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\"><strong style=\"box-sizing: border-box;\">\u6b65\u9aa4\u56db\uff1a\u4fee\u6539wordpress\u914d\u7f6e\u6587\u4ef6<\/strong><\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">1\uff09\u4fee\u6539wp-config.php<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\u5728define(\u2018DB_NAME\u2019, \u2018wordpress\u2019)\u8fd9\u884c\u524d\u9762\u6dfb\u52a0\u5982\u4e0b\u4e24\u884c\u5185\u5bb9\uff1a<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@web3 html]# vim \/usr\/local\/nginx\/html\/wp-config.php<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">define(&#8216;WP_SITEURL&#8217;, &#8216;http:\/\/www.lab.com&#8217;);<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">define(&#8216;WP_HOME&#8217;, &#8216;http:\/\/www.lab.com&#8217;);<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\u5982\u679c\u4e0d\u6dfb\u52a0\u8fd9\u4e24\u884c\u914d\u7f6e\uff0c\u6d4f\u89c8\u5668\u8bbf\u95ee\u7f51\u7ad9\u67d0\u4e2a\u5b50\u9875\u9762\u540e\uff0cURL\u4f1a\u56fa\u5b9a\u5230\u67d0\u4e00\u53f0\u540e\u7aef\u670d\u52a1\u5668\u4e0d\u8f6e\u8be2\u3002<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\"><strong style=\"box-sizing: border-box;\">\u9644\u52a0\u77e5\u8bc6\uff08\u5e38\u89c1\u9762\u8bd5\u9898\uff09<\/strong><\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\"><span style=\"text-decoration: underline; box-sizing: border-box;\">\u4ec0\u4e48\u662f\u7070\u5ea6\u53d1\u5e03\uff1f<\/span><\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\u7b54\uff1a\u7070\u5ea6\u53d1\u5e03\uff08\u53c8\u540d\u91d1\u4e1d\u96c0\u53d1\u5e03\uff09\u662f\u6307\u5728\u9ed1\u4e0e\u767d\u4e4b\u95f4\uff0c\u80fd\u591f\u5e73\u6ed1\u8fc7\u6e21\u7684\u4e00\u79cd\u53d1\u5e03\u65b9\u5f0f\u3002<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\u8ba9\u4e00\u90e8\u5206\u7528\u6237\u7ee7\u7eed\u7528\u4ea7\u54c1\u7279\u6027A\uff0c\u4e00\u90e8\u5206\u7528\u6237\u5f00\u59cb\u7528\u4ea7\u54c1\u7279\u6027B\uff0c\u5982\u679c\u7528\u6237\u5bf9B\u6ca1\u6709\u4ec0\u4e48\u53cd\u5bf9\u610f\u89c1\uff0c\u90a3\u4e48\u9010\u6b65\u6269\u5927\u8303\u56f4\uff0c\u628a\u6240\u6709\u7528\u6237\u90fd\u8fc1\u79fb\u5230B\u4e0a\u9762\u6765\u3002\u7070\u5ea6\u53d1\u5e03\u53ef\u4ee5\u4fdd\u8bc1\u6574\u4f53\u7cfb\u7edf\u7684\u7a33\u5b9a\uff0c\u5728\u521d\u59cb\u7070\u5ea6\u7684\u65f6\u5019\u5c31\u53ef\u4ee5\u53d1\u73b0\u3001\u8c03\u6574\u95ee\u9898\uff0c\u4ee5\u4fdd\u8bc1\u5176\u5f71\u54cd\u5ea6\u3002\u7070\u5ea6\u671f\uff1a\u7070\u5ea6\u53d1\u5e03\u5f00\u59cb\u5230\u7ed3\u675f\u671f\u95f4\u7684\u8fd9\u4e00\u6bb5\u65f6\u95f4\uff0c\u79f0\u4e3a\u7070\u5ea6\u671f\u3002<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\"><span style=\"text-decoration: underline; box-sizing: border-box;\">DNS\u670d\u52a1\u5668\u6709\u54ea\u4e9b\u79cd\uff0c\u5176\u4f7f\u7528\u7684\u7aef\u53e3\u4e3a\u591a\u5c11\uff1f<\/span><\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\u7b54\uff1a\u6709 \u6839DNS\u3001\u4e00\u7ea7DNS\u3001\u4e8c\u7ea7DNS\u3001\u4e09\u7ea7DNS\u3001\u7f13\u5b58DNS\uff1b\u4e3bDNS\u670d\u52a1\u5668\u3001\u4eceDNS\u670d\u52a1\u5668\uff1b\u7aef\u53e3\uff1a53<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\"><span style=\"text-decoration: underline; box-sizing: border-box;\">\u4ece\u65e5\u5fd7\/opt\/bjca3\/logs\/ca_access.log\u4e2d\u622a\u53d614\u70b9\u523016\u70b9\u7684\u65e5\u5fd7\uff0c\u5c06\u622a\u53d6\u7684\u65e5\u5fd7\u5bfc\u5165\u5230\/tmp\/ca_access.txt\u4e2d\uff0c\u65e5\u5fd7\u683c\u5f0f\u5982\u4e0b\uff1a<\/span><\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\u7b54\uff1aawk \u2018$4&gt;\u201c13:00:00\u201d&amp;&amp;$4&lt;=\u201c16:59:00\u201d\u2019 ca_access.log<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\"><span style=\"text-decoration: underline; box-sizing: border-box;\">\u76d1\u63a7\u68c0\u67e5\uff0c\u4f7f\u7528ping\u547d\u4ee4\u7f16\u5199\u811a\u672c\u6765\u67e5\u8be2\u4e00\u7ec4IP\u5730\u5740\u540c\u65f6\u68c0\u6d4b\u4ed6\u4eec\u662f\u5426\u5904\u4e8e\u6d3b\u8dc3\u72b6\u6001\u3002\u8981\u6c42\uff08range\uff1a192.168.1.200-192.168.1.220\uff0c\u4e00\u4e2aIP\u53d1\u90014\u4e2aping\u5305\uff0cping\u7684\u8fc7\u7a0b\u4e0d\u80fd\u8f93\u51fa\u4fe1\u606f\u5230\u7ec8\u7aef\uff09\uff1f<\/span><\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\u7b54\uff1a<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">#!\/bin\/bash<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">for i in {200..220}<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">do<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">ping -c 4 -i 0.2 -W 1 192.168.1.$i &amp;&gt;\/dev\/null<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">if [ $? -ne 0 ];then<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">echo &#8220;192.168.1.$i is down&#8221;<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">fi<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">done<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\"><span style=\"text-decoration: underline; box-sizing: border-box;\">\u5047\u8bbenginx\u7684\u8bbf\u95ee\u65e5\u5fd7\u683c\u5f0f\u5982\u4e0b\uff0c\u7edf\u8ba1\u8bbf\u95ee\u9875\u9762\u524d10\u4f4d\u7684IP\u6570\uff1f<\/span><\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\u7b54\uff1a<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">awk \u2018{IP[$1]++} END{for(i in IP){print i,IP[i]}}\u2019 access.log<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">| sort -n | tail -10<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\"><span style=\"text-decoration: underline; box-sizing: border-box;\">\u8bf7\u5217\u4e3e\u51fa10\u4e2a\u4ee5\u4e0a\u7684\u4f60\u6240\u77e5\u6653\u7684SQL\u8bed\u53e5\uff1f<\/span><\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\u53c2\u8003\u7b54\u6848\uff1a<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">insert select delete update create show drop grant revoke load data create view<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\"><span style=\"text-decoration: underline; box-sizing: border-box;\">\u5982\u4f55\u5207\u6362\u5230\u67d0\u4e2a\u6570\u636e\u5e93\uff0c\u5e76\u5728\u4e0a\u9762\u5de5\u4f5c\uff1f<\/span><\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\u7b54\uff1ause \u5e93\u540d;<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\"><span style=\"text-decoration: underline; box-sizing: border-box;\">\u5217\u51fa\u6570\u636e\u5e93\u5185\u7684\u6240\u6709\u8868\uff1f<\/span><\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\u7b54\uff1ashow tables;<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\"><span style=\"text-decoration: underline; box-sizing: border-box;\">\u5982\u4f55\u5220\u9664\u8868\u3001\u5220\u9664\u6570\u636e\u5e93\uff1f<\/span><\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\u7b54\uff1adrop table \u8868\u540d;drop database \u5e93\u540d;<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\"><span style=\"text-decoration: underline; box-sizing: border-box;\">\u5982\u4f55\u5217\u51fa\u8868&#8221;xrt&#8221;\u5185name\u57df\u503c\u4e3a&#8221;tecmint&#8221;\uff0cweb_address\u57df\u503c\u4e3a&#8221;tecmint.com&#8221;\u7684\u6240\u6709\u6570\u636e\uff1f<\/span><\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\u7b54\uff1a<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">select * from xrt where name=&#8221;tecmint&#8221; and web_address=&#8221;tecmint.com&#8221;;<\/p>\n<p style=\"box-sizing: border-box;\">\n<\/section>\n<section style=\"margin-top: 10px; margin-right: 0%; margin-left: 0%; box-sizing: border-box;\">\n<section style=\"font-family: Optima-Regular, PingFangTC-light; color: #3e3e3e; font-size: 18px; line-height: 1; letter-spacing: 1px; box-sizing: border-box;\">\n<p style=\"box-sizing: border-box;\"><strong style=\"box-sizing: border-box;\">Keepalived\u9ad8\u53ef\u7528<\/strong><\/p>\n<\/section>\n<\/section>\n<section style=\"box-sizing: border-box;\">\n<section style=\"display: flex; flex-flow: row nowrap; margin-right: 0%; margin-bottom: 10px; margin-left: 0%; box-sizing: border-box;\">\n<section style=\"display: inline-block; width: auto; vertical-align: top; flex: 100 100 0%; align-self: flex-start; height: auto; line-height: 0; background-color: rgba(86, 61, 227, 0.04); box-sizing: border-box;\">\n<section style=\"box-sizing: border-box;\">\n<section style=\"display: flex; flex-flow: row nowrap; text-align: left; justify-content: flex-start; margin-right: 0%; margin-left: 0%; box-sizing: border-box;\">\n<section style=\"display: inline-block; vertical-align: bottom; width: auto; flex: 0 0 0%; height: auto; align-self: flex-end; box-sizing: border-box;\">\n<section style=\"justify-content: flex-start; box-sizing: border-box;\">\n<section style=\"display: inline-block; width: 8px; height: 8px; vertical-align: top; overflow: hidden; background-color: #375072; box-sizing: border-box;\">\n<section><\/section>\n<\/section>\n<\/section>\n<\/section>\n<section style=\"display: inline-block; vertical-align: bottom; width: auto; flex: 0 0 0%; align-self: flex-end; height: auto; box-sizing: border-box;\">\n<section style=\"justify-content: flex-start; box-sizing: border-box;\">\n<section style=\"display: inline-block; width: 8px; height: 8px; vertical-align: top; overflow: hidden; background-color: #8ec965; box-sizing: border-box;\">\n<section><\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<section style=\"text-align: unset; font-size: 15px; line-height: 2; letter-spacing: 1.75px; padding-right: 5px; padding-left: 5px; box-sizing: border-box;\">\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\"><span style=\"color: #867f7f; font-size: 16px; box-sizing: border-box;\"><strong style=\"box-sizing: border-box;\">1. \u95ee\u9898<\/strong><\/span><\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\u90e8\u7f72\u4e24\u53f0\u4ee3\u7406\u670d\u52a1\u5668\uff0c\u5b9e\u73b0\u5982\u4e0b\u6548\u679c\uff1a<\/p>\n<ul class=\"list-paddingleft-2\">\n<li style=\"box-sizing: border-box;\">\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\u5229\u7528keepalived\u5b9e\u73b0\u4e24\u53f0\u4ee3\u7406\u670d\u52a1\u5668\u7684\u9ad8\u53ef\u7528<\/p>\n<\/li>\n<li style=\"box-sizing: border-box;\">\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\u914d\u7f6eVIP\u4e3a192.168.4.80<\/p>\n<\/li>\n<li style=\"box-sizing: border-box;\">\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\u4fee\u6539\u5bf9\u5e94\u7684\u57df\u540d\u89e3\u6790\u8bb0\u5f55<\/p>\n<\/li>\n<\/ul>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\"><strong style=\"box-sizing: border-box;\"><span style=\"font-size: 16px; color: #867f7f; box-sizing: border-box;\">2. \u65b9\u6848<\/span><\/strong><\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\u5b9e\u9a8c\u62d3\u6251\u5982\u56fe-1\u6240\u793a\uff0c\u505a\u5177\u4f53\u5b9e\u9a8c\u524d\u8bf7\u5148\u914d\u7f6e\u597d\u73af\u5883\u3002<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\n<p style=\"box-sizing: border-box;\">\u5907\u6ce8\uff1a\u5b9e\u9645\u64cd\u4f5c\u4e2dDNS\u670d\u52a1\u4ee3\u7406\u670d\u52a1\u5668\u90e8\u7f72\u5728\u540c\u4e00\u53f0\u4e3b\u673a\u4e0a\uff08\u8282\u7ea6\u865a\u62df\u673a\u8d44\u6e90\uff09\u3002\u4e3b\u673a\u914d\u7f6e\u5982\u8868-1\u6240\u793a\u3002<\/p>\n<\/section>\n<section style=\"box-sizing: border-box;\">\n<section style=\"max-width: 100%; vertical-align: middle; display: inline-block; line-height: 0; box-sizing: border-box;\"><div class='fancybox-wrapper lazyload-container-unload' data-fancybox='post-images' href='https:\/\/www.xh86.me\/wp-content\/uploads\/2021\/12\/wxsync-2021-12-f42ff02b9d75aa65230abb462339ab65.png'><img class=\"lazyload lazyload-style-1\" src=\"data:image\/svg+xml;base64,PCEtLUFyZ29uTG9hZGluZy0tPgo8c3ZnIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3Ryb2tlPSIjZmZmZmZmMDAiPjxnPjwvZz4KPC9zdmc+\"  decoding=\"async\" class=\"rich_pages wxw-img\" style=\"vertical-align: middle; box-sizing: border-box;\" data-original=\"https:\/\/www.xh86.me\/wp-content\/uploads\/2021\/12\/wxsync-2021-12-f42ff02b9d75aa65230abb462339ab65.png\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB\/AAffA0nNPuCLAAAAAElFTkSuQmCC\" data-ratio=\"0.4475524\" data-type=\"png\" data-w=\"572\" \/><\/div><\/section>\n<\/section>\n<section style=\"text-align: unset; font-size: 15px; line-height: 2; letter-spacing: 1.75px; padding-right: 5px; padding-left: 5px; box-sizing: border-box;\">\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\"><span style=\"color: #867f7f; font-size: 16px; box-sizing: border-box;\"><strong style=\"box-sizing: border-box;\">3. \u6b65\u9aa4<\/strong><\/span><\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\u5b9e\u73b0\u6b64\u6848\u4f8b\u9700\u8981\u6309\u7167\u5982\u4e0b\u6b65\u9aa4\u8fdb\u884c\u3002<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\"><strong style=\"box-sizing: border-box;\">\u6b65\u9aa4\u4e00\uff1a\u914d\u7f6e\u7b2c\u4e8c\u53f0\u4ee3\u7406\u670d\u52a1\u5668<\/strong><\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">1\uff09\u90e8\u7f72HAProxy<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\u5b89\u88c5\u8f6f\u4ef6\uff0c\u624b\u52a8\u4fee\u6539\u914d\u7f6e\u6587\u4ef6\uff0c\u6dfb\u52a0\u5982\u4e0b\u5185\u5bb9\u3002<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@proxy2 ~]# yum -y install haproxy<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@proxy2 ~]# vim \/etc\/haproxy\/haproxy.cfg<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">listen wordpress *:80<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">balance roundrobin<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">server web1 192.168.2.11:80 check inter 2000 rise 2 fall 3<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">server web2 192.168.2.12:80 check inter 2000 rise 2 fall 3<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">server web3 192.168.2.13:80 check inter 2000 rise 2 fall 3<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@proxy2 ~]# systemctl start haproxy<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@proxy2 ~]# systemctl enable haproxy<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\"><strong style=\"box-sizing: border-box;\">\u6b65\u9aa4\u4e8c\uff1a\u4e3a\u4e24\u53f0\u4ee3\u7406\u670d\u52a1\u5668\u914d\u7f6ekeepalived<\/strong><\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">1\uff09\u914d\u7f6e\u7b2c\u4e00\u53f0\u4ee3\u7406\u670d\u52a1\u5668proxy\uff08192.168.4.5\uff09\u3002<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@proxy ~]# yum install -y keepalived<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@proxy ~]# vim \/etc\/keepalived\/keepalived.conf<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">global_defs {<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">router_id proxy1 \/\/\u8bbe\u7f6e\u8def\u7531ID\u53f7<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">vrrp_iptables \/\/\u4e0d\u6dfb\u52a0\u4efb\u4f55\u9632\u706b\u5899\u89c4\u5219<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">} vrrp_instance VI_1 {<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">state MASTER \/\/\u4e3b\u670d\u52a1\u5668\u4e3aMASTER\uff08\u5907\u670d\u52a1\u5668\u9700\u8981\u4fee\u6539\u4e3aBACKUP\uff09<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">interface eth0 \/\/\u5b9a\u4e49\u7f51\u7edc\u63a5\u53e3<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">virtual_router_id 51<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">priority 100 \/\/\u670d\u52a1\u5668\u4f18\u5148\u7ea7,\u4f18\u5148\u7ea7\u9ad8\u4f18\u5148\u83b7\u53d6VIP\uff08\u5b9e\u9a8c\u9700\u8981\u4fee\u6539\uff09<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">advert_int 1<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">authentication {<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">auth_type pass<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">auth_pass 1111 \/\/\u4e3b\u5907\u670d\u52a1\u5668\u5bc6\u7801\u5fc5\u987b\u4e00\u81f4<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">}<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">virtual_ipaddress { \/\/\u8c01\u662f\u4e3b\u670d\u52a1\u5668\u8c01\u83b7\u5f97\u8be5VIP\uff08\u5b9e\u9a8c\u9700\u8981\u4fee\u6539\uff09 1<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">92.168.4.80<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">}<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">}<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@proxy ~]# systemctl start keepalived<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\uff01\uff01\uff01\u91cd\u8981\uff01\uff01\uff01<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\u5728\u5168\u5c40\u914d\u7f6eglobal_defs{}\u4e2d\u624b\u52a8\u6dfb\u52a0vrrp_iptables\uff0c\u5373\u53ef\u89e3\u51b3\u9632\u706b\u5899\u7684\u95ee\u9898\u3002<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">2\uff09\u914d\u7f6e\u7b2c\u4e8c\u53f0\u4ee3\u7406\u670d\u52a1\u5668proxy\uff08192.168.4.6\uff09<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@proxy2 ~]# yum install -y keepalived<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@proxy2 ~]# vim \/etc\/keepalived\/keepalived.conf<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">global_defs {<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">router_id proxy2 \/\/\u8bbe\u7f6e\u8def\u7531ID\u53f7<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">vrrp_iptables \/\/\u4e0d\u6dfb\u52a0\u4efb\u4f55\u9632\u706b\u5899\u89c4\u5219<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">}<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">vrrp_instance VI_1 {<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">state BACKUP \/\/\u4e3b\u670d\u52a1\u5668\u4e3aMASTER\uff08\u5907\u670d\u52a1\u5668\u9700\u8981\u4fee\u6539\u4e3aBACKUP\uff09<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">interface eth0 \/\/\u5b9a\u4e49\u7f51\u7edc\u63a5\u53e3<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">virtual_router_id 51<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">priority 50 \/\/\u670d\u52a1\u5668\u4f18\u5148\u7ea7,\u4f18\u5148\u7ea7\u9ad8\u4f18\u5148\u83b7\u53d6VIP<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">advert_int 1<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">authentication {<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">auth_type pass auth_pass 1111 \/\/\u4e3b\u5907\u670d\u52a1\u5668\u5bc6\u7801\u5fc5\u987b\u4e00\u81f4<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">}<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">virtual_ipaddress { \/\/\u8c01\u662f\u4e3b\u670d\u52a1\u5668\u8c01\u83b7\u5f97\u8be5VIP<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">192.168.4.80<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">}<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">}<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@proxy2 ~]# systemctl start keepalived<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\uff01\uff01\uff01\u91cd\u8981\uff01\uff01\uff01<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\u5728\u5168\u5c40\u914d\u7f6eglobal_defs{}\u4e2d\u624b\u52a8\u6dfb\u52a0vrrp_iptables\uff0c\u5373\u53ef\u89e3\u51b3\u9632\u706b\u5899\u7684\u95ee\u9898\u3002<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\"><strong style=\"box-sizing: border-box;\">\u6b65\u9aa4\u4e09\uff1a\u4fee\u6539DNS\u670d\u52a1\u5668<\/strong><\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">1\uff09\u4fee\u6539\u7f51\u7ad9\u57df\u540d\u5bf9\u5e94\u7684\u89e3\u6790\u8bb0\u5f55\uff0c\u89e3\u6790\u5230\u65b0\u7684VIP\u5730\u5740\u3002<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">192.168.4.5\u4e3aDNS\u670d\u52a1\u5668\u3002<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@proxy ~]# vim \/var\/named\/lab.com.zone<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">$TTL 1D<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">@ IN SOA @ rname.invalid. (<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">0 ; serial<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">1D ; refresh<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">1H ; retry<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">1W ; expire<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">3H ) ; minimum<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">@ NS dns.lab.com.<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">dns A 192.168.4.5<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">www A 192.168.4.80<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">2\uff09\u91cd\u542fDNS\u670d\u52a1<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@proxy ~]# systemctl restart named<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\n<\/section>\n<section style=\"margin-top: 10px; margin-right: 0%; margin-left: 0%; box-sizing: border-box;\">\n<section style=\"font-family: Optima-Regular, PingFangTC-light; color: #3e3e3e; font-size: 18px; line-height: 1; letter-spacing: 1px; box-sizing: border-box;\">\n<p style=\"box-sizing: border-box;\"><strong style=\"box-sizing: border-box;\">\u90e8\u7f72Ceph\u5206\u5e03\u5f0f\u5b58\u50a8<\/strong><\/p>\n<\/section>\n<\/section>\n<section style=\"box-sizing: border-box;\">\n<section style=\"display: flex; flex-flow: row nowrap; margin-right: 0%; margin-bottom: 10px; margin-left: 0%; box-sizing: border-box;\">\n<section style=\"display: inline-block; width: auto; vertical-align: top; flex: 100 100 0%; align-self: flex-start; height: auto; line-height: 0; background-color: rgba(86, 61, 227, 0.04); box-sizing: border-box;\">\n<section style=\"box-sizing: border-box;\">\n<section style=\"display: flex; flex-flow: row nowrap; text-align: left; justify-content: flex-start; margin-right: 0%; margin-left: 0%; box-sizing: border-box;\">\n<section style=\"display: inline-block; vertical-align: bottom; width: auto; flex: 0 0 0%; height: auto; align-self: flex-end; box-sizing: border-box;\">\n<section style=\"justify-content: flex-start; box-sizing: border-box;\">\n<section style=\"display: inline-block; width: 8px; height: 8px; vertical-align: top; overflow: hidden; background-color: #375072; box-sizing: border-box;\">\n<section><\/section>\n<\/section>\n<\/section>\n<\/section>\n<section style=\"display: inline-block; vertical-align: bottom; width: auto; flex: 0 0 0%; align-self: flex-end; height: auto; box-sizing: border-box;\">\n<section style=\"justify-content: flex-start; box-sizing: border-box;\">\n<section style=\"display: inline-block; width: 8px; height: 8px; vertical-align: top; overflow: hidden; background-color: #8ec965; box-sizing: border-box;\">\n<section><\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<section style=\"text-align: unset; font-size: 15px; line-height: 2; letter-spacing: 1.75px; padding-right: 5px; padding-left: 5px; box-sizing: border-box;\">\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\"><span style=\"color: #867f7f; font-size: 16px; box-sizing: border-box;\"><strong style=\"box-sizing: border-box;\">1. \u95ee\u9898<\/strong><\/span><\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\"><strong style=\"box-sizing: border-box;\">\u90e8\u7f72Ceph\u5206\u5e03\u5f0f\u5b58\u50a8\uff0c\u5b9e\u73b0\u5982\u4e0b\u6548\u679c\uff1a<\/strong><\/p>\n<ul class=\"list-paddingleft-2\">\n<li style=\"box-sizing: border-box;\">\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\u4f7f\u7528\u4e09\u53f0\u670d\u52a1\u5668\u90e8\u7f72Ceph\u5206\u5e03\u5f0f\u5b58\u50a8<\/p>\n<\/li>\n<li style=\"box-sizing: border-box;\">\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\u5b9e\u73b0Ceph\u6587\u4ef6\u7cfb\u7edf\u5171\u4eab<\/p>\n<\/li>\n<li style=\"box-sizing: border-box;\">\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\u5c06\u7f51\u7ad9\u6570\u636e\u4eceNFS\u8fc1\u79fb\u5230Ceph\u5b58\u50a8<\/p>\n<\/li>\n<\/ul>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\"><strong style=\"box-sizing: border-box;\"><span style=\"font-size: 16px; color: #867f7f; box-sizing: border-box;\">2. \u65b9\u6848<\/span><\/strong><\/p>\n<p style=\"box-sizing: border-box;\">\u5b9e\u9a8c\u62d3\u6251\u5982\u56fe-2\u6240\u793a\uff0c\u505a\u5177\u4f53\u5b9e\u9a8c\u524d\u8bf7\u5148\u914d\u7f6e\u597d\u73af\u5883\u3002<\/p>\n<\/section>\n<section style=\"box-sizing: border-box;\">\n<section style=\"max-width: 100%; vertical-align: middle; display: inline-block; line-height: 0; box-sizing: border-box;\"><div class='fancybox-wrapper lazyload-container-unload' data-fancybox='post-images' href='https:\/\/www.xh86.me\/wp-content\/uploads\/2021\/12\/wxsync-2021-12-3c2511cd417db4de5fa051fc4f04614c.png'><img class=\"lazyload lazyload-style-1\" src=\"data:image\/svg+xml;base64,PCEtLUFyZ29uTG9hZGluZy0tPgo8c3ZnIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3Ryb2tlPSIjZmZmZmZmMDAiPjxnPjwvZz4KPC9zdmc+\"  decoding=\"async\" class=\"rich_pages wxw-img\" style=\"vertical-align: middle; box-sizing: border-box;\" data-original=\"https:\/\/www.xh86.me\/wp-content\/uploads\/2021\/12\/wxsync-2021-12-3c2511cd417db4de5fa051fc4f04614c.png\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB\/AAffA0nNPuCLAAAAAElFTkSuQmCC\" data-ratio=\"0.4610778\" data-type=\"png\" data-w=\"501\" \/><\/div><\/section>\n<\/section>\n<section style=\"text-align: unset; font-size: 15px; line-height: 2; letter-spacing: 1.75px; padding-right: 5px; padding-left: 5px; box-sizing: border-box;\">\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\n<p style=\"box-sizing: border-box;\">\u5907\u6ce8\uff1a\u5b9e\u9645\u64cd\u4f5c\u4e2dDNS\u670d\u52a1\u4ee3\u7406\u670d\u52a1\u5668\u90e8\u7f72\u5728\u540c\u4e00\u53f0\u4e3b\u673a\u4e0a\uff08\u8282\u7ea6\u865a\u62df\u673a\u8d44\u6e90\uff09\u3002\u4e3b\u673a\u914d\u7f6e\u5982\u8868-2\u6240\u793a\u3002<\/p>\n<\/section>\n<section style=\"box-sizing: border-box;\">\n<section style=\"max-width: 100%; vertical-align: middle; display: inline-block; line-height: 0; box-sizing: border-box;\"><div class='fancybox-wrapper lazyload-container-unload' data-fancybox='post-images' href='https:\/\/www.xh86.me\/wp-content\/uploads\/2021\/12\/wxsync-2021-12-8a5a3da97296ebd4340a8412aa134fff.png'><img class=\"lazyload lazyload-style-1\" src=\"data:image\/svg+xml;base64,PCEtLUFyZ29uTG9hZGluZy0tPgo8c3ZnIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3Ryb2tlPSIjZmZmZmZmMDAiPjxnPjwvZz4KPC9zdmc+\"  decoding=\"async\" class=\"rich_pages wxw-img\" style=\"vertical-align: middle; box-sizing: border-box; display: inline;\" data-original=\"https:\/\/www.xh86.me\/wp-content\/uploads\/2021\/12\/wxsync-2021-12-8a5a3da97296ebd4340a8412aa134fff.png\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB\/AAffA0nNPuCLAAAAAElFTkSuQmCC\" data-ratio=\"0.1853147\" data-type=\"png\" data-w=\"572\" \/><\/div><\/section>\n<\/section>\n<section style=\"text-align: unset; font-size: 15px; line-height: 2; letter-spacing: 1.75px; padding-right: 5px; padding-left: 5px; box-sizing: border-box;\">\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\"><span style=\"font-size: 16px; box-sizing: border-box;\"><strong style=\"box-sizing: border-box;\">3. \u6b65\u9aa4<\/strong><\/span><\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\u5b9e\u73b0\u6b64\u6848\u4f8b\u9700\u8981\u6309\u7167\u5982\u4e0b\u6b65\u9aa4\u8fdb\u884c\u3002<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\"><strong style=\"box-sizing: border-box;\">\u6b65\u9aa4\u4e00\uff1a\u51c6\u5907\u5b9e\u9a8c\u73af\u5883<\/strong><\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">1\uff09\u7269\u7406\u673a\u4e3a\u6240\u6709\u8282\u70b9\u914d\u7f6eyum\u6e90\u670d\u52a1\u5668\u3002<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\u63d0\u793a\uff1aceph10.iso\u5728\/linux-soft\/02\u76ee\u5f55\u3002<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@room9pc01 ~]# mkdir \/var\/ftp\/ceph<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@room9pc01 ~]# mount ceph10.iso \/var\/ftp\/ceph\/<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">2\uff09\u5728node1\u914d\u7f6eSSH\u5bc6\u94a5\uff0c\u8ba9node1\u53ef\u7528\u65e0\u5bc6\u7801\u8fde\u63a5node1,node2,node3<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@node1 ~]# ssh-keygen -f \/root\/.ssh\/id_rsa -N &#8221;<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@node1 ~]# for i in 41 42 43<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">do<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">ssh-copy-id 192.168.2.$i<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">done<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">3)\u4fee\u6539\/etc\/hosts\u57df\u540d\u89e3\u6790\u8bb0\u5f55\uff08\u4e0d\u8981\u5220\u9664\u539f\u6709\u7684\u6570\u636e\uff09\uff0c\u540c\u6b65\u7ed9\u6240\u6709ceph\u8282\u70b9\u3002<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@node1 ~]# vim \/etc\/hosts<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">192.168.2.41 node1<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">192.168.2.42 node2<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">192.168.2.43 node3<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@node1 ~]# for i in 41 42 43<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">do<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">scp \/etc\/hosts 192.168.2.$i:\/etc<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">done<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">4\uff09\u4e3a\u6240\u6709ceph\u8282\u70b9\u914d\u7f6eyum\u6e90\uff0c\u5e76\u5c06\u914d\u7f6e\u540c\u6b65\u7ed9\u6240\u6709\u8282\u70b9<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@node1 ~]# cat \/etc\/yum.repos.d\/ceph.repo<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[mon]<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">name=mon<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">baseurl=ftp:\/\/192.168.2.254\/ceph\/MON<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">gpgcheck=0<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[osd]<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">name=osd<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">baseurl=ftp:\/\/192.168.2.254\/ceph\/OSD<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">gpgcheck=0<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[tools]<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">name=tools<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">baseurl=ftp:\/\/192.168.2.254\/ceph\/Tools<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">gpgcheck=0<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@node1 ~]# yum repolist #\u9a8c\u8bc1YUM\u6e90\u8f6f\u4ef6\u6570\u91cf<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\u6e90\u6807\u8bc6 \u6e90\u540d\u79f0 \u72b6\u6001<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">Dvd redhat 9,911<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">Mon mon 41<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">Osd osd 28<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">Tools tools 33<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">repolist: 10,013<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@node1 ~]# for i in 41 42 43<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">do<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">scp \/etc\/yum.repos.d\/ceph.repo 192.168.2.$i:\/etc\/yum.repos.d\/<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">done<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">5\uff09\u6240\u6709\u8282\u70b9\u4e3b\u673a\u4e0e\u771f\u5b9e\u4e3b\u673a\u7684NTP\u670d\u52a1\u5668\u540c\u6b65\u65f6\u95f4\u3002<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\u63d0\u793a\uff1a\u9ed8\u8ba4\u771f\u5b9e\u7269\u7406\u673a\u5df2\u7ecf\u914d\u7f6e\u4e3aNTP\u670d\u52a1\u5668\u3002<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@node1 ~]# vim \/etc\/chrony.conf<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\u2026 \u2026<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">server 192.168.2.254 iburst<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@node1 ~]# for i in 41 42 43<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">do<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">scp \/etc\/chrony.conf 192.168.2.$i:\/etc\/<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">ssh 192.168.2.$i &#8220;systemctl restart chronyd&#8221;<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">done<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">6\uff09\u4f7f\u7528virt-manager\u4e3a\u4e09\u53f0ceph\u865a\u62df\u673a\u6dfb\u52a0\u78c1\u76d8\u3002<span style=\"font-size: 14px; box-sizing: border-box;\">\u6bcf\u53f0\u865a\u62df\u673a\u6dfb\u52a02\u575720G\u7684\u78c1\u76d8\u3002<\/span><\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\"><strong style=\"box-sizing: border-box;\">\u6b65\u9aa4\u4e8c\uff1a\u90e8\u7f72ceph\u96c6\u7fa4<\/strong><\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">1\uff09\u7ed9node1\u4e3b\u673a\u5b89\u88c5ceph-deploy\uff0c\u521b\u5efa\u5de5\u4f5c\u76ee\u5f55\uff0c\u521d\u59cb\u5316\u914d\u7f6e\u6587\u4ef6\u3002<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@node1 ~]# yum -y install ceph-deploy<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@node1 ~]# mkdir ceph-cluster<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@node1 ~]# cd ceph-cluster<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">2<span style=\"font-size: 14px; box-sizing: border-box;\">\uff09\u7ed9\u6240\u6709ceph\u8282\u70b9\u5b89\u88c5ceph\u76f8\u5173\u8f6f\u4ef6\u5305<\/span><\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@node1 ceph-cluster]# for i in node1 node2 node3<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">do<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">ssh $i &#8220;yum -y install ceph-mon ceph-osd ceph-mds&#8221;<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">done<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">3\uff09\u521d\u59cb\u5316mon\u670d\u52a1<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@node1 ceph-cluster]# ceph-deploy new node1 node2 node3<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@node1 ceph-cluster]# ceph-deploy mon create-initial<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@node1 ceph-cluster]# ceph -s #\u67e5\u770b\u7ed3\u679c<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">cluster 9f3e04b8-7dbb-43da-abe6-b9e3f5e46d2e<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">health HEALTH_ERR monmap e2: 3 mons at<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">{node1=192.168.2.41:6789\/0,node2=192.168.2.42:6789\/0,node3=192.168.2.43:6789\/0}<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">osdmap e45: 0 osds: 0 up, 0 in<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">4\uff09\u51c6\u5907\u78c1\u76d8\u5206\u533a\uff0c\u521b\u5efajournal\u76d8\uff0c\u5e76\u6c38\u4e45\u4fee\u6539\u8bbe\u5907\u6743\u9650\u3002<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@node1 ceph-cluster]# for i in node1 node2 node3<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">do<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">ssh $i &#8220;parted \/dev\/vdb mklabel gpt&#8221;<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">ssh $i &#8220;parted \/dev\/vdb mkpart primary 1 100%&#8221;<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">done<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\u63d0\u793a\uff1a\u4e0b\u9762\u7684\u6b65\u9aa4\u5728\u6240\u6709\u4e3b\u673a\u90fd\u9700\u8981\u64cd\u4f5c\uff08node1\uff0cnode2\uff0cnode3\uff09<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">#\u4e34\u65f6\u4fee\u6539\u6743\u9650\uff1a<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@node1 ceph-cluster]# chown ceph.ceph \/dev\/vdb1<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">#\u6c38\u4e45\u4fee\u6539\u6743\u9650\uff1a<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@node1 ceph-cluster]# vim \/etc\/udev\/rules.d\/70-vdb.rules<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">ENV{DEVNAME}==&#8221;\/dev\/vdb1&#8243;,OWNER=&#8221;ceph&#8221;,GROUP=&#8221;ceph&#8221;<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">4\uff09\u4f7f\u7528ceph-deploy\u5de5\u5177\u521d\u59cb\u5316\u6570\u636e\u78c1\u76d8\uff08\u4ec5node1\u64cd\u4f5c\uff09\u3002<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@node1 ceph-cluster]# ceph-deploy disk zap node1:vdc<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@node1 ceph-cluster]# ceph-deploy disk zap node2:vdc<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@node1 ceph-cluster]# ceph-deploy disk zap node3:vdc<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">5\uff09\u521d\u59cb\u5316OSD\u96c6\u7fa4\u3002<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@node1 ceph-cluster]# ceph-deploy osd create<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">node1:vdc:\/dev\/vdb1<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\/\/\u521b\u5efaosd\u5b58\u50a8\u8bbe\u5907\uff0cvdc\u4e3a\u96c6\u7fa4\u63d0\u4f9b\u5b58\u50a8\u7a7a\u95f4\uff0cvdb1\u63d0\u4f9bJOURNAL\u7f13\u5b58\uff0c<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\/\/\u4e00\u4e2a\u5b58\u50a8\u8bbe\u5907\u5bf9\u5e94\u4e00\u4e2a\u7f13\u5b58\u8bbe\u5907\uff0c\u7f13\u5b58\u9700\u8981SSD\uff0c\u4e0d\u9700\u8981\u5f88\u5927<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@node1 ceph-cluster]# ceph-deploy osd create<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">node2:vdc:\/dev\/vdb1<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@node1 ceph-cluster]# ceph-deploy osd create<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">node3:vdc:\/dev\/vdb1<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@node1 ceph-cluster]# ceph -s #\u67e5\u770b\u96c6\u7fa4\u72b6\u6001<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">cluster 9f3e04b8-7dbb-43da-abe6-b9e3f5e46d2e<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">health HEALTH_OK<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">monmap e2: 3 mons at {node1=192.168.4.11:6789\/0,node2=192.168.4.12:6789\/0,node3=192.168.4.13:6789\/0}<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">election epoch 6, quorum 0,1,2 node1,node2,node3<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">osdmap e45: 3 osds: 3 up, 3 in<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">flags sortbitwise<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">pgmap v25712: 64 pgs, 1 pools, 86465 kB data, 2612 objects<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">508 MB used, 60 GB \/ 60 GB avail<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">64 active+clean<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\"><strong style=\"box-sizing: border-box;\">\u6b65\u9aa4\u4e09\uff1a\u90e8\u7f72ceph\u6587\u4ef6\u7cfb\u7edf<\/strong><\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">1\uff09\u542f\u52a8mds\u670d\u52a1<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@node1 ceph-cluster]# ceph-deploy mds create node3<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">2\uff09\u521b\u5efa\u5b58\u50a8\u6c60\uff08\u6587\u4ef6\u7cfb\u7edf\u7531inode\u548cblock\u7ec4\u6210\uff09<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@node1 ceph-cluster]# ceph osd pool create cephfs_data 128<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@node1 ceph-cluster]# ceph osd pool create cephfs_metadata 128<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@node1 ceph-cluster]# ceph osd lspools<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">0 rbd,1 cephfs_data,2 cephfs_metadata<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">3\uff09\u521b\u5efa\u6587\u4ef6\u7cfb\u7edf<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@node1 ceph-cluster]# ceph fs new myfs1 cephfs_metadata cephfs_data<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@node1 ceph-cluster]# ceph fs ls<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">name: myfs1, metadata pool: cephfs_metadata, data pools: [cephfs_data ]<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\"><strong style=\"box-sizing: border-box;\">\u6b65\u9aa4\u56db\uff1a\u8fc1\u79fb\u7f51\u7ad9\u6570\u636e\u5230ceph\u96c6\u7fa4<\/strong><\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">1\uff09\u5378\u8f7dweb1\uff0cweb2\uff0cweb3\u7684NFS\u5171\u4eab\u3002<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\u6682\u505c\u670d\u52a1\u9632\u6b62\u6709\u4eba\u5b9e\u65f6\u8bfb\u5199\u6587\u4ef6\u3002<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@web1 ~]# \/usr\/local\/nginx\/sbin\/nginx -s stop<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@web2 ~]# \/usr\/local\/nginx\/sbin\/nginx -s stop<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@web3 ~]# \/usr\/local\/nginx\/sbin\/nginx -s stop<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@web1 ~]# umount \/usr\/local\/nginx\/html<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@web2 ~]# umount \/usr\/local\/nginx\/html<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@web3 ~]# umount \/usr\/local\/nginx\/html<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@web1 ~]# vim \/etc\/fstab<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">#192.168.2.31:\/web_share\/html \/usr\/local\/nginx\/html\/ nfs defaults 0 0<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@web2 ~]# vim \/etc\/fstab<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">#192.168.2.31:\/web_share\/html \/usr\/local\/nginx\/html\/ nfs defaults 0 0<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@web3 ~]# vim \/etc\/fstab<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">#192.168.2.31:\/web_share\/html \/usr\/local\/nginx\/html\/ nfs defaults 0 0<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">2\uff09web\u670d\u52a1\u5668\u6c38\u4e45\u6302\u8f7dCeph\u6587\u4ef6\u7cfb\u7edf\uff08web1\u3001web2\u3001web3\u90fd\u9700\u8981\u64cd\u4f5c\uff09\u3002<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\u5728\u4efb\u610fceph\u8282\u70b9\uff0c\u5982node1\u67e5\u770bceph\u8d26\u6237\u4e0e\u5bc6\u7801\u3002<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@node1 ~]# cat \/etc\/ceph\/ceph.client.admin.keyring<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[client.admin]<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">key = AQA0KtlcRGz5JxAA\/K0AD\/uNuLI1RqPsNGC7zg==<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\/etc\/rc.local\u662f\u5f00\u673a\u542f\u52a8\u811a\u672c\uff0c\u4efb\u4f55\u547d\u4ee4\u653e\u5728\u8be5\u6587\u4ef6\u4e2d\u90fd\u662f\u5f00\u673a\u81ea\u542f\u3002<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@web1 ~]# mount -t ceph 192.168.2.41:6789:\/ \/usr\/local\/nginx\/html\/<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">-o name=admin,secret=AQA0KtlcRGz5JxAA\/K0AD\/uNuLI1RqPsNGC7zg==<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@web1 ~]# echo &#8216;mount -t ceph 192.168.2.41:6789:\/ \/usr\/local\/nginx\/html\/<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">-o name=admin,secret=AQA0KtlcRGz5JxAA\/K0AD\/uNuLI1RqPsNGC7zg==&#8217; &gt;&gt; \/etc\/rc.local<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@web1 ~]# chmod +x \/etc\/rc.local<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@web2 ~]# mount -t ceph 192.168.2.41:6789:\/ \/usr\/local\/nginx\/html\/<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">-o name=admin,secret=AQA0KtlcRGz5JxAA\/K0AD\/uNuLI1RqPsNGC7zg==<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@web2 ~]# echo &#8216;mount -t ceph 192.168.2.41:6789:\/ \/usr\/local\/nginx\/html\/<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">-o name=admin,secret=AQA0KtlcRGz5JxAA\/K0AD\/uNuLI1RqPsNGC7zg==&#8217; &gt;&gt; \/etc\/rc.local<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@web2 ~]# chmod +x \/etc\/rc.local<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@web3 ~]# mount -t ceph 192.168.2.41:6789:\/ \/usr\/local\/nginx\/html\/<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">-o name=admin,secret=AQA0KtlcRGz5JxAA\/K0AD\/uNuLI1RqPsNGC7zg==<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@web3 ~]# echo &#8216;mount -t ceph 192.168.2.41:6789:\/ \/usr\/local\/nginx\/html\/<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">-o name=admin,secret=AQA0KtlcRGz5JxAA\/K0AD\/uNuLI1RqPsNGC7zg==&#8217; &gt;&gt; \/etc\/rc.local<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@web3 ~]# chmod +x \/etc\/rc.local<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\u53e6\u4e00\u79cd\u89e3\u51b3\u65b9\u6848\uff0c\u8fd8\u53ef\u4ee5\u901a\u8fc7fstab\u5b9e\u73b0\u6c38\u4e45\u6302\u8f7d\u3002<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\u63d0\u793a\uff1a\u5982\u679c\u5e0c\u671b\u4f7f\u7528fstab\u5b9e\u73b0\u6c38\u4e45\u6302\u8f7d\uff0c\u5ba2\u6237\u7aef\u9700\u8981\u989d\u5916\u5b89\u88c5libcephfs1\u8f6f\u4ef6\u5305\u3002<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@web1 ~]# yum -y install libcephfs1<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@web1 ~]# vim \/etc\/fstab<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\u2026 \u2026<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">192.168.4.11:\/ \/usr\/local\/nginx\/html\/ ceph defaults,_netdev,name=admin,secret=AQCVcu9cWXkgKhAAWSa7qCFnFVbNCTB2DwGIOA== 0 0<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\u7b2c\u4e09\u79cd\u6302\u8f7d\u65b9\u6848\uff1a\u5bf9\u4e8e\u9ad8\u53ef\u7528\u7684\u95ee\u9898\uff0c\u53ef\u4ee5\u5728mount\u65f6\u540c\u65f6\u5199\u5165\u591a\u4e2aIP\u3002<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\u4e34\u65f6\u547d\u4ee4\uff1a<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@web1 ~]# mount -t ceph<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">192.168.4.11:6789,192.168.4.12:6789,192.168.4.13:6789:\/ \/usr\/local\/nginx\/html<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">-o name=admin,secret=\u5bc6\u94a5<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\u6c38\u4e45\u4fee\u6539\uff1a<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@web1 ~]# vim \/etc\/fstab<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">192.168.4.11:6789,192.168.4.12:6789,192.168.4.13:6789:\/ \/usr\/local\/nginx\/html\/<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">ceph defaults,_netdev,name=admin,secret=\u5bc6\u94a5 0 0<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">3)\u8fc1\u79fbNFS\u670d\u52a1\u5668\u4e2d\u7684\u6570\u636e\u5230Ceph\u5b58\u50a8<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\u767b\u9646NFS\u670d\u52a1\u5668\u5907\u4efd\u6570\u636e\uff0c\u5c06\u5907\u4efd\u6570\u636e\u62f7\u8d1d\u7ed9web1\u6216web2\u6216web3\uff0ctar\u5907\u4efd\u6570\u636e\u65f6\u6ce8\u610f\u4f7f\u7528-f\u9009\u9879\u4fdd\u7559\u6587\u4ef6\u6743\u9650\u3002<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@nfs ~]# cd \/web_share\/html\/<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@nfs html]# tar -czpf \/root\/html.tar.gz .\/*<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@nfs html]# scp \/root\/html.tar.gz 192.168.2.11:\/usr\/local\/nginx\/html\/<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\u767b\u9646web1\u5c06\u6570\u636e\u6062\u590d\u5230Ceph\u5171\u4eab\u76ee\u5f55<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@web1 html]# tar -xf html.tar.gz<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@web1 html]# rm -rf html.tar.gz<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">4\uff09\u6062\u590dweb\u670d\u52a1<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@web1 ~]# \/usr\/local\/nginx\/sbin\/nginx<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@web2 ~]# \/usr\/local\/nginx\/sbin\/nginx<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@web3 ~]# \/usr\/local\/nginx\/sbin\/nginx<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\n<\/section>\n<section style=\"margin-top: 10px; margin-right: 0%; margin-left: 0%; box-sizing: border-box;\">\n<section style=\"font-family: Optima-Regular, PingFangTC-light; color: #3e3e3e; font-size: 18px; line-height: 1; letter-spacing: 1px; box-sizing: border-box;\">\n<p style=\"box-sizing: border-box;\"><strong style=\"box-sizing: border-box;\">\u90e8\u7f72Git\u7248\u672c\u63a7\u5236\u7cfb\u7edf<\/strong><\/p>\n<\/section>\n<\/section>\n<section style=\"box-sizing: border-box;\">\n<section style=\"display: flex; flex-flow: row nowrap; margin-right: 0%; margin-bottom: 10px; margin-left: 0%; box-sizing: border-box;\">\n<section style=\"display: inline-block; width: auto; vertical-align: top; flex: 100 100 0%; align-self: flex-start; height: auto; line-height: 0; background-color: rgba(86, 61, 227, 0.04); box-sizing: border-box;\">\n<section style=\"box-sizing: border-box;\">\n<section style=\"display: flex; flex-flow: row nowrap; text-align: left; justify-content: flex-start; margin-right: 0%; margin-left: 0%; box-sizing: border-box;\">\n<section style=\"display: inline-block; vertical-align: bottom; width: auto; flex: 0 0 0%; height: auto; align-self: flex-end; box-sizing: border-box;\">\n<section style=\"justify-content: flex-start; box-sizing: border-box;\">\n<section style=\"display: inline-block; width: 8px; height: 8px; vertical-align: top; overflow: hidden; background-color: #375072; box-sizing: border-box;\">\n<section><\/section>\n<\/section>\n<\/section>\n<\/section>\n<section style=\"display: inline-block; vertical-align: bottom; width: auto; flex: 0 0 0%; align-self: flex-end; height: auto; box-sizing: border-box;\">\n<section style=\"justify-content: flex-start; box-sizing: border-box;\">\n<section style=\"display: inline-block; width: 8px; height: 8px; vertical-align: top; overflow: hidden; background-color: #8ec965; box-sizing: border-box;\">\n<section><\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<section style=\"text-align: unset; font-size: 15px; line-height: 2; letter-spacing: 1.75px; padding-right: 5px; padding-left: 5px; box-sizing: border-box;\">\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\"><span style=\"font-size: 16px; color: #867f7f; box-sizing: border-box;\"><strong style=\"box-sizing: border-box;\">1. \u95ee\u9898<\/strong><\/span><\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\"><strong style=\"box-sizing: border-box;\">\u90e8\u7f72Git\u7248\u672c\u63a7\u5236\u7cfb\u7edf\uff0c\u7ba1\u7406\u7f51\u7ad9\u4ee3\u7801\uff0c\u5b9e\u73b0\u5982\u4e0b\u6548\u679c\uff1a<\/strong><\/p>\n<ul class=\"list-paddingleft-2\">\n<li style=\"box-sizing: border-box;\">\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\u57fa\u4e8eSSH\u534f\u8bae\u7684\u670d\u52a1\u5668<\/p>\n<\/li>\n<li style=\"box-sizing: border-box;\">\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\u57fa\u4e8eGit\u534f\u8bae\u7684\u670d\u52a1\u5668<\/p>\n<\/li>\n<li style=\"box-sizing: border-box;\">\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\u57fa\u4e8eHTTP\u534f\u8bae\u7684\u670d\u52a1\u5668<\/p>\n<\/li>\n<li style=\"box-sizing: border-box;\">\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\u4e0a\u4f20\u4ee3\u7801\u5230\u7248\u672c\u4ed3\u5e93<\/p>\n<\/li>\n<\/ul>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\"><span style=\"font-size: 16px; color: #867f7f; box-sizing: border-box;\"><strong style=\"box-sizing: border-box;\">2. \u65b9\u6848<\/strong><\/span><\/p>\n<p style=\"box-sizing: border-box;\">\u751f\u4ea7\u73af\u5883\u5e94\u8be5\u6709\u4e00\u53f0\u72ec\u7acb\u7684Git\u670d\u52a1\u5668\uff0c\u8fd9\u91cc\u4e3a\u4e86\u8282\u7ea6\u4e3b\u673a\u8d44\u6e90\uff0c\u6211\u4eec\u4f7f\u7528\u6570\u636e\u5e93\u4e3b\u673a\u540c\u65f6\u505a\u5b8cGit\u670d\u52a1\u5668\uff0c\u5982\u56fe-1\u6240\u793a\u3002<\/p>\n<\/section>\n<section style=\"box-sizing: border-box;\">\n<section style=\"max-width: 100%; vertical-align: middle; display: inline-block; line-height: 0; box-sizing: border-box;\"><div class='fancybox-wrapper lazyload-container-unload' data-fancybox='post-images' href='https:\/\/www.xh86.me\/wp-content\/uploads\/2021\/12\/wxsync-2021-12-c77061f979f6aa3373cf9b72e61a0e39.png'><img class=\"lazyload lazyload-style-1\" src=\"data:image\/svg+xml;base64,PCEtLUFyZ29uTG9hZGluZy0tPgo8c3ZnIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3Ryb2tlPSIjZmZmZmZmMDAiPjxnPjwvZz4KPC9zdmc+\"  decoding=\"async\" class=\"rich_pages wxw-img\" style=\"vertical-align: middle; box-sizing: border-box;\" data-original=\"https:\/\/www.xh86.me\/wp-content\/uploads\/2021\/12\/wxsync-2021-12-c77061f979f6aa3373cf9b72e61a0e39.png\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB\/AAffA0nNPuCLAAAAAElFTkSuQmCC\" data-ratio=\"0.4610778\" data-type=\"png\" data-w=\"501\" \/><\/div><\/section>\n<\/section>\n<section style=\"text-align: unset; font-size: 15px; line-height: 2; letter-spacing: 1.75px; padding-right: 5px; padding-left: 5px; box-sizing: border-box;\">\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\n<p style=\"box-sizing: border-box;\">\u4e3b\u673a\u914d\u7f6e\u5982\u8868-1\u6240\u793a\u3002<\/p>\n<\/section>\n<section style=\"box-sizing: border-box;\">\n<section style=\"max-width: 100%; vertical-align: middle; display: inline-block; line-height: 0; box-sizing: border-box;\"><div class='fancybox-wrapper lazyload-container-unload' data-fancybox='post-images' href='https:\/\/www.xh86.me\/wp-content\/uploads\/2021\/12\/wxsync-2021-12-c957a4367c78875c972cc5ef46ef461d.png'><img class=\"lazyload lazyload-style-1\" src=\"data:image\/svg+xml;base64,PCEtLUFyZ29uTG9hZGluZy0tPgo8c3ZnIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3Ryb2tlPSIjZmZmZmZmMDAiPjxnPjwvZz4KPC9zdmc+\"  decoding=\"async\" class=\"rich_pages wxw-img\" style=\"vertical-align: middle; box-sizing: border-box;\" data-original=\"https:\/\/www.xh86.me\/wp-content\/uploads\/2021\/12\/wxsync-2021-12-c957a4367c78875c972cc5ef46ef461d.png\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB\/AAffA0nNPuCLAAAAAElFTkSuQmCC\" data-ratio=\"0.1101399\" data-type=\"png\" data-w=\"572\" \/><\/div><\/section>\n<\/section>\n<section style=\"text-align: unset; font-size: 15px; line-height: 2; letter-spacing: 1.75px; padding-right: 5px; padding-left: 5px; box-sizing: border-box;\">\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\"><span style=\"font-size: 16px; color: #867f7f; box-sizing: border-box;\"><strong style=\"box-sizing: border-box;\">3. \u6b65\u9aa4<\/strong><\/span><\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\u5b9e\u73b0\u6b64\u6848\u4f8b\u9700\u8981\u6309\u7167\u5982\u4e0b\u6b65\u9aa4\u8fdb\u884c\u3002<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\"><strong style=\"box-sizing: border-box;\">\u6b65\u9aa4\u4e00\uff1a\u90e8\u7f72SSH\u534f\u8bae\u7684\u7248\u672c\u63a7\u5236\u670d\u52a1\u5668<\/strong><\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">1\uff09\u5b89\u88c5\u8f6f\u4ef6\u5305\uff0c\u521b\u5efa\u7a7a\u4ed3\u5e93\u3002<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@database ~]# yum -y install git<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@database ~]# mkdir \/var\/git\/<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@database ~]# git init &#8211;bare \/var\/git\/wordpress.git #\u521b\u5efa\u7a7a\u4ed3\u5e93<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">2\uff09\u767b\u9646web1\u670d\u52a1\u5668\u514b\u9686git\u4ed3\u5e93\uff0c\u4e0a\u4f20\u7f51\u7ad9\u4ee3\u7801\u5230git\u670d\u52a1\u5668\u3002<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@web1 var]# git config &#8211;global push.default simple<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@web1 var]# git config &#8211;global user.email you@example.com<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@web1 var]# git config &#8211;global user.name &#8220;Your Name&#8221;<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@web1 var]# cd \/var\/<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@web1 var]# git clone root@192.168.2.21:\/var\/git\/wordpress.git<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@web1 var]# cd \/var\/wordpress<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@web1 wordpress]# cp -a \/usr\/local\/nginx\/html\/* \u00a0.\/<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@web1 wordpress]# git add .<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@web1 wordpress]# git commit -m &#8220;wordpress code&#8221;<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@web1 wordpress]# git push<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">root@192.168.2.21&#8217;s password:&lt;\u8f93\u5165192.168.2.21\u4e3b\u673aroot\u7684\u5bc6\u7801&gt;<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\"><strong style=\"box-sizing: border-box;\">\u6b65\u9aa4\u4e8c\uff1a\u90e8\u7f72Git\u534f\u8bae\u7684\u7248\u672c\u63a7\u5236\u670d\u52a1\u5668<\/strong><\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">1\uff09\u5b89\u88c5\u8f6f\u4ef6\u5305\uff08192.168.2.21\u64cd\u4f5c\uff09<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@database ~]# yum -y install git-daemon<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">2\uff09\u4fee\u6539\u914d\u7f6e\u6587\u4ef6\uff0c\u542f\u52a8Git\u670d\u52a1<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@database ~]# vim \/usr\/lib\/systemd\/system\/git@.service<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\u4fee\u6539\u524d\u5185\u5bb9\u5982\u4e0b\uff1a<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">ExecStart=-\/usr\/libexec\/git-core\/git-daemon &#8211;base-path=\/var\/lib\/git &#8211;export-all &#8211;user-path=public_git &#8211;syslog &#8211;inetd \u2013verbose<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\u4fee\u6539\u540e\u5185\u5bb9\u5982\u4e0b\uff1aExecStart=-\/usr\/libexec\/git-core\/git-daemon &#8211;base-path=\/var\/git &#8211;export-all &#8211;user-path=public_git &#8211;syslog &#8211;inetd \u2013verbose<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@database ~]# systemctl start git.socket<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@database ~]# systemctl status git.socket<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">3)\u5ba2\u6237\u7aef\u6d4b\u8bd5\uff08\u4f7f\u7528web2\u505a\u5b8c\u5ba2\u6237\u7aef\u4e3b\u673a\uff0c192.168.2.12\uff09<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\u5728web2\u6267\u884cclone\u7b49\u540c\u4e8e\u662f\u628a\u4ee3\u7801\u53c8\u5907\u4efd\u4e86\u4e00\u4efd\u3002<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@web2 ~]# cd \/var\/<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@web2 var]# git clone git:\/\/192.168.2.21\/wordpress.git<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\"><strong style=\"box-sizing: border-box;\">\u6b65\u9aa4\u4e09\uff1a\u90e8\u7f72HTTP\u534f\u8bae\u7684\u7248\u672c\u63a7\u5236\u670d\u52a1\u5668<\/strong><\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">1\uff09\u5b89\u88c5\u8f6f\u4ef6\u5305\uff08192.168.2.21\u64cd\u4f5c\uff09<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@database ~]# yum -y install httpd gitweb<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">2\uff09\u4fee\u6539\u914d\u7f6e\u6587\u4ef6<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@database ~]# vim \/etc\/gitweb.conf<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">$projectroot = &#8220;\/var\/git&#8221;; #\u6dfb\u52a0\u4e00\u884c<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">3\uff09\u542f\u52a8\u670d\u52a1<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@database ~]# systemctl start httpd<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">4\uff09\u5ba2\u6237\u7aef\u9a8c\u8bc1<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@room9pc01 ~]# firefox http:\/\/192.168.2.21\/git<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\n<p style=\"box-sizing: border-box;\">\u8bbf\u95ee\u7f51\u9875\u53ef\u4ee5\u67e5\u770b\u5230wordpress\u4ed3\u5e93\uff0c\u70b9\u51fbtree\u83dc\u5355\u540e\u53ef\u4ee5\u770b\u5230\u5982\u56fe-2\u6240\u793a\u7684\u4ee3\u7801\u3002<\/p>\n<\/section>\n<section style=\"box-sizing: border-box; text-align: center;\">\n<section style=\"max-width: 100%; vertical-align: middle; display: inline-block; line-height: 0; box-sizing: border-box;\"><div class='fancybox-wrapper lazyload-container-unload' data-fancybox='post-images' href='https:\/\/www.xh86.me\/wp-content\/uploads\/2021\/12\/wxsync-2021-12-0a9f6b9c7f2c01c1ec273189d61a68e1.png'><img class=\"lazyload lazyload-style-1\" src=\"data:image\/svg+xml;base64,PCEtLUFyZ29uTG9hZGluZy0tPgo8c3ZnIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3Ryb2tlPSIjZmZmZmZmMDAiPjxnPjwvZz4KPC9zdmc+\"  decoding=\"async\" class=\"rich_pages wxw-img\" style=\"vertical-align: middle; box-sizing: border-box;\" data-original=\"https:\/\/www.xh86.me\/wp-content\/uploads\/2021\/12\/wxsync-2021-12-0a9f6b9c7f2c01c1ec273189d61a68e1.png\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB\/AAffA0nNPuCLAAAAAElFTkSuQmCC\" data-ratio=\"1.0621118\" data-type=\"png\" data-w=\"322\" \/><\/div><\/section>\n<\/section>\n<section style=\"text-align: unset; box-sizing: border-box;\">\n<p style=\"box-sizing: border-box;\">\n<\/section>\n<section style=\"margin-top: 10px; margin-right: 0%; margin-left: 0%; box-sizing: border-box;\">\n<section style=\"font-family: Optima-Regular, PingFangTC-light; color: #3e3e3e; font-size: 18px; line-height: 1; letter-spacing: 1px; box-sizing: border-box;\">\n<p style=\"box-sizing: border-box;\"><strong style=\"box-sizing: border-box;\">\u4f18\u5316Web\u670d\u52a1\u5668<\/strong><\/p>\n<\/section>\n<\/section>\n<section style=\"box-sizing: border-box;\">\n<section style=\"display: flex; flex-flow: row nowrap; margin-right: 0%; margin-bottom: 10px; margin-left: 0%; box-sizing: border-box;\">\n<section style=\"display: inline-block; width: auto; vertical-align: top; flex: 100 100 0%; align-self: flex-start; height: auto; line-height: 0; background-color: rgba(86, 61, 227, 0.04); box-sizing: border-box;\">\n<section style=\"box-sizing: border-box;\">\n<section style=\"display: flex; flex-flow: row nowrap; text-align: left; justify-content: flex-start; margin-right: 0%; margin-left: 0%; box-sizing: border-box;\">\n<section style=\"display: inline-block; vertical-align: bottom; width: auto; flex: 0 0 0%; height: auto; align-self: flex-end; box-sizing: border-box;\">\n<section style=\"justify-content: flex-start; box-sizing: border-box;\">\n<section style=\"display: inline-block; width: 8px; height: 8px; vertical-align: top; overflow: hidden; background-color: #375072; box-sizing: border-box;\">\n<section><\/section>\n<\/section>\n<\/section>\n<\/section>\n<section style=\"display: inline-block; vertical-align: bottom; width: auto; flex: 0 0 0%; align-self: flex-end; height: auto; box-sizing: border-box;\">\n<section style=\"justify-content: flex-start; box-sizing: border-box;\">\n<section style=\"display: inline-block; width: 8px; height: 8px; vertical-align: top; overflow: hidden; background-color: #8ec965; box-sizing: border-box;\">\n<section><\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<section style=\"text-align: unset; font-size: 15px; line-height: 2; letter-spacing: 1.75px; padding-right: 5px; padding-left: 5px; box-sizing: border-box;\">\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\"><span style=\"color: #867f7f; font-size: 16px; box-sizing: border-box;\"><strong style=\"box-sizing: border-box;\">1. \u95ee\u9898<\/strong><\/span><\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\"><strong style=\"box-sizing: border-box;\">\u4f18\u5316Web\u670d\u52a1\u5668\uff0c\u5b9e\u73b0\u5982\u4e0b\u6548\u679c\uff1a<\/strong><\/p>\n<ul class=\"list-paddingleft-2\">\n<li style=\"box-sizing: border-box;\">\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\u81ea\u5b9a\u4e49\u7f51\u7ad9404\u9519\u8bef\u9875\u9762<\/p>\n<\/li>\n<li style=\"box-sizing: border-box;\">\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\u5347\u7ea7nginx\u81f31.15.8\u7248\u672c\uff0c\u5f00\u542fstatus\u6a21\u5757<\/p>\n<\/li>\n<li style=\"box-sizing: border-box;\">\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\u7f16\u5199\u65e5\u5fd7\u5207\u5272\u811a\u672c\uff0c\u5b9e\u73b0\u6bcf\u5468\u4e94\u5907\u4efd\u65e5\u5fd7<\/p>\n<\/li>\n<li style=\"box-sizing: border-box;\">\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\u5f00\u542fgzip\u538b\u7f29\u529f\u80fd\uff0c\u63d0\u9ad8\u6570\u636e\u4f20\u8f93\u6548\u7387<\/p>\n<\/li>\n<li style=\"box-sizing: border-box;\">\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\u5f00\u542f\u6587\u4ef6\u7f13\u5b58\u529f\u80fd<\/p>\n<\/li>\n<\/ul>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\"><strong style=\"box-sizing: border-box;\"><span style=\"font-size: 16px; color: #867f7f; box-sizing: border-box;\">2. \u6b65\u9aa4<\/span><\/strong><\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\u5b9e\u73b0\u6b64\u6848\u4f8b\u9700\u8981\u6309\u7167\u5982\u4e0b\u6b65\u9aa4\u8fdb\u884c\u3002<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\"><strong style=\"box-sizing: border-box;\">\u6b65\u9aa4\u4e00\uff1a\u81ea\u5b9a\u4e49404\u9519\u8bef\u9875\u9762<\/strong><\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">1\uff09\u4f18\u5316\u524d\u6d4b\u8bd5\uff08\u5ba2\u6237\u7aef\u8bbf\u95ee\u4e00\u4e2a\u4e0d\u5b58\u5728\u7684\u9875\u9762\uff09\u3002<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@room9pc01 ~]# firefox http:\/\/www.lab.com\/git<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">2\uff09\u4fee\u6539Nginx\u914d\u7f6e\u6587\u4ef6\uff0c\u81ea\u5b9a\u4e49\u9519\u8bef\u9875\u9762<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@web1 ~]# vim \/usr\/local\/nginx\/conf\/nginx.conf<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">error_page 404 \/404.html; \/\/\u81ea\u5b9a\u4e49\u9519\u8bef\u9875\u9762<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@web2 ~]# vim \/usr\/local\/nginx\/conf\/nginx.conf<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">error_page 404 \/404.html; \/\/\u81ea\u5b9a\u4e49\u9519\u8bef\u9875\u9762<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@web3 ~]# vim \/usr\/local\/nginx\/conf\/nginx.conf<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">error_page 404 \/404.html; \/\/\u81ea\u5b9a\u4e49\u9519\u8bef\u9875\u9762<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">3\uff09 \u91cd\u542fnginx<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@web1 ~]# \/usr\/local\/nginx\/sbin\/nginx -s reload<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@web2 ~]# \/usr\/local\/nginx\/sbin\/nginx -s reload<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@web3 ~]# \/usr\/local\/nginx\/sbin\/nginx -s reload<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\"><strong style=\"box-sizing: border-box;\">\u6b65\u9aa4\u4e8c\uff1a\u5347\u7ea7nginx\u7248\u672c\uff0c\u5f00\u542fstatus\u6a21\u5757<\/strong><\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">1\uff09\u914d\u7f6e\u3001\u7f16\u8bd1\u65b0\u7684nginx\uff08web1\u3001web2\u3001web3\u505a\u76f8\u540c\u64cd\u4f5c\uff0c\u4e0b\u9762\u4ee5web1\u4e3a\u4f8b\uff09<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@web1 ~]# tar -xf nginx-1.15.8.tar.gz<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@web1 ~]# cd nginx-1.15.8<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@web1 nginx-1.15.8]# .\/configure<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">&#8211;with-http_ssl_module<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">&#8211;with-http_stub_status_module<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@web1 nginx-1.15.8]# make<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">2\uff09\u5907\u4efd\u8001\u7248\u672cnginx\uff0c\u66f4\u65b0\u65b0\u7248\u672cnginx<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@web1 nginx-1.15.8]# mv \/usr\/local\/nginx\/sbin\/nginx{,.old}<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@web1 nginx-1.15.8]# cp objs\/nginx \/usr\/local\/nginx\/sbin\/<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">3\uff09\u4fee\u6539\u914d\u7f6e\u6587\u4ef6<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@web1 ~]# vim \/usr\/local\/nginx\/conf\/nginx.conf<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">&#8230; &#8230;<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">location \/status {<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">stub_status on;<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">allow 192.168.2.0\/24;<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">deny all;<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">}<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">&#8230; &#8230;<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">4\uff09\u5347\u7ea7\u6216\u91cd\u542f\u670d\u52a1<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\u6ce8\u610f\uff1a\u5fc5\u987b\u5728nginx-1.15.8\u6e90\u7801\u5305\u76ee\u5f55\u4e0b\u6267\u884cmake upgrade\u547d\u4ee4\u3002<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@web1 nginx-1.15.8]# make upgrade<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\u6216\u8005\u624b\u52a8\u6267\u884ckillall\u547d\u4ee4\u6740\u6b7b\u8fdb\u7a0b\u540e\u91cd\u65b0\u542f\u52a8<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@web1 ~]# killall nginx<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@web1 ~]# \/usr\/local\/nginx\/sbin\/nginx<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\"><strong style=\"box-sizing: border-box;\">\u6b65\u9aa4\u4e09\uff1a\u7f16\u5199\u65e5\u5fd7\u5207\u5272\u811a\u672c<\/strong><\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">1\uff09\u7f16\u5199\u811a\u672c\uff08\u4ee5web1\u4e3a\u4f8b\uff09<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@web1 ~]# vim \/usr\/local\/nginx\/logbak.sh<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">#!\/bin\/bash<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">date=`date +%Y%m%d`<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">logpath=\/usr\/local\/nginx\/logs<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">mv $logpath\/access.log $logpath\/access-$date.log<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">mv $logpath\/error.log $logpath\/error-$date.log<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">kill -USR1 $(cat $logpath\/nginx.pid)<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">2\uff09\u521b\u5efa\u8ba1\u5212\u4efb\u52a1<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@web1 ~]# crontab -e<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">03 03 * * 5 \/usr\/local\/nginx\/logbak.sh<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\"><strong style=\"box-sizing: border-box;\">\u6b65\u9aa4\u56db\uff1a\u5bf9\u9875\u9762\u8fdb\u884c\u538b\u7f29\u5904\u7406<\/strong><\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">1\uff09\u4fee\u6539Nginx\u914d\u7f6e\u6587\u4ef6<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">[root@proxy ~]# cat \/usr\/local\/nginx\/conf\/nginx.conf<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">http {<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">.. ..<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">gzip on; \/\/\u5f00\u542f\u538b\u7f29<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">gzip_min_length 1000; \/\/\u5c0f\u6587\u4ef6\u4e0d\u538b\u7f29<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">gzip_comp_level 4; \/\/\u538b\u7f29\u6bd4\u7387<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">gzip_types text\/plain text\/css application\/json application\/x-javascript text\/xml application\/xml application\/xml+rss text\/javascript;<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\/\/\u5bf9\u7279\u5b9a\u6587\u4ef6\u538b\u7f29\uff0c\u7c7b\u578b\u53c2\u8003mime.types<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">.. ..<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">}<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\"><strong style=\"box-sizing: border-box;\">\u6b65\u9aa4\u4e94\uff1a\u670d\u52a1\u5668\u5185\u5b58\u7f13\u5b58<\/strong><\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">1\uff09\u5982\u679c\u9700\u8981\u5904\u7406\u5927\u91cf\u9759\u6001\u6587\u4ef6\uff0c\u53ef\u4ee5\u5c06\u6587\u4ef6\u7f13\u5b58\u5728\u5185\u5b58\uff0c\u4e0b\u6b21\u8bbf\u95ee\u4f1a\u66f4\u5feb\u3002<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">http {<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">open_file_cache max=2000 inactive=20s;<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">open_file_cache_valid 60s;<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">open_file_cache_min_uses 5;<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">open_file_cache_errors off;<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\/\/\u8bbe\u7f6e\u670d\u52a1\u5668\u6700\u5927\u7f13\u5b582000\u4e2a\u6587\u4ef6\u53e5\u67c4\uff0c\u5173\u95ed20\u79d2\u5185\u65e0\u8bf7\u6c42\u7684\u6587\u4ef6\u53e5\u67c4<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\/\/\u6587\u4ef6\u53e5\u67c4\u7684\u6709\u6548\u65f6\u95f4\u662f60\u79d2\uff0c60\u79d2\u540e\u8fc7\u671f<\/p>\n<p style=\"margin-bottom: 2px; box-sizing: border-box;\">\/\/\u53ea\u6709\u8bbf\u95ee\u6b21\u6570\u8d85\u8fc75\u6b21\u4f1a\u88ab\u7f13\u5b58<\/p>\n<p style=\"box-sizing: border-box;\">}<\/p>\n<\/section>\n<\/section>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u7f51\u7ad9\u67b6\u6784\u6f14\u53d8 1. \u95ee\u9898 \u5b66\u4e60\u4ece\u5355\u673a\u67b6\u6784\u5230\u96c6\u7fa4\u67b6\u6784\u7684\u6f14\u53d8\u4e4b\u8def\uff1a \u5355\u673a\u7248LNMP \u72ec\u7acb\u6570\u636e\u5e93\u670d\u52a1\u5668 Web\u670d\u52a1\u5668 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12],"tags":[],"class_list":["post-5060","post","type-post","status-publish","format-standard","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/www.xh86.me\/index.php?rest_route=\/wp\/v2\/posts\/5060","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.xh86.me\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.xh86.me\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.xh86.me\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.xh86.me\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=5060"}],"version-history":[{"count":1,"href":"https:\/\/www.xh86.me\/index.php?rest_route=\/wp\/v2\/posts\/5060\/revisions"}],"predecessor-version":[{"id":5245,"href":"https:\/\/www.xh86.me\/index.php?rest_route=\/wp\/v2\/posts\/5060\/revisions\/5245"}],"wp:attachment":[{"href":"https:\/\/www.xh86.me\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5060"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.xh86.me\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=5060"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.xh86.me\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=5060"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}