Skip to Content

Introduction

With the aid of the SAP HANA system replication function, the SAP Business One, version for SAP HANA high availability (HA) solution ensures more reliable database service and nearly zero data loss in case of unplanned server outage. The HA functionality is available as of 9.0 PL03.

Prerequisites

  • Download HA package from Partner Edge http://sappartneredge.com/b1/documentation ==> 9.0 ==> B1 for HANA
    • Decompress zip file
    • Upload Linux scripts and configuration files to HANA servers
  • Install HANA on server1 and server2
  • Both HANA systems must share:
    • SYSTEM ID (SID): NDB
    • Instance number:00
    • Password for SYSTEM user
  • 64 and 32 bit client installed on both HANA servers and server tools server
  • Standalone Linux server for Apache Load Balancer and Server Tools
  • Your 2 HANA servers have the system time synchronized.  You can use the NTP service to accomplish this.

In order to enable HA you will need 3 server: 2 HANA servers and 1 Linux server for Apache Load Balancer and Server Tools.  The Linux server for Apache Load Balancer and Server Tools can be a vm.

Deployment and Configuration

The steps below provide an overview of what is installed to enable HA for Business One powered by HANA.  Please install in the order presented.  Do not skip ahead.

HANA components

The 64 and 32 bit version of the HANA client must be installed on all 3 servers.  Please use the default directories.  The 64-bit version installs to /usr/sap/hdbclient.  The 32-bit version installs to /usr/sap/hdbclient32.  You can install the client using ./hdbsetup (graphical) or ./hdbinst (console).

SAP Business One Server Tools

On the Linux Server where you are planning to install server tools, as root, navigate to the directory where the install.bin file resides and start it using ./install.bin.  The path is something like ../Packages Linux/ServerComponents.

An overview of the installation steps are available from http://scn.sap.com/community/business-one/blog/2013/08/08/90-bare-metal-to-live-system.

Please note the following points:

  • When prompted for the HANA hostname use the IP address of the primary HANA server.  Do not enter the hostname.
  • On the “Specify Security Certificates for Exteme App Framework select “Configure SSL after installation”.  Note 1929288 https://service.sap.com/sap/support/notes/1929288 contains more details

ServerToolsSSL.PNG

Post installation steps

  • In the browser open https://<Center IP>:40000/ControlCenter/
  • Confirm the server tools system has been registered with SLD (system landscape directory)
  • Reinitialize the server tools
    • Logon to the server tools system with a SSH client
    • Copy the attached shell script reinit.sh to the installation path of the server tools (the default is /opt/sap/SAPBusinessOne/ServerTools).
    • Replace the following information in the script with your own data
      • REGISTER_HANA_SERVER=”10.58.1.121:30015;10.58.1.123:30015″

        Both HANA systems and the port for example 30015

      • REGISTER_HANA_SERVER_USER=”SYSTEM”

      • REGISTER_HANA_SERVER_PASSWD=”manager”

      • SLD_HANA_ADDRESS=’10.58.1.121:30015;10.58.1.123′

        The first set is primary HANAhost:<HANA port> the second is the Secondary HANAhost without the port

      • SLD_HANA_PORT=’30015′

      • SLD_DATABASE=’SLDDATA’

      • SLD_HANA_INSTANCE_NO=’00’

      • SLD_HANA_SERVER_USER=’SYSTEM’

      • SLD_HANA_SERVER_PASSWD=’manager’

      • TOMCAT_USER=”root”

      • TOMCAT_GROUP=”root”

      • SITE_PASSWD=’1234

        The value above becomes the value for B1SiteUser, if you do not want to change the value for B1SiteUser enter the existing password

reinit.sh.PNG

    • Grant execute to reinit,sh using chmod 754 reinit.sh
    • Run the update scrip, reinit.sh, to reinitialize server tools
    • Execute /etc/init.d/sapb1servertools restart to restart the server tools
    • Delete reinit.sh to prevent the disclosure of private information

/wp-content/uploads/2013/11/reinit_sh_320139.png

Installing the SAP Business One Server

The SBOCOMMON DB is required on both SAP HANA DBs.  The creation of the DB is accomplished by installing the SAP Business One Server on both HANA servers.  When the SAP Business One Server installer prompts for HANA DB provide the IP address for the HANA server on which you are installing the SAP Business One Server, do not provide the hostname.

