private static NameService nameService(String nameServiceId, ConfigHelper config, Cluster cluster) {
    List<NameNode> namenodes = nnUniqueIds(nameServiceId, config, cluster).stream()
      .map(nnUniquId -> NameNode.fromConfig(nameServiceId, nnUniquId, config, cluster))
      .collect(Collectors.toList());
    return new NameService(nameServiceId, namenodes);
  }
NameNodes in this nameservice.
The minimum number of NameNodes for HA is two, but more can be configured.
ambari-server/src/main/java/org/apache/ambari/server/stack/NameService.java