• SAP HANA

saphana
  1. Help Center
  2. SAP HANA
  3. User Guide (Single Node)
  4. Deployment
  5. Installing SAP HANA (Single-Node Deployment with HA Required)
  6. Configuring HA on SAP HANA Nodes

Configuring HA on SAP HANA Nodes

Use scripts (HAE) to configure HA on SAP HANA nodes, improving SAP HANA node reliability.

This only applies to SAP HANA nodes running the OS SUSE Linux Enterprise Server 12 SP1 for SAP for automatic active/standby switchovers.

In the cross-AZ HA scenario, three ECSs are required. Each ECS is bound to a SCSI disk and iSCSI configuration is required for SBD. For details, see section Configuring iSCSI (Cross-AZ HA Deployment).

Prerequisites

SSH switching between SAP HANA nodes has been allowed.

Procedure

  1. Attach the SBD volume to the other SAP HANA node.

    The reason is as follows: When one SAP HANA node is created, the SBD volume is attached to it. This SBD volume must be attached to the other SAP HANA node.

    1. On the management console, choose Computing > Elastic Cloud Server. On the left side of the page, choose Elastic Cloud Server. Then, the system displays all ECSs on the right side of the page.
    2. Locate the HANA ECS attached with the SBD volume by ECS name and click its name.
    3. On the page providing details about the ECS, click the EVS tab and locate the disk of the SBD volume. Then, click the target data disk.
    4. On the page providing details about the data disk, view and record its Device Name. Then, click the data disk ID.
    5. On the page that is displayed, click Attachments and then Attach to switch to the Attach Disk page.
    6. On the Attach Disk page, select the target ECS to which the disk is to be attached, ensure that the device name of the ECS is the same as that of the ECS involved in 1.d, and attach the disk to the ECS.

  2. Create a floating IP address.

    1. On the management console, choose Computing > Elastic Cloud Server. On the left side of the page, choose Elastic Cloud Server to switch to the Elastic Cloud Server page.
    2. Locate an SAP HANA node and click the HANA ECS name. Then, the page for the HANA ECS details is displayed.
    3. Click the NICs tab and then Manage Virtual IP Address in the row of the cloud management or backup plane NIC. Then, the system displays the Virtual IP Addresses page.
    4. Click Assign Virtual IP Address to assign a floating IP address. Locate the row that contains the target IP address, click Bind to Server to bind the IP address to the target ECS, and repeat this operation to bind the IP address to other ECSs.

  3. Download scripts and configure the file.

    1. Use PuTTY to log in to the NAT server with an elastic IP address bound. Ensure that user root and the key file (.ppk file) are used for authentication. Then, use SSH to switch to the SAP HANA node that works as the active node.
    2. Download scripts and configure the file.

      wget https://obs-sap.obs.otc.t-systems.com/hana/cfgandscript/ha_auto_script.zip -P /hana/shared

    1. Run the following commands to decompress the file:

      cd /hana/shared

      unzip ha_auto_script.zip

  4. Modify the configuration file.

    vi /hana/shared/ha_auto_script/hana_ha.cfg

    Set the parameters in the configuration file based on the actual requirements. The following is an example:

    [masterNode]
    # Host name of the active node
    masterName=hana001                                                         
    # Heartbeat IP address of the active node
    masterHeartbeatIP1=10.0.4.2
    masterHeartbeatIP2=                             
                                                                            
    [slaveNode]
    # Host name of the standby node
    slaveName=hana002                                           
    # Heartbeat IP address of the standby node
    slaveHeartbeatIP1=10.0.4.3
    slaveHeartbeatIP2=                                         
    
    [trunkInfo]                                                                              
    # Floating IP address of SAP HANA
    hanaBusinessIP=10.0.3.103                                                                                                                                                                                                           
    [hanaInfo]                                                        
    # SBD volume path
    SBDDevice=/dev/sdc,/dev/sdd,/dev/sde                                                    
    # SAP HANA administrator account
    hanaUser=s00adm                                            
    # SAP HANA instance number
    InstanceNumber=00
    NOTE:

    This script supports the configuration of the two heartbeat network planes. During the configuration, you need to add the IP addresses of the server or client plane after masterHeartbeatIP2 and slaveHeartbeatIP2 parameters respectively in the script.

    In the cross-AZ scenario, configure SBDDevice to the drive letters of SBD volumes on the three ECSs. For example, SBDDevice=/dev/sbd1,/dev/sbd2,/dev/sbd3.

  5. Run the following commands to verify that the configuration file meeting requirements:

    cd ha_auto_script

    chmod +x hana_auto_ha.sh

  6. Execute the script.

    sh hana_auto_ha.sh
    NOTE:
    • If the script execution fails, you have to run the command sh hana_auto_ha.sh unconf to roll back manually before executing the script again. In addition, configure the ha_auto.cfg file based on the latest drive letter of the SBD volume.
    • After the switchover between active and standby nodes is complete, configure the new standby node to make HA take effect. Perform the operations described as follows:

      1. Run the following command on the standby node to switch to the administrator mode:

      su - <SID>adm

      2. Stop the database of the standby node.

      HDB stop

      3. Register the standby node with the active node.

      Set secondary to the host name of the new active node. Set site_name to the original active node name defined when configuring System Replication.

      hdbnsutil -sr_register --remoteHost=<secondary> --remoteInstance=<instance_number> --replicationMode=sync --name=<site_name>

      4. Start the database on the standby node and exit the administrator mode.

      HDB start

      exit

      5. Start the HAE service.

      systemctl start pacemaker

      6. Clear resources on the original active node (current standby node).

      rsc_SAPHana_SLE_HDB00 is an example resource name, which can be obtained by running the crm_mon - r1 command. Set primary to the name of the host on which the standby node is deployed.

      crm resource cleanup <rsc_SAPHana_SLE_HDB00> <primary>

    The following information is displayed if the command is successfully executed:

    Online: [ hana001 hana002 ]
    
    Full list of resources:
    
     Clone Set: cln_SAPHanaTopology_SLE_HDB00 [rsc_SAPHanaTopology_SLE_HDB00]
         Started: [ hana001 hana002 ]
     rsc_ip_SLE_HDB00?(ocf::heartbeat:IPaddr2):?Started hana001
     stonith-sbd?(stonith:external/sbd):?Started hana001
     Master/Slave Set: msl_SAPHana_SLE_HDB00 [rsc_SAPHana_SLE_HDB00]
         Masters: [ hana001 ]
         Slaves: [ hana002 ]
    All Complete!
    

  7. Connect SAP HANA nodes to the SAP HANA Studio again.
  8. On the SAP HANA Studio, delete the two connected SAP HANA nodes. Then, use the floating IP address of the SAP HANA nodes to connect them to the SAP HANA Studio again and configure the backup path.

    NOTE:

    After the HA function is configured, HAE manages resources. Do not start or stop resources in other modes. If you need to manually perform test or modification operations, switch the cluster to the maintenance mode first.

    crm configure property maintenance-mode=true

    Exit the maintenance mode after the modification is complete.

    crm configure property maintenance-mode=false

    If you need to stop or restart the node, manually stop the cluster service.

    systemctl stop pacemaker

    After the ECS is started or restarted, run the following command to start the cluster service:

    systemctl start pacemaker