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 any changes are made to the cluster configuration, put the cluster in maintenance mode as shown in the following example.

# crm configure property maintenance-mode="true"

Cluster bootstrap

Run the following commands on one of the nodes to set the properties of the cluster.

# vi crm-bootstrap.txt property cib-bootstrap-options: \ stonith-enabled="true" \ stonith-action="off" \ stonith-timeout="600s" rsc_defaults rsc-options: \ resource-stickiness=1 \ migration-threshold=3 op_defaults op-options: \ timeout=600 \ record-pending=true

Upload the configuration to the cluster configuration.

# crm configure load update crm-bootstrap.txt

STONITH device

Run the following commands to set STONITH properties with external/Amazon EC2.

# vi aws-stonith.txt primitive res_AWS_STONITH stonith:external/ec2 \ op start interval=0 timeout=180 \ op stop interval=0 timeout=180 \ op monitor interval=300 timeout=60 \ params tag=pacemaker profile=cluster pcmk_delay_max=45

Note: replace the tag parameter with the tag key created in previous steps.

Upload the configuration to the cluster configuration.

# crm configure load update aws-stonith.txt

Overlay IP Resource

Create an overlay IP resource for ASCS and ERS by using the following command.

# vi crm_oip.txt primitive rsc_IP_HA1_ASCS00 ocf:suse:aws-vpc-move-ip \ params ip=x.x.x.x \ routing_table=rtb-xxxxxxxxx \ interface=eth0 profile=cluster \ op start interval=0 timeout=180 \ op stop interval=0 timeout=180 \ op monitor interval=60 timeout=60 primitive rsc_IP_HA1_ERS10 ocf:suse:aws-vpc-move-ip \ params ip=x.x.x.x \ routing_table=rtb-xxxxxxxx \ interface=eth0 profile=cluster \ op start interval=0 timeout=180 \ op stop interval=0 timeout=180 \ op monitor interval=60 timeout=60

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

You can also use multiple Amazon VPC routing tables in the routing_table parameter, as shown in the following example.

primitive rsc_IP_HA1_ASCS00 ocf:suse:aws-vpc-move-ip \ params ip=x.x.x.x \ routing_table=rtb-xxxxxxxxx,rtb-yyyyyyyyy,rtb-zzzzzzzzz \ interface=eth0 profile=cluster \ op start interval=0 timeout=180 \ op stop interval=0 timeout=180 \ op monitor interval=60 timeout=60

Filesystem resource

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

# vi crm_filesystems.txt primitive rsc_FS_HA1_ASCS00 Filesystem \ params device="fs-xxxxxx.efs.xxxxxx.amazonaws.com:/ASCS" \ directory="/usr/sap/HA1/ASCS00" \ fstype="nfs4" \ options="rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2,noresvport" \ op start timeout=60s interval=0 \ op stop timeout=60s interval=0 \ op monitor interval=200s timeout=40s primitive rsc_FS_HA1_ERS10 Filesystem \ params device="fs-xxxx.efs.xxxxxx.amazonaws.com:/ERS" \ directory="/usr/sap/HA1/ERS10" \ fstype=nfs4 \ options="rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2,noresvport" \ op start timeout=60s interval=0 \ op stop timeout=60s interval=0 \ op monitor interval=200s timeout=40s

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

If you do not want the cluster to manage the shared filesystems, ensure that they are available before the pacemaker service is started. Enter the correct entries in the /etc/fstab file.222.

SAP instances - ASCS

Run the following command to set up the ASCS configuration for the cluster.

ENSA1

# vi crm_ascs.txt primitive rsc_SAP_HA1_ASCS00 SAPInstance \ operations $id=rsc_SAP_HA1_ASCS00-operations \ op monitor interval=11 timeout=60 on-fail=restart \ params InstanceName=HA1_ASCS00_sapha1as \ START_PROFILE="/sapmnt/HA1/profile/HA1_ASCS00_ascshost" \ AUTOMATIC_RECOVER=false \ meta resource-stickiness=5000 failure-timeout=60 \ migration-threshold=1 priority=10 group grp_HA1_ASCS00 \ rsc_IP_HA1_ASCS00 rsc_FS_HA1_ASCS00 rsc_SAP_HA1_ASCS00 \ meta resource-stickiness=3000

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

ENSA2

# vi crm_ascs.txt primitive rsc_SAP_HA1_ASCS00 SAPInstance \ operations $id=rsc_SAP_HA1_ASCS00-operations \ op monitor interval=11 timeout=60 on-fail=restart \ params InstanceName=HA1_ASCS00_sapha1as \ START_PROFILE="/sapmnt/HA1/profile/HA1_ASCS00_ascshost" \ AUTOMATIC_RECOVER=false \ meta resource-stickiness=3000 group grp_HA1_ASCS00 \ rsc_IP_HA1_ASCS00 rsc_FS_HA1_ASCS00 rsc_SAP_HA1_ASCS00 \ meta resource-stickiness=3000

Upload the configuration to the cluster configuration.

# crm configure load update crm_ascs.txt

SAP instance - ERS

Run the following command to set up the ASCS configuration for the cluster.

ENSA1

# vi crm_ers.txt primitive rsc_SAP_HA1_ERS10 SAPInstance \ operations $id=rsc_SAP_HA1_ERS10-operations \ op monitor interval=11 timeout=60 on-fail=restart \ params InstanceName=HA1_ERS10_sapha1er \ START_PROFILE="/sapmnt/HA1/profile/HA1_ERS10_ershost" \ AUTOMATIC_RECOVER=false IS_ERS=true \ meta priority=1000 group grp_HA1_ERS10 \ rsc_IP_HA1_ERS10 rsc_FS_HA1_ERS10 rsc_SAP_HA1_ERS10

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

ENSA2

# vi crm_ers.txt primitive rsc_SAP_HA1_ERS10 SAPInstance \ operations $id=rsc_SAP_HA1_ERS10-operations \ op monitor interval=11 timeout=60 on-fail=restart \ params InstanceName=HA1_ERS10_sapha1er \ START_PROFILE="/sapmnt/HA1/profile/HA1_ERS10_ershost" \ AUTOMATIC_RECOVER=false IS_ERS=true group grp_HA1_ERS10 \ rsc_IP_HA1_ERS10 rsc_FS_HA1_ERS10 rsc_SAP_HA1_ERS10

Upload the configuration to the cluster configuration.

# crm configure load update crm_ers.txt

Cluster constraint configuration

The constraint ensures that ASCS and ERS resources are started on opposite nodes, when possible. Run the following commands to create resource placement constraints.

ENSA1

# vi crm_loc_constraint.txt colocation col_SAP_HA1_no_both -5000: grp_HA1_ERS10 grp_HA1_ASCS00 location loc_sap_HA1_failover_to_ers rsc_sap_HA1_ASCS00 \ rule 2000: runs_ers_HA1 eq 1 order ord_SAP_HA1_first_start_ascs Optional: rsc_SAP_HA1_ASCS00:start \ rsc_SAP_HA1_ERS10:stop symmetrical=false

ENSA2

# vi crm_loc_constraint.txt colocation col_SAP_HA1_no_both -5000: grp_HA1_ERS10 grp_HA1_ASCS00 order ord_SAP_HA1_first_start_ascs Optional: rsc_SAP_HA1_ASCS00:start \ rsc_SAP_HA1_ERS10:stop symmetrical=false

Upload the configuration to the cluster configuration.

# crm configure load update crm_loc_constraint.txt

Move the cluster out of maintenance mode to activate it.

# crm configure property maintenance-mode="false"