Configuring Mapping Between Hostnames and IP Addresses

Scenarios

During the SAP installation, installation programs use hostnames for communication. Therefore, you must configure the mapping between hostnames and IP addresses.

Procedure

  1. Log in to the jump host. Ensure that user root and the key file are used for authentication. Then, use SSH to switch to the BMS on which the SAP HANA is to be installed.

    In the cluster deployment scenario, you will switch to the first SAP HANA BMS. Then, you will perform operations on this BMS when installing SAP HANA.

  2. Run the following command to open the hosts file:

    vi /etc/hosts

  3. Write the hostnames and IP addresses of all SAP nodes into the hosts file.

    • In the single-node deployment mode, IP-Address is the IP address of the heartbeat plane for SAP HANA nodes. In the cluster deployment mode, IP-Address is the IP address of the internal communication plane for SAP HANA nodes.
    • Both Full-Qualified-Hostname and Short-Hostname are the node name, for example, hana001.

    The format is IP-Address Full-Qualified-Hostname Short-Hostname.

    In an SAP system, you must write the mapping between all SAP node IP addresses and node names into the hosts file.

    You need to first bind the virtual IP addresses in the SAP NetWeaver system to the active and standby ASCS node names. The virtual IP addresses take effect only after the ASCS HA is configured. Do not bind virtual IP addresses to virtual hostnames before the virtual IP addresses take effect. After the ASCS and ERS instances are installed, write the mapping between the virtual IP addresses and virtual hostnames to the hosts file.

  4. Transfer the configured /etc/hosts file to other SAP HANA nodes:

    The command is in the following format:

    scp /etc/hosts Peer IP address:/etc/hosts

  5. Verify the SSH switching between SAP HANA nodes.

    Use SSH to switch from one SAP HANA node to all SAP HANA nodes (including the current node) to ensure that the switching is correct.

    For example, if the name of the peer SAP HANA node is hana002, run the following command:

    ssh hana002