Constraints
Define two constraints, one for the Overlay IP address which helps with routing
client traffic to active database host and the second one for the start order between
the SAPHANA
and SAPHanaTopology
resource agents.
Cluster defaults
The following command creates the default cluster migration-threshold and stickiness for the cluster resources.
RHEL 7.x
[root@prihana ~]# pcs resource defaults resource-stickiness=1000 [root@prihana ~]# pcs resource defaults migration-threshold=5000
RHEL 8.x
For RHEL 8.0 through 8.3:
[root@prihana ~]# pcs resource defaults resource-stickiness=1000 [root@prihana ~]# pcs resource defaults migration-threshold=5000
Starting with RHEL 8.4 (pcs-0.10.8-1.el8):
[root@prihana ~]# pcs resource defaults update resource-stickiness=1000 [root@prihana ~]# pcs resource defaults update migration-threshold=5000
Constraint: start SAPHanaTopology
before
SAPHana
The following command creates the constraint that mandates the start order of these resources.
RHEL 7.x
[root@prihana ~]# pcs constraint order SAPHanaTopology_HDB_00-clone \ then SAPHana_HDB_00-master symmetrical=false
RHEL 8.x
[root@prihana ~]# pcs constraint order SAPHanaTopology_HDB_00-clone \ then SAPHana_HDB_00-clone symmetrical=false
-
symmetrical=false
— This attribute defines that it is just the start order of resources and they don't need to be stopped in reverse order. -
interleave = true
— This attribute allows parallel start of these resources on nodes. This allows theSAPHana
resource to start on any node as soon as theSAPHanaTopology
resource is running on any one node.
Both resources
(SAPHana
and SAPHanaTopology
)
have the attribute interleave=true
that allows parallel start of these
resources on nodes.
Constraint co-locate the aws-vpc-move-ip
resource with the primary
SAPHana
resource
The following command co-locates the aws-vpc-move-ip
resource
with the SAPHana
resource when promoted as primary.
RHEL 7.x
[root@prihana ~]# pcs constraint colocation add hana-oip with master SAPHana_HDB_00-master 2000
RHEL 8.x
[root@prihana ~]# pcs constraint colocation add hana-oip with master SAPHana_HDB_00-clone 2000
You can use the following command to check the final status of the cluster:
[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 ~]#
This concludes the configuration of the SAP HANA cluster setup. You can proceed with testing.