Installing the SAP Business One Analytics powered by SAP HANA

The SAP Analytics must be installed on both SAP HANA DB server 1 and server 2.  When the SAP Business One Analytics installer prompts for HANA DB provide the IP address for the HANA server on which you are installing the SAP Business One Server, do not provide the hostname.

SAP Business One Analytics powered by SAP HANA post installation steps

  1. In the web browser navigate to https://<Host IP>:8443/Enablement/ and confirm Analytics installed successful.  You should verify successful installation on both HANA hosts
  2. Logon to HANA host2 as ndbadm and stop B1AH by executing  ./B1AShutdown.sh from /opt/sap/SAPBusinessOne/AnalyticsPlatform/tomcat/bin
  3. Update the registration information of B1AH on Host1.
    1. In the SAP HANA studio, connect to SAP HANA Host1
    2. Execute UPDATE “SBOCOMMON”.”SLSPP” SET “ParamValue”='<SAP Business One Server Tools host>’ WHERE “ParamKey”=’host’.  Replace <SAP Business One Server Tools> with the name of your SAP Business One Server Tools host.
      1. You can use select “ParamValue” from “SBOCOMMON”.”SLSPP” WHERE “ParamKey”=’host’ to look up the host

Setting Up Apache Proxy Balancer

  1. Execute yast2 -i apache2 to confirm/install Apache
    1. You need to do this on the physical host or be connected with an xWindows client
    2. Before calling the command you can call xeyes to confirm your xWindows client is accepting requests
  2. Enable the http service with YaST you can find more information on https://www.suse.com/documentation/
    1. Network Services > HTTP server > Select network devices

1_HTTPService.PNG

          2. Select Modules

          3. Review Default Host settings and click next

3_HTTPService.PNG

          4. Click next twice more then finish

3. Configure Apache, with yast, as shown below

     1. HTTP Server ==> Server module ==> Add module.  In the pop-up select proxy_balancer

4_HTTPService.PNG

     2. Enable the following modules:

    • proxy
    • proxy_http
    • ssl
    • proxy_balancer
    • headers

You enable the module by selecting it and clicking toggle status.

5_HTTPService.PNG

4. Run the following command to generate a private key and certificates for SSL:

  • mkdir –p /etc/apache2/b1
  • openssl req -nodes -newkey rsa:2048 -keyout /etc/apache2/b1/server.key -out /etc/apache2/b1/server.csr
  • openssl genrsa -des3 -out /etc/apache2/b1/sign.key 1024
  • openssl x509 -req -days 365 -in /etc/apache2/b1/server.csr -signkey /etc/apache2/b1/sign.key -out /etc/apache2/b1/server.crt
  • openssl rsa -in /etc/apache2/b1/sign.key -out /etc/apache2/b1/sign.key

5. In YaST add ports 8443 (B1AH) and 8000 (XAapp) to Apache

6_HTTPService.PNG

6. Copy the xs.conf and b1ah.conf files from download earlier to  /etc/apache2/vhosts.d directory, and then make the following updates with your own data:

  • b1ah.conf:
    • Update both balancer members with the IP addresses of the HANA database servers

/wp-content/uploads/2013/11/7_b1ah_conf_430941.png

  • xs.conf:
    • Update the balancer member with the IP address of Host1 (including the port number)
    • Update the header with the IP address of SAP Business One Server Tools server  (including the port numbers)

/wp-content/uploads/2013/11/8_xs_config_430942.png

7. Restart Apache server using service apache2 restart

8. In a Web browser, navigate to https://<SAP Business One Server Tools Server>:8443/Enablement/ to confirm you can access B1AH from the Apache proxy.

9. Update the Xapp information in the SLD

  1. In a Web browser, navigate to https://<SAP Business One Server Tools Server>:40000/ControlCenter/ and log on as B1SiteUser.
  2. In the system landscape directory, on the Services tab, update the URL link of the Extreme App Framework service to HTTPS protocols: https://<SAP Business One Server Tools Server IP>:80<Instance Number>. For example, change the link to https://10.58.5.76:8000
  3. In a Web browser, navigate to the new URL link to confirm you can access the XApp from the Apache proxy

Enabling SAP HANA DB Replication

This section describes how to enable Primary and secondary HANA system replication.  Before proceeding please read section 14 of http://help.sap.com/hana/SAP_HANA_Administration_Guide_en.pdf.

