Search in sources :

Example 1 with CrateNode

use of io.crate.node.CrateNode in project crate by crate.

the class BootstrapProxy method setup.

private void setup(boolean addShutdownHook, Settings settings, Environment environment) throws Exception {
    initializeNatives(environment.tmpFile(), settings.getAsBoolean("bootstrap.mlockall", false), settings.getAsBoolean("bootstrap.seccomp", true), settings.getAsBoolean("bootstrap.ctrlhandler", true));
    // initialize probes before the security manager is installed
    initializeProbes();
    if (addShutdownHook) {
        Runtime.getRuntime().addShutdownHook(new Thread() {

            @Override
            public void run() {
                if (node != null) {
                    node.close();
                }
            }
        });
    }
    // look for jar hell
    JarHell.checkJarHell();
    // We do not need to reload system properties here as we have already applied them in building the settings and
    // reloading could cause multiple prompts to the user for values if a system property was specified with a prompt
    // placeholder
    Settings nodeSettings = Settings.settingsBuilder().put(settings).put(CrateSettingsPreparer.IGNORE_SYSTEM_PROPERTIES_SETTING, true).build();
    Environment crateEnvironment = CrateSettingsPreparer.prepareEnvironment(nodeSettings, null);
    /**
         * DISABLED setup of security manager due to policy problems with plugins (e.g. SigarPlugin will not work)
         */
    // install SM after natives, shutdown hooks, etc.
    //setupSecurity(settings, crateEnvironment);
    node = new CrateNode(crateEnvironment);
}
Also used : CrateNode(io.crate.node.CrateNode) Environment(org.elasticsearch.env.Environment) Settings(org.elasticsearch.common.settings.Settings)

Aggregations

CrateNode (io.crate.node.CrateNode)1 Settings (org.elasticsearch.common.settings.Settings)1 Environment (org.elasticsearch.env.Environment)1