SQL Server 2017 AlwaysOn on Linux 配置和維護(18)

2.6.2使用Pacemaker修改CIB

在Windows平臺,WSFC本身支持多子網,通過對IP地址的OR依賴來處理多IP地址。

在Linux平臺,沒有OR依賴,但可以通過使用Pacemaker修改CIB來支持多子網。簡單的通過Pacemaker命令修改一個資源做不到,需要修改羣集信息庫(CIB)。CIB是一個Pacemaker配置用的XML文件。

clip_image002


導出CIB

sudo pcs cluster cib <filename>


編輯CIB文件

在<resources>部分,會看到尾AG或FCI創建的各種資源。找到與IP地址相關的資源。爲第二個IP地址,在已存在IP地址的上面或下面,但在<operations>之前,添加

<instance attributes>部分。語法類似於:
<instance attributes id="<NameForAttribute>" score="<Score>">
<rule id="<RuleName>" score="INFINITY">
<expression id="<ExpressionName>" attribute="\#uname" operation="eq" value="<NodeNameInSubnet2>" />
</rule>
<nvpair id="<NameForSecondIP>" name="ip" value="<IPAddress>"/>
<nvpair id="<NameForSecondIPNetmask>" name="cidr\_netmask" value="<Netmask>"/>
</instance attributes>

例如:

<instance attributes id="Node3-2nd-IP" score="2">
<rule id="Subnet2-IP" score="INFINITY">
<expression id="Subnet2-Node" attribute="\#uname" operation="eq" value="Node3" />
</rule>
<nvpair id="IP-In-Subnet-2" name="ip" value="192.168.2.102"/>
<nvpair id="Netmask-For-IP2" name="cidr\_netmask" value="24" />
</instance attributes>

clip_image004


導入CIB並重新配置Pacemaker

sudo pcs cluster cib-push <filename>


檢查並驗證故障轉移

1.PING在Pacemaker中與IP地址資源相關的DNS名。它應該返回承載AG或FCI的當前子網相關的IP地址。

2.故障轉移AG或FCI到其他子網。

3.在AG或FCI完全在線後,PING與IP地址相關的DNS名。它應該返回第二個子網的IP地址。

4.如果需要,故障轉移AG或FCI回原來的子網。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章