1.  You must make the following change in global.ini of both HANA servers:

    • listeninterface: .global
    • Confirm the log_mode is set to  normal

1_HANAreplication.PNG

2. Confirm both server can ping each other

3. Take a backup of HANA host 1 DB http://scn.sap.com/docs/DOC-44558#Task2_Backing_up_the_HANA_system_regularly

4. Enable system replication, on HANA host,1 by logging on as ndbadm and executing hdbnsutil -sr_enable –name=<Host1 Alias>.  The command can be found in /usr/sap/NDB/HDB00/exe.

5. To enable system replication on Host2 and register Host2 with the primary site as the secondary site (standby database server), log on to Host2 as the ndbadm user and run the following commands:

  1. Shuts down the system: /usr/sap/NDB/HDB00/exe/sapcontrol -nr <Instance Number> -function Stop
  2. Registery using hdbnsutil -sr_register –name=<Host2 Alias> –remoteHost=<Host1 IP> –remoteInstance=<Instance Number> –mode=syncmem the command can be found in /usr/sap/NDB/HDB00/exe
  3. Starts the SAP HANA system on Host2: HDB start

6. Confirm the replication status by connecting the SAP HANA Studio to SAP HANA host1 and opening the Administrator prospective.  In the administrator prospective select the Landscape tab select System Replication.

When you first enable replication you can track the replication status.

1_HANAreplication.PNG

After the replication is completed you can check in the same location to confirm replication is enabled.

2_HANAreplication.PNG

Enabling SSH Login without a Password

  1. Log on to SAP HANA Host1 as the ndbadm user.
  2. Run the following commands to generate a key pair:
    1. Generate a private/public key pair: ssh-keygen -t dsa -b 1024
    2. Create an authorized_keys file:
      1. cd /usr/sap/NDB/home/.ssh
      2. touch authorized_keys
      3. Assign read and write permission to the owner of the authorized_keys file: chmod 600 authorized_keys
  3. Log on to SAP HANA Host2 as the ndbadm user and generate a key pair as described in step 2.
  4. Log on to SAP Business One Server Tools server as a root user and run the following command to generate a key pair: ssh-keygen -t dsa -b 1024
  5. Copy the generated id_dsa.pub file to the two HANA hosts, and rename it as switch, as below:
    1. cd /root/.ssh
    2. scp id_dsa.pub ndbadm@<Host1 IP>:~/.ssh/switch
    3. scp id_dsa.pub ndbadm@<Host2 IP>:~/.ssh/switch
  6. Log on to HANA Host1 as the ndbadm user and do the following:
    1. Navigate to the ssh directory: cd ~/.ssh
    2. Append the public key to the authorized_keys file: cat switch >> authorized_keys
    3. Delete the temporary switch file: rm switch
  7. Log on to HANA Host2 as the ndbadm user and perform the same operations as in step 6.
  8. On SAP Business One Server tools server, run the following commands to try SSH login without a password:
    1. ssh ndbadm@<HANA Host1 IP>
    2. ssh ndbadm@<HANA Host2 IP>

Deploying Switch Script

This section describes how to deploy the monitoring and switch scripts. In the event of a failure on the active database server, you can switch on the standby database server to replace the active database.

Procedure

  1. Copy the attached b1h_switcher.sh and haenv.sh shell scripts to Server Tools Server.
  2. Open haenv.sh and update the following variables:
    1. hana_sid_user=ndbadm
    2. hana_instance_number=00
    3. hanadb01=10.58.1.121
    4. hanadb02=10.58.1.123

1_hdenv.sh.PNG

If you encounter a failure on your DB server, you run the b1h_switcher.sh script which will switch you to the standby server.

To report this post you need to login first.

28 Comments

