private static void checkForDualNetworkCards(Set<String> componentHosts, NameService.NameNode nameNode) {
    if (!componentHosts.contains(nameNode.getHost())) {
      //This may happen when NN HA is configured on dual network card machines with public/private FQDNs.
      LOG.error(
        MessageFormat.format(
          "Hadoop NameNode HA configuration {0} contains host {1} that does not exist in the NameNode hosts list {3}",
          nameNode.getPropertyName(), nameNode.getHost(), componentHosts.toString()));
    }
  }
Find the master and secondary namenode(s) based on JMX NameNodeStatus.
ambari-server/src/main/java/org/apache/ambari/server/stack/MasterHostResolver.java