Technology Blogs by Members
Explore a vibrant mix of technical expertise, industry insights, and tech buzz in member blogs covering SAP products, technology, and events. Get in the mix!
cancel
Showing results for 
Search instead for 
Did you mean: 
former_member182505
Contributor
0 Kudos
8,589
Friends ! I would Like to Share my experience today on SAP HANA Replication setup On Multi Multi Tenant Database Container Few things will be helping to you on your assignment setup, I am Trying to explain as much as possible in details, For Basic idea and complete details can be found in the  SAP   document 

I will be Performing whole setup using command line , if required by HANA Studio i will add the steps in the future ,

System Replication:- SAP HANA system replication ships all data to a secondary system located at
another site:



 

Once SAP HANA system replication is enabled, each server process on the
secondary system establishes a connection with its primary counterpart and
requests a snapshot of the data. Now all logged changes in the primary system are
replicated continuously. Each persisted redo log in the primary system is sent to
the secondary. A transaction in the primary system is not committed before the
redo logs are replicated.

SAP HANA Multitenant Database Containers (introduced with SPS09) can also run
in an SAP HANA system replication configuration. The system as a whole is
replicated, i. e. the System DB and all tenant DBs. Just like in the single container
HANA database each service of the primary site replicates to its counterpart on
the secondary site.

MDC Tips:-  During the installation of SAP HANA we will be only creating Tenant Database on Primary Node, No need to create Tenant Database on Secondary Node ,

While the system replication is running, the secondary system, which is configured
identically to the primary, will be on standby until a takeover takes place.

You can chose Replication and Operation mode as per you as per your company Police and Requirement,

Prerequisite :

  • The primary and secondary systems are both installed and configured. You have verified that both are independently up and running.

  • The number of nodes in the secondary system has to be equal to the number of active nodes in the primary system. (As of SPS06 the secondary system does not need to have standby nodes.) .

  • All configuration steps have to be executed on the master name server node;for SAP HANA Multitenant Database Containers this means on the System DB .

  • The secondary system must have the same SAP system ID, <SID>, and instance number as the primary system. The primary replicates all relevant license information to the secondary.

  • Changes to the ini file configuration parameters made on one system should be manually duplicated on the other system.

  • An initial data backup or snapshot must be performed on the primary before the system replication can be activated


Installation of SAP HANA


Now download the SAP HANA package and can be uncompressed with the command SAPCAR xvf <PACKAGE-NAME>.CAR

After the uncompressing is done, the installer can be started which guides through the installation procedure for SAP HANA on Node 1 ,

Make sure User id and Groups has to be created as per the SAP HANA installation Guide ,

In My environment we are using Database mode as High isolation ,

 







MyHost:/DATA_UNITS/HDB_SERVER_LINUX_PPC64 # ./hdblcmSAP HANA Lifecycle Management - SAP HANA 1.00.122.06.1485334242
***************************************************************Scanning Software Locations...
Detected components:
SAP HANA Database (1.00.122.06.1485334242) in DATA_UNITS/HDB_SERVER_LINUX_PPC64/server
SAP HANA AFL (incl.PAL,BFL,OFL,HIE) (1.00.122.0600.1485350425) in DATA_UNITS/HDB_AFL_LINUX_PPC64/packages
SAP TRD AFL FOR HANA (1.00.122.0600.1485350425) in DATA_UNITS/HDB_TRD_AFL_LINUX_PPC64/packages
SAP HANA Database Client (1.00.120.050.1484020229) in DATA_UNITS/HDB_CLIENT_LINUX_PPC64/client
SAP HANA XS Advanced Runtime (1.0.43.282823) in DATA_UNITS/XSA_RT_10_LINUX_PPC64/packages
SAP Web IDE Web Client (3.012.6) in DATA_UNITS/XSAC_SAP_WEB_IDE_10/XSACSAPWEBIDE12_6.ZIP
SAP Web IDE Development Infrastructure (3.012.6) in DATA_UNITS/XSAC_DI_CORE_10/XSACDEVXDI12_6.ZIP
XS Monitoring 1 (1.002.0) in DATA_UNITS/XSA_CONTENT_10/XSACMONITORING02_0.ZIP
XS Services 1 (1.002.0) in DATA_UNITS/XSA_CONTENT_10/XSACSERVICES02_0.ZIP
SAP HANA Runtime Tools 1 (1.002.5) in DATA_UNITS/XSAC_HRTT_10/XSACHRTT02_5.ZIPChoose installationIndex | System | Database Properties
------------------------------------------------
1 | Install new system |
| |
2 | Extract components |
3 | Exit (do nothing) |Enter selected system index [3]: 1

