Promoting Secondary Namenode to Primary
In this recipe, we will cover how to promote Secondary Namenode to be Primary Namenode.
In production, Datanodes will never talk to the Secondary and only the Primary node knows about the data block mappings. In a non-HA setup, if the Primary Namenode fails, there will be outage, but we can still reduce the downtime by quickly promoting the Secondary to be Primary.
Getting ready
For this recipe, make sure you have completed the previous recipe on Secondary Namenode configuration and have a running Secondary Namenode.
How to do it...
Connect to the
master2.cyrus.com
master node and switch to userhadoop
.The first thing is to check the
seen_txid
file under location/data/secondary/current/
, to make sure until what point is the Secondary in sync with Primary.If the lag is high, it is important that the metadata is copied from the NFS mount of the Primary Namenode. That is the reason of having at least one Primary Namenode metadata directory mount on NFS.
Change...