停止Elasticsearch中的节点间通信(无需使用防火墙来阻止端口)

时间:2019-03-25 05:38:23

标签: elasticsearch netty

我希望停止elasticsearch中的节点间通信,基本上是停止侦听端口9300。 应该在不使用防火墙阻止任何端口的情况下实现以上目的。

我尝试关闭服务器引导程序中的网络通道,如果这样做,elasticsearch将不会启动。

当我运行elasticsearch实例时,它不应收听9300,

但是我遇到了错误,  [2019-03-25T10:46:16,344] [WARN] [o.e.b.ElasticsearchUncaughtExceptionHandler] [node-0]线程[main]中未捕获的异常 [elasticsearch] org.elasticsearch.bootstrap.StartupException:java.lang.IllegalStateException:未设置处理程序 [elasticsearch],位于org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:163)〜[elasticsearch-7.0.0-SNAPSHOT.jar:7.0.0-SNAPSHOT] [elasticsearch],位于org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:150)〜[elasticsearch-7.0.0-SNAPSHOT.jar:7.0.0-SNAPSHOT] [elasticsearch]位于org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:86)〜[elasticsearch-7.0.0-SNAPSHOT.jar:7.0.0-SNAPSHOT] org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:124)上的[elasticsearch]〜[elasticsearch-cli-7.0.0-SNAPSHOT.jar:7.0.0-SNAPSHOT] [elasticsearch]位于org.elasticsearch.cli.Command.main(Command.java:90)〜[elasticsearch-cli-7.0.0-SNAPSHOT.jar:7.0.0-SNAPSHOT] [elasticsearch]位于org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:115)〜[elasticsearch-7.0.0-SNAPSHOT.jar:7.0.0-SNAPSHOT] [elasticsearch],位于org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:92)〜[elasticsearch-7.0.0-SNAPSHOT.jar:7.0.0-SNAPSHOT] [elasticsearch]原因:java.lang.IllegalStateException:未设置处理程序 [elasticsearch]位于io.netty.bootstrap.Bootstrap.validate(Bootstrap.java:284)〜[?:?] [elasticsearch]位于io.netty.bootstrap.Bootstrap.connect(Bootstrap.java:113)〜[?:?] [elasticsearch],位于org.elasticsearch.transport.netty4.Netty4Transport.createClientBootstrap(Netty4Transport.java:189)〜[?:?] [elasticsearch]在org.elasticsearch.transport.netty4.Netty4Transport.doStart(Netty4Transport.java:149)〜[?:?] [elasticsearch] at org.elasticsearch.common.component.AbstractLifecycleComponent.start(AbstractLifecycleComponent.java:61)〜[elasticsearch-7.0.0-SNAPSHOT.jar:7.0.0-SNAPSHOT] org.elasticsearch.transport.TransportService.doStart(TransportService.java:228)上的[elasticsearch]〜[elasticsearch-7.0.0-SNAPSHOT.jar:7.0.0-SNAPSHOT] [elasticsearch] at org.elasticsearch.common.component.AbstractLifecycleComponent.start(AbstractLifecycleComponent.java:61)〜[elasticsearch-7.0.0-SNAPSHOT.jar:7.0.0-SNAPSHOT] [elasticsearch]位于org.elasticsearch.node.Node.start(Node.java:661)〜[elasticsearch-7.0.0-SNAPSHOT.jar:7.0.0-SNAPSHOT] [elasticsearch]位于org.elasticsearch.bootstrap.Bootstrap.start(Bootstrap.java:263)〜[elasticsearch-7.0.0-SNAPSHOT.jar:7.0.0-SNAPSHOT] [elasticsearch]位于org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:334)〜[elasticsearch-7.0.0-SNAPSHOT.jar:7.0.0-SNAPSHOT] [elasticsearch]在org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:159)〜[elasticsearch-7.0.0-SNAPSHOT.jar:7.0.0-SNAPSHOT]

2 个答案:

答案 0 :(得分:0)

为什么不尝试单节点发现? 单节点(通过将discovery.type设置为single-node进行配置);在这种情况下,节点将选举自己为主节点,并且不会与任何其他节点一起加入群集。这是更干净的方法

此外,有可能规避引导检查(通过不将传输绑定到外部接口,或通过将传输绑定到外部接口并将发现类型设置为单节点)

答案 1 :(得分:0)

将node.name设置为0.0.0.0/0以外的其他值