Skip to Content
Technical Articles

SAP On Azure : HIGH AVAILIABILITY setup for SAP NETWEAVER with SAP ASE 16 DB on WINDOWS SERVER

Introduction

This blog is a detailed guide for setting up highly available (HA) setup of SAP Netweaver 7.5 with SAP ASE 16 DB on Windows Server environment in Microsoft Azure Cloud. It uses ASE DB’s SAP replication server(REP) and Fault Manager(FM) features to setup, manage the HA and automatic failover of DB. SAP ASE Always-On HA setup can be used for SAP Netweaver ABAP OR JAVA based systems.

Purpose

By deploying a HA solution, we can protect SAP Netweaver & DB (on SAP ASE) against Infrastructure & VM failure and removes Single Point of Failure (SPOF) for the environment. This document can be used as reference for deployment of HA environment for the SAP ASE DB for SAP workloads and not intended to cover other aspects of system design like infra, network, security, and performance.

System Design

Following diagram is a reference architecture for SAP Netweaver & ASE DB HA on Windows Server in Microsoft Azure .

Following are the major components of the setup.

SOFS Cluster – Its used for hosting the highly available Fileshare for the SAP Application like ‘sapmnt’ & ‘trans’ which are common across Application Server, DB and ASCS/ERS VMs. There are other alternative methods available in Azure to deploy HA FilesShare for SAP.

ASCS/ERS Cluster – SAP ASCS/ERS Cluster will be part of Windows WFSC Cluster and its virtual IP will be defined in Azure Internal Load Balancer.

SAP ASE DB – ASE DB will be running be on 2 separate VMs with role as Primary DB and Secondary DB and part of availability set. DBs replication(sync method) will be running from primary to secondary DB. DBs can switch roles in the event of failover.

SAP application connection will connect to primary/active DB. SAP ASE DB HA setup is independent of Operating System HA software such as Windows cluster and Pacemaker and does not require the Azure Internal Load Balancer(ILB) for virtual IP address. Its also highly recommended to use latest version of ASE DB(Min. version 16.0.03.07 for HA setup) and saphostcontrol (Min. version 721 patch 46).

Fault Manager – FM will monitor the availability of DB nodes and trigger switching of roles of DB from Secondary to Primary in the event of unavailability of Primary DB. FM will be installed on ASCS cluster node and it will be highly available within the ASCS Cluster.

Application Servers – SAP application servers will be installed to process user workloads.

Following are the details of the reference setup which are described in this blog:

Hostname Description OS Version DB Version SAP & DB SID
azwinascs1  ASCS/ERS Node1 + Fault Manager Windows 2019

 

 

PR1

azwinascs2 ASCS Node2 + Fault Manager Windows 2019
Pr1-ascsha Virtual hostname for ASCS Cluster
azwinsydb1 ASE DB Node1 (Primary) Windows 2019 ASE 16.0.03.07
azwinsydb2 ASE DB Node1 (Secondary) Windows 2019 ASE 16.0.03.07
azwinpas1 SAP Primary Application Server Windows 2019
sofssycl1 SOFS Node1 Windows 2016
sofssycl2 SOFS Node2 Windows 2016

The setup can be extended for Disaster Recovery (DR) in paired Azure region by setting up third SAP ASE DB VM and setting up SAP ASE DB replication (async method).

References

SAP Guide for ASE HA Setup

SAP ASE Azure Virtual Machines DBMS deployment for SAP workload

SAP Note 2912040 – SAP ASE on Microsoft Azure: Documentation by Microsoft

SAP Note 2134316 – Can SAP ASE run in a cloud environment? – SAP ASE

SAP Note 1941500 – Certification information for Linux and other Operating Systems – SAP ASE

SAP Note 1891560 – SYB: Disaster Recovery Setup with SAP Replication Server

SAP Note 1928533 – SAP Applications on Azure: Supported Products and Azure VM types

High Level Overview of Installation Steps

High level Installation process for HA setup SAP Netweaver 7.5 with ASE DB are following :

  1. Read the required Installation Guide, SAP Notes, SAP on Azure docs and download the installation media.
  2. Preform the Preparatory Steps.
  3. Install the SOFS Fileshare cluster.
  4. Define the Virtual IP in the Internal Load Balancer.
  5. Deploy the WFSC Cluster for ASCS/ERS.
  6. Install the ASCS on first Node of the Cluster
  7. Install the ACCS/ERS on the second node of the cluster.
  8. Install the SAP ASE Database (primary).
  9. Install the SAP Primary Application Server.
  10. Perform the ASE Replication Server on the Primary DB.
  11. Install the SAP ASE DB (Secondary).
  12. Perform the ASE Replication Server on the Secondary DB.
  13. Post DB HADR Setup actions.
  14. Deploy the Fault Manager
  15. Test the ASE DB failover (planned & unplanned).

