{"id":602,"date":"2022-12-09T08:25:43","date_gmt":"2022-12-09T00:25:43","guid":{"rendered":"http:\/\/119.45.47.125\/?p=602"},"modified":"2022-12-11T12:09:38","modified_gmt":"2022-12-11T04:09:38","slug":"fzjh","status":"publish","type":"post","link":"http:\/\/119.45.47.125\/index.php\/2022\/12\/09\/fzjh\/","title":{"rendered":"\u8d1f\u8f7d\u5747\u8861"},"content":{"rendered":"<p>\u628a\u8681\u5251\u7684 Labs \u7ed3\u4e2a\u5c3e\uff0c\u540e\u9762\u518d\u7ee7\u7eed\u5b66\u4e00\u4e0b\u8681\u5251\u7684\u5176\u4ed6\u4e1c\u897f<\/p>\n<blockquote>\n  AntSword-Labs \u8fd8\u6709\u4e00\u4e2a LoadBalance-JSP \u7684\u6587\u4ef6\u5939\uff0c\u770b\u4e86\u4e0b\u4ecb\u7ecd\u7684 .md\uff0c\u662f\u5173\u4e8e\u8d1f\u8f7d\u5747\u8861\u7684\n<\/blockquote>\n<h3>\u4e00\u3001\u8d1f\u8f7d\u5747\u8861(Load Balance)<\/h3>\n<p>\u5173\u4e8e\u8d1f\u8f7d\u5747\u8861\u7684\u6587\u7ae0\u7f51\u4e0a\u6709\u5f88\u591a\uff0c\ud83d\udc27\u4e91\u7684<a class=\"wp-editor-md-post-content-link\" href=\"https:\/\/cloud.tencent.com\/document\/product\/214\/524\" title=\"\u6587\u6863\">\u6587\u6863<\/a>\u91cc\u4e5f\u6709\u4ecb\u7ecd\uff0c\u7b80\u5355\u7406\u89e3\u5c31\u662f\u5b9e\u73b0\u4e86\u8d1f\u8f7d\uff08\u6d41\u91cf\uff09\u5206\u53d1\uff08\u5206\u644a\uff09\u5230\u4e0d\u540c\u7684\u670d\u52a1\u5355\u5143\u4e0a\u5904\u7406\uff0c\u65e2\u53ef\u4ee5\u63d0\u9ad8\u670d\u52a1\u7684\u6027\u80fd\uff0c\u4e5f\u80fd\u907f\u514d\u51fa\u73b0\u5355\u70b9\u6545\u969c\u5e26\u6765\u7684\u95ee\u9898\uff08\u5404\u5b98\u65b9\u4e91\u670d\u52a1\u5668\u63d0\u4f9b\u5546\u90fd\u4f1a\u6709\u8d1f\u8f7d\u5747\u8861\u7684\u6587\u6863\uff0c\u56e0\u4e3a\u81ea\u5df1\u7684\u662f\u817e\u8baf\u4e91\uff0c\u4e00\u4e9b\u5185\u5bb9\u5c31\u53c2\u8003\u4e86\ud83d\udc27\u7684\uff09<\/p>\n<p>\u5b9e\u73b0\u8d1f\u8f7d\u5747\u8861\u7684\u65b9\u5f0f\u6709\u5f88\u591a\u79cd\uff0c\u6bd4\u5982 <code>DNS\/F5\/LVS\/HAproxy\/Nginx<\/code>\uff0c\u5173\u4e8e Nginx\uff0c<a class=\"wp-editor-md-post-content-link\" href=\"https:\/\/nginx.org\/en\/docs\/http\/load_balancing.html\" title=\"\u5b98\u65b9\u6587\u6863\">\u5b98\u65b9\u6587\u6863<\/a>\u91cc\u6709\u4ecb\u7ecd<\/p>\n<div class='fancybox-wrapper lazyload-container-unload' data-fancybox='post-images' href='http:\/\/119.45.47.125\/wp-content\/uploads\/2022\/12\/wp_editor_md_e2daf41d36ac8ed4576c64695c3350c9.jpg'><img class=\"lazyload lazyload-style-1\" src=\"data:image\/svg+xml;base64,PCEtLUFyZ29uTG9hZGluZy0tPgo8c3ZnIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3Ryb2tlPSIjZmZmZmZmMDAiPjxnPjwvZz4KPC9zdmc+\"  decoding=\"async\" data-original=\"http:\/\/119.45.47.125\/wp-content\/uploads\/2022\/12\/wp_editor_md_e2daf41d36ac8ed4576c64695c3350c9.jpg\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB\/AAffA0nNPuCLAAAAAElFTkSuQmCC\" alt=\"\" \/><\/div>\n<p>\u7b56\u7565\u4e3b\u8981\u6709\uff1a\u8f6e\u8be2(round-robin)\u3001\u6700\u5c11\u8fde\u63a5(least-connected)\u3001ip_hash\u3001\u6743\u91cd(weight)<\/p>\n<p><strong>\u8f6e\u8be2<\/strong>\u5c31\u662f\u6309\u7167\u8bf7\u6c42\u5230\u8fbe\u65f6\u95f4\u7684\u5148\u540e\u987a\u5e8f\u5206\u914d\u5230\u4e0d\u540c\u7684 server\uff0c\u5982\u679c\u6709 server \u6302\u6389\u4e86\uff0c\u81ea\u52a8\u5254\u9664<\/p>\n<pre><code class=\"language-shell line-numbers\">http {\n    upstream myapp1 {\n        server srv1.example.com;\n        server srv2.example.com;\n        server srv3.example.com;\n    }\n\n    server {\n        listen 80;\n\n        location \/ {\n            proxy_pass http:\/\/myapp1;\n        }\n    }\n}\n<\/code><\/pre>\n<p><strong>\u6700\u5c11\u8fde\u63a5<\/strong>\u5c31\u662f\u4e0d\u8ba9\u5904\u4e8e\u7e41\u5fd9\u72b6\u6001\u7684\u670d\u52a1\u5668\u5904\u7406\u8fc7\u591a\u7684\u8bf7\u6c42\uff0c\u800c\u662f\u5c06\u65b0\u7684\u8bf7\u6c42\u5206\u914d\u7ed9\u5176\u4ed6\u4e0d\u90a3\u4e48\u7e41\u5fd9\u7684\u670d\u52a1\u5668\uff08\u89e3\u91ca\u4e86\u7b49\u4e8e\u6ca1\u89e3\u91ca\ud83d\ude05\uff09\uff0c\u9002\u5408\u8bf7\u6c42\u5904\u7406\u65f6\u95f4\u957f\u77ed\u4e0d\u4e00\u9020\u6210\u670d\u52a1\u5668\u8fc7\u8f7d\u7684\u60c5\u51b5<\/p>\n<pre><code class=\"language-shell line-numbers\">upstream myapp1 {\n        least_conn;\n        server srv1.example.com;\n        server srv2.example.com;\n        server srv3.example.com;\n    }\n<\/code><\/pre>\n<p><strong>ip_hash<\/strong> \u662f\u4e3a\u4e86\u786e\u4fdd\u6765\u81ea\u540c\u4e00\u5ba2\u6237\u7aef\u7684\u8bf7\u6c42\u59cb\u7ec8\u6307\u5411\u540c\u4e00\u670d\u52a1\u5668\uff0c\u9002\u5408\u89e3\u51b3\u540c\u4e00\u7528\u6237\u8bbf\u95ee\u540c\u4e00\u7a0b\u5e8f session \u4e0d\u5171\u4eab\u7684\u95ee\u9898<\/p>\n<pre><code class=\"language-shell line-numbers\">upstream myapp1 {\n    ip_hash;\n    server srv1.example.com;\n    server srv2.example.com;\n    server srv3.example.com;\n}\n<\/code><\/pre>\n<p><strong>weight<\/strong> \u5c31\u662f\u7ed9\u670d\u52a1\u5668\u8d4b\u4e00\u5b9a\u7684\u6743\u91cd\uff0c\u6743\u91cd\u8d8a\u9ad8\uff0c\u5206\u914d\u7684\u4e5f\u5c31\u76f8\u5bf9\u8d8a\u591a\uff0c\u9002\u5408\u540e\u7aef\u670d\u52a1\u5668\u7684\u786c\u4ef6\u914d\u7f6e\u5dee\u522b\u6bd4\u8f83\u5927\u7684\u60c5\u51b5<\/p>\n<pre><code class=\"language-shell line-numbers\">upstream myapp1 {\n        server srv1.example.com weight=3;\n        server srv2.example.com;\n        server srv3.example.com;\n    }\n<\/code><\/pre>\n<p>\u5982\u4f55\u77e5\u9053\u540e\u7aef\u7684\u670d\u52a1\u5668\u662f\u5426\u5904\u4e8e\u6b63\u5e38\u8fd0\u884c\u72b6\u6001\uff0c\u53ef\u4ee5\u901a\u8fc7\u5065\u5eb7\u68c0\u67e5(Health checks)\u5b9e\u73b0\uff0c\u5177\u4f53\u65b9\u5f0f\u4e5f\u53ef\u53c2\u8003<a class=\"wp-editor-md-post-content-link\" href=\"https:\/\/cloud.tencent.com\/document\/product\/214\/50021\" title=\"\u817e\u8baf\u4e91\">\u817e\u8baf\u4e91<\/a><\/p>\n<h3>\u4e8c\u3001Webshell \u7ba1\u7406<\/h3>\n<h4>\u53c2\u8003\u6587\u7ae0\uff1a<\/h4>\n<ul><li><a class=\"wp-editor-md-post-content-link\" href=\"https:\/\/mp.weixin.qq.com\/s\/4Bmz_fuu0yrLMK1oBKKtRA\" title=\"\u8d1f\u8f7d\u5747\u8861\u4e0b\u7684 WebShell \u8fde\u63a5\">\u8d1f\u8f7d\u5747\u8861\u4e0b\u7684 WebShell \u8fde\u63a5<\/a><\/li>\n<li><a class=\"wp-editor-md-post-content-link\" href=\"https:\/\/xz.aliyun.com\/t\/10297\" title=\"\u8d1f\u8f7d\u5747\u8861\u8e29\u5751\u8bb0\">\u8d1f\u8f7d\u5747\u8861\u8e29\u5751\u8bb0<\/a><\/li>\n<\/ul>\n<p>\u4e0a\u9762\u662f\u8d1f\u8f7d\u5747\u8861\u7684\u57fa\u672c\u5185\u5bb9\u4ecb\u7ecd\uff0c\u56de\u5230 webshell \u4e0a\u9762\u6765<\/p>\n<blockquote>\n  \u5047\u5b9a\u4e1a\u52a1\u4e2d\u5b58\u5728RCE\u6f0f\u6d1e\uff0c\u4e0a\u4f20\u4e86 WebShell \u4e4b\u540e, \u56e0\u4e3a\u8d1f\u8f7d\u5747\u8861\u7684\u5b58\u5728, \u5bfc\u81f4\u540e\u7eed\u4e0a\u4f20\u7684\u5de5\u5177\u3001\u6267\u884c\u547d\u4ee4\u7b49\u64cd\u4f5c\u51fa\u73b0\u4e0d\u8fde\u7eed\u7684\u60c5\u51b5<br>\u6f14\u793a\u73af\u5883\u4e2d, LBSNode1 \u548c LBSNode2 \u5747\u5b58\u5728\u4f4d\u7f6e\u76f8\u540c\u7684 Shell: ant.jsp\n<\/blockquote>\n<pre><code class=\"language-shell line-numbers\">upstream lbspool {\n  server lbsnode1:8080;\n  server lbsnode2:8080;\n}\n\nserver {\n    listen       80 default_server;\n    server_name  _;\n    charset utf-8;\n    root   \/usr\/share\/nginx\/html;\n    index index.jsp index.html index.htm;\n    location \/ {\n        proxy_pass http:\/\/lbspool;\n        proxy_set_header Host $host;\n        proxy_set_header X-Real-IP $remote_addr;\n        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;\n    }\n}\n\n                          \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n                          \u2502             \u2502\n                   \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u25ba  LBSNode 1  \u2502\n\u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510        \u2502      \u2502             \u2502\n\u2502         \u2502        \u2502      \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n\u2502  Nginx  \u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524\n\u2502         \u2502        \u2502      \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518        \u2502      \u2502             \u2502\n                   \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u25ba  LBSNode 2  \u2502\n                          \u2502             \u2502\n                          \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n<\/code><\/pre>\n<p>\u5728\u4e0a\u9762\u7684\u8f6e\u8be2\u72b6\u6001\u4e0b ip \u4e00\u76f4\u90fd\u662f\u8df3\u7684<\/p>\n<div class='fancybox-wrapper lazyload-container-unload' data-fancybox='post-images' href='http:\/\/119.45.47.125\/wp-content\/uploads\/2022\/12\/wp_editor_md_aa7722a36ad36c7001572e3abfeac9c2.jpg'><img class=\"lazyload lazyload-style-1\" src=\"data:image\/svg+xml;base64,PCEtLUFyZ29uTG9hZGluZy0tPgo8c3ZnIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3Ryb2tlPSIjZmZmZmZmMDAiPjxnPjwvZz4KPC9zdmc+\"  decoding=\"async\" data-original=\"http:\/\/119.45.47.125\/wp-content\/uploads\/2022\/12\/wp_editor_md_aa7722a36ad36c7001572e3abfeac9c2.jpg\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB\/AAffA0nNPuCLAAAAAElFTkSuQmCC\" alt=\"\" \/><\/div>\n<p>\u6240\u4ee5\u4e0a\u4f20\u6587\u4ef6\u7684\u65f6\u5019\uff0c\u5728\u5206\u7247\u4f20\u8f93\u7684\u673a\u5236\u4e0b\u60f3\u8981\u4f20\u4e0a\u53bb\u7684\u6587\u4ef6\u4f1a\u88ab\u5206\u6210\u51e0\u90e8\u5206\u6563\u843d\u5728\u670d\u52a1\u5668\u4e0a\uff0c\u5373\u4f7f\u662f\u5c0f\u6587\u4ef6\u4e5f\u4e00\u6837\uff0c\u4f20\u4e0a\u53bb\u4e5f\u4e0d\u4e00\u5b9a\u80fd\u8bbf\u95ee\u5230\uff0c\u56e0\u4e3a\u4e0d\u80fd\u4fdd\u8bc1\u540e\u9762\u51e0\u53f0\u673a\u5b50\u7684\u76f8\u540c\u4f4d\u7f6e\u4e0a\u90fd\u6709\uff0c\u800c\u4e14\u91c7\u7528\u4ec0\u4e48\u8d1f\u8f7d\u5747\u8861\u65b9\u5f0f\u4e5f\u4e0d\u77e5\u9053\uff0c\u6e17\u900f\u6d4b\u8bd5\u603b\u4e0d\u80fd\u78b0\u8fd0\u6c14\u5427<\/p>\n<p>\u7136\u540e Medicean \u5e08\u5085\u63d0\u51fa\u4e86<strong>\u5728Web \u5c42\u505a\u4e00\u6b21 HTTP \u6d41\u91cf\u8f6c\u53d1<\/strong>\u7684\u89e3\u51b3\u65b9\u6cd5\uff0c\u628a\u6240\u6709\u7684\u6d41\u91cf\u901a\u8fc7\u4ee3\u7406\u811a\u672c \/antproxy.jsp \u8bf7\u6c42\u91cd\u7ec4\u4e4b\u540e\u4f20\u9012\u5230\u4e00\u53f0 Node \u4e0a\u9762\uff0c\u5b9e\u73b0\u547d\u4ee4\u6267\u884c<\/p>\n<div class='fancybox-wrapper lazyload-container-unload' data-fancybox='post-images' href='http:\/\/119.45.47.125\/wp-content\/uploads\/2022\/12\/wp_editor_md_c7901dc8a35753de348d971a3cb5669a.jpg'><img class=\"lazyload lazyload-style-1\" src=\"data:image\/svg+xml;base64,PCEtLUFyZ29uTG9hZGluZy0tPgo8c3ZnIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3Ryb2tlPSIjZmZmZmZmMDAiPjxnPjwvZz4KPC9zdmc+\"  decoding=\"async\" data-original=\"http:\/\/119.45.47.125\/wp-content\/uploads\/2022\/12\/wp_editor_md_c7901dc8a35753de348d971a3cb5669a.jpg\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB\/AAffA0nNPuCLAAAAAElFTkSuQmCC\" alt=\"\" \/><\/div>\n<p>\u811a\u672c\u5728\u85cf\u9752\u5e08\u5085\u7684\u6587\u7ae0\u4e0b\u6709<\/p>","protected":false},"excerpt":{"rendered":"\u628a\u8681\u5251\u7684 Labs \u7ed3\u4e2a\u5c3e\uff0c\u540e\u9762\u518d\u7ee7\u7eed\u5b66\u4e00\u4e0b\u8681\u5251\u7684\u5176\u4ed6\u4e1c\u897f AntSword-Labs \u8fd8\u6709\u4e00\u4e2a LoadBa [&hellip;]","protected":false},"author":1,"featured_media":605,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[32,26],"tags":[33],"class_list":["post-602","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-antsword","category-study","tag-antsword"],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/119.45.47.125\/wp-content\/uploads\/2022\/12\/xhr.webp?fit=1920%2C1080","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"http:\/\/119.45.47.125\/index.php\/wp-json\/wp\/v2\/posts\/602","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/119.45.47.125\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/119.45.47.125\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/119.45.47.125\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/119.45.47.125\/index.php\/wp-json\/wp\/v2\/comments?post=602"}],"version-history":[{"count":6,"href":"http:\/\/119.45.47.125\/index.php\/wp-json\/wp\/v2\/posts\/602\/revisions"}],"predecessor-version":[{"id":612,"href":"http:\/\/119.45.47.125\/index.php\/wp-json\/wp\/v2\/posts\/602\/revisions\/612"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/119.45.47.125\/index.php\/wp-json\/wp\/v2\/media\/605"}],"wp:attachment":[{"href":"http:\/\/119.45.47.125\/index.php\/wp-json\/wp\/v2\/media?parent=602"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/119.45.47.125\/index.php\/wp-json\/wp\/v2\/categories?post=602"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/119.45.47.125\/index.php\/wp-json\/wp\/v2\/tags?post=602"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}