If you want to do failover of NameNode (or even kill NameNode process) doing shell operation (like ./hdfs haadmin -getServiceState nn) is mandatory from program.
For DataNode there is one function in DFSClient#datanodeReport which provides list of LIVE Datanode. To avoid shell operations of hdfs haadmin, i was looking for some function which can provide Name of Active NameNode. Is there anything implemented in Hadoop which provide Active NameNode? On Fri, Oct 20, 2017 at 4:25 AM, Arpit Agarwal <aagar...@hortonworks.com> wrote: > Mihir, > > HAAdmin is a private interface. Most of its functionality is exposed via > the ‘hdfs haadmin’ command [1]. Will that work for you? > > 1. https://hadoop.apache.org/docs/r2.7.0/hadoop-project- > dist/hadoop-hdfs/HDFSCommands.html#haadmin > > > > > On 10/17/17, 4:28 AM, "Mihir Monani" <mmon...@salesforce.com> wrote: > > I wanted to write Chaos Action for HBase Chaos Monkey (something like > RestartActiveMaster > <https://github.com/apache/hbase/blob/master/hbase-it/ > src/test/java/org/apache/hadoop/hbase/chaos/actions/ > RestartActiveMasterAction.java> > ) which can trigger NN Failover. > > For that i was going through HAAdmin.java. Is there any way I can use > function like HAAdmin#failover , HAAdmin#getServiceState from HAAdmin > class. > > Can someone guide me how do i use them? > > Thanks, > Mihir Monani > > >