群集管理 - 上的 SAP HANAAmazon
Amazon Web Services 文档中描述的 Amazon Web Services 服务或功能可能因区域而异。要查看适用于中国区域的差异,请参阅中国的 Amazon Web Services 服务入门

本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。

群集管理

您可以使用以下命令以 root 用户身份手动将群集资源从一个节点迁移到另一个节点:

root@prihana ~]# pcs resource move SAPHana_HDB_00-master Warning: Creating location constraint cli-ban-SAPHana_HDB_00- master-on-prihana with a score of -INFINITY for resource SAPHana_HDB_00-master on node prihana. This will prevent SAPHana_HDB_00-master from running on prihana until the constraint is removed. This will be the case even if prihana is the last node in the cluster.

您可以再次检查群集的状态以验证资源迁移的状态。

[root@prihana ~]#pcs status Thu Nov 12 10:45:14 2020 Cluster name: rhelhanaha Stack: corosync Current DC: sechana (version 1.1.19-8.el7_6.5-c3c624ea3d) - partition with quorum Last updated: Thu Nov 12 10:45:14 2020 Last change: Thu Nov 12 10:45:06 2020 by root via crm_attribute on sechana 2 nodes configured 6 resources configured Online: [ prihana sechana ] Full list of resources: clusterfence (stonith:fence_aws): Started prihana Clone Set: SAPHanaTopology_HDB_00-clone [SAPHanaTopology_HDB_00] Started: [ prihana sechana ] Master/Slave Set: SAPHana_HDB_00-master [SAPHana_HDB_00] Masters: [ sechana ] Stopped: [ prihana ] hana-oip (ocf::heartbeat:aws-vpc-move-ip): Started sechana Daemon Status: corosync: active/enabled pacemaker: active/enabled pcsd: active/enabled

清理失败的操作,如下一节所示。随着每个pcs资源 move 命令调用时,群集会创建位置约束以导致资源移动。必须删除这些约束,以便将来能够自动进行故障切换。要删除由移动创建的约束,请运行以下命令:

root@prihana ~]# pcs resource clear SAPHana_HDB_00-master

检查集群的状态:

root@prihana ~]# pcs status Cluster name: rhelhanaha Stack: corosync Current DC: sechana (version 1.1.19-8.el7_6.5-c3c624ea3d) - partition with quorum Last updated: Thu Nov 12 10:49:44 2020 Last change: Thu Nov 12 10:49:12 2020 by root via crm_attribute on sechana 2 nodes configured 6 resources configured Online: [ prihana sechana ] Full list of resources: clusterfence (stonith:fence_aws): Started prihana Clone Set: SAPHanaTopology_HDB_00-clone [SAPHanaTopology_HDB_00] Started: [ prihana sechana ] Master/Slave Set: SAPHana_HDB_00-master [SAPHana_HDB_00] Masters: [ sechana ] Slaves: [ prihana ] hana-oip (ocf::heartbeat:aws-vpc-move-ip): Started sechana Daemon Status: corosync: active/enabled pacemaker: active/enabled pcsd: active/enabled [root@prihana ~]#