{"id":35662,"date":"2025-05-05T18:55:52","date_gmt":"2025-05-05T10:55:52","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/35662.html"},"modified":"2025-05-05T18:55:52","modified_gmt":"2025-05-05T10:55:52","slug":"centos%e6%9c%8d%e5%8a%a1%e5%99%a8%e7%83%ad%e5%a4%87%e6%96%b9%e6%a1%88%e8%af%a6%e8%a7%a3","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/35662.html","title":{"rendered":"CentOS\u670d\u52a1\u5668\u70ed\u5907\u65b9\u6848\u8be6\u89e3"},"content":{"rendered":"<p>\u9488\u5bf9CentOS\u670d\u52a1\u5668\u7684\u70ed\u5907&#xff08;\u9ad8\u53ef\u7528\u6027&#xff09;\u65b9\u6848&#xff0c;\u6838\u5fc3\u76ee\u6807\u662f\u5b9e\u73b0\u4e1a\u52a1\u8fde\u7eed\u6027&#xff0c;\u786e\u4fdd\u5728\u786c\u4ef6\u6545\u969c\u3001\u7ef4\u62a4\u6216\u5176\u4ed6\u610f\u5916\u60c5\u51b5\u4e0b\u670d\u52a1\u4e0d\u4e2d\u65ad\u3002\u4ee5\u4e0b\u662f\u5e38\u89c1\u7684\u51e0\u79cd\u70ed\u5907\u65b9\u6848\u53ca\u5176\u5b9e\u73b0\u601d\u8def&#xff1a;<\/p>\n<hr \/>\n<h4>1. \u57fa\u4e8e\u5171\u4eab\u5b58\u50a8\u7684\u9ad8\u53ef\u7528\u65b9\u6848&#xff08;\u5982 RHCS\u3001Pacemaker&#043;Corosync&#xff09;<\/h4>\n<h5>\u539f\u7406&#xff1a;<\/h5>\n<ul>\n<li>\u591a\u53f0\u670d\u52a1\u5668\u5171\u4eab\u540c\u4e00\u5757\u5b58\u50a8&#xff08;\u5982SAN\/NAS\/iSCSI&#xff09;\u3002<\/li>\n<li>\u4e3b\u8282\u70b9\u6302\u8f7d\u5b58\u50a8\u8fd0\u884c\u670d\u52a1&#xff0c;\u5907\u7528\u8282\u70b9\u76d1\u63a7\u4e3b\u8282\u70b9\u72b6\u6001\u3002<\/li>\n<li>\u4e3b\u8282\u70b9\u6545\u969c\u65f6&#xff0c;\u5907\u7528\u8282\u70b9\u63a5\u7ba1\u5b58\u50a8\u5e76\u542f\u52a8\u670d\u52a1\u3002<\/li>\n<\/ul>\n<h5>\u90e8\u7f72\u6b65\u9aa4&#xff1a;<\/h5>\n<li>\n<p>\u914d\u7f6e\u5171\u4eab\u5b58\u50a8&#xff1a;<\/p>\n<p> <span class=\"token comment\"># \u5b89\u88c5iSCSI\u5ba2\u6237\u7aef&#xff08;\u5982\u4f7f\u7528iSCSI&#xff09;<\/span><br \/>\nyum <span class=\"token function\">install<\/span> iscsi-initiator-utils<br \/>\niscsiadm -m discovery -t st -p <span class=\"token operator\">&lt;<\/span>\u5b58\u50a8\u670d\u52a1\u5668IP<span class=\"token operator\">&gt;<\/span><br \/>\niscsiadm -m node -T <span class=\"token operator\">&lt;<\/span>\u76ee\u6807\u540d\u79f0<span class=\"token operator\">&gt;<\/span> -p <span class=\"token operator\">&lt;<\/span>\u5b58\u50a8\u670d\u52a1\u5668IP<span class=\"token operator\">&gt;<\/span> -l\n <\/li>\n<li>\n<p>\u5b89\u88c5\u96c6\u7fa4\u7ba1\u7406\u5de5\u5177&#xff1a;<\/p>\n<p> yum <span class=\"token function\">install<\/span> pacemaker corosync pcs<br \/>\nsystemctl <span class=\"token builtin class-name\">enable<\/span> pcsd corosync pacemaker<br \/>\nsystemctl start pcsd\n <\/li>\n<li>\n<p>\u914d\u7f6e\u96c6\u7fa4&#xff1a;<\/p>\n<p> <span class=\"token function\">passwd<\/span> hacluster  <span class=\"token comment\"># \u8bbe\u7f6e\u96c6\u7fa4\u5bc6\u7801<\/span><br \/>\npcs cluster auth node1 node2  <span class=\"token comment\"># \u8282\u70b9\u4e92\u4fe1<\/span><br \/>\npcs cluster setup &#8211;name my_cluster node1 node2<br \/>\npcs cluster start &#8211;all<br \/>\npcs property <span class=\"token builtin class-name\">set<\/span> stonith-enabled<span class=\"token operator\">&#061;<\/span>false  <span class=\"token comment\"># \u7981\u7528STONITH&#xff08;\u6d4b\u8bd5\u73af\u5883&#xff09;<\/span>\n <\/li>\n<li>\n<p>\u5b9a\u4e49\u8d44\u6e90&#xff08;\u4ee5\u865a\u62dfIP\u548cNginx\u4e3a\u4f8b&#xff09;&#xff1a;<\/p>\n<p> pcs resource create Virtual_IP ocf:heartbeat:IPaddr2 <span class=\"token assign-left variable\">ip<\/span><span class=\"token operator\">&#061;<\/span><span class=\"token number\">192.168<\/span>.1.100 <span class=\"token assign-left variable\">cidr_netmask<\/span><span class=\"token operator\">&#061;<\/span><span class=\"token number\">24<\/span> <span class=\"token function\">op<\/span> monitor <span class=\"token assign-left variable\">interval<\/span><span class=\"token operator\">&#061;<\/span>30s<br \/>\npcs resource create Web_Server systemd:nginx <span class=\"token function\">op<\/span> monitor <span class=\"token assign-left variable\">interval<\/span><span class=\"token operator\">&#061;<\/span>5s<br \/>\npcs constraint colocation <span class=\"token function\">add<\/span> Web_Server Virtual_IP INFINITY<br \/>\npcs constraint order Virtual_IP <span class=\"token keyword\">then<\/span> Web_Server\n <\/li>\n<h5>\u4f18\u70b9&#xff1a;<\/h5>\n<ul>\n<li>\u6570\u636e\u4e00\u81f4\u6027\u9ad8&#xff08;\u5171\u4eab\u5b58\u50a8&#xff09;\u3002<\/li>\n<li>\u5207\u6362\u901f\u5ea6\u5feb&#xff08;\u79d2\u7ea7&#xff09;\u3002<\/li>\n<\/ul>\n<h5>\u7f3a\u70b9&#xff1a;<\/h5>\n<ul>\n<li>\u4f9d\u8d56\u5171\u4eab\u5b58\u50a8\u786c\u4ef6&#xff0c;\u6210\u672c\u8f83\u9ad8\u3002<\/li>\n<li>\u9700\u8981\u907f\u514d\u8111\u88c2&#xff08;Split-Brain&#xff09;&#xff0c;\u9700\u914d\u7f6eSTONITH\u3002<\/li>\n<\/ul>\n<hr \/>\n<h4>2. \u57fa\u4e8e\u6570\u636e\u540c\u6b65\u7684\u70ed\u5907\u65b9\u6848&#xff08;\u5982 DRBD &#043; Keepalived&#xff09;<\/h4>\n<h5>\u539f\u7406&#xff1a;<\/h5>\n<ul>\n<li>DRBD&#xff08;Distributed Replicated Block Device&#xff09;\u5b9e\u73b0\u78c1\u76d8\u7ea7\u5b9e\u65f6\u540c\u6b65\u3002<\/li>\n<li>Keepalived \u7ba1\u7406\u865a\u62dfIP&#xff0c;\u5b9e\u73b0\u6545\u969c\u8f6c\u79fb\u3002<\/li>\n<\/ul>\n<h5>\u90e8\u7f72\u6b65\u9aa4&#xff1a;<\/h5>\n<li>\n<p>\u5b89\u88c5DRBD&#xff1a;<\/p>\n<p> yum <span class=\"token function\">install<\/span> drbd kmod-drbd84<br \/>\nmodprobe drbd\n <\/li>\n<li>\n<p>\u914d\u7f6eDRBD\u8d44\u6e90&#xff08;\/etc\/drbd.d\/resource.res&#xff09;&#xff1a;<\/p>\n<p> resource my_res {<br \/>\n  protocol C;  # \u540c\u6b65\u6a21\u5f0f&#xff08;\u5b8c\u5168\u540c\u6b65&#xff09;<br \/>\n  on node1 {<br \/>\n    device \/dev\/drbd0;<br \/>\n    disk \/dev\/sdb1;<br \/>\n    address 192.168.1.1:7788;<br \/>\n    meta-disk internal;<br \/>\n  }<br \/>\n  on node2 {<br \/>\n    device \/dev\/drbd0;<br \/>\n    disk \/dev\/sdb1;<br \/>\n    address 192.168.1.2:7788;<br \/>\n    meta-disk internal;<br \/>\n  }<br \/>\n}\n <\/li>\n<li>\n<p>\u521d\u59cb\u5316\u5e76\u542f\u52a8DRBD&#xff1a;<\/p>\n<p> drbdadm create-md my_res<br \/>\nsystemctl <span class=\"token builtin class-name\">enable<\/span> drbd<br \/>\nsystemctl start drbd<br \/>\ndrbdadm primary my_res &#8211;force  <span class=\"token comment\"># \u4e3b\u8282\u70b9\u521d\u59cb\u5316<\/span><br \/>\nmkfs.ext4 \/dev\/drbd0  <span class=\"token comment\"># \u683c\u5f0f\u5316\u6587\u4ef6\u7cfb\u7edf<\/span>\n <\/li>\n<li>\n<p>\u914d\u7f6eKeepalived&#xff08;\u4e3b\u5907\u8282\u70b9\u914d\u7f6e\u4e0d\u540c\u4f18\u5148\u7ea7&#xff09;&#xff1a;<\/p>\n<p> vrrp_instance VI_1 {<br \/>\n  state MASTER  # \u5907\u7528\u8282\u70b9\u8bbe\u4e3aBACKUP<br \/>\n  interface eth0<br \/>\n  virtual_router_id 51<br \/>\n  priority 100  # \u5907\u7528\u8282\u70b9\u8bbe\u4e3a50<br \/>\n  virtual_ipaddress {<br \/>\n    192.168.1.100\/24<br \/>\n  }<br \/>\n}\n <\/li>\n<h5>\u4f18\u70b9&#xff1a;<\/h5>\n<ul>\n<li>\u7eaf\u8f6f\u4ef6\u65b9\u6848&#xff0c;\u65e0\u9700\u5171\u4eab\u5b58\u50a8\u786c\u4ef6\u3002<\/li>\n<li>\u6570\u636e\u5b9e\u65f6\u540c\u6b65&#xff0c;\u53ef\u9760\u6027\u9ad8\u3002<\/li>\n<\/ul>\n<h5>\u7f3a\u70b9&#xff1a;<\/h5>\n<ul>\n<li>DRBD\u540c\u6b65\u53ef\u80fd\u5bf9\u7f51\u7edc\u5e26\u5bbd\u548c\u5ef6\u8fdf\u654f\u611f\u3002<\/li>\n<li>\u9700\u8981\u624b\u52a8\u5904\u7406\u8111\u88c2\u95ee\u9898\u3002<\/li>\n<\/ul>\n<hr \/>\n<h4>3. \u5e94\u7528\u5c42\u70ed\u5907&#xff08;Nginx\/HAProxy &#043; Keepalived&#xff09;<\/h4>\n<h5>\u539f\u7406&#xff1a;<\/h5>\n<ul>\n<li>\u4f7f\u7528\u8d1f\u8f7d\u5747\u8861\u5668&#xff08;\u5982Nginx\/HAProxy&#xff09;\u4f5c\u4e3a\u524d\u7aef\u4ee3\u7406\u3002<\/li>\n<li>Keepalived\u7ba1\u7406\u8d1f\u8f7d\u5747\u8861\u5668\u7684\u865a\u62dfIP&#xff0c;\u5b9e\u73b0\u53cc\u673a\u70ed\u5907\u3002<\/li>\n<\/ul>\n<h5>\u90e8\u7f72\u6b65\u9aa4&#xff1a;<\/h5>\n<li>\n<p>\u5b89\u88c5\u8d1f\u8f7d\u5747\u8861\u5668&#xff08;\u4ee5Nginx\u4e3a\u4f8b&#xff09;&#xff1a;<\/p>\n<p> yum <span class=\"token function\">install<\/span> nginx<br \/>\nsystemctl <span class=\"token builtin class-name\">enable<\/span> nginx<br \/>\nsystemctl start nginx\n <\/li>\n<li>\n<p>\u914d\u7f6eKeepalived&#xff08;\u4e3b\u5907\u8282\u70b9&#xff09;&#xff1a;<\/p>\n<p> vrrp_script chk_nginx {<br \/>\n  script &#034;pgrep nginx || exit 1&#034;<br \/>\n  interval 2<br \/>\n  weight 2<br \/>\n}<br \/>\nvrrp_instance VI_1 {<br \/>\n  state MASTER<br \/>\n  interface eth0<br \/>\n  virtual_router_id 51<br \/>\n  priority 100<br \/>\n  virtual_ipaddress {<br \/>\n    192.168.1.100\/24<br \/>\n  }<br \/>\n  track_script {<br \/>\n    chk_nginx<br \/>\n  }<br \/>\n}\n <\/li>\n<li>\n<p>\u914d\u7f6e\u540e\u7aef\u670d\u52a1\u5668&#xff1a;<\/p>\n<ul>\n<li>\u786e\u4fdd\u5e94\u7528\u670d\u52a1\u5668&#xff08;\u5982Web\u3001\u6570\u636e\u5e93&#xff09;\u5df2\u914d\u7f6e\u96c6\u7fa4\u6216\u4e3b\u4ece\u590d\u5236\u3002<\/li>\n<\/ul>\n<\/li>\n<h5>\u4f18\u70b9&#xff1a;<\/h5>\n<ul>\n<li>\u5b9e\u73b0\u8d1f\u8f7d\u5747\u8861\u548c\u9ad8\u53ef\u7528\u53cc\u91cd\u529f\u80fd\u3002<\/li>\n<li>\u9002\u7528\u4e8e\u65e0\u72b6\u6001\u670d\u52a1&#xff08;\u5982Web\u5e94\u7528&#xff09;\u3002<\/li>\n<\/ul>\n<h5>\u7f3a\u70b9&#xff1a;<\/h5>\n<ul>\n<li>\u9700\u7ed3\u5408\u540e\u7aef\u670d\u52a1\u7684\u9ad8\u53ef\u7528\u65b9\u6848&#xff08;\u5982\u6570\u636e\u5e93\u4e3b\u4ece&#xff09;\u3002<\/li>\n<\/ul>\n<hr \/>\n<h4>4. \u6570\u636e\u5e93\u70ed\u5907&#xff08;\u5982 MySQL\u4e3b\u4ece\u590d\u5236 &#043; MHA&#xff09;<\/h4>\n<h5>\u539f\u7406&#xff1a;<\/h5>\n<ul>\n<li>\u4e3b\u6570\u636e\u5e93\u5b9e\u65f6\u540c\u6b65\u6570\u636e\u5230\u4ece\u5e93\u3002<\/li>\n<li>MHA&#xff08;Master High Availability&#xff09; \u81ea\u52a8\u76d1\u63a7\u4e3b\u5e93\u72b6\u6001\u5e76\u5207\u6362\u3002<\/li>\n<\/ul>\n<h5>\u90e8\u7f72\u6b65\u9aa4&#xff1a;<\/h5>\n<li>\n<p>\u914d\u7f6eMySQL\u4e3b\u4ece\u590d\u5236&#xff1a;<\/p>\n<p> <span class=\"token comment\">&#8212; \u4e3b\u5e93\u914d\u7f6e<\/span><br \/>\n<span class=\"token keyword\">CREATE<\/span> <span class=\"token keyword\">USER<\/span> <span class=\"token string\">&#039;repl&#039;<\/span><span class=\"token variable\">&#064;&#039;%&#039;<\/span> IDENTIFIED <span class=\"token keyword\">BY<\/span> <span class=\"token string\">&#039;password&#039;<\/span><span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token keyword\">GRANT<\/span> <span class=\"token keyword\">REPLICATION<\/span> SLAVE <span class=\"token keyword\">ON<\/span> <span class=\"token operator\">*<\/span><span class=\"token punctuation\">.<\/span><span class=\"token operator\">*<\/span> <span class=\"token keyword\">TO<\/span> <span class=\"token string\">&#039;repl&#039;<\/span><span class=\"token variable\">&#064;&#039;%&#039;<\/span><span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token keyword\">SHOW<\/span> MASTER <span class=\"token keyword\">STATUS<\/span><span class=\"token punctuation\">;<\/span>  <span class=\"token comment\"># \u8bb0\u5f55File\u548cPosition<\/span><\/p>\n<p><span class=\"token comment\">&#8212; \u4ece\u5e93\u914d\u7f6e<\/span><br \/>\nCHANGE MASTER <span class=\"token keyword\">TO<\/span><br \/>\n  MASTER_HOST<span class=\"token operator\">&#061;<\/span><span class=\"token string\">&#039;\u4e3b\u5e93IP&#039;<\/span><span class=\"token punctuation\">,<\/span><br \/>\n  MASTER_USER<span class=\"token operator\">&#061;<\/span><span class=\"token string\">&#039;repl&#039;<\/span><span class=\"token punctuation\">,<\/span><br \/>\n  MASTER_PASSWORD<span class=\"token operator\">&#061;<\/span><span class=\"token string\">&#039;password&#039;<\/span><span class=\"token punctuation\">,<\/span><br \/>\n  MASTER_LOG_FILE<span class=\"token operator\">&#061;<\/span><span class=\"token string\">&#039;mysql-bin.000001&#039;<\/span><span class=\"token punctuation\">,<\/span><br \/>\n  MASTER_LOG_POS<span class=\"token operator\">&#061;<\/span><span class=\"token number\">107<\/span><span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token keyword\">START<\/span> SLAVE<span class=\"token punctuation\">;<\/span>\n <\/li>\n<li>\n<p>\u90e8\u7f72MHA&#xff1a;<\/p>\n<p> yum <span class=\"token function\">install<\/span> mha4mysql-manager mha4mysql-node\n <\/li>\n<li>\n<p>\u914d\u7f6eMHA\u7ba1\u7406\u8282\u70b9&#xff08;\/etc\/mha\/app1.conf&#xff09;&#xff1a;<\/p>\n<p> [server default]<br \/>\nmanager_workdir&#061;\/var\/log\/mha\/app1<br \/>\nmanager_log&#061;\/var\/log\/mha\/app1\/manager.log<br \/>\nssh_user&#061;root<br \/>\n[server1]<br \/>\nhostname&#061;master_ip<br \/>\n[server2]<br \/>\nhostname&#061;slave_ip\n <\/li>\n<li>\n<p>\u542f\u52a8MHA\u76d1\u63a7&#xff1a;<\/p>\n<p> masterha_manager &#8211;conf<span class=\"token operator\">&#061;<\/span>\/etc\/mha\/app1.conf\n <\/li>\n<h5>\u4f18\u70b9&#xff1a;<\/h5>\n<ul>\n<li>\u6570\u636e\u5e93\u5c42\u9ad8\u53ef\u7528&#xff0c;\u81ea\u52a8\u6545\u969c\u8f6c\u79fb\u3002<\/li>\n<li>\u652f\u6301\u6570\u636e\u4e00\u81f4\u6027\u68c0\u67e5\u3002<\/li>\n<\/ul>\n<h5>\u7f3a\u70b9&#xff1a;<\/h5>\n<ul>\n<li>\u914d\u7f6e\u590d\u6742\u5ea6\u8f83\u9ad8\u3002<\/li>\n<li>\u4e3b\u4ece\u540c\u6b65\u53ef\u80fd\u5b58\u5728\u5ef6\u8fdf\u3002<\/li>\n<\/ul>\n<hr \/>\n<h4>5. \u4e91\u73af\u5883\u70ed\u5907&#xff08;\u5982 AWS\/Aliyun \u8d1f\u8f7d\u5747\u8861 &#043; \u591a\u53ef\u7528\u533a&#xff09;<\/h4>\n<h5>\u539f\u7406&#xff1a;<\/h5>\n<ul>\n<li>\u5229\u7528\u4e91\u5e73\u53f0\u7684\u8d1f\u8f7d\u5747\u8861&#xff08;\u5982AWS ELB\u3001\u963f\u91cc\u4e91SLB&#xff09;\u5c06\u6d41\u91cf\u5206\u53d1\u5230\u591a\u53f0ECS\u5b9e\u4f8b\u3002<\/li>\n<li>\u7ed3\u5408\u4e91\u5b58\u50a8&#xff08;\u5982EBS\u3001OSS&#xff09;\u5b9e\u73b0\u6570\u636e\u6301\u4e45\u5316\u3002<\/li>\n<\/ul>\n<h5>\u90e8\u7f72\u6b65\u9aa4&#xff1a;<\/h5>\n<li>\n<p>\u521b\u5efa\u4e91\u670d\u52a1\u5668\u5b9e\u4f8b&#xff1a;<\/p>\n<ul>\n<li>\u5728\u591a\u4e2a\u53ef\u7528\u533a\u90e8\u7f72CentOS\u5b9e\u4f8b\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u914d\u7f6e\u8d1f\u8f7d\u5747\u8861\u5668&#xff1a;<\/p>\n<ul>\n<li>\u6dfb\u52a0\u76d1\u542c\u89c4\u5219&#xff0c;\u7ed1\u5b9a\u540e\u7aef\u670d\u52a1\u5668\u7ec4\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u6302\u8f7d\u5171\u4eab\u5b58\u50a8&#xff1a;<\/p>\n<p> <span class=\"token comment\"># \u4f8b\u5982\u6302\u8f7d\u963f\u91cc\u4e91NAS<\/span><br \/>\nyum <span class=\"token function\">install<\/span> nfs-utils<br \/>\n<span class=\"token function\">mount<\/span> -t nfs nas.aliyuncs.com:\/ \/mnt\n <\/li>\n<h5>\u4f18\u70b9&#xff1a;<\/h5>\n<ul>\n<li>\u65e0\u9700\u81ea\u884c\u7ba1\u7406\u7269\u7406\u786c\u4ef6\u3002<\/li>\n<li>\u5f39\u6027\u6269\u5c55\u80fd\u529b\u5f3a\u3002<\/li>\n<\/ul>\n<h5>\u7f3a\u70b9&#xff1a;<\/h5>\n<ul>\n<li>\u4f9d\u8d56\u4e91\u670d\u52a1\u5546&#xff0c;\u6210\u672c\u53ef\u80fd\u8f83\u9ad8\u3002<\/li>\n<\/ul>\n<hr \/>\n<h4>\u9009\u62e9\u5efa\u8bae<\/h4>\n<ul>\n<li>\u5173\u952e\u4e1a\u52a1&#xff1a;\u5171\u4eab\u5b58\u50a8 &#043; Pacemaker\/Corosync\u3002<\/li>\n<li>\u9884\u7b97\u6709\u9650&#xff1a;DRBD &#043; Keepalived\u3002<\/li>\n<li>Web\u5e94\u7528&#xff1a;Nginx\/HAProxy &#043; Keepalived\u3002<\/li>\n<li>\u6570\u636e\u5e93&#xff1a;MySQL\u4e3b\u4ece &#043; MHA \u6216 Galera Cluster\u3002<\/li>\n<li>\u4e91\u73af\u5883&#xff1a;\u4e91\u5e73\u53f0\u8d1f\u8f7d\u5747\u8861 &#043; \u591a\u53ef\u7528\u533a\u90e8\u7f72\u3002<\/li>\n<\/ul>\n<hr \/>\n<h4>\u6ce8\u610f\u4e8b\u9879<\/h4>\n<li>\u7f51\u7edc\u7a33\u5b9a\u6027&#xff1a;\u786e\u4fdd\u8282\u70b9\u95f4\u5fc3\u8df3\u7f51\u7edc\u4f4e\u5ef6\u8fdf\u3001\u9ad8\u53ef\u9760\u3002<\/li>\n<li>\u8111\u88c2\u5904\u7406&#xff1a;\u914d\u7f6eSTONITH\u6216\u4ef2\u88c1\u673a\u5236\u3002<\/li>\n<li>\u6570\u636e\u4e00\u81f4\u6027&#xff1a;\u4f18\u5148\u9009\u62e9\u540c\u6b65\u590d\u5236\u6a21\u5f0f\u3002<\/li>\n<li>\u6d4b\u8bd5\u9a8c\u8bc1&#xff1a;\u5b9a\u671f\u6a21\u62df\u6545\u969c\u6d4b\u8bd5\u5207\u6362\u6d41\u7a0b\u3002<\/li>\n<li>\u76d1\u63a7\u544a\u8b66&#xff1a;\u96c6\u6210Zabbix\/Prometheus\u76d1\u63a7\u96c6\u7fa4\u72b6\u6001\u3002<\/li>\n<p>\u901a\u8fc7\u4e0a\u8ff0\u65b9\u6848&#xff0c;\u53ef\u663e\u8457\u63d0\u5347CentOS\u670d\u52a1\u5668\u7684\u53ef\u7528\u6027&#xff0c;\u6839\u636e\u5b9e\u9645\u573a\u666f\u9009\u62e9\u6700\u9002\u5408\u7684\u67b6\u6784\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb688\u6b21\uff0c\u70b9\u8d5e10\u6b21\uff0c\u6536\u85cf7\u6b21\u3002\u9488\u5bf9CentOS\u670d\u52a1\u5668\u7684\u70ed\u5907\uff08\u9ad8\u53ef\u7528\u6027\uff09\u65b9\u6848\uff0c\u6838\u5fc3\u76ee\u6807\u662f\u5b9e\u73b0\u4e1a\u52a1\u8fde\u7eed\u6027\uff0c\u786e\u4fdd\u5728\u786c\u4ef6\u6545\u969c\u3001\u7ef4\u62a4\u6216\u5176\u4ed6\u610f\u5916\u60c5\u51b5\u4e0b\u670d\u52a1\u4e0d\u4e2d\u65ad\u3002\u4ee5\u4e0b\u662f\u5e38\u89c1\u7684\u51e0\u79cd\u70ed\u5907\u65b9\u6848\u53ca\u5176\u5b9e\u73b0\u601d\u8def\uff1a\u914d\u7f6e\u5171\u4eab\u5b58\u50a8\uff1a\u5b89\u88c5\u96c6\u7fa4\u7ba1\u7406\u5de5\u5177\uff1a\u914d\u7f6e\u96c6\u7fa4\uff1a\u5b9a\u4e49\u8d44\u6e90\uff08\u4ee5\u865a\u62dfIP\u548cNginx\u4e3a\u4f8b\uff09\uff1a\u4f18\u70b9\uff1a\u6570\u636e\u4e00\u81f4\u6027\u9ad8\uff08\u5171\u4eab\u5b58\u50a8\uff09\u3002\u5207\u6362\u901f\u5ea6\u5feb\uff08\u79d2\u7ea7\uff09\u3002\u7f3a\u70b9\uff1a\u4f9d\u8d56\u5171\u4eab\u5b58\u50a8\u786c\u4ef6\uff0c\u6210\u672c\u8f83\u9ad8\u3002\u9700\u8981\u907f\u514d\u8111\u88c2\uff08Split-Brain\uff09\uff0c\u9700\u914d\u7f6eSTONITH\u30022. \u57fa\u4e8e\u6570\u636e\u540c\u6b65\u7684\u70ed\u5907\u65b9\u6848\uff08\u5982 DRBD + Keepalived\uff09\u539f\u7406\uff1a<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[59,58,43],"topic":[],"class_list":["post-35662","post","type-post","status-publish","format-standard","hentry","category-server","tag-centos","tag-linux","tag-43"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>CentOS\u670d\u52a1\u5668\u70ed\u5907\u65b9\u6848\u8be6\u89e3 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/35662.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"CentOS\u670d\u52a1\u5668\u70ed\u5907\u65b9\u6848\u8be6\u89e3 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb688\u6b21\uff0c\u70b9\u8d5e10\u6b21\uff0c\u6536\u85cf7\u6b21\u3002\u9488\u5bf9CentOS\u670d\u52a1\u5668\u7684\u70ed\u5907\uff08\u9ad8\u53ef\u7528\u6027\uff09\u65b9\u6848\uff0c\u6838\u5fc3\u76ee\u6807\u662f\u5b9e\u73b0\u4e1a\u52a1\u8fde\u7eed\u6027\uff0c\u786e\u4fdd\u5728\u786c\u4ef6\u6545\u969c\u3001\u7ef4\u62a4\u6216\u5176\u4ed6\u610f\u5916\u60c5\u51b5\u4e0b\u670d\u52a1\u4e0d\u4e2d\u65ad\u3002\u4ee5\u4e0b\u662f\u5e38\u89c1\u7684\u51e0\u79cd\u70ed\u5907\u65b9\u6848\u53ca\u5176\u5b9e\u73b0\u601d\u8def\uff1a\u914d\u7f6e\u5171\u4eab\u5b58\u50a8\uff1a\u5b89\u88c5\u96c6\u7fa4\u7ba1\u7406\u5de5\u5177\uff1a\u914d\u7f6e\u96c6\u7fa4\uff1a\u5b9a\u4e49\u8d44\u6e90\uff08\u4ee5\u865a\u62dfIP\u548cNginx\u4e3a\u4f8b\uff09\uff1a\u4f18\u70b9\uff1a\u6570\u636e\u4e00\u81f4\u6027\u9ad8\uff08\u5171\u4eab\u5b58\u50a8\uff09\u3002\u5207\u6362\u901f\u5ea6\u5feb\uff08\u79d2\u7ea7\uff09\u3002\u7f3a\u70b9\uff1a\u4f9d\u8d56\u5171\u4eab\u5b58\u50a8\u786c\u4ef6\uff0c\u6210\u672c\u8f83\u9ad8\u3002\u9700\u8981\u907f\u514d\u8111\u88c2\uff08Split-Brain\uff09\uff0c\u9700\u914d\u7f6eSTONITH\u30022. \u57fa\u4e8e\u6570\u636e\u540c\u6b65\u7684\u70ed\u5907\u65b9\u6848\uff08\u5982 DRBD + Keepalived\uff09\u539f\u7406\uff1a\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/35662.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2025-05-05T10:55:52+00:00\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/35662.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/35662.html\",\"name\":\"CentOS\u670d\u52a1\u5668\u70ed\u5907\u65b9\u6848\u8be6\u89e3 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2025-05-05T10:55:52+00:00\",\"dateModified\":\"2025-05-05T10:55:52+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/35662.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/35662.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/35662.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"CentOS\u670d\u52a1\u5668\u70ed\u5907\u65b9\u6848\u8be6\u89e3\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"CentOS\u670d\u52a1\u5668\u70ed\u5907\u65b9\u6848\u8be6\u89e3 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/35662.html","og_locale":"zh_CN","og_type":"article","og_title":"CentOS\u670d\u52a1\u5668\u70ed\u5907\u65b9\u6848\u8be6\u89e3 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb688\u6b21\uff0c\u70b9\u8d5e10\u6b21\uff0c\u6536\u85cf7\u6b21\u3002\u9488\u5bf9CentOS\u670d\u52a1\u5668\u7684\u70ed\u5907\uff08\u9ad8\u53ef\u7528\u6027\uff09\u65b9\u6848\uff0c\u6838\u5fc3\u76ee\u6807\u662f\u5b9e\u73b0\u4e1a\u52a1\u8fde\u7eed\u6027\uff0c\u786e\u4fdd\u5728\u786c\u4ef6\u6545\u969c\u3001\u7ef4\u62a4\u6216\u5176\u4ed6\u610f\u5916\u60c5\u51b5\u4e0b\u670d\u52a1\u4e0d\u4e2d\u65ad\u3002\u4ee5\u4e0b\u662f\u5e38\u89c1\u7684\u51e0\u79cd\u70ed\u5907\u65b9\u6848\u53ca\u5176\u5b9e\u73b0\u601d\u8def\uff1a\u914d\u7f6e\u5171\u4eab\u5b58\u50a8\uff1a\u5b89\u88c5\u96c6\u7fa4\u7ba1\u7406\u5de5\u5177\uff1a\u914d\u7f6e\u96c6\u7fa4\uff1a\u5b9a\u4e49\u8d44\u6e90\uff08\u4ee5\u865a\u62dfIP\u548cNginx\u4e3a\u4f8b\uff09\uff1a\u4f18\u70b9\uff1a\u6570\u636e\u4e00\u81f4\u6027\u9ad8\uff08\u5171\u4eab\u5b58\u50a8\uff09\u3002\u5207\u6362\u901f\u5ea6\u5feb\uff08\u79d2\u7ea7\uff09\u3002\u7f3a\u70b9\uff1a\u4f9d\u8d56\u5171\u4eab\u5b58\u50a8\u786c\u4ef6\uff0c\u6210\u672c\u8f83\u9ad8\u3002\u9700\u8981\u907f\u514d\u8111\u88c2\uff08Split-Brain\uff09\uff0c\u9700\u914d\u7f6eSTONITH\u30022. \u57fa\u4e8e\u6570\u636e\u540c\u6b65\u7684\u70ed\u5907\u65b9\u6848\uff08\u5982 DRBD + Keepalived\uff09\u539f\u7406\uff1a","og_url":"https:\/\/www.wsisp.com\/helps\/35662.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2025-05-05T10:55:52+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"3 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/35662.html","url":"https:\/\/www.wsisp.com\/helps\/35662.html","name":"CentOS\u670d\u52a1\u5668\u70ed\u5907\u65b9\u6848\u8be6\u89e3 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2025-05-05T10:55:52+00:00","dateModified":"2025-05-05T10:55:52+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/35662.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/35662.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/35662.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"CentOS\u670d\u52a1\u5668\u70ed\u5907\u65b9\u6848\u8be6\u89e3"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/35662","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=35662"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/35662\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=35662"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=35662"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=35662"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=35662"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}