This blog is focusing on setting up highly available SAP ASE DB and Fault Manager Installation and skip the detailed steps to perform the SOFS, ASCS/ERS Cluster and Primary Application Server. Please follow the below link for detailed Setup of skipped sections.

SOFS Fileshare for ASCS Instance

SAP Netweaver Installation (HA) for ASCS/ERS instances on Windows Failover Cluster

Preparations

  • Deploy the VM in Availability Sets as per the system architecture and Choose Operating System as Windows Server.
  • Include data and log disk on each of the DB VMs.
  • Add disk to SOFS Nodes for File share cluster.
  • Join the VMs to the Domain
  • Define Page File in Temp Disk (D Drive).
  • Necessary Ports are open in Windows firewall.
  • Disable the Continuous Availability Feature in Windows using the instructions in this link.

Install the SAP ASE Primary DB

  • Run SWPM to Install the DB Instance

  • Provide the Fileshare path in SOFS cluster (or created using other Methods in Azure).
  • Provide the ASCS Message server port
  • VM hostname and DB port number

Skipping other SWPM standard installation screenshots. Recommendation is to keep the DB data and Log files in separate Disks.

  • DB Installation is Completed.

Once DB installation is finished, Install the PAS & AAS instances.

DB Replication Setup on Primary DB

  • Login as syb<sid> user
  • Create/update the DMA & setuphadr files.

Sample file are attached in the link.

Update SID, hostname, userid, passwords, port numbers and path in the sample files.

  • Go to SAP ASE DVD folder to setup the DMA (open command prompt in admin mode).

.\setupConsole -f M:\sybase\sybdb1_dma.rs -i silent

  • Unlock the user

isql -Usapsso -P<password> -SPR1 -X

>sp_locklogin sa, unlock

>go

  • Create the RMA service

sc create SybaseDRAgent_PR1 binpath=M:\sybase\PR1\DM\RMA-16_0\compatibility\WinService\x64\Release\drservice.exe obj=contoso234\sybpr1 password=”<password>”

  • Run the setup hadr

cd M:\sybase\PR1\ASE-16_0\bin

setuphadr.bat M:\sybase\sybdb1_setup_hadr.rs

Setup up ASE HA on Secondary Node

  • Start SWPM to setup the replication environment.
  • Enter the SID, Master Password, Fileshare Name(sapglobalhost). Select the Setup Secondary DB Instance option
  • Workaround for the below error in SWPM

Rename the profile directory(path is mentioned in the error) to profile1 temporarily to bypass the issue. Rename it back to profile as soon as we reach to next screen in swpm.

  • Primary DB Details
  • Provide the Fileshare path in SOFS cluster (or created using other Methods).
  • Secondary DB Details

Skipping other SWPM standard installation screenshots. Recommendation is to keep the DB data and Log files in separate Disks.

  • Secondary DB Installation is Successful.
  • Login as user syb<sid>
  • Create/update the DMA & setuphadr files.

Sample file are attached in the link.

Update SID, hostname, userid, passwords,port numbers and path in the sample files.

  • Install the DMA by running the following command. Need to ‘cd’ to SAP ASE DVD location and open command prompt as Administrator

.\setupConsole -f M:\sybase\sybdb2_dma.rs -i silent

  • Unlock the user

isql -Usapsso -P<password> -SPR1 -X

>sp_locklogin sa, unlock

>go

  • Create the RMA service

sc create SybaseDRAgent_PR1 binpath=M:\sybase\PR1\DM\RMA-16_0\compatibility\WinService\x64\Release\drservice.exe obj=contoso234\sybpr1 password=”<Password>”

  • Run the Setuphadr

cd M:\sybase\PR1\ASE-16_0\bin

setuphadr.bat M:\sybase\sybdb2_setup_hadr.rs

Post Setup Actions for ASE DB HA

  • Restart the Replication as a Service
    • In DB Node1, login as syb<sid> user.
    • Login to RMA

isql -UDR_admin -P<password> -Sazwinsydb1:4909

  • Run the following Command

sap_set_replication_service Site1, contoso234\sybpr1, <password>

sap_set_replication_service Site1, restart

  • In DB Node2, login as syb<sid> user.
  • Login to RMA

