5.2. 使用 sapcontrol 手动移动 ASCS 实例(启用了 SAP HA 接口)
在为实例启用 SAP HA 接口时,验证 sapcontrol
命令是否可以将实例移到其他 HA 集群节点。
测试先决条件
- 为 SAP 实例启用 SAP HA 接口。
两个集群节点都有运行
ASCS
和ERS
的资源组。[root@node2: ~]# pcs status | egrep -e "S4H_ascs20|S4H_ers29" * S4H_ascs20 (ocf:heartbeat:SAPInstance): Started node2 * S4H_ers29 (ocf:heartbeat:SAPInstance): Started node1
- 已清除资源和资源组的所有故障,并且已重置故障计数。
测试步骤
-
以 &
lt;sid>adm
用户身份,运行sapcontrol
的HAFailoverToNode
功能,将ASCS
实例移到其他节点。
-
以 &
监控
在测试过程中在一个单独的终端中运行以下命令:
[root@node2]# watch -n 1 pcs status
预期行为
-
ASCS
实例应该移到其他 HA 集群节点,为移动创建一个临时位置约束。
-
测试
[root@node2]# su - s4hadm node2:s4hadm 52> sapcontrol -nr 20 -function HAFailoverToNode "" 06.12.2023 12:57:04 HAFailoverToNode OK
测试结果
ASCS
和ERS
移动到其他节点:[root@node2]# pcs status | egrep -e "S4H_ascs20|S4H_ers29" * S4H_ascs20 (ocf:heartbeat:SAPInstance): Started node1 * S4H_ers29 (ocf:heartbeat:SAPInstance): Started node2
约束创建,如下所示:
[root@node1]# pcs constraint Location Constraints: Resource: S4H_ASCS20_group Constraint: cli-ban-S4H_ASCS20_group-on-node2 Rule: boolean-op=and score=-INFINITY Expression: #uname eq string node1 Expression: date lt xxxx-xx-xx xx:xx:xx +xx:xx
恢复过程
-
当达到 Expression 中提到
的日期
时,上面显示的约束会被自动清除。 另外,您可以使用以下命令删除约束:
[root@node1]# pcs resource clear S4H_ascs20
-
当达到 Expression 中提到