Advertisement

Wednesday, April 18, 2018

Hadoop V2 - HAAdmin


In this blog I discuss usage of haadmin command.
I have already setup Manual HA configuration using QJM in last blog.

haadmin command is supported for failing over , switching over in case of manual configuration.

Below is help document of haadmin


hdfs haadmin
Usage: haadmin
    [-transitionToActive [--forceactive] <serviceId>]
    [-transitionToStandby <serviceId>]
    [-failover [--forcefence] [--forceactive] <serviceId> <serviceId>]
    [-getServiceState <serviceId>]
    [-checkHealth <serviceId>]
    [-help <command>]


Failover Example
hdfs haadmin -failover -forcefence -forceactive nn2 nn1
Failover from nn2 to nn1 successful   

Whenever a failover is forced, the other node is forced kill by the node which is going to be come active.
   
   
Graceful Swithcover Example

[hdfs@nn ~]$ hdfs haadmin -getServiceState nn1
standby
[hdfs@nn ~]$ hdfs haadmin -getServiceState nn2
standby
[hdfs@nn ~]$ hdfs haadmin -transitionToActive nn2
[hdfs@nn ~]$ hdfs haadmin -getServiceState nn2
active

No comments:
Write comments