SAP HANA Database version '1.00.122.06.1485334242' will be installed.

Select additional components for installation:

Index | Components | Description
-------------------------------------------------------------------------------------------------
1 | server | No additional components
2 | all | All components
3 | client | Install SAP HANA Database Client version 1.00.120.050.1484020229
4 | afl | Install SAP HANA AFL (incl.PAL,BFL,OFL,HIE) version 1.00.122.0600.1485350425
5 | trd | Install SAP TRD AFL FOR HANA version 1.00.122.0600.1485350425
6 | xs | Install SAP HANA XS Advanced Runtime version 1.0.43.282823

Enter comma-separated list of the selected indices [3]: 1
Enter Installation Path [/hana/shared]:
Enter Local Host Name [MyHost]: Logical host use the logical hostname here
Do you want to add additional hosts to the system? (y/n) [n]:
Enter SAP HANA System ID: SID
The defined user 'SIDadm' already exists on the system. Neither the password, nor any other attribute of the user will be changed.
Verify that the user is correct.
Enter Instance Number [00]:

Index | Database Mode | Description
-----------------------------------------------------------------------------------------------
1 | single_container | The system contains one database
2 | multiple_containers | The system contains one system database and 1..n tenant databases

Select Database Mode / Enter Index [1]: 2

Index | Database Isolation | Description
----------------------------------------------------------------------------
1 | low | All databases are owned by the sidadm user
2 | high | Each database has its own operating system user

Select Database Isolation / Enter Index [1]: 2

Index | System Usage | Description
-------------------------------------------------------------------------------
1 | production | System is used in a production environment
2 | test | System is used for testing, not production
3 | development | System is used for development, not production
4 | custom | System usage is neither production, test nor development

Select System Usage / Enter Index [4]: 4
Enter Location of Data Volumes [/hana/data/SID]:
Enter Location of Log Volumes [/hana/log/SID]:
Restrict maximum memory allocation? [n]:
Enter Certificate Host Name For Host ' Logicalhost' [MyHost]: Logicalhost  use the logical hostname here
Enter System Administrator (SIDadm) Password:
Enter Database User (SYSTEM) Password:
Confirm Database User (SYSTEM) Password:
Restart system after machine reboot? [n]:

Summary before execution:
=========================

SAP HANA Components Installation
Installation Parameters
Remote Execution: ssh
Installation Path: /hana/shared
Local Host Name: Logicalhost
SAP HANA System ID: SID
Instance Number: 00
Database Mode: multiple_containers
Database Isolation: high
System Usage: custom
Location of Data Volumes: /hana/data/SID
Location of Log Volumes: /hana/log/SID
Certificate Host Names: Logicalhost -> Logicalhost
System Administrator Home Directory: /usr/sap/SID/home
System Administrator Login Shell: /bin/sh
System Administrator User ID: 56009
ID of User Group (sapsys): 12
Software Components
SAP HANA Database
Install version 1.00.122.06.1485334242
Location: DATA_UNITS/HDB_SERVER_LINUX_PPC64/server
SAP HANA AFL (incl.PAL,BFL,OFL,HIE)
Do not install
SAP TRD AFL FOR HANA
Do not install
SAP HANA Database Client
Do not install
SAP HANA XS Advanced Runtime
Do not install

Note: The defined user 'SIDadm' already exists on the system. Neither the password, nor any other attribute of the user will be changed.
Verify that the user is correct.

Do you want to continue? (y/n): y

