public static void main(String[] args) {
    for (ServerName server : readZKNodes(HBaseConfiguration.create())) {
      // bin/zookeeper.sh relies on the "ZK host" string for grepping which is case sensitive.
      System.out.println("ZK host: " + server.getHostname());
    }
  }
Run the tool.
@param args Command line arguments.
hbase-zookeeper/src/main/java/org/apache/hadoop/hbase/zookeeper/ZKServerTool.java