isql -UDR_admin -P<password> -Sazwinsydb2:4909

  • Run the following Command

sap_set_replication_service Site2, contoso234\sybpr1, <password>

sap_set_replication_service Site2, restart

  • Update the environment parameters.
    • In DB Node1 & Node2, Login as <sid>adm
    • Update the following environment parameters:

Make sure SAPLOCALHOST parameter points the Fileshare Name.

  • Update the DR_Admin password in Secure Store

In both the DB Nodes. Login as <sid>adm user and Run the following command.

rsecssfx put DB_CONNECT/SYB/DR_USER DR_admin -plain

rsecssfx put DB_CONNECT/SYB/DR_PASSWORD <password of DR_admin>

In both the DB Nodes, Login as syb<sid> user and run the following command.

cd C:\Program Files\SAP\hostctrl\exe

saphostctrl -user sapadm <password of sapadm> -function LiveDatabaseUpdate -dbname PR1 -dbtype syb -dbuser DR_admin -dbpass <password of DR_admin> -updatemethod Execute -updateoption TASK=SET_USER_PASSWORD -updateoption USER=DR_ADMIN

  • Configure Replication Server with sap_tune_rs

Perform these steps on the Primary and Secondary DB servers to configure Replication Server to specify the maximum number of the CPUs and the maximum size of the memory for the Replication Server instance.

In DB Node 1 & 2, Login as syb<sid> and run the following command

    • Login to RMA
    • Run the Following Command

sap_tune_rs Site1, 6, 2  (In Node 1)

sap_tune_rs Site2, 6, 2  (in Node 2)

  • Check the Status of DB Replication

saphostctrl -user sapadm <password of sapadm> – -function LiveDatabaseUpdate -dbname PR1 -dbtype syb -updatemethod Check -updateoption TASK=REPLICATION_STATUS

  • Parameter Changes for SAP Application server for DB HA.

Refer to SAP Note 1891560.

Adapt the user environment for <sid>adm:

Adapt dbs_syb_ha:

dbs_syb_ha = 1

Adapt dbs_syb_server:

The host name can contain a list of host names:

dbs_syb_server = <primary hostname>:<standby hostname>

The port can contain a list of ports:

dbs_syb_port =<primary_port>:<standby_port>

If both ports are equal, this parameter is not required.

Restart the SAP application servers to activate the changes.

Only for Netweaver Java environment.

Open the config tool and To enable failover for the J2EE Engine / Java EE, you have to change the connection URL in the secure storage (see SAP Note 867976):

jdbc:sybase:Tds:<hostname1:port1>,<hostname2:port2>/<SID>?<your current parameters>&HADR_MODE=NONE

<hostname1> is the name of the server of your primary node, and <hostname2> is the name of your standby node. The same applies for the port numbers. The parameter HADR_MODE=NONE does NOT mean that data replication is switched off.

Deploy the Fault Manager

Fault manager needs to be deployed in active ASCS Node. Once successfully installed, it will bind itself with active ASCS node and can failover between ASCS cluster nodes.

  • Download the latest version of ASE DB kernel SAR File SYBCTRL.SAR and extract it. Copy the extracted files to kernel directory (\\sapglobal\sapmnt\PR1\SYS\exe\uc\NTAMD64)
  • Login to ASCS Node as <sid>adm.
  • Check/Update environment variable for <sid>adm user

SAPLOCALHOST=sapglobal   (Fileshare Name)

RSEC_SSFS_KEYPATH=\\sapglobal\sapmnt\PR1\SYS\global\security\rsecssfs\key

set RSEC_SSFS_DATAPATH=\\sapglobal\sapmnt\PR1\SYS\global\security\rsecssfs\data

  • Check the rsecssfx list and make sure it displays successfully

C:\Program Files\SAP\hostctrl\exe>rsecssfx list

  • Add the ODBC driver path to PATH

C:\usr\sap\PR1\ASCS00\work>set Path=%Path%;\\sapglobal\sapmnt\PR1\SYS\global\syb\NTAMD64\sybodbc

  • Install the FM
C:\Program Files\SAP\hostctrl\exe>\\sapglobal\sapmnt\PR1\SYS\exe\uc\NTAMD64\sybdbfm install

replication manager agent user DR_admin and password set in Secure Store.

Keep existing values (yes/no)? (yes) 

SAPHostAgent connect user: (sapadm) 

Enter password for user sapadm. 

Enter value for SAPLOCALHOST: (sapglobal) 

