Search in sources :

Example 1 with HealthCheckClient

use of alluxio.HealthCheckClient in project alluxio by Alluxio.

the class AlluxioProxyMonitor method main.

/**
 * Starts the Alluxio proxy monitor.
 *
 * @param args command line arguments, should be empty
 */
public static void main(String[] args) {
    if (args.length != 0) {
        LOG.info("java -cp {} {}", RuntimeConstants.ALLUXIO_JAR, AlluxioProxyMonitor.class.getCanonicalName());
        LOG.warn("ignoring arguments");
    }
    HealthCheckClient client = new ProxyHealthCheckClient(NetworkAddressUtils.getBindAddress(NetworkAddressUtils.ServiceType.PROXY_WEB, new InstancedConfiguration(ConfigurationUtils.defaults())), () -> new ExponentialBackoffRetry(50, 100, 2));
    if (!client.isServing()) {
        System.exit(1);
    }
    System.exit(0);
}
Also used : InstancedConfiguration(alluxio.conf.InstancedConfiguration) ExponentialBackoffRetry(alluxio.retry.ExponentialBackoffRetry) HealthCheckClient(alluxio.HealthCheckClient)

Example 2 with HealthCheckClient

use of alluxio.HealthCheckClient in project alluxio by Alluxio.

the class AlluxioMasterMonitor method main.

/**
 * Starts the Alluxio master monitor.
 *
 * @param args command line arguments, should be empty
 */
public static void main(String[] args) {
    if (args.length != 0) {
        LOG.warn("java -cp {} {}", RuntimeConstants.ALLUXIO_JAR, AlluxioMasterMonitor.class.getCanonicalName());
        LOG.warn("ignoring arguments");
    }
    AlluxioConfiguration alluxioConf = new InstancedConfiguration(ConfigurationUtils.defaults());
    MasterHealthCheckClient.Builder builder = new MasterHealthCheckClient.Builder(alluxioConf);
    if (ConfigurationUtils.isHaMode(alluxioConf)) {
        builder.withProcessCheck(true);
    } else {
        builder.withProcessCheck(false);
    }
    HealthCheckClient client = builder.build();
    if (!client.isServing()) {
        System.exit(1);
    }
    System.exit(0);
}
Also used : InstancedConfiguration(alluxio.conf.InstancedConfiguration) AlluxioConfiguration(alluxio.conf.AlluxioConfiguration) HealthCheckClient(alluxio.HealthCheckClient)

Example 3 with HealthCheckClient

use of alluxio.HealthCheckClient in project alluxio by Alluxio.

the class AlluxioJobMasterMonitor method main.

/**
 * Starts the Alluxio job_master monitor.
 *
 * @param args command line arguments, should be empty
 */
public static void main(String[] args) {
    if (args.length != 0) {
        LOG.info("java -cp {} {}", RuntimeConstants.ALLUXIO_JAR, AlluxioJobMasterMonitor.class.getCanonicalName());
        LOG.warn("ignoring arguments");
    }
    AlluxioConfiguration conf = new InstancedConfiguration(ConfigurationUtils.defaults());
    HealthCheckClient client;
    // checking for the running process.
    if (ConfigurationUtils.isHaMode(conf)) {
        client = new MasterHealthCheckClient.Builder(conf).withAlluxioMasterType(MasterHealthCheckClient.MasterType.JOB_MASTER).build();
    } else {
        client = new JobMasterRpcHealthCheckClient(NetworkAddressUtils.getConnectAddress(NetworkAddressUtils.ServiceType.JOB_MASTER_RPC, conf), AlluxioMasterMonitor.TWO_MIN_EXP_BACKOFF, conf);
    }
    if (!client.isServing()) {
        System.exit(1);
    }
    System.exit(0);
}
Also used : InstancedConfiguration(alluxio.conf.InstancedConfiguration) AlluxioConfiguration(alluxio.conf.AlluxioConfiguration) HealthCheckClient(alluxio.HealthCheckClient) MasterHealthCheckClient(alluxio.master.MasterHealthCheckClient) MasterHealthCheckClient(alluxio.master.MasterHealthCheckClient)

Example 4 with HealthCheckClient

use of alluxio.HealthCheckClient in project alluxio by Alluxio.

the class AlluxioWorkerMonitor method main.

/**
 * Starts the Alluxio worker monitor.
 *
 * @param args command line arguments, should be empty
 */
public static void main(String[] args) {
    if (args.length != 0) {
        LOG.info("java -cp {} {}", RuntimeConstants.ALLUXIO_JAR, AlluxioWorkerMonitor.class.getCanonicalName());
        LOG.warn("ignoring arguments");
    }
    AlluxioConfiguration conf = new InstancedConfiguration(ConfigurationUtils.defaults());
    HealthCheckClient client = new WorkerHealthCheckClient(NetworkAddressUtils.getConnectAddress(NetworkAddressUtils.ServiceType.WORKER_RPC, conf), ONE_MIN_EXP_BACKOFF, conf);
    if (!client.isServing()) {
        System.exit(1);
    }
    System.exit(0);
}
Also used : InstancedConfiguration(alluxio.conf.InstancedConfiguration) AlluxioConfiguration(alluxio.conf.AlluxioConfiguration) HealthCheckClient(alluxio.HealthCheckClient)

Example 5 with HealthCheckClient

use of alluxio.HealthCheckClient in project alluxio by Alluxio.

the class AlluxioJobWorkerMonitor method main.

/**
 * Starts the Alluxio job_worker monitor.
 *
 * @param args command line arguments, should be empty
 */
public static void main(String[] args) {
    if (args.length != 0) {
        LOG.info("java -cp {} {}", RuntimeConstants.ALLUXIO_JAR, AlluxioJobWorkerMonitor.class.getCanonicalName());
        LOG.warn("ignoring arguments");
    }
    AlluxioConfiguration conf = new InstancedConfiguration(ConfigurationUtils.defaults());
    HealthCheckClient client = new JobWorkerHealthCheckClient(NetworkAddressUtils.getConnectAddress(NetworkAddressUtils.ServiceType.JOB_WORKER_RPC, conf), AlluxioWorkerMonitor.ONE_MIN_EXP_BACKOFF, conf);
    if (!client.isServing()) {
        System.exit(1);
    }
    System.exit(0);
}
Also used : InstancedConfiguration(alluxio.conf.InstancedConfiguration) AlluxioConfiguration(alluxio.conf.AlluxioConfiguration) HealthCheckClient(alluxio.HealthCheckClient)

Aggregations

HealthCheckClient (alluxio.HealthCheckClient)5 InstancedConfiguration (alluxio.conf.InstancedConfiguration)5 AlluxioConfiguration (alluxio.conf.AlluxioConfiguration)4 MasterHealthCheckClient (alluxio.master.MasterHealthCheckClient)1 ExponentialBackoffRetry (alluxio.retry.ExponentialBackoffRetry)1