private void addDisableSecurityCommandToAllServices(Cluster cluster, Stage stage) throws AmbariException {
      for (Service service : cluster.getServices().values()) {
        for (ServiceComponent component : service.getServiceComponents().values()) {
          if (!component.getServiceComponentHosts().isEmpty()) {
            String firstHost = component.getServiceComponentHosts().keySet().iterator().next(); // it is only necessary to send it to one host
            ActionExecutionContext exec = new ActionExecutionContext(
              cluster.getClusterName(),
              "DISABLE_SECURITY",
              singletonList(new RequestResourceFilter(service.getName(), component.getName(), singletonList(firstHost))),
              Collections.emptyMap());
            customCommandExecutionHelper.addExecutionCommandsToStage(exec, stage, Collections.emptyMap(), null);
          }
        }
      }
    }
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