Enter value for primary database host: (azwinsyascs2)

azwinsydb1

Enter value for primary database name: (PR1)

PR1

Enter value for primary database port: (4901) 

Enter value for primary site name:

Site1

Enter value for primary database heart beat port: (13777) 

Enter value for standby database host: (azwinsyascs2)

azwinsydb2

Enter value for standby database name: (PR1) 

Enter value for standby database port: (4901) 

Enter value for standby site name :

Site2

Enter value for standby database heart beat port: (13787) 

Enter value for fault manager host: (sapglobal)

azwinsyascs2

Enter value for heart beat to heart beat port: (13797) 

Enter value for support for floating database ip: (no) 

Enter value for use SAP ASE Cockpit if it is installed and running: (no) 

installation finished successfully.
  • Check the profile directory for file SYBHA.PFL which will be created after installation of FM.
  • Also check that following entries are added to the ASCS Instance profile.

#———————————————————————–

# Start sybha

#———————————————————————–

_SYBHAD = $(DIR_EXECUTABLE)\sybdbfm$(FT_EXE)

_SYBHA_PF = $(DIR_PROFILE)\SYBHA.PFL

Restart_Program_06 = local $(_SYBHAD) hadm pf=$(_SYBHA_PF)

  • Check the FM Status
C:\usr\sap\PR1\ASCS00\work>sybdbfm status

fault manager running, pid = 8284, fault manager overall status = OK, currently executing in mode PAUSING

*** sanity check report (14)***.

node 1: server azwinjsydb1, site Site1.

db host status: OK.

db status OK hadr status STANDBY.

node 2: server azwinjsydb2, site Site2.

db host status: OK.

db status OK hadr status PRIMARY.

replication status: SYNC_OK.

failover prerequisites fulfilled: YES.

Test the ASE DB failover

  • Planned failover

Login to one of the DB Node as user syb<sid> and run the following command as

C:\Program Files\SAP\hostctrl\exe>saphostctrl -user sapadm <password of sapadm> – -function LiveDatabaseUpdate -dbname PR1 -dbtype syb -updatemethod Execute -updateoption TASK=FAILOVER -updateoption FAILOVER_FORCE=1 -updateoption FAILOVER_TIME=30

FM will detect the failover and show the status as Primary role switches to DB Node2.

C:\usr\sap\PR1\ASCS00\work>sybdbfm status

fault manager running, pid = 8284, fault manager overall status = OK, currently executing in mode PAUSING

*** sanity check report (14)***.

node 1: server azwinsydb1, site Site1.

db host status: OK.

db status OK hadr status STANDBY.

node 2: server azwinsydb2, site Site2.

db host status: OK.

db status OK hadr status PRIMARY.

replication status: SYNC_OK.

failover prerequisites fulfilled: YES.
  • Unplanned Failover

We can crash the ASE DB (Primary) using the tool ‘notmyfault’. FM will detect the unavailability of Primary DB and turn the secondary DB as Primary.

C:\usr\sap\PR1\ASCS00\work>sybdbfm status

fault manager running, pid = 8284, fault manager overall status = OK, currently executing in mode PAUSING

*** sanity check report (6901)***.

node 1: server azwinsydb1, site Site1.

db host status: OK.

db status DB DEAD hadr status UNREACHABLE.

node 2: server azwinsydb2, site Site2.

db host status: OK.

db status OK hadr status PRIMARY.

replication status: INDOUBT.

failover prerequisites fulfilled: NO.

 

Once the VM is restarted. Start the ASE DB and Replication server Services.

    • Login to OS user syb<sid>.
    • Open the command prompt
    • login to RMA and
    • Run the command “sap_host_available <site name>”.

Once the command is completed, FM will show that DB sync is OK.

C:\usr\sap\PR1\SCS01\work>sybdbfm status

fault manager running, pid = 8284, fault manager overall status = OK, currently executing in mode PAUSING

*** sanity check report (9126)***.

node 1: server azwinjsydb1, site Site1.

db host status: OK.

db status OK hadr status STANDBY.

node 2: server azwinjsydb2, site Site2.

db host status: OK.

db status OK hadr status PRIMARY.

replication status: SYNC_OK.

failover prerequisites fulfilled: YES.

Summary

This completes the HA setup SAP Netweaver with SAP ASE 16 DB in Windows Server. The setup can be extended to DR by setting up 3rd DB Node in another Azure region and setting up DB (async mode) replication.

Be the first to leave a comment
You must be Logged on to comment or reply to a post.