Monday, 11 July 2016

MDC conversion on HANA System Replication configured

MDC system can only be replicated as the whole system, it means that the system database and all tenant databases are part of system replication. A take over happen for the whole Hana database (system database + all tenant databases) and is not possible to take over just for a particular container.

In our scenario, we have system replication setup for single container systems running on 112.02, and we decided to convert them into MDC. As we know that primary and secondary must be identical (N+N, nodes (except Standby) and services) during system replication setup, there's no exception for MDC.
Hence, i don't see any other way than breaking the system replication between primary and secondary, convert them into MDC individually, and reconfigure the system replication.

Steps performed as below:
1) Stop Secondary
# HDB stop

2) On secondary, clean up replication config
# hdbnsutil -sr_cleanup --force

3) Start up secondary. Now the secondary startup as active database
# HDB start

4) On primary, clear system replication config.
# hdbnsutil -sr_disable --force

once done, you can check with command # hdbnsutil -sr_state --sapcontrol=1

It is critical to clear the system replication config to avoid hitting error below during MDC conversion:

/hana/shared/SID/exe/linuxx86_64/hdb/python_support> python convertMDC.py
Stop System
Convert Topology to MDC
Set database Isolation low
Export Topology
Reinit SYSTEMDB persistence
RETURN CODE:
1
OUT BEGIN:

error: 'hdbnsutil -initTopology' is not allowed on system replication sites.
failed.

OUT END
ERROR BEGIN

ERROR END
'hdbnsutil failed!'

I believe above error is due to 2281734 - Re-Initialize secondary site in HANA system replication where hdbnsutil -initTopology is prohibited on system replication on primary and secondary site to avoid data loss.

If you hit above error, you can't redo the MDC conversion as its topology already converted to multidb. Workaround is bring up nameserver to reset user SYSTEM password manually. Refer to administration guide, section resetting system user password in MDC.

4) Convert both primary and secondary to MDC by running python convertMDC.py at the same time.

5) MDC conversion completed and system were started

shutdown is completed.
Start System
Conversion done
Please reinstall your licenses and delivery units into the SYSTEMDB.
Tenant SID can now be started by execution:
           "ALTER SYSTEM START DATABASE SID"

6) go to Primary and startup tenant
# ALTER SYSTEM START DATABASE SID

7) in Primary, reconfigure system replication by running below command to enable system replication
# hdbnsutil -sr_enable --name=UrName

8) Stop secondary and perform the replication setup
hdbnsutil -sr_register --remoteHost=PrimaryHost --remoteInstance=## --replicationMode=syncmem --operationMode=delta_datashipping --Name=UrName

9) On Studio -> Primary -> Landscape -> System Replication, you will notice full data replication is needed.

10) Once full data shipping completed, your replication should be active now with MDC


On secondary you'll see:


11) redeploy delivery_unit by running below on Primary:
# /hana/shared/SID/global/hdb/install/bin> ./hdbupdrep

Now, your MDC conversion with system replication setup is completed.

 Also, i've tested below scenario:

a) on primary, convert single container to MDC whilst system replication is running, and encountered below error:
error: 'hdbnsutil -initTopology' is not allowed on system replication sites.
failed.

b) on primary, convert single container to MDC with system replication config on, but shutdown secondary, and encountered same error:
error: 'hdbnsutil -initTopology' is not allowed on system replication sites.
failed

c) Converted only primary to MDC. Tried to startup secondary to resume replication, but secondary refused to startup with due to the replication port is different, 4XX00 is used instead of 3XX00 for SAP HANA system replication with MDC.

Source: scn.sap.com

No comments:

Post a Comment