在Windows平台,WSFC自己支持多子网,经过对IP地址的OR依赖来处理多IP地址。express
在Linux平台,没有OR依赖,但能够经过使用Pacemaker修改CIB来支持多子网。简单的经过Pacemaker命令修改一个资源作不到,须要修改群集信息库(CIB)。CIB是一个Pacemaker配置用的XML文件。bash
导出CIBide
sudo pcs cluster cib <filename>
编辑CIB文件3d
在<resources>部分,会看到尾AG或FCI建立的各类资源。找到与IP地址相关的资源。为第二个IP地址,在已存在IP地址的上面或下面,但在<operations>以前,添加xml
<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>
例如:blog
<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>
导入CIB并从新配置Pacemakerip
sudo pcs cluster cib-push <filename>
检查并验证故障转移ci
1.PING在Pacemaker中与IP地址资源相关的DNS名。它应该返回承载AG或FCI的当前子网相关的IP地址。资源
2.故障转移AG或FCI到其余子网。get
3.在AG或FCI彻底在线后,PING与IP地址相关的DNS名。它应该返回第二个子网的IP地址。
4.若是须要,故障转移AG或FCI回原来的子网。