Search in sources :

Example 1 with StaticPropertiesConfigurationFactory

use of io.mantisrx.server.master.config.StaticPropertiesConfigurationFactory in project mantis by Netflix.

the class MasterMain method main.

public static void main(String[] args) {
    try {
        Args.parse(MasterMain.class, args);
    } catch (IllegalArgumentException e) {
        Args.usage(MasterMain.class);
        System.exit(1);
    }
    try {
        StaticPropertiesConfigurationFactory factory = new StaticPropertiesConfigurationFactory(loadProperties(propFile));
        setupDummyAgentClusterAutoScaler();
        final AuditEventSubscriber auditEventSubscriber = new AuditEventSubscriberLoggingImpl();
        MasterMain master = new MasterMain(factory, auditEventSubscriber);
        // blocks until shutdown hook (ctrl-c)
        master.start();
    } catch (Exception e) {
        // unexpected to get a RuntimeException, will exit
        logger.error("Unexpected error: " + e.getMessage(), e);
        System.exit(2);
    }
}
Also used : AuditEventSubscriberLoggingImpl(io.mantisrx.master.events.AuditEventSubscriberLoggingImpl) StaticPropertiesConfigurationFactory(io.mantisrx.server.master.config.StaticPropertiesConfigurationFactory) AuditEventSubscriber(io.mantisrx.master.events.AuditEventSubscriber) FileNotFoundException(java.io.FileNotFoundException) JsonProcessingException(io.mantisrx.shaded.com.fasterxml.jackson.core.JsonProcessingException) IOException(java.io.IOException)

Example 2 with StaticPropertiesConfigurationFactory

use of io.mantisrx.server.master.config.StaticPropertiesConfigurationFactory in project mantis by Netflix.

the class TestHelpers method setupMasterConfig.

public static void setupMasterConfig() {
    final Properties props = new Properties();
    props.setProperty("mantis.master.consoleport", "8080");
    props.setProperty("mantis.master.apiport", "7070");
    props.setProperty("mantis.master.metrics.port", "7102");
    props.setProperty("mantis.master.apiportv2", "7075");
    props.setProperty("mantis.master.schedInfoPort", "7076");
    props.setProperty("mantis.master.workqueuelength", "100");
    props.setProperty("mantis.master.storageProvider", "io.mantisrx.server.master.store.NoopStorageProvider");
    props.setProperty("mantis.master.api.status.path", "api/postjobstatus");
    props.setProperty("mantis.master.mesos.failover.timeout.ms", "1000.0");
    props.setProperty("mantis.worker.executor.name", "Mantis Worker Executor");
    props.setProperty("mantis.localmode", "true");
    props.setProperty("mantis.zookeeper.connectionTimeMs", "1000");
    props.setProperty("mantis.zookeeper.connection.retrySleepMs", "100");
    props.setProperty("mantis.zookeeper.connection.retryCount", "3");
    props.setProperty("mantis.zookeeper.connectString", "ec2-50-19-255-1.compute-1.amazonaws.com:2181,ec2-54-235-159-245.compute-1.amazonaws.com:2181,ec2-50-19-255-97.compute-1.amazonaws.com:2181,ec2-184-73-152-248.compute-1.amazonaws.com:2181,ec2-50-17-247-179.compute-1.amazonaws.com:2181");
    props.setProperty("mantis.zookeeper.root", "/mantis/master");
    props.setProperty("mantis.zookeeper.leader.election.path", "/hosts");
    props.setProperty("mantis.zookeeper.leader.announcement.path", "/leader");
    props.setProperty("mesos.master.location", "127.0.0.1:5050");
    props.setProperty("mesos.worker.executorscript", "startup.sh");
    props.setProperty("mesos.worker.installDir", "/tmp/mantisWorkerInstall");
    props.setProperty("mantis.master.framework.name", "MantisFramework");
    props.setProperty("mesos.worker.timeoutSecondsToReportStart", "5");
    props.setProperty("mesos.lease.offer.expiry.secs", "1");
    props.setProperty("mantis.master.stage.assignment.refresh.interval.ms", "-1");
    ConfigurationProvider.initialize(new StaticPropertiesConfigurationFactory(props));
}
Also used : StaticPropertiesConfigurationFactory(io.mantisrx.server.master.config.StaticPropertiesConfigurationFactory) Properties(java.util.Properties)

Aggregations

StaticPropertiesConfigurationFactory (io.mantisrx.server.master.config.StaticPropertiesConfigurationFactory)2 AuditEventSubscriber (io.mantisrx.master.events.AuditEventSubscriber)1 AuditEventSubscriberLoggingImpl (io.mantisrx.master.events.AuditEventSubscriberLoggingImpl)1 JsonProcessingException (io.mantisrx.shaded.com.fasterxml.jackson.core.JsonProcessingException)1 FileNotFoundException (java.io.FileNotFoundException)1 IOException (java.io.IOException)1 Properties (java.util.Properties)1