title: Any command to get active namenode for nameservice in hadoop?
body: <p>The command:</p>
  
  <pre><code>hdfs haadmin -getServiceState machine-98
  </code></pre>
  
  <p>Works only if you know the machine name. Is there any command like:</p>
  
  <pre><code>hdfs haadmin -getServiceState &lt;nameservice&gt;
  </code></pre>
  
  <p>which can tell you the IP/hostname of the <strong>active</strong> namenode?</p>