{"id":155965,"date":"2019-09-04T11:40:35","date_gmt":"2019-09-04T03:40:35","guid":{"rendered":"https:\/\/lrxjmw.cn\/?p=155965"},"modified":"2019-08-27T14:24:38","modified_gmt":"2019-08-27T06:24:38","slug":"lvs","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/lvs.html","title":{"rendered":"LVS\u8d1f\u8f7d\u5747\u8861\u7684\u51e0\u79cd\u6a21\u5f0f\u548c\u7b97\u6cd5"},"content":{"rendered":"
\u5bfc\u8bfb<\/td>\n | LVS(Linux Virtual Server)\u5373Linux\u865a\u62df\u670d\u52a1\u5668\uff0c\u662f\u7531\u7ae0\u6587\u5d69\u535a\u58eb\u4e3b\u5bfc\u7684\u5f00\u6e90\u8d1f\u8f7d\u5747\u8861\u9879\u76ee\uff0c\u76ee\u524dLVS\u5df2\u7ecf\u88ab\u96c6\u6210\u5230Linux\u5185\u6838\u6a21\u5757\u4e2d\u3002<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n <\/p>\n LVS\u7b80\u4ecb<\/strong><\/div>\n LVS(Linux Virtual Server)\u5373Linux\u865a\u62df\u670d\u52a1\u5668\uff0c\u662f\u7531\u7ae0\u6587\u5d69\u535a\u58eb\u4e3b\u5bfc\u7684\u5f00\u6e90\u8d1f\u8f7d\u5747\u8861\u9879\u76ee\uff0c\u76ee\u524dLVS\u5df2\u7ecf\u88ab\u96c6\u6210\u5230Linux\u5185\u6838\u6a21\u5757\u4e2d\u3002\u8be5\u9879\u76ee\u5728Linux\u5185\u6838\u4e2d\u5b9e\u73b0\u4e86\u57fa\u4e8eIP\u7684\u6570\u636e\u8bf7\u6c42\u8d1f\u8f7d\u5747\u8861\u8c03\u5ea6\u65b9\u6848\uff0c\u5176\u4f53\u7cfb\u7ed3\u6784\u5982\u56fe1\u6240\u793a\uff0c\u7ec8\u7aef\u4e92\u8054\u7f51\u7528\u6237\u4ece\u5916\u90e8\u8bbf\u95ee\u516c\u53f8\u7684\u5916\u90e8\u8d1f\u8f7d\u5747\u8861\u670d\u52a1\u5668\uff0c\u7ec8\u7aef\u7528\u6237\u7684Web\u8bf7\u6c42\u4f1a\u53d1\u9001\u7ed9LVS\u8c03\u5ea6\u5668\uff0c\u8c03\u5ea6\u5668\u6839\u636e\u81ea\u5df1\u9884\u8bbe\u7684\u7b97\u6cd5\u51b3\u5b9a\u5c06\u8be5\u8bf7\u6c42\u53d1\u9001\u7ed9\u540e\u7aef\u7684\u67d0\u53f0Web\u670d\u52a1\u5668\uff0c\u6bd4\u5982\uff0c\u8f6e\u8be2\u7b97\u6cd5\u53ef\u4ee5\u5c06\u5916\u90e8\u7684\u8bf7\u6c42\u5e73\u5747\u5206\u53d1\u7ed9\u540e\u7aef\u7684\u6240\u6709\u670d\u52a1\u5668\uff0c\u7ec8\u7aef\u7528\u6237\u8bbf\u95eeLVS\u8c03\u5ea6\u5668\u867d\u7136\u4f1a\u88ab\u8f6c\u53d1\u5230\u540e\u7aef\u771f\u5b9e\u7684\u670d\u52a1\u5668\uff0c\u4f46\u5982\u679c\u771f\u5b9e\u670d\u52a1\u5668\u8fde\u63a5\u7684\u662f\u76f8\u540c\u7684\u5b58\u50a8\uff0c\u63d0\u4f9b\u7684\u670d\u52a1\u4e5f\u662f\u76f8\u540c\u7684\u670d\u52a1\uff0c\u6700\u7ec8\u7528\u6237\u4e0d\u7ba1\u662f\u8bbf\u95ee\u54ea\u53f0\u771f\u5b9e\u670d\u52a1\u5668\uff0c\u5f97\u5230\u7684\u670d\u52a1\u5185\u5bb9\u90fd\u662f\u4e00\u6837\u7684\uff0c\u6574\u4e2a\u96c6\u7fa4\u5bf9\u7528\u6237\u800c\u8a00\u90fd\u662f\u900f\u660e\u7684\u3002\u6700\u540e\u6839\u636eLVS\u5de5\u4f5c\u6a21\u5f0f\u7684\u4e0d\u540c\uff0c\u771f\u5b9e\u670d\u52a1\u5668\u4f1a\u9009\u62e9\u4e0d\u540c\u7684\u65b9\u5f0f\u5c06\u7528\u6237\u9700\u8981\u7684\u6570\u636e\u53d1\u9001\u5230\u7ec8\u7aef\u7528\u6237\uff0cLVS\u5de5\u4f5c\u6a21\u5f0f\u5206\u4e3aNAT\u6a21\u5f0f\u3001TUN\u6a21\u5f0f\u3001\u4ee5\u53caDR\u6a21\u5f0f\u3002 \u4e09\u79cd\u5de5\u4f5c\u6a21\u5f0f\u7684\u89e3\u6790\u3002<\/p>\n 1\u3001\u57fa\u4e8eNAT\u7684LVS\u6a21\u5f0f\u8d1f\u8f7d\u5747\u8861<\/strong><\/div>\n NAT(Network Address Translation)\u5373\u7f51\u7edc\u5730\u5740\u8f6c\u6362\uff0c\u5176\u4f5c\u7528\u662f\u901a\u8fc7\u6570\u636e\u62a5\u5934\u7684\u4fee\u6539\uff0c\u4f7f\u5f97\u4f4d\u4e8e\u4f01\u4e1a\u5185\u90e8\u7684\u79c1\u6709IP\u5730\u5740\u53ef\u4ee5\u8bbf\u95ee\u5916\u7f51\uff0c\u4ee5\u53ca\u5916\u90e8\u7528\u7528\u6237\u53ef\u4ee5\u8bbf\u95ee\u4f4d\u4e8e\u516c\u53f8\u5185\u90e8\u7684\u79c1\u6709IP\u4e3b\u673a\u3002VS\/NAT\u5de5\u4f5c\u6a21\u5f0f\u62d3\u6251\u7ed3\u6784\u5982\u56fe2\u6240\u793a\uff0cLVS\u8d1f\u8f7d\u8c03\u5ea6\u5668\u53ef\u4ee5\u4f7f\u7528\u4e24\u5757\u7f51\u5361\u914d\u7f6e\u4e0d\u540c\u7684IP\u5730\u5740\uff0ceth0\u8bbe\u7f6e\u4e3a\u79c1\u94a5IP\u4e0e\u5185\u90e8\u7f51\u7edc\u901a\u8fc7\u4ea4\u6362\u8bbe\u5907\u76f8\u4e92\u8fde\u63a5\uff0ceth1\u8bbe\u5907\u4e3a\u5916\u7f51IP\u4e0e\u5916\u90e8\u7f51\u7edc\u8054\u901a\u3002<\/p>\n \u7b2c\u4e00\u6b65\uff0c\u7528\u6237\u901a\u8fc7\u4e92\u8054\u7f51DNS\u670d\u52a1\u5668\u89e3\u6790\u5230\u516c\u53f8\u8d1f\u8f7d\u5747\u8861\u8bbe\u5907\u4e0a\u9762\u7684\u5916\u7f51\u5730\u5740\uff0c\u76f8\u5bf9\u4e8e\u771f\u5b9e\u670d\u52a1\u5668\u800c\u8a00\uff0cLVS\u5916\u7f51IP\u53c8\u79f0VIP(Virtual IP Address)\uff0c\u7528\u6237\u901a\u8fc7\u8bbf\u95eeVIP\uff0c\u5373\u53ef\u8fde\u63a5\u540e\u7aef\u7684\u771f\u5b9e\u670d\u52a1\u5668(Real Server)\uff0c\u800c\u8fd9\u4e00\u5207\u5bf9\u7528\u6237\u800c\u8a00\u90fd\u662f\u900f\u660e\u7684\uff0c\u7528\u6237\u4ee5\u4e3a\u81ea\u5df1\u8bbf\u95ee\u7684\u5c31\u662f\u771f\u5b9e\u670d\u52a1\u5668\uff0c\u4f46\u4ed6\u5e76\u4e0d\u77e5\u9053\u81ea\u5df1\u8bbf\u95ee\u7684VIP\u4ec5\u4ec5\u662f\u4e00\u4e2a\u8c03\u5ea6\u5668\uff0c\u4e5f\u4e0d\u6e05\u695a\u540e\u7aef\u7684\u771f\u5b9e\u670d\u52a1\u5668\u5230\u5e95\u5728\u54ea\u91cc\u3001\u6709\u591a\u5c11\u771f\u5b9e\u670d\u52a1\u5668\u3002<\/p>\n \u7b2c\u4e8c\u6b65\uff0c\u7528\u6237\u5c06\u8bf7\u6c42\u53d1\u9001\u81f3124.126.147.168\uff0c\u6b64\u65f6LVS\u5c06\u6839\u636e\u9884\u8bbe\u7684\u7b97\u6cd5\u9009\u62e9\u540e\u7aef\u7684\u4e00\u53f0\u771f\u5b9e\u670d\u52a1\u5668(192.168.0.1~192.168.0.3)\uff0c\u5c06\u6570\u636e\u8bf7\u6c42\u5305\u8f6c\u53d1\u7ed9\u771f\u5b9e\u670d\u52a1\u5668\uff0c\u5e76\u4e14\u5728\u8f6c\u53d1\u4e4b\u524dLVS\u4f1a\u4fee\u6539\u6570\u636e\u5305\u4e2d\u7684\u76ee\u6807\u5730\u5740\u4ee5\u53ca\u76ee\u6807\u7aef\u53e3\uff0c\u76ee\u6807\u5730\u5740\u4e0e\u76ee\u6807\u7aef\u53e3\u5c06\u88ab\u4fee\u6539\u4e3a\u9009\u51fa\u7684\u771f\u5b9e\u670d\u52a1\u5668IP\u5730\u5740\u4ee5\u53ca\u76f8\u5e94\u7684\u7aef\u53e3\u3002<\/p>\n \u7b2c\u4e09\u6b65\uff0c\u771f\u5b9e\u7684\u670d\u52a1\u5668\u5c06\u54cd\u5e94\u6570\u636e\u5305\u8fd4\u56de\u7ed9LVS\u8c03\u5ea6\u5668\uff0c\u8c03\u5ea6\u5668\u5728\u5f97\u5230\u54cd\u5e94\u7684\u6570\u636e\u5305\u540e\u4f1a\u5c06\u6e90\u5730\u5740\u548c\u6e90\u7aef\u53e3\u4fee\u6539\u4e3aVIP\u53ca\u8c03\u5ea6\u5668\u76f8\u5e94\u7684\u7aef\u53e3\uff0c\u4fee\u6539\u5b8c\u6210\u540e\uff0c\u7531\u8c03\u5ea6\u5668\u5c06\u54cd\u5e94\u6570\u636e\u5305\u53d1\u9001\u56de\u7ec8\u7aef\u7528\u6237\uff0c\u53e6\u5916\uff0c\u7531\u4e8eLVS\u8c03\u5ea6\u5668\u6709\u4e00\u4e2a\u8fde\u63a5Hash\u8868\uff0c\u8be5\u8868\u4e2d\u4f1a\u8bb0\u5f55\u8fde\u63a5\u8bf7\u6c42\u53ca\u8f6c\u53d1\u4fe1\u606f\uff0c\u5f53\u540c\u4e00\u4e2a\u8fde\u63a5\u7684\u4e0b\u4e00\u4e2a\u6570\u636e\u5305\u53d1\u9001\u7ed9\u8c03\u5ea6\u5668\u65f6\uff0c\u4ece\u8be5Hash\u8868\u4e2d\u53ef\u4ee5\u76f4\u63a5\u627e\u5230\u4e4b\u524d\u7684\u8fde\u63a5\u8bb0\u5f55\uff0c\u5e76\u6839\u636e\u8bb0\u5f55\u4fe1\u606f\u9009\u51fa\u76f8\u540c\u7684\u771f\u5b9e\u670d\u52a1\u5668\u53ca\u7aef\u53e3\u4fe1\u606f\u3002 2\u3001\u57fa\u4e8eTUN\u7684LVS\u8d1f\u8f7d\u5747\u8861<\/strong><\/div>\n \u5728LVS(NAT)\u6a21\u5f0f\u7684\u96c6\u7fa4\u73af\u5883\u4e2d\uff0c\u7531\u4e8e\u6240\u6709\u7684\u6570\u636e\u8bf7\u6c42\u53ca\u54cd\u5e94\u7684\u6570\u636e\u5305\u90fd\u9700\u8981\u7ecf\u8fc7LVS\u8c03\u5ea6\u5668\u8f6c\u53d1\uff0c\u5982\u679c\u540e\u7aef\u670d\u52a1\u5668\u7684\u6570\u91cf\u5927\u4e8e10\u53f0\uff0c\u5219\u8c03\u5ea6\u5668\u5c31\u4f1a\u6210\u4e3a\u6574\u4e2a\u96c6\u7fa4\u73af\u5883\u7684\u74f6\u9888\u3002\u6211\u4eec\u77e5\u9053\uff0c\u6570\u636e\u8bf7\u6c42\u5305\u5f80\u5f80\u8fdc\u5c0f\u4e8e\u54cd\u5e94\u6570\u636e\u5305\u7684\u5927\u5c0f\u3002\u56e0\u4e3a\u54cd\u5e94\u6570\u636e\u5305\u4e2d\u5305\u542b\u6709\u5ba2\u6237\u9700\u8981\u7684\u5177\u4f53\u6570\u636e\uff0c\u6240\u4ee5LVS(TUN)\u7684\u601d\u8def\u5c31\u662f\u5c06\u8bf7\u6c42\u4e0e\u54cd\u5e94\u6570\u636e\u5206\u79bb\uff0c\u8ba9\u8c03\u5ea6\u5668\u4ec5\u5904\u7406\u6570\u636e\u8bf7\u6c42\uff0c\u800c\u8ba9\u771f\u5b9e\u670d\u52a1\u5668\u54cd\u5e94\u6570\u636e\u5305\u76f4\u63a5\u8fd4\u56de\u7ed9\u5ba2\u6237\u7aef\u3002VS\/TUN\u5de5\u4f5c\u6a21\u5f0f\u62d3\u6251\u7ed3\u6784\u5982\u56fe3\u6240\u793a\u3002\u5176\u4e2d\uff0cIP\u96a7\u9053(IP tunning)\u662f\u4e00\u79cd\u6570\u636e\u5305\u5c01\u88c5\u6280\u672f\uff0c\u5b83\u53ef\u4ee5\u5c06\u539f\u59cb\u6570\u636e\u5305\u5c01\u88c5\u5e76\u6dfb\u52a0\u65b0\u7684\u5305\u5934(\u5185\u5bb9\u5305\u62ec\u65b0\u7684\u6e90\u5730\u5740\u53ca\u7aef\u53e3\u3001\u76ee\u6807\u5730\u5740\u53ca\u7aef\u53e3)\uff0c\u4ece\u800c\u5b9e\u73b0\u5c06\u4e00\u4e2a\u76ee\u6807\u4e3a\u8c03\u5ea6\u5668\u7684VIP\u5730\u5740\u7684\u6570\u636e\u5305\u5c01\u88c5\uff0c\u901a\u8fc7\u96a7\u9053\u8f6c\u53d1\u7ed9\u540e\u7aef\u7684\u771f\u5b9e\u670d\u52a1\u5668(Real Server)\uff0c\u901a\u8fc7\u5c06\u5ba2\u6237\u7aef\u53d1\u5f80\u8c03\u5ea6\u5668\u7684\u539f\u59cb\u6570\u636e\u5305\u5c01\u88c5\uff0c\u5e76\u5728\u5176\u57fa\u7840\u4e0a\u6dfb\u52a0\u65b0\u7684\u6570\u636e\u5305\u5934(\u4fee\u6539\u76ee\u6807\u5730\u5740\u4e3a\u8c03\u5ea6\u5668\u9009\u62e9\u51fa\u6765\u7684\u771f\u5b9e\u670d\u52a1\u5668\u7684IP\u5730\u5740\u53ca\u5bf9\u5e94\u7aef\u53e3)\uff0cLVS(TUN)\u6a21\u5f0f\u8981\u6c42\u771f\u5b9e\u670d\u52a1\u5668\u53ef\u4ee5\u76f4\u63a5\u4e0e\u5916\u90e8\u7f51\u7edc\u8fde\u63a5\uff0c\u771f\u5b9e\u670d\u52a1\u5668\u5728\u6536\u5230\u8bf7\u6c42\u6570\u636e\u5305\u540e\u76f4\u63a5\u7ed9\u5ba2\u6237\u7aef\u4e3b\u673a\u54cd\u5e94\u6570\u636e\u3002 3\u3001\u57fa\u4e8eDR\u7684LVS\u8d1f\u8f7d\u5747\u8861<\/strong><\/div>\n \u5728LVS(TUN)\u6a21\u5f0f\u4e0b\uff0c\u7531\u4e8e\u9700\u8981\u5728LVS\u8c03\u5ea6\u5668\u4e0e\u771f\u5b9e\u670d\u52a1\u5668\u4e4b\u95f4\u521b\u5efa\u96a7\u9053\u8fde\u63a5\uff0c\u8fd9\u540c\u6837\u4f1a\u589e\u52a0\u670d\u52a1\u5668\u7684\u8d1f\u62c5\u3002\u4e0eLVS(TUN)\u7c7b\u4f3c\uff0cDR\u6a21\u5f0f\u4e5f\u53eb\u76f4\u63a5\u8def\u7531\u6a21\u5f0f\uff0c\u5176\u4f53\u7cfb\u7ed3\u6784\u5982\u56fe4\u6240\u793a\uff0c\u8be5\u6a21\u5f0f\u4e2dLVS\u4f9d\u7136\u4ec5\u627f\u62c5\u6570\u636e\u7684\u5165\u7ad9\u8bf7\u6c42\u4ee5\u53ca\u6839\u636e\u7b97\u6cd5\u9009\u51fa\u5408\u7406\u7684\u771f\u5b9e\u670d\u52a1\u5668\uff0c\u6700\u7ec8\u7531\u540e\u7aef\u771f\u5b9e\u670d\u52a1\u5668\u8d1f\u8d23\u5c06\u54cd\u5e94\u6570\u636e\u5305\u53d1\u9001\u8fd4\u56de\u7ed9\u5ba2\u6237\u7aef\u3002\u4e0e\u96a7\u9053\u6a21\u5f0f\u4e0d\u540c\u7684\u662f\uff0c\u76f4\u63a5\u8def\u7531\u6a21\u5f0f(DR\u6a21\u5f0f)\u8981\u6c42\u8c03\u5ea6\u5668\u4e0e\u540e\u7aef\u670d\u52a1\u5668\u5fc5\u987b\u5728\u540c\u4e00\u4e2a\u5c40\u57df\u7f51\u5185\uff0cVIP\u5730\u5740\u9700\u8981\u5728\u8c03\u5ea6\u5668\u4e0e\u540e\u7aef\u6240\u6709\u7684\u670d\u52a1\u5668\u95f4\u5171\u4eab\uff0c\u56e0\u4e3a\u6700\u7ec8\u7684\u771f\u5b9e\u670d\u52a1\u5668\u7ed9\u5ba2\u6237\u7aef\u56de\u5e94\u6570\u636e\u5305\u65f6\u9700\u8981\u8bbe\u7f6e\u6e90IP\u4e3aVIP\u5730\u5740\uff0c\u76ee\u6807IP\u4e3a\u5ba2\u6237\u7aefIP\uff0c\u8fd9\u6837\u5ba2\u6237\u7aef\u8bbf\u95ee\u7684\u662f\u8c03\u5ea6\u5668\u7684VIP\u5730\u5740\uff0c\u56de\u5e94\u7684\u6e90\u5730\u5740\u4e5f\u4f9d\u7136\u662f\u8be5VIP\u5730\u5740(\u771f\u5b9e\u670d\u52a1\u5668\u4e0a\u7684VIP)\uff0c\u5ba2\u6237\u7aef\u662f\u611f\u89c9\u4e0d\u5230\u540e\u7aef\u670d\u52a1\u5668\u5b58\u5728\u7684\u3002\u7531\u4e8e\u591a\u53f0\u8ba1\u7b97\u673a\u90fd\u8bbe\u7f6e\u4e86\u540c\u6837\u4e00\u4e2aVIP\u5730\u5740\uff0c\u6240\u4ee5\u5728\u76f4\u63a5\u8def\u7531\u6a21\u5f0f\u4e2d\u8981\u6c42\u8c03\u5ea6\u5668\u7684VIP\u5730\u5740\u662f\u5bf9\u5916\u53ef\u89c1\u7684\uff0c\u5ba2\u6237\u7aef\u9700\u8981\u5c06\u8bf7\u6c42\u6570\u636e\u5305\u53d1\u9001\u5230\u8c03\u5ea6\u5668\u4e3b\u673a\uff0c\u800c\u6240\u6709\u7684\u771f\u5b9e\u670d\u52a1\u5668\u7684VIP\u5730\u5740\u5fc5\u987b\u914d\u7f6e\u5728Non-ARP\u7684\u7f51\u7edc\u8bbe\u5907\u4e0a\uff0c\u4e5f\u5c31\u662f\u8be5\u7f51\u7edc\u8bbe\u5907\u5e76\u4e0d\u4f1a\u5411\u5916\u5e7f\u64ad\u81ea\u5df1\u7684MAC\u53ca\u5bf9\u5e94\u7684IP\u5730\u5740\uff0c\u771f\u5b9e\u670d\u52a1\u5668\u7684VIP\u5bf9\u5916\u754c\u662f\u4e0d\u53ef\u89c1\u7684\uff0c\u4f46\u771f\u5b9e\u670d\u52a1\u5668\u5374\u53ef\u4ee5\u63a5\u53d7\u76ee\u6807\u5730\u5740VIP\u7684\u7f51\u7edc\u8bf7\u6c42\uff0c\u5e76\u5728\u56de\u5e94\u6570\u636e\u5305\u65f6\u5c06\u6e90\u5730\u5740\u8bbe\u7f6e\u4e3a\u8be5VIP\u5730\u5740\u3002\u8c03\u5ea6\u5668\u6839\u636e\u7b97\u6cd5\u5728\u9009\u51fa\u771f\u5b9e\u670d\u52a1\u5668\u540e\uff0c\u5728\u4e0d\u4fee\u6539\u6570\u636e\u62a5\u6587\u7684\u60c5\u51b5\u4e0b\uff0c\u5c06\u6570\u636e\u5e27\u7684MAC\u5730\u5740\u4fee\u6539\u4e3a\u9009\u51fa\u7684\u771f\u5b9e\u670d\u52a1\u5668\u7684MAC\u5730\u5740\uff0c\u901a\u8fc7\u4ea4\u6362\u673a\u5c06\u8be5\u6570\u636e\u5e27\u53d1\u7ed9\u771f\u5b9e\u670d\u52a1\u5668\u3002\u6574\u4e2a\u8fc7\u7a0b\u4e2d\uff0c\u771f\u5b9e\u670d\u52a1\u5668\u7684VIP\u4e0d\u9700\u8981\u5bf9\u5916\u754c\u53ef\u89c1\u3002 LVS\u8d1f\u8f7d\u5747\u8861\u8c03\u5ea6\u7b97\u6cd5<\/p>\n \u6839\u636e\u524d\u9762\u7684\u4ecb\u7ecd\uff0c\u6211\u4eec\u4e86\u89e3\u4e86LVS\u7684\u4e09\u79cd\u5de5\u4f5c\u6a21\u5f0f\uff0c\u4f46\u4e0d\u7ba1\u5b9e\u9645\u73af\u5883\u4e2d\u91c7\u7528\u7684\u662f\u54ea\u79cd\u6a21\u5f0f\uff0c\u8c03\u5ea6\u7b97\u6cd5\u8fdb\u884c\u8c03\u5ea6\u7684\u7b56\u7565\u4e0e\u7b97\u6cd5\u90fd\u662fLVS\u7684\u6838\u5fc3\u6280\u672f\uff0cLVS\u5728\u5185\u6838\u4e2d\u4e3b\u8981\u5b9e\u73b0\u4e86\u4e00\u4e0b\u5341\u79cd\u8c03\u5ea6\u7b97\u6cd5\u3002<\/p>\n 1.\u8f6e\u8be2\u8c03\u5ea6<\/strong><\/span><\/div>\n \u8f6e\u8be2\u8c03\u5ea6(Round Robin \u7b80\u79f0'RR')\u7b97\u6cd5\u5c31\u662f\u6309\u4f9d\u6b21\u5faa\u73af\u7684\u65b9\u5f0f\u5c06\u8bf7\u6c42\u8c03\u5ea6\u5230\u4e0d\u540c\u7684\u670d\u52a1\u5668\u4e0a\uff0c\u8be5\u7b97\u6cd5\u6700\u5927\u7684\u7279\u70b9\u5c31\u662f\u5b9e\u73b0\u7b80\u5355\u3002\u8f6e\u8be2\u7b97\u6cd5\u5047\u8bbe\u6240\u6709\u7684\u670d\u52a1\u5668\u5904\u7406\u8bf7\u6c42\u7684\u80fd\u529b\u90fd\u4e00\u6837\u7684\uff0c\u8c03\u5ea6\u5668\u4f1a\u5c06\u6240\u6709\u7684\u8bf7\u6c42\u5e73\u5747\u5206\u914d\u7ed9\u6bcf\u4e2a\u771f\u5b9e\u670d\u52a1\u5668\u3002<\/p>\n 2.\u52a0\u6743\u8f6e\u8be2\u8c03\u5ea6<\/strong><\/span><\/div>\n \u52a0\u6743\u8f6e\u8be2(Weight Round Robin \u7b80\u79f0'WRR')\u7b97\u6cd5\u4e3b\u8981\u662f\u5bf9\u8f6e\u8be2\u7b97\u6cd5\u7684\u4e00\u79cd\u4f18\u5316\u4e0e\u8865\u5145\uff0cLVS\u4f1a\u8003\u8651\u6bcf\u53f0\u670d\u52a1\u5668\u7684\u6027\u80fd\uff0c\u5e76\u7ed9\u6bcf\u53f0\u670d\u52a1\u5668\u6dfb\u52a0\u4e00\u4e2a\u6743\u503c\uff0c\u5982\u679c\u670d\u52a1\u5668A\u7684\u6743\u503c\u4e3a1\uff0c\u670d\u52a1\u5668B\u7684\u6743\u503c\u4e3a2\uff0c\u5219\u8c03\u5ea6\u5668\u8c03\u5ea6\u5230\u670d\u52a1\u5668B\u7684\u8bf7\u6c42\u4f1a\u662f\u670d\u52a1\u5668A\u7684\u4e24\u500d\u3002\u6743\u503c\u8d8a\u9ad8\u7684\u670d\u52a1\u5668\uff0c\u5904\u7406\u7684\u8bf7\u6c42\u8d8a\u591a\u3002<\/p>\n 3.\u6700\u5c0f\u8fde\u63a5\u8c03\u5ea6<\/strong><\/span><\/div>\n \u6700\u5c0f\u8fde\u63a5\u8c03\u5ea6(Least Connections \u7b80\u79f0'LC')\u7b97\u6cd5\u662f\u628a\u65b0\u7684\u8fde\u63a5\u8bf7\u6c42\u5206\u914d\u5230\u5f53\u524d\u8fde\u63a5\u6570\u6700\u5c0f\u7684\u670d\u52a1\u5668\u3002\u6700\u5c0f\u8fde\u63a5\u8c03\u5ea6\u662f\u4e00\u79cd\u52a8\u6001\u7684\u8c03\u5ea6\u7b97\u6cd5\uff0c\u5b83\u901a\u8fc7\u670d\u52a1\u5668\u5f53\u524d\u6d3b\u8dc3\u7684\u8fde\u63a5\u6570\u6765\u4f30\u8ba1\u670d\u52a1\u5668\u7684\u60c5\u51b5\u3002\u8c03\u5ea6\u5668\u9700\u8981\u8bb0\u5f55\u5404\u4e2a\u670d\u52a1\u5668\u5df2\u5efa\u7acb\u8fde\u63a5\u7684\u6570\u76ee\uff0c\u5f53\u4e00\u4e2a\u8bf7\u6c42\u88ab\u8c03\u5ea6\u5230\u67d0\u53f0\u670d\u52a1\u5668\uff0c\u5176\u8fde\u63a5\u6570\u52a01;\u5f53\u8fde\u63a5\u4e2d\u65ad\u6216\u8005\u8d85\u65f6\uff0c\u5176\u8fde\u63a5\u6570\u51cf1\u3002<\/p>\n (\u96c6\u7fa4\u7cfb\u7edf\u7684\u771f\u5b9e\u670d\u52a1\u5668\u5177\u6709\u76f8\u8fd1\u7684\u7cfb\u7edf\u6027\u80fd\uff0c\u91c7\u7528\u6700\u5c0f\u8fde\u63a5\u8c03\u5ea6\u7b97\u6cd5\u53ef\u4ee5\u6bd4\u8f83\u597d\u5730\u5747\u8861\u8d1f\u8f7d\u3002)<\/p>\n 4.\u52a0\u6743\u6700\u5c0f\u8fde\u63a5\u8c03\u5ea6<\/strong><\/span><\/div>\n \u52a0\u6743\u6700\u5c11\u8fde\u63a5(Weight Least Connections \u7b80\u79f0'WLC')\u7b97\u6cd5\u662f\u6700\u5c0f\u8fde\u63a5\u8c03\u5ea6\u7684\u8d85\u96c6\uff0c\u5404\u4e2a\u670d\u52a1\u5668\u76f8\u5e94\u7684\u6743\u503c\u8868\u793a\u5176\u5904\u7406\u6027\u80fd\u3002\u670d\u52a1\u5668\u7684\u7f3a\u7701\u6743\u503c\u4e3a1\uff0c\u7cfb\u7edf\u7ba1\u7406\u5458\u53ef\u4ee5\u52a8\u6001\u5730\u8bbe\u7f6e\u670d\u52a1\u5668\u7684\u6743\u503c\u3002\u52a0\u6743\u6700\u5c0f\u8fde\u63a5\u8c03\u5ea6\u5728\u8c03\u5ea6\u65b0\u8fde\u63a5\u65f6\u5c3d\u53ef\u80fd\u4f7f\u670d\u52a1\u5668\u7684\u5df2\u5efa\u7acb\u8fde\u63a5\u6570\u548c\u5176\u6743\u503c\u6210\u6bd4\u4f8b\u3002\u8c03\u5ea6\u5668\u53ef\u4ee5\u81ea\u52a8\u95ee\u8be2\u771f\u5b9e\u670d\u52a1\u5668\u7684\u8d1f\u8f7d\u60c5\u51b5\uff0c\u5e76\u52a8\u6001\u5730\u8c03\u6574\u5176\u6743\u503c\u3002<\/p>\n 5.\u57fa\u4e8e\u5c40\u90e8\u7684\u6700\u5c11\u8fde\u63a5<\/strong><\/span><\/div>\n \u57fa\u4e8e\u5c40\u90e8\u7684\u6700\u5c11\u8fde\u63a5\u8c03\u5ea6(Locality-Based Least Connections \u7b80\u79f0'LBLC')\u7b97\u6cd5\u662f\u9488\u5bf9\u8bf7\u6c42\u62a5\u6587\u7684\u76ee\u6807IP\u5730\u5740\u7684 \u8d1f\u8f7d\u5747\u8861\u8c03\u5ea6\uff0c\u76ee\u524d\u4e3b\u8981\u7528\u4e8eCache\u96c6\u7fa4\u7cfb\u7edf\uff0c\u56e0\u4e3a\u5728Cache\u96c6\u7fa4\u5ba2\u6237\u8bf7\u6c42\u62a5\u6587\u7684\u76ee\u6807IP\u5730\u5740\u662f\u53d8\u5316\u7684\u3002\u8fd9\u91cc\u5047\u8bbe\u4efb\u4f55\u540e\u7aef\u670d\u52a1\u5668\u90fd\u53ef\u4ee5\u5904\u7406\u4efb\u4e00\u8bf7\u6c42\uff0c\u7b97\u6cd5\u7684\u8bbe\u8ba1\u76ee\u6807\u662f\u5728\u670d\u52a1\u5668\u7684\u8d1f\u8f7d\u57fa\u672c\u5e73\u8861\u60c5\u51b5\u4e0b\uff0c\u5c06\u76f8\u540c\u76ee\u6807IP\u5730\u5740\u7684\u8bf7\u6c42\u8c03\u5ea6\u5230\u540c\u4e00\u53f0\u670d\u52a1\u5668\uff0c\u6765\u63d0\u9ad8\u5404\u53f0\u670d\u52a1\u5668\u7684\u8bbf\u95ee\u5c40\u90e8\u6027\u548cCache\u547d\u4e2d\u7387\uff0c\u4ece\u800c\u63d0\u5347\u6574\u4e2a\u96c6\u7fa4\u7cfb\u7edf\u7684\u5904\u7406\u80fd\u529b\u3002LBLC\u8c03\u5ea6\u7b97\u6cd5\u5148\u6839\u636e\u8bf7\u6c42\u7684\u76ee\u6807IP\u5730\u5740\u627e\u51fa\u8be5\u76ee\u6807IP\u5730\u5740\u6700\u8fd1\u4f7f\u7528\u7684\u670d\u52a1\u5668\uff0c\u82e5\u8be5\u670d\u52a1\u5668\u662f\u53ef\u7528\u7684\u4e14\u6ca1\u6709\u8d85\u8f7d\uff0c\u5c06\u8bf7\u6c42\u53d1\u9001\u5230\u8be5\u670d\u52a1\u5668;\u82e5\u670d\u52a1\u5668\u4e0d\u5b58\u5728\uff0c\u6216\u8005\u8be5\u670d\u52a1\u5668\u8d85\u8f7d\u4e14\u6709\u670d\u52a1\u5668\u5904\u4e8e\u4e00\u534a\u7684\u5de5\u4f5c\u8d1f\u8f7d\uff0c\u5219\u4f7f\u7528'\u6700\u5c11\u8fde\u63a5'\u7684\u539f\u5219\u9009\u51fa\u4e00\u4e2a\u53ef\u7528\u7684\u670d\u52a1\u5668\uff0c\u5c06\u8bf7\u6c42\u53d1\u9001\u5230\u670d\u52a1\u5668\u3002<\/p>\n 6.\u5e26\u590d\u5236\u7684\u57fa\u4e8e\u5c40\u90e8\u6027\u7684\u6700\u5c11\u8fde\u63a5<\/strong><\/span><\/div>\n \u5e26\u590d\u5236\u7684\u57fa\u4e8e\u5c40\u90e8\u6027\u7684\u6700\u5c11\u8fde\u63a5(Locality-Based Least Connections with Replication \u7b80\u79f0'LBLCR')\u7b97\u6cd5\u4e5f\u662f\u9488\u5bf9\u76ee\u6807IP\u5730\u5740\u7684\u8d1f\u8f7d\u5747\u8861\uff0c\u76ee\u524d\u4e3b\u8981\u7528\u4e8eCache\u96c6\u7fa4\u7cfb\u7edf\uff0c\u5b83\u4e0eLBLC\u7b97\u6cd5\u4e0d\u540c\u4e4b\u5904\u662f\u5b83\u8981\u7ef4\u62a4\u4ece\u4e00\u4e2a\u76ee\u6807IP\u5730\u5740\u5230\u4e00\u7ec4\u670d\u52a1\u5668\u7684\u6620\u5c04\uff0c\u800cLBLC\u7b97\u6cd5\u7ef4\u62a4\u4ece\u4e00\u4e2a\u76ee\u6807IP\u5730\u5740\u5230\u4e00\u53f0\u670d\u52a1\u5668\u7684\u6620\u5c04\u3002\u6309'\u6700\u5c0f\u8fde\u63a5'\u539f\u5219\u4ece\u8be5\u670d\u52a1\u5668\u7ec4\u4e2d\u9009\u51fa\u4e00\u4e00\u53f0\u670d\u52a1\u5668\uff0c\u82e5\u670d\u52a1\u5668\u6ca1\u6709\u8d85\u8f7d\uff0c\u5c06\u8bf7\u6c42\u53d1\u9001\u5230\u8be5\u670d\u52a1\u5668;\u82e5\u670d\u52a1\u5668\u8d85\u8f7d\uff0c\u5219\u6309'\u6700\u5c0f\u8fde\u63a5'\u539f\u5219\u4ece\u6574\u4e2a\u96c6\u7fa4\u4e2d\u9009\u51fa\u4e00\u53f0\u670d\u52a1\u5668\uff0c\u5c06\u8be5\u670d\u52a1\u5668\u52a0\u5165\u5230\u8fd9\u4e2a\u670d\u52a1\u5668\u7ec4\u4e2d\uff0c\u5c06\u8bf7\u6c42\u53d1\u9001\u5230\u8be5\u670d\u52a1\u5668\u3002\u540c\u65f6\uff0c\u5f53\u8be5\u670d\u52a1\u5668\u7ec4\u6709\u4e00\u6bb5\u65f6\u95f4\u6ca1\u6709\u88ab\u4fee\u6539\uff0c\u5c06\u6700\u5fd9\u7684\u670d\u52a1\u5668\u4ece\u670d\u52a1\u5668\u7ec4\u4e2d\u5220\u9664\uff0c\u4ee5\u964d\u4f4e\u590d\u5236\u7684\u7a0b\u5ea6\u3002<\/p>\n 7.\u76ee\u6807\u5730\u5740\u6563\u5217\u8c03\u5ea6<\/strong><\/span><\/div>\n \u76ee\u6807\u5730\u5740\u6563\u5217\u8c03\u5ea6(Destination Hashing \u7b80\u79f0'DH')\u7b97\u6cd5\u5148\u6839\u636e\u8bf7\u6c42\u7684\u76ee\u6807IP\u5730\u5740\uff0c\u4f5c\u4e3a\u6563\u5217\u952e(Hash Key)\u4ece\u9759\u6001\u5206\u914d\u7684\u6563\u5217\u8868\u627e\u51fa\u5bf9\u5e94\u7684\u670d\u52a1\u5668\uff0c\u82e5\u8be5\u670d\u52a1\u5668\u662f\u53ef\u7528\u7684\u4e14\u5e76\u672a\u8d85\u8f7d\uff0c\u5c06\u8bf7\u6c42\u53d1\u9001\u5230\u8be5\u670d\u52a1\u5668\uff0c\u5426\u5219\u8fd4\u56de\u7a7a\u3002<\/p>\n 8.\u6e90\u5730\u5740\u6563\u5217\u8c03\u5ea6U<\/strong><\/span><\/div>\n \u6e90\u5730\u5740\u6563\u5217\u8c03\u5ea6(Source Hashing \u7b80\u79f0'SH')\u7b97\u6cd5\u5148\u6839\u636e\u8bf7\u6c42\u7684\u6e90IP\u5730\u5740\uff0c\u4f5c\u4e3a\u6563\u5217\u952e(Hash Key)\u4ece\u9759\u6001\u5206\u914d\u7684\u6563\u5217\u8868\u627e\u51fa\u5bf9\u5e94\u7684\u670d\u52a1\u5668\uff0c\u82e5\u8be5\u670d\u52a1\u5668\u662f\u53ef\u7528\u7684\u4e14\u5e76\u672a\u8d85\u8f7d\uff0c\u5c06\u8bf7\u6c42\u53d1\u9001\u5230\u8be5\u670d\u52a1\u5668\uff0c\u5426\u5219\u8fd4\u56de\u7a7a\u3002\u5b83\u91c7\u7528\u7684\u6563\u5217\u51fd\u6570\u4e0e\u76ee\u6807\u5730\u5740\u6563\u5217\u8c03\u5ea6\u7b97\u6cd5\u7684\u76f8\u540c\uff0c\u5b83\u7684\u7b97\u6cd5\u6d41\u7a0b\u4e0e\u76ee\u6807\u5730\u5740\u6563\u5217\u8c03\u5ea6\u7b97\u6cd5\u7684\u57fa\u672c\u76f8\u4f3c\u3002<\/p>\n 9.\u6700\u77ed\u7684\u671f\u671b\u7684\u5ef6\u8fdf<\/strong><\/span><\/div>\n \u6700\u77ed\u7684\u671f\u671b\u7684\u5ef6\u8fdf\u8c03\u5ea6(Shortest Expected Delay \u7b80\u79f0'SED')\u7b97\u6cd5\u57fa\u4e8eWLC\u7b97\u6cd5\u3002\u4e3e\u4e2a\u4f8b\u5b50\u5427\uff0cABC\u4e09\u53f0\u670d\u52a1\u5668\u7684\u6743\u91cd\u5206\u522b\u4e3a1\u30012\u30013 \u3002\u90a3\u4e48\u5982\u679c\u4f7f\u7528WLC\u7b97\u6cd5\u7684\u8bdd\u4e00\u4e2a\u65b0\u8bf7\u6c42\u8fdb\u5165\u65f6\u5b83\u53ef\u80fd\u4f1a\u5206\u7ed9ABC\u4e2d\u7684\u4efb\u610f\u4e00\u4e2a\u3002\u4f7f\u7528SED\u7b97\u6cd5\u540e\u4f1a\u8fdb\u884c\u4e00\u4e2a\u8fd0\u7b97<\/p>\n A\uff1a(1+1)\/1=2 B\uff1a(1+2)\/2=3\/2 C\uff1a(1+3)\/3=4\/3 \u5c31\u628a\u8bf7\u6c42\u4ea4\u7ed9\u5f97\u51fa\u8fd0\u7b97\u7ed3\u679c\u6700\u5c0f\u7684\u670d\u52a1\u5668\u3002<\/p>\n 10.\u6700\u5c11\u961f\u5217\u8c03\u5ea6<\/strong><\/span><\/div>\n \u6700\u5c11\u961f\u5217\u8c03\u5ea6(Never Queue \u7b80\u79f0'NQ')\u7b97\u6cd5\uff0c\u65e0\u9700\u961f\u5217\u3002\u5982\u679c\u6709realserver\u7684\u8fde\u63a5\u6570\u7b49\u4e8e0\u5c31\u76f4\u63a5\u5206\u914d\u8fc7\u53bb\uff0c\u4e0d\u9700\u8981\u5728\u8fdb\u884cSED\u8fd0\u7b97\u3002<\/p>\n","protected":false},"excerpt":{"rendered":" LVS(Linux Virtual Server)\u5373Linux\u865a\u62df\u670d\u52a1\u5668\uff0c\u662f\u7531\u7ae0\u6587\u5d69\u535a\u58eb\u4e3b\u5bfc\u7684\u5f00\u6e90\u8d1f\u8f7d\u5747\u8861\u9879\u76ee […]<\/p>\n","protected":false},"author":1469,"featured_media":155970,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-155965","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-thread"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/155965","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/users\/1469"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=155965"}],"version-history":[{"count":7,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/155965\/revisions"}],"predecessor-version":[{"id":156386,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/155965\/revisions\/156386"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/155970"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=155965"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=155965"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=155965"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}} |