How To Configure VMware fencing using fence_vmware_soap in RHEL High Availability Add On(RHEL Pacemaker中配置STONITH),pacemakerstonith

來源:互聯網
上載者:User

How To Configure VMware fencing using fence_vmware_soap in RHEL High Availability Add On(RHEL Pacemaker中配置STONITH),pacemakerstonith

本文主要簡單介紹一下如何在RHEL 7 Pacemaker中配置一個fence_vmware_soap類型的STONITH裝置(僅供測試學習)。

 

STONITH是Shoot-The-Other-Node-In-The-Head的簡稱,並且它能夠保護資料使其不會因為節點異常或者同時訪問而遭到損壞。

節點無反應並不代表它沒有存取資料,如果想要百分百確認資料安全的話,需要使用STONITH來隔離節點,以確保在目前的節點已經離線後其它節點才能正常存取資料。

STONITH也能用於叢集服務無法停下的情況。在這種情況下,叢集可以使用STONITH來強制整個節點離線,並讓服務在其它節點上安全啟用。

 

下面簡單介紹一下如何在RHEL 7 Pacemaker中配置一個fence_vmware_soap類型的STONITH裝置(How to configure VMware fencing using fence_vmware_soap in Red Hat Enterprise Linux High Availability Add On)。

由於之前搭建的RHEL系統都是在VMware Server上,因此選擇fence_vmware_soap類型的Fencing Agent配置STONITH裝置。

1. 確認當前Cluster狀態正常:
sudo supcs status

  

2. 確認所有節點都已經安裝了fence_vmware_soap:
pcs stonith list | grep fence_vmware_soap

 

3. 查看fence_vmware_soap的相關配置參數:
pcs stonith describe fence_vmware_soap
4. 確認當前機器是否可以通過fence_vmware_soap擷取VMware上的機器列表:
fence_vmware_soap --ip <Your IP Address or Host Name> --ssl --ssl-insecure --action list --username="<Your UserName>" --password="<Your Password>" | grep RedHat

Note:

ip是VMware ESXi Server或者vCenter Server的IP或者是HostName;

username是串連VMware Server的使用者名稱;

password是串連VMware Server的密碼;

最後RedHat是需要替換成你自己的機器入口名。 

5. 複製一份CIB配置:
pcs cluster cib stonith_cfg
6. 建立一個新的STONITH資源:
pcs -f stonith_cfg stonith create MyVMwareFence fence_vmware_soap ipaddr=<Your IP Address or Host Name> ipport=443 ssl_insecure=1 inet4_only=1 login="<Your User Name>" passwd="<Your Password>" action=reboot pcmk_host_map="RHEL73Bob1:1;RHEL73Bob2:2" pcmk_host_check=static-list pcmk_host_list="RHEL73Bob1,RHEL73Bob2" power_wait=3 op monitor interval=60s
7. 啟用STONITH並且使CIB配置生效:
pcs -f stonith_cfg property set stonith-enabled=truepcs cluster cib-push stonith_cfg

8. 查看更改後的狀態:

pcs stonith showpcs status

 

 

下面簡單測實驗證一下STONITH功能,過程如下:

  • 剛開始Cluster狀態如下,資源都在RHEL73Bob2上,而STONITH裝置運行在RHEL73Bob1上;

  • 當RHEL73Bob2機器異常OFFLINE後,狀態如下,所有資源都自動轉到RHEL73Bob1上;

  • 當RHEL73Bob2機器又Online的時候,狀態如下,猜想由於STONITH還未切換完成,File System資源在兩個節點上均為開啟狀態(時間很短);

  • 最後當RHEL73Bob2機器完全線上的時候,狀態如下,STONITH裝置自動切換到RHEL73Bob2,恢複到正常狀態,保證了File System資源沒有在兩個節點上都啟動。

 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.