You must be Logged on to comment or reply to a post.

  1. Eun Seok Bang

    Hi Duncan

    Great article! I have some questions.

    1. Is it OK to install server tool in only one HANA server?

    2. Is it OK to buy only one HANA license file for both 2 HANA servers?

    Regards

    Eunseok

    (0) 
    1. Duncan Speidel Post author

      Hi Eunseok,

      You need a separate server for the server tools.  It can be a VM.  If you install server tools on one of the HANA servers and that server goes offline you cannot access business one because server tools are offline.

      The HANA license applied to the primary HANA server will be replicated to the secondary server.  You will need only 1 HANA license.

      Best regards,

      Duncan

      (0) 
  2. Ed Sanchez

    Replicate in Two Locations? SAP B1 HANA High Availability

    Outstanding Article Duncan!

    Hello Experts!  Hope this message finds you well.

    Can we replicate SAP B1 HANA to a standby server that is in another location?

    Example Active Server\Central Server at my New York Data Center and Standby Server in Ohio

    What would be needed in terms of high speed pipe between locations and NTP to synch time to a common time server.

    Thank you for your advice.

    Ed

    (0) 
    1. Duncan Speidel Post author

      Hi Ed,

      Currently the two locations have to be within ~100 KM of each other.  You find this in section 14 of the HANA admin guide for SP6.   You can open a support ticket asking what to consider if you want a distance greater than 100KM.

      Best regards,

      Duncan

      (0) 
    1. Duncan Speidel Post author

      Hi Grzegorz,

      The latest version of the HA guide is available for download from the partner edge portal.  The latest version, I am aware of, has a date of 2014-10-10.

      Best regards,

      Duncan

      (0) 
  3. Jacobo Agami

    Hi Duncan

    Excelent Article.

    Every time we restart our server we most restart the server tools manualy, do you think the Reinit.sh script could help us to avoid this issue??

    Regards

    Jacobo

    (0) 
    1. Duncan Speidel Post author

      Hi Jacobo,

      What does chkconfig sapb1servertools return?  If it shows sapb1servertools off the server tools are not starting with a reboot because they are not configured to.  You can change this using chkconfig sapb1servertools on.

      Best regards,

      Duncan

      (0) 
    1. Duncan Speidel Post author

      Hi Homsi,

      You cannot install the xApps on the standalone server, you can install everything else.  If you need the extreme apps install them on the HANA server.  Install the SLD and License server on the standalone server.

      Best regards,

      Duncan

      (0) 
      1. mohammed homsi

        Dear Duncan ,

        the below note for server tools server or for two hana server :

        • When prompted for the HANA hostname use the IP address of the primary HANA server.  Do not enter the hostname.
        • On the “Specify Security Certificates for Exteme App Framework select “Configure SSL after installation”.  Note 1929288 https://service.sap.com/sap/support/notes/1929288 contains more details

        because i didn’t see it when configure Server tools server ??

        and the script is not work can check with me on below :

        #!/bin/bash

        REGISTER_HANA_SERVER=”192.168.7.123:30015;192.168.7.124:30015″

        REGISTER_HANA_SERVER_USER=”SYSTEM”

        REGISTER_HANA_SERVER_PASSWD=”manager”

        SLD_HANA_ADDRESS=’192.168.7.123:30015;192.168.7.124′

        SLD_HANA_PORT=’30015′

        SLD_DATABASE=’SLDDATA’

        SLD_HANA_INSTANCE_NO=’00’

        SLD_HANA_SERVER=”$SLD_HANA_ADDRESS:$SLD_HANA_PORT/$SLD_DATABASE”

        SLD_HANA_SERVER_USER=’SYSTEM’

        SLD_HANA_SERVER_PASSWD=’manager’

        TOMCAT_USER=”root”

        TOMCAT_GROUP=”root”

        SITE_PASSWD=’B1SiteUser’

        INSTALL_DIR=”‘pwd'”

        (0) 
  4. Anonymous

    Dear Duncan,

    this HA solution need a little update I believe.

    Starting from SAP B1 9.1 B1AH has changed – it runs under sapb1servicetools at port 40000 – and it works fine…

    …but I can’t add this 40000 port to apache – apache returns critical error – and I can’t go any further with configuration.

    So I stuck under Setting Up Apache Proxy Balancer for now…

    This conf file b1ah.conf with 8443 ports is obsolete too for now.

    Any ideas?

    Regards

    GN

    (0) 
  5. Grzegorz Niecka

    Screenshot from host CENTER (load balancer) to my last comment – for SAP 9.1 B1AH runs on port 40000 (not on port 8443) so this HA procedure when Setting Up Apache Proxy Balancer need update while I can’t add port 40000 to apache (apache return critical error when adding 40000 port)

    HA01.jpg

    (0) 
  6. Angelo Tirone

    Hello Duncan,

    my compliments for the article.

    I have to implement a B1 for Hana in HA and I have one question on your article.

    I see on B1_for_SAP_HANA_Admin_Guide  “The license service and the SLD must be installed on the SAP HANA database server machine.” while you written “..1 Linux server for Apache Load Balancer and Server Tools” ,  It means that you installed SLD and LM on a separate server, isn’t it? Did it work?

    Regards

    Luigi

    (0) 
    1. Duncan Speidel Post author

      Hi Luigi,

      Happy New Year!  Please forgive the delay in responding, I have been on holiday.

      The setup is as follows:

      -2 HANA servers where you install SAP HANA and SAP Business One but not the SLD.

      -A standalone server with 8GB RAM and 60 GB disk (this server can be a VM)

      On the smaller server you install the SLD,  When you install the other B1 components on the HANA servers you tell them to use the standalone SLD server. 

      You can find the official HA install guides on the partner edge portal. 

      Does this answer your question?

      Best regards,

      Duncan

      (0) 
      1. Fabrizio Verna

        Hi Duncan,

        we are setting up an HA environment for a customer in the Early Adopter program (SAP B1H 9.2). We have followed the latest documentation on partneredge for Manual HA Failover setup. The HANA DB part seems to be working perfectly, replication is active and data in sync.

        However there is a problem with the client that is not showing the FIORI style interface correctly (giving the error: FATAL ERROR: XS_HOST_NOT_FOUND ) and also from the SLD Enablement page the error: “You are not connected to the SAP HANA database server; the database server is not available or you entered an invalid SYSTEM logon password. “

        Do you have any hints were to look for? maybe re-install the Analytics part on both Host1 and Host2 ?? Thanks.

        Here’s a couple of screenshot of SAP Client and from the SLD Enablement page.

        HANA_SAP_B1H_CLIENT-ERROR-20160209.PNG

        HANA_VirtualHost-Enablement-ERROR-20160209.PNG

        Best regards,

        Fabrizio

        (0) 
        1. Duncan Speidel Post author

          Hi Fabrizio,

          You can try reinstalling the analytics engine on the two hosts.  If that works continue on as normal.  If that doesn’t work, I would suggest a support ticket to ensure that development is aware of things that need to be fixed for HA for 9.2.

          Best regards,

          Duncan

          (0) 
        2. Jiawei Huang

          Hi Fabrizio,

          So far, 9.2 is still in verification.

          The latest HA document is for 9.0 and 9.1.

          Will publish to parteredge when 9.2 HA is ready.

          Best Regards

          Jiawei

          (0) 
  7. Luis Veloso

    Hi Duncan;
    I need your help.

              I need to update the HA solution, which review of hana and SAP version should I install to work properly.?

    installed today:
    SAP HANA 9.1 PL06 with REV85

    (0) 
    1. Duncan Speidel Post author

      Hi Luis,

      At this time we have only certified HA for 9.1 and earlier.  You will find mappings of HANA revision to 9.1 releases in note 2001393 – Central Note for SAP Business One 9.1, version for SAP HANA.  Check partner portal periodically to see when 9.2 is certified.


      Best regards,

      Duncan

      (0) 
  8. Shougata Ghosh

    Hi Duncan

    Thanks for this blog! We are in the process of setting up SAP B1 9.2 HANA with HA and this blog is extremely helpful.

    I have a few questions regarding the hardware and network setup for the HA configuration. We have the following components:

    1. Primary HANA server
    2. Secondary HANA server
    3. Shared Network Storage
    4. Central Server (linux server)
    5. Windows Server: we are using this to run the Browser Access service

    Question-1: What sort of shared network storage device do we need for SBD? Can we use a NAS Hard disk and create three partitions in it, each having 10 MB? Will that be ok?

    Question-2: How will the components be connected at switch level and sub-domain level? We have the following. Is this configuration OK?
    – Primary and Secondary HANA servers are connected to Switch-1 and have IP addresses 192.168.1.1 and 192.168.1.2 respectively.

    – Primary and Secondary HANA servers are also connected to another switch, Switch-2, and have IP addresses 10.1.5.1 and 10.1.5.2.

    – There is a Virtual IP address 10.1.5.3 in Switch-2’s sub domain.

    – The NAS device is connected to Switch-2 and has IP address 10.1.5.4.

    – Central Server and Windows Server are connected to Switch-2 and have IP addresses 10.1.5.5 and 10.1.5.6 respectively.

    Thanking you in advance!

    Best regards
    Shougata

     

    (0) 

Leave a Reply