Installing components...
Installing SAP HANA Database...
Preparing package 'Saphostagent Setup'...
Preparing package 'Python Support'...
Preparing package 'Python Runtime'...
Preparing package 'Product Manifest'...
Preparing package 'Binaries'...
Preparing package 'Data Quality'...
Preparing package 'Krb5 Runtime'...
Preparing package 'Installer'...
Preparing package 'Ini Files'...
Preparing package 'HWCCT'...
Preparing package 'Emergency Support Package'...
Preparing package 'EPM'...
Preparing package 'Documentation'...
Preparing package 'Delivery Units'...
Preparing package 'DAT Languages'...
Preparing package 'DAT Configfiles'...
Creating System...
Extracting software...
Installing package 'Saphostagent Setup'...
Installing package 'Python Support'...
Installing package 'Python Runtime'...
Installing package 'Product Manifest'...
Installing package 'Binaries'...
Installing package 'Data Quality'...
Installing package 'Krb5 Runtime'...
Installing package 'Installer'...
Installing package 'Ini Files'...
Installing package 'HWCCT'...
Installing package 'Emergency Support Package'...
Installing package 'EPM'...
Installing package 'Documentation'...
Installing package 'Delivery Units'...
Installing package 'DAT Languages'...
Installing package 'DAT Configfiles'...
Creating instance...
Starting SAP HANA Database system...
Starting 1 process on host 'MyHost' (worker):
Starting on 'MyHost': hdbdaemon
Starting 5 processes on host 'MyHost' (worker):
Starting on 'MyHost': hdbcompileserver, hdbdaemon, hdbnameserver, hdbpreprocessor, hdbwebdispatcher
Starting on 'MyHost': hdbdaemon, hdbwebdispatcher
All server processes started on host 'MyHost' (worker).
Importing delivery units...
Importing delivery unit HCO_INA_SERVICE
Importing delivery unit HANA_DT_BASE
Importing delivery unit HANA_IDE_CORE
Importing delivery unit HANA_TA_CONFIG
Importing delivery unit HANA_UI_INTEGRATION_SVC
Importing delivery unit HANA_UI_INTEGRATION_CONTENT
Importing delivery unit HANA_XS_BASE
Importing delivery unit HANA_XS_DBUTILS
Importing delivery unit HANA_XS_EDITOR
Importing delivery unit HANA_XS_IDE
Importing delivery unit HANA_XS_LM
Importing delivery unit HDC_ADMIN
Importing delivery unit HDC_BACKUP
Importing delivery unit HDC_IDE_CORE
Importing delivery unit HDC_SEC_CP
Importing delivery unit HDC_SYS_ADMIN
Importing delivery unit HDC_XS_BASE
Importing delivery unit HDC_XS_LM
Importing delivery unit SAPUI5_1
Importing delivery unit SAP_WATT
Importing delivery unit HANA_BACKUP
Importing delivery unit HANA_HDBLCM
Importing delivery unit HANA_SEC_BASE
Importing delivery unit HANA_SEC_CP
Importing delivery unit HANA_ADMIN
Importing delivery unit HANA_SYS_ADMIN
Importing delivery unit HANA_WKLD_ANLZ
Installing Resident hdblcm...
Updating SAP HANA Instance Integration on Local Host...
Regenerating SSL certificates...
Deploying SAP Host Agent configurations...
Creating Component List...
SAP HANA system installed
You can send feedback to SAP with this form: https://MyHost:1129/lmsl/HDBLCM/SID/feedback/feedback.html
Log file written to '/var/tmp/hdb_SID_hdblcm_install_2018-06-08_08.41.43/hdblcm.log' on host 'MyHost'.


Create a Tenant Database on Primary Node using command like or from HANA Cockpit  and Repeat the installation exactly on the second node ,

After the installation has been completed, check if the SAP HANA processes are up and running on both nodes







MyHost:~ # su - sidadm
sidadm@MyHost:/usr/sap/SID/HDB00> HDB info
USER PID PPID %CPU VSZ RSS COMMAND
sidadm 7483 7482 1.7 41280 6784 -bash
sidadm 7584 7483 0.0 39488 4800 \_ /bin/sh /usr/sap/SID/HDB00/HDB info
sidadm 7615 7584 0.0 37440 3840 \_ ps fx -U sidadm -o user,pid,ppid,pcpu,vsz,rss,args
sidadm 25648 1 0.0 40960 4736 sapstart pf=/hana/shared/SID/profile/SID_HDB00_MyHost
sidadm 25671 25648 0.0 560896 332864 \_ /usr/sap/SID/HDB00/MyHost/trace/hdb.sapSID_HDB00 -d -nw -f /usr/sap/SID/HDB00/MyHost/daemon.ini pf=/usr/sap/SID/SYS/profile/SID_HDB0
sidadm 25688 25671 19.2 15976768 11198208 \_ hdbnameserver
root 25711 25671 0.0 40512 5632 \_ hdbmdcdispatcher -s SID -t /usr/sap/SID/HDB00/MyHost/trace
sidadm 25957 25671 3.0 3437440 692416 \_ hdbcompileserver
sidadm 25959 25671 28.6 6419648 3623232 \_ hdbpreprocessor
sidadm 25996 25671 0.4 3489536 724672 \_ hdbwebdispatcher
sidadm 25529 1 0.2 110528 36480 /usr/sap/SID/HDB00/exe/sapstartsrv pf=/hana/shared/SID/profile/SID_HDB00_MyHost -D -u sidadm


