SAP HANA Hands on tests ( part 4.1 ) : HANA replication takeover
In a previous document / blog , I performed the replication setup of my HANA test db.
My layout is described by this diagram. in this first attempt, the replication is perfomed @ HDB level ( not at the disks level, i’ll probably give it a try later ) :
My first HANA system sits in DC1 ( hdbtest1 ) the second is in DC2 ( hdbtest2 ).
What i did so far was :
- Install the HDB node 1
- Install an ECC EHP7 on top of it
- Build a stdby node
- Replicate to HDB node 2
In my test set up , I do not have the nice network layer and HA solution that would allow me to switch from one DC to another with minimum downtime.
I will perform this switch manually ( mainly by re-configuring the ECC application server to point on hdbtest2 instead of hdbtest1 as a db server and modifying the hdbuserstore “DEFAULT” key ) .
So, in fact, my ECC server will still work from DC1, while the HDB will be available in DC2.
The hana takeover can be done using the HDB studio or the command line tool “hdbnsutil”.
When it comes to DR scenario, I like to consider nothing works as it should, so let’s pretend the HDBStudio does not work and use the hdbnsutil command line huh !
Generate some load on the HDB
I’m running SGEN on the ECC platform in order to generate some load on the system :
and I can see in some HDB log files that things are being replicated :
on hdbtest1 ( PRIM ) :
on hdbtest2 ( STBY ) :
Now let’ s “crash the system ” !!
Ouch … This one was nasty :
As of now, the primary DB is down, the standby is still in standby mode.
The ECC server lost the DB :
The stby HDB lost contact of the primary one :
Let’ s perform the HANA takeover :
- Connect to the STBY ( surviving ) host .
- Use the <hdb>adm user.
- Trigger the takeover :
hdbnsutil -sr_takeover ( Easy )
looking at the logs on the stby hosts, we can see the takeover progress :
The HDB is back online in a few minutes on node 2 in DC2 :
Now I have to stop and reconfigure my ECC server ( this is due to my test infra layout ) .
In this kind of layout I had to modify the DEFAULT entry in mt <sid>adm hdb userstore :
hdbuserstore SET DEFAULT “hdbtest1:30015;hdbtest2:30015” SAPHEC1 <password>
Restart my ECC instance. Et Voilà !
The system is back online with the hana DB working in DC2 on node 2.
Let’s reconnect and keep going with the SGEN :
Next step : failback !