Search in sources :

Example 1 with HelixServerStarter

use of com.linkedin.pinot.server.starter.helix.HelixServerStarter in project pinot by linkedin.

the class ClusterTest method startServers.

protected void startServers(int serverCount) {
    try {
        for (int i = 0; i < serverCount; i++) {
            Configuration configuration = DefaultHelixStarterServerConfig.loadDefaultServerConf();
            configuration.setProperty(Server.CONFIG_OF_INSTANCE_DATA_DIR, Server.DEFAULT_INSTANCE_DATA_DIR + "-" + i);
            configuration.setProperty(Server.CONFIG_OF_INSTANCE_SEGMENT_TAR_DIR, Server.DEFAULT_INSTANCE_SEGMENT_TAR_DIR + "-" + i);
            configuration.setProperty(Server.CONFIG_OF_ADMIN_API_PORT, Integer.toString(Integer.valueOf(Server.DEFAULT_ADMIN_API_PORT) - i));
            configuration.setProperty(Server.CONFIG_OF_NETTY_PORT, Integer.toString(Integer.valueOf(Helix.DEFAULT_SERVER_NETTY_PORT) + i));
            configuration.setProperty(Server.CONFIG_OF_SEGMENT_FORMAT_VERSION, "v3");
            overrideOfflineServerConf(configuration);
            _serverStarters.add(new HelixServerStarter(getHelixClusterName(), ZkStarter.DEFAULT_ZK_STR, configuration));
        }
    } catch (Exception e) {
        throw new RuntimeException(e);
    }
}
Also used : Configuration(org.apache.commons.configuration.Configuration) HelixServerStarter(com.linkedin.pinot.server.starter.helix.HelixServerStarter)

Example 2 with HelixServerStarter

use of com.linkedin.pinot.server.starter.helix.HelixServerStarter in project pinot by linkedin.

the class StartServerCommand method execute.

@Override
public boolean execute() throws Exception {
    if (_serverHost == null) {
        _serverHost = NetUtil.getHostAddress();
    }
    Configuration configuration = readConfigFromFile(_configFileName);
    if (configuration == null) {
        if (_configFileName != null) {
            LOGGER.error("Error: Unable to find file {}.", _configFileName);
            return false;
        }
        configuration = new PropertiesConfiguration();
        configuration.addProperty(CommonConstants.Helix.KEY_OF_SERVER_NETTY_HOST, _serverHost);
        configuration.addProperty(CommonConstants.Helix.KEY_OF_SERVER_NETTY_PORT, _serverPort);
        configuration.addProperty("pinot.server.instance.dataDir", _dataDir + _serverPort + "/index");
        configuration.addProperty("pinot.server.instance.segmentTarDir", _segmentDir + _serverPort + "/segmentTar");
    }
    LOGGER.info("Executing command: " + toString());
    final HelixServerStarter pinotHelixStarter = new HelixServerStarter(_clusterName, _zkAddress, configuration);
    String pidFile = ".pinotAdminServer-" + String.valueOf(System.currentTimeMillis()) + ".pid";
    savePID(System.getProperty("java.io.tmpdir") + File.separator + pidFile);
    return true;
}
Also used : Configuration(org.apache.commons.configuration.Configuration) PropertiesConfiguration(org.apache.commons.configuration.PropertiesConfiguration) HelixServerStarter(com.linkedin.pinot.server.starter.helix.HelixServerStarter) PropertiesConfiguration(org.apache.commons.configuration.PropertiesConfiguration)

Example 3 with HelixServerStarter

use of com.linkedin.pinot.server.starter.helix.HelixServerStarter in project pinot by linkedin.

the class PerfBenchmarkDriver method startServer.

private void startServer() throws Exception {
    if (!_conf.shouldStartServer()) {
        LOGGER.info("Skipping start server step. Assumes server is already started.");
        return;
    }
    Configuration serverConfiguration = new PropertiesConfiguration();
    serverConfiguration.addProperty(CommonConstants.Server.CONFIG_OF_INSTANCE_DATA_DIR, _serverInstanceDataDir);
    serverConfiguration.addProperty(CommonConstants.Server.CONFIG_OF_INSTANCE_SEGMENT_TAR_DIR, _serverInstanceSegmentTarDir);
    serverConfiguration.setProperty(CommonConstants.Server.CONFIG_OF_SEGMENT_FORMAT_VERSION, _segmentFormatVersion);
    serverConfiguration.setProperty("instanceId", _serverInstanceName);
    LOGGER.info("Starting server instance: {}", _serverInstanceName);
    new HelixServerStarter(_clusterName, _zkAddress, serverConfiguration);
}
Also used : Configuration(org.apache.commons.configuration.Configuration) PropertiesConfiguration(org.apache.commons.configuration.PropertiesConfiguration) HelixServerStarter(com.linkedin.pinot.server.starter.helix.HelixServerStarter) PropertiesConfiguration(org.apache.commons.configuration.PropertiesConfiguration)

Aggregations

HelixServerStarter (com.linkedin.pinot.server.starter.helix.HelixServerStarter)3 Configuration (org.apache.commons.configuration.Configuration)3 PropertiesConfiguration (org.apache.commons.configuration.PropertiesConfiguration)2