code: public static MesosServices createMesosServices(Configuration configuration, String hostname) throws Exception {
  
  		ActorSystem localActorSystem = AkkaUtils.createLocalActorSystem(configuration);
  
  		MesosArtifactServer artifactServer = createArtifactServer(configuration, hostname);
  
  		HighAvailabilityMode highAvailabilityMode = HighAvailabilityMode.fromConfig(configuration);
  
  		switch (highAvailabilityMode) {
  			case NONE:
  				return new StandaloneMesosServices(localActorSystem, artifactServer);
  
  			case ZOOKEEPER:
  				final String zkMesosRootPath = configuration.getString(
  					HighAvailabilityOptions.HA_ZOOKEEPER_MESOS_WORKERS_PATH);
  
  				ZooKeeperUtilityFactory zooKeeperUtilityFactory = new ZooKeeperUtilityFactory(
  					configuration,
  					zkMesosRootPath);
  
  				return new ZooKeeperMesosServices(localActorSystem, artifactServer, zooKeeperUtilityFactory);
  
  			default:
  				throw new Exception("High availability mode " + highAvailabilityMode + " is not supported.");
  		}
  	}
docs: Creates a {@link MesosServices} instance depending on the high availability settings.
  
  @param configuration containing the high availability settings
  @param hostname the hostname to advertise to remote clients
  @return a mesos services instance
  @throws Exception if the mesos services instance could not be created