{"id":2447,"date":"2025-09-17T21:51:23","date_gmt":"2025-09-17T13:51:23","guid":{"rendered":"https:\/\/linuxjk.cn\/?p=2447"},"modified":"2025-09-19T22:15:33","modified_gmt":"2025-09-19T14:15:33","slug":"ha%e9%ab%98%e5%8f%af%e7%94%a8%e6%9c%8d%e5%8a%a1","status":"publish","type":"post","link":"https:\/\/linuxjk.cn\/?p=2447","title":{"rendered":"HA\u9ad8\u53ef\u7528\u670d\u52a1"},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-post\" data-elementor-id=\"2447\" class=\"elementor elementor-2447\">\n\t\t\t\t<div class=\"elementor-element elementor-element-b8fe312 e-flex e-con-boxed e-con e-parent\" data-id=\"b8fe312\" data-element_type=\"container\" data-e-type=\"container\">\n\t\t\t\t\t<div class=\"e-con-inner\">\n\t\t\t\t<div class=\"elementor-element elementor-element-bf23f69 elementor-widget elementor-widget-text-editor\" data-id=\"bf23f69\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p><a href=\"https:\/\/www.processon.com\/view\/link\/6285fa13e0b34d35a1f37680\">\u7f51\u7ad9\u67b6\u6784\u6f14\u53d8<\/a><\/p><div id=\"ez-toc-container\" class=\"ez-toc-v2_0_82_2 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">\u76ee\u5f55<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/linuxjk.cn\/?p=2447\/#%E6%A6%82%E8%BF%B0\" >\u6982\u8ff0<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/linuxjk.cn\/?p=2447\/#%E5%8E%9F%E7%90%86\" >\u539f\u7406<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/linuxjk.cn\/?p=2447\/#%E9%83%A8%E7%BD%B2%E4%B8%8E%E4%BD%BF%E7%94%A8\" >\u90e8\u7f72\u4e0e\u4f7f\u7528<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/linuxjk.cn\/?p=2447\/#%E6%9C%BA%E5%99%A8%E6%B8%85%E5%8D%95%EF%BC%9A\" >\u673a\u5668\u6e05\u5355\uff1a<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/linuxjk.cn\/?p=2447\/#%E9%83%A8%E7%BD%B2%E6%9C%8D%E5%8A%A1\" >\u90e8\u7f72\u670d\u52a1<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/linuxjk.cn\/?p=2447\/#%E6%8A%93%E5%8C%85%E6%9F%A5%E7%9C%8B\" >\u6293\u5305\u67e5\u770b<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/linuxjk.cn\/?p=2447\/#%E9%97%AE%E9%A2%98\" >\u95ee\u9898<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/linuxjk.cn\/?p=2447\/#1_%E8%84%91%E8%A3%82%E6%95%85%E9%9A%9C_%E2%AD%90%E2%AD%90%E2%AD%90\" >1) \u8111\u88c2\u6545\u969c \u2b50\u2b50\u2b50<\/a><ul class='ez-toc-list-level-4' ><li class='ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/linuxjk.cn\/?p=2447\/#%E7%8E%B0%E8%B1%A1_%E4%B8%BB%E5%A4%87%E9%83%BD%E6%9C%89vip\" >\u73b0\u8c61: \u4e3b\u5907\u90fd\u6709vip .<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/linuxjk.cn\/?p=2447\/#%E5%8E%9F%E5%9B%A0\" >\u539f\u56e0:<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-11\" href=\"https:\/\/linuxjk.cn\/?p=2447\/#%E8%A7%A3%E5%86%B3\" >\u89e3\u51b3:<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-12\" href=\"https:\/\/linuxjk.cn\/?p=2447\/#%E8%A7%A3%E5%86%B3%E6%96%B9%E6%A1%88%EF%BC%9A%E7%9B%91%E6%8E%A7%E8%84%91%E8%A3%82%E6%88%96%E4%B8%BB%E5%A4%87%E5%88%87%E6%8D%A2%E8%84%9A%E6%9C%AC\" >\u89e3\u51b3\u65b9\u6848\uff1a\u76d1\u63a7\u8111\u88c2\u6216\u4e3b\u5907\u5207\u6362\u811a\u672c.<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-13\" href=\"https:\/\/linuxjk.cn\/?p=2447\/#2_%E6%A1%88%E4%BE%8B01-keepalived%E5%9F%BA%E4%BA%8E%E4%B8%BB%E6%9C%BA%E9%AB%98%E5%8F%AF%E7%94%A8%E8%BD%AF%E4%BB%B6%E2%AD%90%E2%AD%90%E2%AD%90\" >2) \u6848\u4f8b01-keepalived\u57fa\u4e8e\u4e3b\u673a\u9ad8\u53ef\u7528\u8f6f\u4ef6\u2b50\u2b50\u2b50<\/a><ul class='ez-toc-list-level-4' ><li class='ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-14\" href=\"https:\/\/linuxjk.cn\/?p=2447\/#%E9%97%AE%E9%A2%98-2\" >\u95ee\u9898:<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-15\" href=\"https:\/\/linuxjk.cn\/?p=2447\/#%E8%A7%A3%E5%86%B3%E6%96%B9%E6%A1%88%EF%BC%88%E9%A1%B9%E7%9B%AE%E6%AD%A5%E9%AA%A4%EF%BC%89\" >\u89e3\u51b3\u65b9\u6848\uff08\u9879\u76ee\u6b65\u9aa4\uff09:<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-16\" href=\"https:\/\/linuxjk.cn\/?p=2447\/#%E5%86%99%E5%AE%8C%E9%85%8D%E7%BD%AE%E6%96%87%E4%BB%B6%E5%90%8E%E5%85%88%E5%90%AF%E5%8A%A8nginx%EF%BC%8C%E5%90%8E%E5%90%AF%E5%8A%A8keepalived%EF%BC%8C%E5%90%A6%E5%88%99keepalive%E8%B5%B7%E4%B8%8D%E6%9D%A5\" >\u5199\u5b8c\u914d\u7f6e\u6587\u4ef6\u540e\u5148\u542f\u52a8nginx\uff0c\u540e\u542f\u52a8keepalived\uff0c\u5426\u5219keepalive\u8d77\u4e0d\u6765<\/a><\/li><\/ul><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-17\" href=\"https:\/\/linuxjk.cn\/?p=2447\/#%E5%B0%8F%E7%BB%93\" >\u5c0f\u7ed3<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-18\" href=\"https:\/\/linuxjk.cn\/?p=2447\/#%E5%B1%80%E9%99%90_%E9%80%82%E7%94%A8%E4%BA%8E%E9%9D%9E%E5%AD%98%E5%82%A8%E6%95%B0%E6%8D%AE%E7%9A%84%E6%9C%8D%E5%8A%A1%E8%AE%BF%E9%97%AE%E9%87%8F%E4%B8%8E%E6%95%B0%E6%8D%AE%E9%87%8F%E4%B8%8D%E5%A4%A7%E4%B9%9F%E5%8F%AF%E4%BB%A5%E7%94%A8\" >\u5c40\u9650:\u9002\u7528\u4e8e\u975e\u5b58\u50a8\u6570\u636e\u7684\u670d\u52a1(\u8bbf\u95ee\u91cf\u4e0e\u6570\u636e\u91cf\u4e0d\u5927\u4e5f\u53ef\u4ee5\u7528)<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-19\" href=\"https:\/\/linuxjk.cn\/?p=2447\/#%E8%BF%9B%E9%98%B6%E7%94%A8%E6%B3%95\" >\u8fdb\u9636\u7528\u6cd5<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-20\" href=\"https:\/\/linuxjk.cn\/?p=2447\/#1_%E9%9D%9E%E6%8A%A2%E5%8D%A0%E6%A8%A1%E5%BC%8F\" >1) \u975e\u62a2\u5360\u6a21\u5f0f<\/a><ul class='ez-toc-list-level-4' ><li class='ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-21\" href=\"https:\/\/linuxjk.cn\/?p=2447\/#%E4%BD%BF%E7%94%A8%E6%B5%81%E7%A8%8B%EF%BC%9A\" >\u4f7f\u7528\u6d41\u7a0b\uff1a<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-22\" href=\"https:\/\/linuxjk.cn\/?p=2447\/#2_%E5%8F%8C%E4%B8%BB%E6%A8%A1%E5%BC%8F\" >2) \u53cc\u4e3b\u6a21\u5f0f<\/a><\/li><\/ul><\/li><\/ul><\/nav><\/div>\n<h2><span class=\"ez-toc-section\" id=\"%E6%A6%82%E8%BF%B0\"><\/span>\u6982\u8ff0<span class=\"ez-toc-section-end\"><\/span><\/h2><p>\u9ad8\u53ef\u7528:HA HighAvailablity \ud83d\udc49 Keepalived<br \/>\u751f\u6210vip\u5730\u5740,dns\u89e3\u6790\u5230\u8fd9\u4e2aip\u5730\u5740\u5373\u53ef.<\/p><p><img fetchpriority=\"high\" decoding=\"async\" class=\"alignnone size-full wp-image-2450\" src=\"https:\/\/linuxjk.cn\/wp-content\/uploads\/2025\/09\/\u9ad8\u53ef\u7528\u9009\u578b.png\" alt=\"\" width=\"1251\" height=\"242\" srcset=\"https:\/\/linuxjk.oss-cn-shanghai.aliyuncs.com\/wp-content\/uploads\/2025\/09\/\u9ad8\u53ef\u7528\u9009\u578b.png 1251w, https:\/\/linuxjk.oss-cn-shanghai.aliyuncs.com\/wp-content\/uploads\/2025\/09\/\u9ad8\u53ef\u7528\u9009\u578b-300x58.png 300w, https:\/\/linuxjk.oss-cn-shanghai.aliyuncs.com\/wp-content\/uploads\/2025\/09\/\u9ad8\u53ef\u7528\u9009\u578b-1024x198.png 1024w, https:\/\/linuxjk.oss-cn-shanghai.aliyuncs.com\/wp-content\/uploads\/2025\/09\/\u9ad8\u53ef\u7528\u9009\u578b-768x149.png 768w\" sizes=\"(max-width: 1251px) 100vw, 1251px\" \/><\/p><h2><span class=\"ez-toc-section\" id=\"%E5%8E%9F%E7%90%86\"><\/span>\u539f\u7406<span class=\"ez-toc-section-end\"><\/span><\/h2><p>keepalived\u662f\u57fa\u4e8eVRRP\u534f\u8bae\u5b9e\u73b0\u9ad8\u53ef\u7528\uff1b\u9ad8\u53ef\u7528\u5c31\u662f\u7ed9\u8d1f\u8f7d\u5747\u8861\u52a0\u4e00\u4e2a\u5907\u7528\u8282\u70b9\uff1b\u4e5f\u53ef\u4ee5\u7ed9\u5821\u5792\u673a\u4f7f\u7528\uff0ckeepalived\u548c\u5f88\u591a\u8f6f\u4ef6\u642d\u914d\u5b9e\u73b0\u9ad8\u53ef\u7528\uff0c\u4e4b\u524d\u662f\u7ed9lvs\u4f7f\u7528\u7684<br \/>VRRP\u865a\u62df\u8def\u7531\u5668\u5197\u4f59\u534f\u8bae,\u6700\u5f00\u59cb\u662f\u7ed9\u7f51\u7edc\u8bbe\u5907\u5b9e\u73b0\u9ad8\u53ef\u7528 .\u76ee\u524dkeepalive\u5b9e\u73b0vrrp\u534f\u8bae,\u901a\u8fc7vrrp\u5b9e\u73b0\u9ad8\u53ef\u7528.<br \/>\u5206\u4e3a\u4e3b,\u5907\uff1b\u4e00\u822c\u662f2\u4e2a\u8282\u70b9.\u4e3b\u5907\u4e4b\u95f4\u901a\u8fc7vrrp\u534f\u8bae\u53d1\u9001\u6570\u636e\u5305\u6c9f\u901a.<br \/>\u4e3b\u7ed9\u5907\u5b9a\u671f\u53d1\u9001\u6570\u636e\u5305 ,\u5907\u6536\u5230\u6570\u636e\u5305\u8868\u793a\u4e3b\u8fd8\u6d3b\u7740,\u5907\u65e0\u6cd5\u6536\u5230\u6570\u636e\u5305,\u8868\u793a\u4e3b\u6302\u4e86,\u5907\u80ce\u8f6c\u6b63\u4e86,\u63a5\u7ba1\u7528\u6237\u8bf7\u6c42\u6d41\u91cf.<br \/>vrrp\u534f\u8bae\u4f7f\u7528\u7ec4\u64ad\u7684ip. 224.xx.xx.x<\/p><h2><span class=\"ez-toc-section\" id=\"%E9%83%A8%E7%BD%B2%E4%B8%8E%E4%BD%BF%E7%94%A8\"><\/span>\u90e8\u7f72\u4e0e\u4f7f\u7528<span class=\"ez-toc-section-end\"><\/span><\/h2><h3><span class=\"ez-toc-section\" id=\"%E6%9C%BA%E5%99%A8%E6%B8%85%E5%8D%95%EF%BC%9A\"><\/span>\u673a\u5668\u6e05\u5355\uff1a<span class=\"ez-toc-section-end\"><\/span><\/h3><p>lb01+lb02\uff0c\u90e8\u7f72nginx + keepalived<\/p><p>\u4e24\u53f0\u8282\u70b9\u914d\u7f6e\u4e00\u6478\u4e00\u6837<\/p><h3><span class=\"ez-toc-section\" id=\"%E9%83%A8%E7%BD%B2%E6%9C%8D%E5%8A%A1\"><\/span>\u90e8\u7f72\u670d\u52a1<span class=\"ez-toc-section-end\"><\/span><\/h3><p>keepalived\u914d\u7f6e\u6587\u4ef6\u5206\u7c7b(\u5206\u4e3a3\u4e2a\u90e8\u5206)<\/p><p>#lb01 lb02<\/p><p><code>yum install -y keepalived<\/code><\/p><p><img decoding=\"async\" class=\"alignnone size-full wp-image-2451\" src=\"https:\/\/linuxjk.cn\/wp-content\/uploads\/2025\/09\/keepalived\u914d\u7f6e\u6587\u4ef6.png\" alt=\"\" width=\"1526\" height=\"268\" srcset=\"https:\/\/linuxjk.oss-cn-shanghai.aliyuncs.com\/wp-content\/uploads\/2025\/09\/keepalived\u914d\u7f6e\u6587\u4ef6.png 1526w, https:\/\/linuxjk.oss-cn-shanghai.aliyuncs.com\/wp-content\/uploads\/2025\/09\/keepalived\u914d\u7f6e\u6587\u4ef6-300x53.png 300w, https:\/\/linuxjk.oss-cn-shanghai.aliyuncs.com\/wp-content\/uploads\/2025\/09\/keepalived\u914d\u7f6e\u6587\u4ef6-1024x180.png 1024w, https:\/\/linuxjk.oss-cn-shanghai.aliyuncs.com\/wp-content\/uploads\/2025\/09\/keepalived\u914d\u7f6e\u6587\u4ef6-768x135.png 768w\" sizes=\"(max-width: 1526px) 100vw, 1526px\" \/><\/p><pre>cat \/etc\/keepalived\/keepalived.conf\n! Configuration File for keepalived\n#\u5168\u5c40\u5b9a\u4e49\u90e8\u5206\nglobal_defs {\nrouter_id lb01 #\u6bcf\u4e00\u4e2akeepalived\u7684\u540d\u5b57,\u5f53\u524d\u7f51\u7edc\u4e2d\u552f\u4e00.\n}\n#vrrp\u5b9e\u4f8b\u914d\u7f6e\u90e8\u5206 \u7528\u4e8e\u914d\u7f6eVIP \u8bbe\u7f6e\u4e3b\u5907 virtual_ipaddress\n#vrrp\u8bbe\u7f6e\u540d\u5b57.\nvrrp_instance vip_3 { #vrrp\u5b9e\u4f8b\u540d\u5b57 \u5728\u540c1\u5bf9\u4e3b\u5907\u4e4b\u95f4\u8981\u4e00\u81f4. \u5728\u5f53\u524dkeepalived\u8f6f\u4ef6\u4e2d\u552f\u4e00.\nstate MASTER #\u4e3b\/\u5907 MASTER\u4e3b BACKUP\u5907 \uff08\u5927\u5199\u5b57\u6bcd\uff09\ninterface ens33 #\u6307\u5b9a\u7f51\u5361\nvirtual_router_id 51 # \u540c1\u5bf9\u4e3b\u5907\u4e4b\u95f4\u8fd9\u4e2aid\u8981\u4e00\u81f4.\npriority 100 #\u4f18\u5148\u7ea7 \u6570\u5b57\u8d8a\u5927\u4f18\u5148\u7ea7\u8d8a\u9ad8 \u8bbe\u7f6e\u5efa\u8bae: \u4e3b&gt;\u5907 100 50 \u76f8\u5dee50\nadvert_int 1 #\u5fc3\u8df3\u95f4\u9694 \u591a\u4e45\u53d1\u9001\u4e00\u6b21vrrp\u6570\u636e\u5305\uff1badvert_int=1\u5355\u4f4d\u662f\u79d2\nauthentication { #\u6388\u6743\u4e0e\u8ba4\u8bc1,\u4fdd\u6301\u9ed8\u8ba4\u5373\u53ef. \u5bf9\u6570\u636e\u5305\u52a0\u5bc6.\nauth_type PASS #\u7b80\u5355\u8ba4\u8bc1\nauth_pass 1111 #1111\n}\nvirtual_ipaddress { #\u8bbe\u7f6evip\u203b\u203b\u203b\u203b\n10.0.0.3 dev ens33 label ens33:0 #label \u8bbe\u7f6e\u4e86\u522b\u540d\n}\n}<\/pre><p>lb01\u914d\u7f6e<\/p><p><code>[root@lb01 ~]# cat \/etc\/keepalived\/keepalived.conf<\/code><\/p><pre>! Configuration File for keepalived\nglobal_defs {\nrouter_id lb01\n}\nvrrp_instance vip_3 {\nstate MASTER\ninterface eth0\nvirtual_router_id 51\npriority 100\nadvert_int 1\nauthentication {\nauth_type PASS\nauth_pass 1111\n}\nvirtual_ipaddress {\n10.0.0.3 dev eth0 label eth0:0\n}\n}<\/pre><h2><span class=\"ez-toc-section\" id=\"%E6%8A%93%E5%8C%85%E6%9F%A5%E7%9C%8B\"><\/span><b>\u6293\u5305\u67e5\u770b<\/b><span class=\"ez-toc-section-end\"><\/span><\/h2><p>\u5982\u679cwireshark\u65e0\u6cd5\u4f7f\u7528\u53ef\u4ee5\u4f7f\u7528tcpdump\u6293\u5305\u5e76\u4fdd\u5b58\u3002\u7136\u540e\u901a\u8fc7wireshark\u67e5\u770b\u3002<\/p><p>tcpdump\u6293\u53d6 vrrp\u6570\u636e\u5305\u6307\u4ee4 <code>tcpdump -vvv -nnn vrrp -w ~\/vrrp.pcap<\/code><\/p><p><img decoding=\"async\" class=\"alignnone size-full wp-image-2453\" src=\"https:\/\/linuxjk.cn\/wp-content\/uploads\/2025\/09\/keepalived\u6293\u5305.png\" alt=\"\" width=\"1405\" height=\"1142\" srcset=\"https:\/\/linuxjk.oss-cn-shanghai.aliyuncs.com\/wp-content\/uploads\/2025\/09\/keepalived\u6293\u5305.png 1405w, https:\/\/linuxjk.oss-cn-shanghai.aliyuncs.com\/wp-content\/uploads\/2025\/09\/keepalived\u6293\u5305-300x244.png 300w, https:\/\/linuxjk.oss-cn-shanghai.aliyuncs.com\/wp-content\/uploads\/2025\/09\/keepalived\u6293\u5305-1024x832.png 1024w, https:\/\/linuxjk.oss-cn-shanghai.aliyuncs.com\/wp-content\/uploads\/2025\/09\/keepalived\u6293\u5305-768x624.png 768w\" sizes=\"(max-width: 1405px) 100vw, 1405px\" \/><\/p><h2><span class=\"ez-toc-section\" id=\"%E9%97%AE%E9%A2%98\"><\/span><b>\u95ee\u9898<\/b><span class=\"ez-toc-section-end\"><\/span><\/h2><h3><span class=\"ez-toc-section\" id=\"1_%E8%84%91%E8%A3%82%E6%95%85%E9%9A%9C_%E2%AD%90%E2%AD%90%E2%AD%90\"><\/span><b>1) <\/b><b>\u8111\u88c2\u6545\u969c <\/b>\u2b50\u2b50\u2b50<span class=\"ez-toc-section-end\"><\/span><\/h3><p>\u8111\u88c2\/\u88c2\u8111:\u4e3b\u8282\u70b9\u4e0e\u5907\u8282\u70b9\u4e0d\u80fd\u4e92\u901a\uff0c\u90fd\u4ee5\u4e3a\u5bf9\u65b9\u6302\u4e86\uff0c\u5411vip\u53d1\u9001\u81ea\u5df1\u662f\u4e3b\u8282\u70b9\u7684\u7ec4\u64ad\uff0c\u8fd9\u79cd\u73b0\u8c61\u53eb\u8111\u88c2<\/p><h4><span class=\"ez-toc-section\" id=\"%E7%8E%B0%E8%B1%A1_%E4%B8%BB%E5%A4%87%E9%83%BD%E6%9C%89vip\"><\/span>\u73b0\u8c61: \u4e3b\u5907\u90fd\u6709vip .<span class=\"ez-toc-section-end\"><\/span><\/h4><h4><span class=\"ez-toc-section\" id=\"%E5%8E%9F%E5%9B%A0\"><\/span>\u539f\u56e0:<span class=\"ez-toc-section-end\"><\/span><\/h4><p>\ud83c\udd70 \u5907\u8ba4\u4e3a\u4e3b\u6302\u4e86,\u63a5\u7ba1\u8d44\u6e90\u751f\u6210VIP.\u5b9e\u9645\u4e0a\u4e3b\u5e76\u6ca1\u6709\u6302,\u4ecd\u6709VIP.<br \/>\ud83c\udd71 \u6709\u5f88\u591a\u539f\u56e0\u53ef\u4ee5\u5bfc\u81f4\u8111\u88c2,\u5f00\u542f \u9632\u706b\u5899 ,selinux,keepalived \u914d\u7f6e ,\u7269\u7406\u7ebf\u8def(\u7f51\u7edc\u4ecb\u8d28).<\/p><h4><span class=\"ez-toc-section\" id=\"%E8%A7%A3%E5%86%B3\"><\/span>\u89e3\u51b3:<span class=\"ez-toc-section-end\"><\/span><\/h4><p>\ud83c\udd70 \u76d1\u63a7(\u5907\u8282\u70b9\u76d1\u63a7),\u53ea\u8981\u5907\u8282\u70b9\u6709vip\u5c31\u544a\u8b66. \ud83c\udd71 \u627e\u4e2a\u7b2c3\u65b9\u673a\u5668,\u5728\u8fd9\u4e2a\u673a\u5668\u4e0a\u6267\u884c<code>ssh root@10.0.0.6 hostname -I<\/code> \u68c0\u67e5\u5907\u8282\u70b9\u662f\u5426\u5b58\u5728vip.<br \/>\ud83c\udd8e\u66f4\u72e0\u4e00\u70b9\u76d1\u63a7\u5907\u8282\u70b9\u53ea\u8981\u6709vip,\u8fdc\u7a0b\u63a7\u5236\u4e3b\u8282\u70b9,\u53ea\u8981\u5907\u8282\u70b9\u8ba4\u4e3a\u4e3b\u6302\u4e86,\u90a3\u5c31\u8ba9\u4ed6\u771f\u7684\u6302\u4e86(\u667a\u80fd\u8bbe\u5907).<\/p><h4><span class=\"ez-toc-section\" id=\"%E8%A7%A3%E5%86%B3%E6%96%B9%E6%A1%88%EF%BC%9A%E7%9B%91%E6%8E%A7%E8%84%91%E8%A3%82%E6%88%96%E4%B8%BB%E5%A4%87%E5%88%87%E6%8D%A2%E8%84%9A%E6%9C%AC\"><\/span>\u89e3\u51b3\u65b9\u6848\uff1a\u76d1\u63a7\u8111\u88c2\u6216\u4e3b\u5907\u5207\u6362\u811a\u672c.<span class=\"ez-toc-section-end\"><\/span><\/h4><p>\u5728keepalived\u5907\u8282\u70b9\u6267\u884c\u76d1\u63a7\u811a\u672c.<\/p><p>\u811a\u672c\u6d41\u7a0b\u6b65\u9aa4:<\/p><ol><li>\u7edf\u8ba1ip a |grep vip\u6570\u91cf<\/li><li>\u5224\u65ad\u5982\u679c\u7b49\u4e8e1\u5219\u53d1\u51fa\u544a\u8b66\u90ae\u4ef6(\u4f7f\u7528echo\u66ff\u4ee3).<\/li><\/ol><pre>#!\/bin\/bash\n#author: linuxjk.cn\n#desc:\u68c0\u67e5\u5907\u8282\u70b9\u662f\u5426\u6709vip\n# 1.vip\u6f02\u79fb \u2193\u51fa\u73b0\u4e86\n#\u6545\u969c2.\u8111\u88c2\u6545\u969c\n#1.vars\nvip=10.0.0.3\n#2.check\nvip_cnt=`ip a | grep -w 10.0.0.3l wc -l`\n#3.if\nif [ $vip_cnt -gt 0 ];then\necho \"keepalived \u5f02\u5e38\"\n#sshpass -plinuxjk.cn666 ssh lb01 shutdown -h now\nfi<\/pre><p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1269\" src=\"https:\/\/linuxjk.cn\/wp-content\/uploads\/2025\/04\/\u6570\u5b57\u6bd4\u5927\u5c0f\u7b26\u53f7.png\" alt=\"\" width=\"1307\" height=\"414\" srcset=\"https:\/\/linuxjk.oss-cn-shanghai.aliyuncs.com\/wp-content\/uploads\/2025\/04\/\u6570\u5b57\u6bd4\u5927\u5c0f\u7b26\u53f7.png 1307w, https:\/\/linuxjk.oss-cn-shanghai.aliyuncs.com\/wp-content\/uploads\/2025\/04\/\u6570\u5b57\u6bd4\u5927\u5c0f\u7b26\u53f7-300x95.png 300w, https:\/\/linuxjk.oss-cn-shanghai.aliyuncs.com\/wp-content\/uploads\/2025\/04\/\u6570\u5b57\u6bd4\u5927\u5c0f\u7b26\u53f7-1024x324.png 1024w, https:\/\/linuxjk.oss-cn-shanghai.aliyuncs.com\/wp-content\/uploads\/2025\/04\/\u6570\u5b57\u6bd4\u5927\u5c0f\u7b26\u53f7-768x243.png 768w\" sizes=\"(max-width: 1307px) 100vw, 1307px\" \/><\/p><h3><span class=\"ez-toc-section\" id=\"2_%E6%A1%88%E4%BE%8B01-keepalived%E5%9F%BA%E4%BA%8E%E4%B8%BB%E6%9C%BA%E9%AB%98%E5%8F%AF%E7%94%A8%E8%BD%AF%E4%BB%B6%E2%AD%90%E2%AD%90%E2%AD%90\"><\/span><b>2) <\/b><b>\u6848\u4f8b<\/b><b>01-keepalived<\/b><b>\u57fa\u4e8e\u4e3b\u673a\u9ad8\u53ef\u7528\u8f6f\u4ef6<\/b>\u2b50\u2b50\u2b50<span class=\"ez-toc-section-end\"><\/span><\/h3><h4><span class=\"ez-toc-section\" id=\"%E9%97%AE%E9%A2%98-2\"><\/span>\u95ee\u9898:<span class=\"ez-toc-section-end\"><\/span><\/h4><p>keepalived \u53ea\u4f1a\u5728\u4e3b\u673a\u6302\u4e86,\u7f51\u7edc\u65ad\u5f00\u540e,\u624d\u4f1a\u8fdb\u884c\u4e3b\u5907\u5207\u6362.<br \/>\u9ed8\u8ba4\u60c5\u51b5\u4e0bkeepalived\u4e0d\u4f1a\u76d1\u63a7\u67d0\u4e2a\u670d\u52a1.<br \/>\u9879\u76ee\u76ee\u6807: \u67d0\u4e2a\u670d\u52a1\u5173\u95ed\u4e86,keepalived\u5c31\u8fdb\u884c\u4e3b\u5907\u5207\u6362.<\/p><h4><span class=\"ez-toc-section\" id=\"%E8%A7%A3%E5%86%B3%E6%96%B9%E6%A1%88%EF%BC%88%E9%A1%B9%E7%9B%AE%E6%AD%A5%E9%AA%A4%EF%BC%89\"><\/span>\u89e3\u51b3\u65b9\u6848\uff08\u9879\u76ee\u6b65\u9aa4\uff09:<span class=\"ez-toc-section-end\"><\/span><\/h4><p>\u4e66\u5199\u811a\u672c,\u8fc7\u6ee4\u670d\u52a1\u8fdb\u7a0b\u6570,\u7aef\u53e3\u6570\u91cf,\u68c0\u67e5\u662f\u5426\u8fd0\u884c(curl\/wget).<br \/>\u7136\u540e\u5728\u811a\u672c\u4e2d\u8fdb\u884c\u5224\u65ad\u5982\u679c\u670d\u52a1\u6ca1\u6709\u8fd0\u884c,\u5219\u5173\u95edkeepalived. \u1cbc<br \/>\u4fee\u6539keepalived\u914d\u7f6e\u6587\u4ef6,\u901a\u8fc7keepalived\u8c03\u7528\u8fd9\u4e2a\u811a\u672c(\u76d1\u63a7nginx).<\/p><p>#\u4e66\u5199\u811a\u672c<\/p><pre>#!\/bin\/bash<br \/>#author:linuxjk.cn<br \/>#desc:\u68c0\u67e5ngx\u7aef\u53e3\u7684\u811a\u672c<\/pre><p>#1.vars<br \/>port=80<br \/>#2.\u68c0\u67e5<\/p><p>#ss -lntup | grep -wc &#8220;$port&#8221;<br \/>port_count=`ss -lntup | grep -w &#8220;$port&#8221; | wc -l`<br \/>#3.\u5224\u65ad<br \/>if [ $port_count -eq 0 ];then<br \/>#\u5f02\u5e38<br \/>systemctl stop keepalived<br \/>fi<\/p><p>\u6ce8\u610f\u7ed9\u811a\u672c\u6267\u884c\u6743\u9650.<\/p><p>\u811a\u672c\u540d\u5b57\u4e2d\u4e0d\u8981\u5305\u542b\u670d\u52a1\u540d\u5b57.<\/p><p>\u4e66\u5199keepalived\u914d\u7f6e\u6587\u4ef6\uff08\u8c03\u7528\u811a\u672c\uff09<\/p><pre>[root@lb01 ~]# cat \/etc\/keepalived\/keepalived.conf\n! Configuration File for keepalived\nglobal_defs {\nrouter_id lb01\n}\n#\u5b9a\u4e49\u76d1\u63a7\u811a\u672c\nvrrp_script keep_lb.sh { \nscript \/server\/scripts\/keep_lb.sh\ninterval 2\nweight 1\nuser root\n}\nvrrp_instance vip_3 {\nstate MASTER\ninterface eth0\nvirtual_router_id 51\npriority 100\nadvert_int 1\nauthentication {\nauth_type PASS\nauth_pass 1111\n}\nvirtual_ipaddress {\n10.0.0.3 dev eth0 label eth0:0\n} \n#\u8fd9\u4e2avrrp\u5b9e\u4f8b\u4f7f\u7528 keep_lb.sh \u811a\u672c.\ntrack_script {\nkeep_lb.sh\n}\n}<\/pre><h4><span class=\"ez-toc-section\" id=\"%E5%86%99%E5%AE%8C%E9%85%8D%E7%BD%AE%E6%96%87%E4%BB%B6%E5%90%8E%E5%85%88%E5%90%AF%E5%8A%A8nginx%EF%BC%8C%E5%90%8E%E5%90%AF%E5%8A%A8keepalived%EF%BC%8C%E5%90%A6%E5%88%99keepalive%E8%B5%B7%E4%B8%8D%E6%9D%A5\"><\/span>\u5199\u5b8c\u914d\u7f6e\u6587\u4ef6\u540e\u5148\u542f\u52a8nginx\uff0c\u540e\u542f\u52a8keepalived\uff0c\u5426\u5219keepalive\u8d77\u4e0d\u6765<span class=\"ez-toc-section-end\"><\/span><\/h4><h2><span class=\"ez-toc-section\" id=\"%E5%B0%8F%E7%BB%93\"><\/span>\u5c0f\u7ed3<span class=\"ez-toc-section-end\"><\/span><\/h2><p>\u76ee\u6807:keepalived\u76d1\u63a7\u6307\u5b9a\u7684\u670d\u52a1,\u7ed9\u6307\u5b9a\u7684\u670d\u52a1\u505a\u9ad8\u53ef\u7528.<\/p><p>\u6d41\u7a0b:<\/p><p>\u4e66\u5199\u811a\u672c: \u83b7\u53d6\u670d\u52a1\u7aef\u53e3\u6570\/\u8fdb\u7a0b\u6570,\u901a\u8fc7if\u8fdb\u884c\u5224\u65ad,\u5982\u679c\u7aef\u53e3\u6216\u8fdb\u7a0b\u6570\u4e3a0,\u5219\u5173\u95edkeepalived.<\/p><p>\u4fee\u6539keepalived\u914d\u7f6e:<\/p><pre>\u5b9a\u4e49\u811a\u672c\nvrrp_script \u540d\u5b57 { script \u811a\u672c\u8def\u5f84\u4e0e\u540d\u5b57 ....}\n\u8c03\u7528\u811a\u672c\nvrrp_instance\u4e2d\u901a\u8fc7track_script<\/pre><p>\u1cbc \u8c03\u8bd5\u4e0e\u68c0\u67e5<\/p><h3><span class=\"ez-toc-section\" id=\"%E5%B1%80%E9%99%90_%E9%80%82%E7%94%A8%E4%BA%8E%E9%9D%9E%E5%AD%98%E5%82%A8%E6%95%B0%E6%8D%AE%E7%9A%84%E6%9C%8D%E5%8A%A1%E8%AE%BF%E9%97%AE%E9%87%8F%E4%B8%8E%E6%95%B0%E6%8D%AE%E9%87%8F%E4%B8%8D%E5%A4%A7%E4%B9%9F%E5%8F%AF%E4%BB%A5%E7%94%A8\"><\/span>\u5c40\u9650:\u9002\u7528\u4e8e\u975e\u5b58\u50a8\u6570\u636e\u7684\u670d\u52a1(\u8bbf\u95ee\u91cf\u4e0e\u6570\u636e\u91cf\u4e0d\u5927\u4e5f\u53ef\u4ee5\u7528)<span class=\"ez-toc-section-end\"><\/span><\/h3><h2><span class=\"ez-toc-section\" id=\"%E8%BF%9B%E9%98%B6%E7%94%A8%E6%B3%95\"><\/span><b>\u8fdb\u9636\u7528\u6cd5<\/b><span class=\"ez-toc-section-end\"><\/span><\/h2><h3><span class=\"ez-toc-section\" id=\"1_%E9%9D%9E%E6%8A%A2%E5%8D%A0%E6%A8%A1%E5%BC%8F\"><\/span><b>1) <\/b><b>\u975e\u62a2\u5360\u6a21\u5f0f<\/b><span class=\"ez-toc-section-end\"><\/span><\/h3><p>keepalived \u4e3b\u5907\u9ed8\u8ba4\u662f\u62a2\u5360\u5f0f,\u4e3b\u6302\u4e86,\u5907\u63a5\u7ba1.\u4e3b\u6062\u590d,\u4e0d\u5e0c\u671b\u4e3b\u91cd\u65b0\u62a2\u56de\u8d44\u6e90.<\/p><p>\u914d\u7f6e\u975e\u62a2\u5360\u5f0f\u6a21\u5f0f\u5373\u53ef.<\/p><p>\u8fd9\u79cd\u6a21\u5f0f\u7684\u76ee\u7684\uff1a\u5207\u6362\u6d41\u91cf\u65f6\u5c3d\u91cf\u5c11\u7684\u53d8\u5316\uff0c\u907f\u514d\u5f71\u54cd\u7528\u6237<\/p><h4><span class=\"ez-toc-section\" id=\"%E4%BD%BF%E7%94%A8%E6%B5%81%E7%A8%8B%EF%BC%9A\"><\/span>\u4f7f\u7528\u6d41\u7a0b\uff1a<span class=\"ez-toc-section-end\"><\/span><\/h4><ul><li>2\u4e2a\u8282\u70b9\u72b6\u6001\u90fd\u662f\u5907 BACKUP<\/li><li>2. \u914d\u7f6enopreempt\u9009\u9879<\/li><li>\u914d\u7f6e\u6587\u4ef6\u5982\u4e0b\uff1a<\/li><\/ul><p>\u5728state BACKUP\u4e0b\u52a0\u4e0a\u4e00\u884cnopreempt\u5373\u53ef\uff0c\u4e3b\u5907\u914d\u7f6e\u6587\u4ef6\u7684\u533a\u522b\u5c31\u662f\u2460router_id \uff0c\u4e00\u4e2alb01\u4e00\u4e2alb02\u00a0 \u00a0 \u2461priority\u6743\u91cd\u4e00\u4e2a100\u4e00\u4e2a50<\/p><h3><span class=\"ez-toc-section\" id=\"2_%E5%8F%8C%E4%B8%BB%E6%A8%A1%E5%BC%8F\"><\/span><b>2) <\/b><b>\u53cc\u4e3b\u6a21\u5f0f <\/b><span class=\"ez-toc-section-end\"><\/span><\/h3><p>\u5e94\u5bf9\u9ad8\u5e76\u53d1\u7684\u65f6\u5019\u8bbe\u7f6e\u7684\u53cc\u4e3b\u6a21\u5f0f. \u4e5f\u5c31\u662f\u62c6\u5206\u57df\u540d.<\/p><p>\u5907\u7528\u8282\u70b9\u5206\u62c5\u4e3b\u7684\u538b\u529b<br \/>\u521b\u5efa\u4e00\u4e2a\u65b0\u7684vip\uff0c\u4e3b\u5907\u5173\u7cfb\u76f8\u53cd<br \/>\u524d\u63d0\u662f<code>\u5176\u4e2d\u4e00\u4e2a\u673a\u5668\u80fd\u5426\u625b\u4f4f\u6240\u6709\u7684\u8bf7\u6c42<\/code><\/p><p>\u539f\u7406\uff1a\u8bbe\u7f6e\u4e24\u4e2a\u7ec4\u64adip\uff0c\u7ec4\u64advip_3\u8fd9\u4e00\u7ec4\u91cc\u9762lb01\u4e3a\u4e3b\uff0cvip_4\u91cc\u9762lb02\u4e3a\u4e3b\uff1b\u6211\u4eec\u9700\u8981\u505a\u7684\u5c31\u662f\u8ba9\u4e0d\u540c\u7684\u57df\u540d\u89e3\u6790\u5230\u4e0d\u540c\u7684\u7ec4\u64adip\u4e0a\uff0c\u53ef\u4ee5\u4e00\u534a\u4e00\u534a\u6216\u8005\u6309\u7167\u8bbf\u95ee\u91cf\u5206\u914d\uff0c\u5c3d\u91cf\u8ba9\u4e24\u53f0\u673a\u5668\u5206\u62c5\u8bf7\u6c42\uff0c\u8fd8\u9700\u8981\u6ce8\u610f\u907f\u514d\u96ea\u5d29\u73b0\u8c61\uff0c\u63d0\u524d\u8bc4\u4f30\u597d\u5982\u679c\u4e00\u4e2a\u6302\u4e86\uff0c\u53e6\u4e00\u4e2alb\u662f\u5426\u80fd\u627f\u8f7d\u6240\u6709\u8bf7\u6c42<\/p><p>\u914d\u7f6e\u6587\u4ef6\u5982\u56fe\uff1a<\/p><p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2461\" src=\"https:\/\/linuxjk.cn\/wp-content\/uploads\/2025\/09\/\u53cc\u4e3b\u6a21\u5f0f\u914d\u7f6e\u6587\u4ef6.png\" alt=\"\" width=\"1980\" height=\"1029\" srcset=\"https:\/\/linuxjk.oss-cn-shanghai.aliyuncs.com\/wp-content\/uploads\/2025\/09\/\u53cc\u4e3b\u6a21\u5f0f\u914d\u7f6e\u6587\u4ef6.png 1980w, https:\/\/linuxjk.oss-cn-shanghai.aliyuncs.com\/wp-content\/uploads\/2025\/09\/\u53cc\u4e3b\u6a21\u5f0f\u914d\u7f6e\u6587\u4ef6-300x156.png 300w, https:\/\/linuxjk.oss-cn-shanghai.aliyuncs.com\/wp-content\/uploads\/2025\/09\/\u53cc\u4e3b\u6a21\u5f0f\u914d\u7f6e\u6587\u4ef6-1024x532.png 1024w, https:\/\/linuxjk.oss-cn-shanghai.aliyuncs.com\/wp-content\/uploads\/2025\/09\/\u53cc\u4e3b\u6a21\u5f0f\u914d\u7f6e\u6587\u4ef6-768x399.png 768w, https:\/\/linuxjk.oss-cn-shanghai.aliyuncs.com\/wp-content\/uploads\/2025\/09\/\u53cc\u4e3b\u6a21\u5f0f\u914d\u7f6e\u6587\u4ef6-1536x798.png 1536w\" sizes=\"(max-width: 1980px) 100vw, 1980px\" \/><\/p><p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2452\" src=\"https:\/\/linuxjk.cn\/wp-content\/uploads\/2025\/09\/keepalive\u53cc\u4e3b\u6a21\u5f0f.png\" alt=\"\" width=\"1796\" height=\"801\" srcset=\"https:\/\/linuxjk.oss-cn-shanghai.aliyuncs.com\/wp-content\/uploads\/2025\/09\/keepalive\u53cc\u4e3b\u6a21\u5f0f.png 1796w, https:\/\/linuxjk.oss-cn-shanghai.aliyuncs.com\/wp-content\/uploads\/2025\/09\/keepalive\u53cc\u4e3b\u6a21\u5f0f-300x134.png 300w, https:\/\/linuxjk.oss-cn-shanghai.aliyuncs.com\/wp-content\/uploads\/2025\/09\/keepalive\u53cc\u4e3b\u6a21\u5f0f-1024x457.png 1024w, https:\/\/linuxjk.oss-cn-shanghai.aliyuncs.com\/wp-content\/uploads\/2025\/09\/keepalive\u53cc\u4e3b\u6a21\u5f0f-768x343.png 768w, https:\/\/linuxjk.oss-cn-shanghai.aliyuncs.com\/wp-content\/uploads\/2025\/09\/keepalive\u53cc\u4e3b\u6a21\u5f0f-1536x685.png 1536w\" sizes=\"(max-width: 1796px) 100vw, 1796px\" \/><\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t","protected":false},"excerpt":{"rendered":"<p>\u7f51\u7ad9\u67b6\u6784\u6f14\u53d8 \u6982\u8ff0 \u9ad8\u53ef\u7528:HA HighAvailablity \ud83d\udc49 Keepalived\u751f\u6210vip\u5730\u5740,dn [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[1],"tags":[12],"class_list":["post-2447","post","type-post","status-publish","format-standard","hentry","category-vxhs888p","tag-study-note"],"_links":{"self":[{"href":"https:\/\/linuxjk.cn\/index.php?rest_route=\/wp\/v2\/posts\/2447","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/linuxjk.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/linuxjk.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/linuxjk.cn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/linuxjk.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2447"}],"version-history":[{"count":13,"href":"https:\/\/linuxjk.cn\/index.php?rest_route=\/wp\/v2\/posts\/2447\/revisions"}],"predecessor-version":[{"id":2471,"href":"https:\/\/linuxjk.cn\/index.php?rest_route=\/wp\/v2\/posts\/2447\/revisions\/2471"}],"wp:attachment":[{"href":"https:\/\/linuxjk.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2447"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linuxjk.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2447"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linuxjk.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2447"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}