HANA System Replication
In this post we will try to perform HANA system replication having two nodes (node A and node B)
Prerequisites:
The primary and secondary systems are installed and configured.
The HANA software version running on the secondary system has to be equal or newer to the version on the primary.
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. An additional SAP HANA license is not required.
Any changes made to the ini file configuration parameters on one system should be manually duplicated on the other system.
The required ports must be available. The same <instance number> is used for primary and secondary systems. The <instance number>+1 must be free on both systems, because this port range is required for system replication communications.
An initial backup must be performed on the primary before system replication can be activated.
Setup:
System replication can be configured with HANA studio or with the command line on the console.
The first step is to enable system replication on the two identical systems. Using HANA Studio
Create a backup of the primary system by right-clicking on the primary system (later named as siteA), navigating to Backup and Recovery, and selecting Back Up system.
Enter the backup type as complete data backup and destination type on file.
We need to enter backup destination path and backup prefix.
Click next.
We will be prompted to review the backup settings which all we had filled in last screen and click finish button.
Next, system replication needs to be enabled on the primary system. Right-click on the primary system, navigate to Configuration and Monitoring, and then Configure System Replication. Choose Enable System Replication.
System will show warning message that “This is a production system. Manipulate data on this system with caution.”
We should give “primary System Logical Name” as NodeB or SiteB.
Below screen will give information like Primary System Information, Host name and Instance Number.
We need to make sure we have taken full system backup before going ahead.
It will check for the last backup taken date and time.
Issue the Stop System command on the Secondary System by right-clicking on the Secondary System, navigating to Configuration and Monitoring, and then to Stop System.
We can either perform soft shutdown type to stop at specific date and time giving active users time to logoff or hard shutdown type to stop immediately logging off all active users.
We need to set stop wait timeout as 400 seconds because if the system doesn’t shutdown within 400 seconds of wait time, then system is forcefully shutdown after 400 seconds.
Next screen will provide summary of all details which we had filled in previous all screens like Primary System Logical name, primary system information, host name and instance number.
Now register the secondary node by right-clicking on Secondary System, navigating to Configuration and Monitoring, and then to Configure System Replication. Select Register Secondary System. It will register the system as the secondary system of the primary system.
Now during the part of system replication, we need to set secondary system logical name (this we had already filled in previous screen), we need to set replication mode as synchronous mode=sync.
Hostname and instance number will be autofilled.
We can start “Initiate full data shipping” but clicking the checkbox.
If we need to start secondary system after the replication is performed, we need to tick the checkbox.
The replication process will automatically start when the secondary system starts.
Monitoring of Replication status:
Go to the HANA Studio.
Double click on <SID> on HANA STUDIO go to the landscape tab then go to system replication.
Here we can check Replication_status_details. It will show percentage of replication performed.
We can see primary host name and secondary host name. Replication mode will be sync. Replication status will be active when full system replication will be performed.
Failover: Manual
To perform an SAP HANA takeover manually, the secondary needs to be told to perform the takeover and the network environment needs to be configured to support that change.
We should ensure primary system is stopped.
Unbind virtual IP address (IP redirection) or change DNS entry.
Right-click on siteB (secondary system), navigate to Configuration and Monitoring, and Configure System Replication.
Select Perform Takeover.
Bind virtual IP addresses.
Ensure backups are running on siteB (new primary), if desired.
Issue the Stop System command on the Primary System by right-clicking on the Primary System, navigating to Configuration and Monitoring, and then to Stop System.
As at this point of time, there will be no active users, hence we can perform hard shutdown. It will shutdown system immediately and any open transaction will be aborted and rolled back.
Now we need to perform takeover by right-clicking on the Secondary System, navigating to Configuration and Monitoring, and then select Perform takeover System.
In next screen we can review the configuration summary. Check secondary system information, host name and instance number. Once verified, click next.
To unregister original secondary node (siteB) and disable system replication on the original primary (siteA):
If siteA is not started, Right-click on the system, navigate to Configuration and Monitoring, and then Start System.
Right-click on the original primary (siteA), navigate to Configuration and Monitoring, and then Configure System Replication. Select Unregister Secondary System, select siteB, and follow prompts.
In this screen we can see secondary system as site B autofiled. Click next.
Right-click on the original primary (siteA), navigate to Configuration and Monitoring, and then Configure System Replication. Choose Disable System Replication and follow the prompts.
Review source system information shown in below screen and click next.
We can see the message of disabling system replication
Assign original primary as secondary:
Stop siteA, Right-click on it, navigate to Configuration and Monitoring, and then Stop System.
Right-click on siteA, navigate to Configuration and Monitoring, and then Configure System Replication. Select Register Secondary System and configure replication as synchronous.
Now placing the systems as they were before fail over
Down the secondary system (original secondary)
Now we shall be putting back original Primary to its place. We need to perform takeover. This will bring back the system takeover from its source system.
We need to perform unregister secondary system.
Enter the secondary system name as siteA.
We shall select register the system siteA as secondary system of the primary system.
In below screen we can see full replication is performing.
Hence we have now performed complete HANA system replication.