Setup SAP HANA System Replication:-


Make Sure that the following requirements are meet:

  • Both nodes are having different hostnames

  • If you use logical hostnames in HANA, ensure that both installations using different ones

  • On both nodes SAP HANA is installed with the same user, groups and IDs

  • On both nodes SAP HANA is installed with the same file systems and sizes

  • On both nodes SAP HANA is installed with the same SAP HANA System ID

  • On both nodes SAP HANA is installed with the same Instance Number

  • On both nodes SAP HANA is installed with the same Database Mode and System Usage

  • Make Sure SAP HANA is started on the Primary Node

  • Make Sure SAP HANA has been stopped on the Standby Node

  • Make Sure the IP addresses, hostnames and FQDNs of both nodes have been added to the /etc/hosts on both system


Before we can start to configure the SAP HANA System Replication, you have to decide which node will host the Primary HANA and Which Node will be Secondary

You have to create a full backup of the  SAP HANA HANA,

The next step is to prepare both installations for the replication. Stop HANA on the secondary node:

MDC Tips:- Now copy the two SSFS key files SSFS_SID.DAT and SSFS_SID.KEY from the primary node to the secondary, so that both HANA installations will thrusted each other:

Configure system_replication_hostname_resolution Parameter on On Both the Node and Maintain IP Address in the global.ini of both HANA installations. Start with the secondary node ,

Stop HANA on the primary node and edit the global.ini and add the exact same lines. Start HANA on the primary node after that .

The next step is to enable the HANA System Replication on the primary node. The option “-name” has to be provided with a logical name. I will be Doing Replication Setup using command Line , You can use HANA Studio for configuring it but Not Recommended,







myHost1:~> hdbnsutil -sr_enable --name=Node1
checking for active nameserver ...
nameserver is active, proceeding ...
successfully enabled system as system replication source site
done.


Now the secondary node can be registered against the primary node. At this step the information has to be provided about how HANA System Replication shall replicate the data:







myHost2:~> hdbnsutil -sr_register --name=Node2 --remoteHost=Myhost1 --remoteInstance=00 --replicationMode=syncmem --operationMode=logreplay --force_full_replica
adding site ...
checking for inactive nameserver ...
nameserver Myhost2:30001 not responding.
collecting information ...
registered at 10.xxx.xx.xxx (Myhost1)
updating local ini files ...
done.


After that HANA can be started on the secondary node to initialize the HANA System Replication

and check the Replication Status







myhost2:~> hdbnsutil -sr_state
checking for active or inactive nameserver ...System Replication State
~~~~~~~~~~~~~~~~~~~~~~~~
online: truemode: syncmem
site id: 2
site name: Node2
active primary site: 1Host Mappings:
~~~~~~~~~~~~~~myhost2 -> [node2] myhost2

 

primary masters:myhost1

 

done.


Tips:- First time startup can take some time and also the initial data replication depends on the database size Before you continue with the next steps, verify with HANA Studio or by python Script , that the HANA System Replication is in sync,


SAP HANA System Replication Takeover:-


SAP HANA System Replication doesn’t provide any automated takeover. To test the takeover, follow the procedure below and test you takeover

The takeover has always been initiated on the standby system or Node 1







MYHOST2:/usr/sap/sid/HDB00> hdbnsutil -sr_takeover
checking local nameserver ...
done.myhost2:/usr/sap/SID/HDB00> hdbnsutil -sr_state
checking for active or inactive nameserver ...
System Replication State ~~~~~~~~~~~~~~~~~~~~~~~~ online: true
mode: primary
site id: 2
site name: Node2
Host Mappings: ~~~~~~~~~~~~~~
myhost2-> [myhost1] myhost1
myhost2-> [myhost1] myhost2
done.


Note:- The original primary system is still available after the takeover. The takeover procedure just breaks the replication, rolls-forward the standby database and activates it for read/write access. In Real Time Disaster your Primary will get down then only takeover will required here we are just testing Replication takeover,

SAP HANA System Replication Reintegration after Takeover:-


Follow the procedure below to reintegrate the failed old primary system.

Register the failed old primary system as new standby system,

Stop the Primary HANA date base Node 1



 

Now Start the HANA DB again on the new standby system( Old Primary  Node which is now Secondary ) and Check Replication Status



So now We have configured and tested the takeover , Please feel free to comment  and give you suggestions ,

Thanks

Sadiq
1 Comment
Labels in this area