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

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

Constraints

定义两个约束,一个用于有助于将客户端流量路由到活动数据库主机的覆盖 IP 地址,另一个用于SAPHANASAPHanaTopology资源代理。

约束:启动SAPHanaTopology优化前SAPHana

以下命令将创建强制这些资源的启动顺序的约束。

RHEL 7.x

pcs constraint order SAPHanaTopology_HDB_00-clone then SAPHana_HDB_00-master symmetrical=false [root@prihana ~]# pcs constraint order SAPHanaTopology_HDB_00-clone then SAPHana_HDB_00-master symmetrical=false Adding SAPHanaTopology_HDB_00-clone SAPHana_HDB_00-master (kind: Mandatory) (Options: first-action=start then-action=start symmetrical=false) [root@prihana ~]#

RHEL 8.x

pcs constraint order SAPHanaTopology_HDB_00-clone then SAPHana_HDB_00-clone symmetrical=false
  • symmetrical=false— 此属性定义它只是资源的开始顺序,不需要以相反的顺序停止。

  • interleave = true— 此属性允许在节点上并行启动这些资源。这允许SAPHana资源在任何节点上启动SAPHanaTopology资源在任何一个节点上运行。

使用以下命令创建约束:

[root@prihana ~]# pcs constraint order SAPHanaTopology_HDB_00-clone then SAPHana_HDB_00-clone symmetrical=false Adding SAPHanaTopology_HDB_00-clone SAPHana_HDB_00-clone (kind: Mandatory) (Options: first-action=start then-action=start symmetrical=false)

这两种资源 (SAPHanaSAPHanaTopology)具有属性interleave=true,允许在节点上并行启动这些资源。

约束共同定位aws-vpc-move-ip资源与主SAPHana资源

以下命令将共同定位aws-vpc-move-ip资源中的SAPHana资源提升为主资源时。

RHEL 7.x

pcs constraint colocation add hana-oip with master SAPHana_HDB_00-master 2000
[root@prihana ~]# pcs constraint Location Constraints: Ordering Constraints: start SAPHanaTopology_HDB_00-clone then start SAPHana_HDB_00-master (kind:Mandatory) (non-symmetrical) Colocation Constraints: hana-oip with SAPHana_HDB_00-master (score:2000) (rsc-role:Started) (with-rsc-role:Master) Ticket Constraints: [root@prihana ~]#

RHEL 8.x

pcs constraint colocation add hana-oip with master SAPHana_HDB_00-clone 2000
[root@prihana ~]# pcs constraint Location Constraints: Ordering Constraints: start SAPHanaTopology_HDB_00-clone then start SAPHana_HDB_00-clone (kind:Mandatory) (non-symmetrical) Colocation Constraints: hana-oip with SAPHana_HDB_00-clone (score:2000) (rsc-role:Started) (with-rsc-role:Master) Ticket Constraints: [root@prihana ~]#

您可以使用以下命令查看集群的最终状态:

[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: Tue Nov 10 17:54:13 2020 Last change: Tue Nov 10 17:53:48 2020 by root via crm_attribute on prihana 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: [ prihana ] Slaves: [ sechana ] hana-oip (ocf::heartbeat:aws-vpc-move-ip): Started prihana Daemon Status: corosync: active/enabled pacemaker: active/enabled pcsd: active/enabled [root@prihana ~]#

SAP HANA 群集设置的配置到此结束。您可以继续进行测试。