SAP HANA System Replication On Multi Tenant Database Container
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 Enter comma-separated list of the selected indices [3]: 1 Index | Database Mode | Description Select Database Mode / Enter Index [1]: 2 Index | Database Isolation | Description Select Database Isolation / Enter Index [1]: 2 Index | System Usage | Description Select System Usage / Enter Index [4]: 4 Summary before execution: SAP HANA Components Installation Note: The defined user ‘SIDadm’ already exists on the system. Neither the password, nor any other attribute of the user will be changed. Do you want to continue? (y/n): y Installing components… |
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
Dear Sadiq Sir,
Thanks for wonderful blog. Really appreciate your contribution in SAP Community. Kudos.
Regards
Wajid