elasticsearch 启动

启动类:Bootstrap

INSTANCE.setup(true, settings, environment); INSTANCE.start();

启动start
private void start() { node.start(); keepAliveThread.start(); }

Node
对每个node轮询启动,如果它是一个lifecycleComponent,则调用start方法。
for (Class plugin : pluginsService.nodeServices()) { injector.getInstance(plugin).start(); }

【elasticsearch 启动】AbstractLifeCycleComponent
@SuppressWarnings({"unchecked"}) @Override public T start() { if (!lifecycle.canMoveToStarted()) { return (T) this; } for (LifecycleListener listener : listeners) { listener.beforeStart(); } doStart(); lifecycle.moveToStarted(); for (LifecycleListener listener : listeners) { listener.afterStart(); } return (T) this; }protected abstract void doStart();

    推荐阅读