gpt4 book ai didi

linux - 如何在 linux 机器上以 root 用户身份运行 Elasticsearch 5.2.1

转载 作者:可可西里 更新时间:2023-11-01 11:52:01 25 4
gpt4 key购买 nike

我正在尝试在我的 linux 机器上运行 Elasticsearch 5.2.1,我是它的根用户。

当我尝试执行 Elasticsearch 时。我收到以下错误,

[2017-03-15T03:26:18,976][WARN ][o.e.b.ElasticsearchUncaughtExceptionHandler] [elk_data1] uncaught exception in thread [main]
org.elasticsearch.bootstrap.StartupException: java.lang.RuntimeException: can not run elasticsearch as root
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:125) ~[elasticsearch-5.2.1.jar:5.2.1]
at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:112) ~[elasticsearch-5.2.1.jar:5.2.1]
at org.elasticsearch.cli.SettingCommand.execute(SettingCommand.java:54) ~[elasticsearch-5.2.1.jar:5.2.1]
at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:122) ~[elasticsearch-5.2.1.jar:5.2.1]
at org.elasticsearch.cli.Command.main(Command.java:88) ~[elasticsearch-5.2.1.jar:5.2.1]
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:89) ~[elasticsearch-5.2.1.jar:5.2.1]
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:82) ~[elasticsearch-5.2.1.jar:5.2.1]
Caused by: java.lang.RuntimeException: can not run elasticsearch as root
at org.elasticsearch.bootstrap.Bootstrap.initializeNatives(Bootstrap.java:105) ~[elasticsearch-5.2.1.jar:5.2.1]
at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:203) ~[elasticsearch-5.2.1.jar:5.2.1]
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:333) ~[elasticsearch-5.2.1.jar:5.2.1]
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:121) ~[elasticsearch-5.2.1.jar:5.2.1]
... 6 more

我也尝试过这种方式 bin/elasticsearch -Des.insecure.allow.root=true 但没有成功。

提前致谢

最佳答案

实际上,从 Elasticsearch 5.0 开始,以 root 身份运行的可能性已被删除,如 issue 中所述和 here .

如果你真的想以 root 身份运行(我想你知道这不是最好的主意),我建议你从 github 查看源代码,然后修改 specific line ,然后重建整个项目。

关于linux - 如何在 linux 机器上以 root 用户身份运行 Elasticsearch 5.2.1,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42807114/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com