Home > Workload Solutions > SAP > Guides > Dell Validated Design for High Availability for SAP with Red Hat Pacemaker Clusters > Overview
This chapter provides a shell script to generate the cluster resources configuration. The script asks basic questions about the landscape and generates three files for a typical cluster resource configuration for a quick start. The cluster resource configuration can be refined later in the process based on reliability needs.
Copy the content of the configuration script generate_cluster_config.sh into a folder on your Linux target server, for example, /home/data/clusterConfiguration.
Important: Use the same file name as the one that is provided in this appendix.
As any user, run generate_cluster_config.sh to create the final configuration files.
Note: Using root is easiest because the root user is required to load the configuration files into the system with crm.
#!/bin/bash
#
#
CONFIGFILES="crm_ascs.txt crm_col.txt crm_ers.txt"
read -p "Enter SID of the netweaver (e.g. TR1): " SID
read -p "Instance number ASCS (e.g. 00): " ASCS_INST
read -p "Block device for ASCS (e.g. /dev/sdb): " ASCS_FS
ASCS_FS=`echo $ASCS_FS |sed -e 's/\//\\\\\//g' `
read -p "Cluster IP of ASCS instance (e.g. 10.14.20.19): " ASCS_IP
read -p "Cluster hostname of ASCS instance (e.g. hwascs-ha): " ASCS_HOST
read -p "Instance Number ERS (e.g. 10): " ERS_INST
read -p "Block device for ERS (e.g. /dev/sdc): " ERS_FS
ERS_FS=`echo $ERS_FS |sed -e 's/\//\\\\\//g' `
read -p "Cluster IP of ERS instance (e.g. 10.14.20.20): " ERS_IP
read -p "Cluster hostname of ERS instance (e.g. nwers-ha): " ERS_HOST
cat <<EOF >crm_ascs-template
primitive rsc_fs_SID_ASCS_INST Filesystem \\
params device="ASCS_FS" directory="/usr/sap/SID/ASCS_INST" \\
fstype=xfs \\
op start timeout=60s interval=0 \\
op stop timeout=60s interval=0 \\
op monitor interval=20s timeout=40s
primitive rsc_ip_SID_ASCS_INST IPaddr2 \\
params ip=ASCS_IP \\
op monitor interval=10s timeout=20s
primitive rsc_sap_SID_ASCS_INST SAPInstance \\
op monitor interval=11 timeout=60 on-fail=restart \\
params InstanceName=SID_ASCS_INST_ASCS_HOST \\
START_PROFILE="/sapmnt/SID/profile/SID_ASCS_INST_ASCS_HOST" \\
AUTOMATIC_RECOVER=false \\
meta resource-stickiness=5000 failure-timeout=60 \\
migration-threshold=1 priority=10
group grp_SID_ASCS_INST \\
rsc_ip_SID_ASCS_INST rsc_fs_SID_ASCS_INST rsc_sap_SID_ASCS_INST \\
meta resource-stickiness=3000
EOF
cat <<EOF >crm_ers-template
primitive rsc_fs_SID_ERS_INST Filesystem \\
params device="ERS_FS" directory="/usr/sap/SID/ERS_INST" fstype=xfs \\
op start timeout=60s interval=0 \\
op stop timeout=60s interval=0 \\
op monitor interval=20s timeout=40s
primitive rsc_ip_SID_ERS_INST IPaddr2 \\
params ip=ERS_IP \\
op monitor interval=10s timeout=20s
primitive rsc_sap_SID_ERS_INST SAPInstance \\
op monitor interval=11 timeout=60 on-fail=restart \\
params InstanceName=SID_ERS_INST_sapha1er \\
START_PROFILE="/sapmnt/SID/profile/SID_ERS_INST_ERS_HOST" \\
AUTOMATIC_RECOVER=false IS_ERS=true \\
meta priority=1000
group grp_SID_ERS_INST \\
rsc_ip_SID_ERS_INST rsc_fs_SID_ERS_INST rsc_sap_SID_ERS_INST
EOF
cat <<EOF >crm_col-template
colocation col_sap_SID_no_both -5000: grp_SID_ERS_INST grp_SID_ASCS_INST
location loc_sap_SID_failover_to_ers rsc_sap_SID_ASCS_INST \\
rule 2000: runs_ers_SID eq 1
order ord_sap_SID_first_start_ascs Optional: rsc_sap_SID_ASCS_INST:start \\
rsc_sap_SID_ERS_INST:stop symmetrical=false
EOF
cp crm_ascs-template crm_ascs.txt
cp crm_ers-template crm_ers.txt
cp crm_col-template crm_col.txt
for FILE in $CONFIGFILES ; do
sed -i "s/SID/$SID/g" $FILE
sed -i "s/ASCS_INST/ASCS${ASCS_INST}/g" $FILE
sed -i "s/ASCS_FS/${ASCS_FS}/g" $FILE
sed -i "s/ASCS_IP/${ASCS_IP}/g" $FILE
sed -i "s/ASCS_HOST/${ASCS_HOST}/g" $FILE
sed -i "s/ERS_INST/ERS${ERS_INST}/g" $FILE
sed -i "s/ERS_FS/${ERS_FS}/g" $FILE
sed -i "s/ERS_IP/${ERS_IP}/g" $FILE
sed -i "s/ERS_HOST/${ERS_HOST}/g" $FILE
done
echo "Generated files ${CONFIGFILES}"
As any user, run the following shell command to generate the cluster resource configuration files:
# sh generate_cluster_config.sh
Enter SID of the netweaver (e.g. TR1): TR1
Instance number ASCS (e.g. 00): 00
Block device for ASCS (e.g. /dev/sdb): /dev/sdb
Cluster IP of ASCS instance (e.g. 10.14.20.19): 192.168.1.1
Cluster hostname of ASCS instance (e.g. hwascs-ha): wash
Instance Number ERS (e.g. 10): 10
Block device for ERS (e.g. /dev/sdc): /dev/sdc
Cluster IP of ERS instance (e.g. 10.14.20.20): 10.2.2.2
Cluster hostname of ERS instance (e.g. nwers-ha): me
Generated files crm_ascs.txt crm_col.txt crm_ers.txt
The script generates three cluster configuration files in the same directory. These files are described in the following section.