void addStopZookeeperStage(Cluster cluster,
                               String clusterHostInfoJson,
                               String hostParamsJson,
                               Map<String, String> commandParameters,
                               RoleCommandOrder roleCommandOrder,
                               RequestStageContainer requestStageContainer)
      throws AmbariException {
      Service zookeeper;
      try {
        zookeeper = cluster.getService("ZOOKEEPER");
      } catch (ServiceNotFoundException e) {
        return;
      }
      Stage stage = createNewStage(requestStageContainer.getLastStageId(),
        cluster,
        requestStageContainer.getId(),
        "Stopping ZooKeeper",
        StageUtils.getGson().toJson(commandParameters),
        hostParamsJson);
      for (ServiceComponent component : zookeeper.getServiceComponents().values()) {
        Set<String> hosts = component.getServiceComponentHosts().keySet();
        ActionExecutionContext exec = new ActionExecutionContext(
          cluster.getClusterName(),
          "STOP",
          singletonList(new RequestResourceFilter(zookeeper.getName(), component.getName(), new ArrayList<>(hosts))),
          Collections.emptyMap());
        customCommandExecutionHelper.addExecutionCommandsToStage(exec, stage, Collections.emptyMap(), null);
      }
      RoleGraph roleGraph = roleGraphFactory.createNew(roleCommandOrder);
      roleGraph.build(stage);

      requestStageContainer.addStages(roleGraph.getStages());
    }
Send a custom command to the KERBEROS_CLIENT to check if there are missing keytabs on each hosts.
ambari-server/src/main/java/org/apache/ambari/server/controller/KerberosHelperImpl.java