Let’s flip the flags! Is my SAP HANA database in sync or not?
The problem
You have setup your SAP HANA system replication cluster. The cluster is working. The tests are passed. Let’s celebrate! But how can I see in the High Availability Web Konsole (HAWK), if the SAP HANA system replication pair is currently in sync? Is there an easy method to show the current replication status detected by the cluster resource agent?
Maybe you know already from our best practice guides, that the solution provides a tool to show all relevant cluster attributes created by the SAPHanaSR resource agents. SAPHana-showAttr is your friend at the Linux command line. Likewise the standard cluster tool crm_mon can print all cluster attributes. Certainly these solutions are working fine and precise. Maybe you would prefer to see the system replication status more prominent and graphical using HAWK.
The solution
As a result of very good community work a colleague of mine thought about a dummy cluster resource. The only purpose of this dummy resource is to represent the system replication status detected by the cluster.
The first HAWK screen shot shows us that the resource rsc_HANAinSync_HD0_HDB00 is not running. This means, the cluster resource agents did not have set the appropriate cluster attribute to the status “SOK”. In this situation the missing resource is indicating that the system replication status needs a review by the SAP HANA database administrator. Maybe SAP HANA is still syncing after a restart of the secondary. But there could also be more problematic scenarios.
Finally the SAP HANA in our setup did came into sync. After the resource agent did discover that the cluster attribute is set to “SOK”. And the cluster magically starts the cluster resource rsc_HANAinSync_HD0_HDB00. The second screen shot from our SUSE HAWK shows the final status.
All resources are either started or even promoted. The cluster status is sane and finally represents the SAP HANA primary and secondary in sync.
It seams that now it’s time to celebrate!
The implementation
You most likely want to know why the dummy resource is able to represent the system replication status. Of course the cluster does not start the dummy magically. The cluster triggers the start directly when the cluster attribute “hana_$<sid>_sync_state” is set to “SOK”. As pacemaker is an extremely flexible cluster framework this can achieved by a simple cluster location constraint like:
location HD0_HDB00_inSync rsc_HANAinSync_HD0_HDB00 \ rule -inf: not_defined hana_hd0_sync_state or \ hana_hd0_sync_state ne "SOK"
And the cluster resource is simply defined as a plain dummy resource without any additional coding.
primitive rsc_HANAinSync_HD0_HDB00 Dummy
The technical support document (TID 7023526) “Showing SOK Status in Cluster Monitoring Tools Workaround” describes the solution in more detail.
And now it’s certainly time to celebrate!
Related Articles
Feb 15th, 2023
Stop the Churn with SUSE eLearning
Jun 04th, 2024
How to upgrade to SAPHanaSR-angi
Oct 15th, 2024
No comments yet