Cluster resources - SAP NetWeaver on Amazon
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China.

Cluster resources

Before you make any changes to the cluster configuration, put the cluster in maintenance mode by running the following command.

# pcs property set maintenance-mode=true

Overlay IP resource

Create an overlay IP resource for both ASCS and ERS by running the following commands.

ASCS

# pcs resource create rsc_vip_ascs00 aws-vpc-move-ip ip=X.X.X.X interface=eth0 routing_table=rtb-xxxxxxx --group rsc_ASCS00_group

Note – replace the VPC route table id, overlay IP address, SAP instance number, and SAP instance id with appropriate values.

ERS

# pcs resource create rsc_vip_ers10 aws-vpc-move-ip ip=X.X.X.X interface=eth0 routing_table=rtb-xxxxxxx --group rsc_ERS10_group

Note – replace the VPC route table id, overlay IP address, SAP instance number, and SAP instance id with appropriate values.

Multiple VPC routing tables can be specified during the overlay IP configuration by adding multiple VPC route table ids in the routing_table parameter, as shown in the following example.

# pcs resource create rsc_vip aws-vpc-move-ip ip=X.X.X.X interface=eth0 routing_table=rtb-xxxxxxx,rtb-yyyyyyy,rtb-zzzzzz --group rsc_ERS10_group

Filesystem resource

Create filesystem resources for ASCS and ERS by running the following commands.

ASCS

# pcs resource create rsc_fs_ascs00 Filesystem \ device=fs-xxxxxx.efs.us-east-1.amazonaws.com:/ASCS \ directory=/usr/sap/HA1/ASCS00 \ fstype=nfs4 \ options="nfsvers=4.1,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2,noresvport" \ force_unmount=safe --group rsc_ASCS00_group

Note – replace the EFS filesystem id, Region, SAP instance number, and SAP instance id with appropriate values.

ERS

# pcs resource create rsc_fs_ers10 Filesystem \ device=fs-xxxxxx.efs.us-east-1.amazonaws.com:/ERS \ directory=/usr/sap/HA1/ERS10 \ fstype=nfs4 \ options="nfsvers=4.1,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2,noresvport" \ force_unmount=safe --group rsc_ERS10_group

Note – replace the EFS filesystem id, Region, SAP instance number, and SAP instance id with appropriate values.

SAP instance – ASCS

Create SAP resources for ASCS by running the following commands.

ENSA1

# pcs resource create rsc_ascs00 SAPInstance \ InstanceName=”HA1_ASCS00_ascshost” \ START_PROFILE=/sapmnt/HA1/profile/HA1_ASCS00_ascshost \ AUTOMATIC_RECOVER=false \ meta resource-stickness=5000 \ migration-threshold=1 \ failure-timeout=60 \ op monitor interval=20s on-fail=restart timeout=60s \ op start interval=0s timeout=600s \ op stop interval=0s timeout=600s --group rsc_ASCS00_group

Note – replace the SAP instance number and SAP instance id with the appropriate values.

ENSA2

# pcs resource create rsc_ascs00 SAPInstance \ InstanceName=”HA1_ASCS00_ascshost” \ START_PROFILE=/sapmnt/HA1/profile/HA1_ASCS00_ascshost \ AUTOMATIC_RECOVER=false \ meta resource-stickness=3000 \ migration-threshold=1 \ op monitor interval=20s on-fail=restart timeout=60s \ op start interval=0s timeout=600s \ op stop interval=0s timeout=600s --group rsc_ASCS00_group

Note – replace the SAP instance number and SAP instance id with the appropriate values.

SAP instance – ERS

Create SAP resources for ERS by running the following commands.

ENSA1

# pcs resource create rsc_ers10 SAPInstance \ InstanceName=”HA1_ERS10_ershost” \ START_PROFILE=/sapmnt/HA1/profile/HA1_ERS10_ershost \ AUTOMATIC_RECOVER=false \ IS_ERS=true \ op monitor interval=20s on-fail=restart timeout=60s \ op start interval=0s timeout=600s \ op stop interval=0s timeout=600s --group rsc_ERS10_group

Note – the IS_ERS=true attribute is mandatory for ENSA1 deployments. Replace the SAP instance number and SAP instance id with the appropriate values.

ENSA2

# pcs resource create rsc_era10 SAPInstance \ InstanceName=”HA1_ERS10_ershost” \ START_PROFILE=/sapmnt/HA1/profile/HA1_ERS10_ershost \ AUTOMATIC_RECOVER=false \ op monitor interval=20s on-fail=restart timeout=60s \ op start interval=0s timeout=600s \ op stop interval=0s timeout=600s --group rsc_ERS10_group

Note – replace the SAP instance number and SAP instance id with the appropriate values.

Cluster constraints configuration

ENSA1

Colocation constraint prevents the ASCS and ERS from running on the same node where possible. The stickiness score of -5000 ensures that ASCS and ERS run on the same node only if there is a single node available.

# pcs constraint colocation add rsc_ERS10_group with rsc_ASCS00_group -5000

Location constraint ensures that in the event of a failure, the ASCS follows the ERS to enable the lock table to be consumed.

# pcs constraint location rsc_ascs00 rule score=2000 runs_ers_rsc eq 1

Order constraint ensures that ASCS resources always start before any action is taken on the ERS resource.

# pcs constraint order start rsc_ASCS00_group then stop rsc_ERS10_group symmetrical=false kind=Optional

ENSA2

Colocation constraint prevents the ASCS and ERS from running on the same node where possible. The stickiness score of -5000 ensures that ASCS and ERS run on the same node only if there is a single node available.

# pcs constraint colocation add rsc_ERS10_group with rsc_ASCS00_group -5000

Order constraint ensures that ASCS resources always start before any action is taken on the ERS resource.

# pcs constraint order start rsc_ASCS00_group then start rsc_ERS10_group symmetrical=false kind=Optional # pcs constraint order start rsc_ASCS00_group then stop rsc_ERS10_group symmetrical=false kind=Optional

Enable SAP HAlib for management by external tools (optional)

Add the SAP administrative user to the haclient group so that the user can interact with the cluster.

# usermod -a -G haclient ha1adm

Add the following parameters to the start profiles of all of the SAP instances that are managed by external tools.

service/halib = $(DIR_CT_RUN)/saphascriptco.so service/halib_cluster_connector = /usr/bin/sap_cluster_connector