【发布时间】:2018-06-30 23:51:08
【问题描述】:
我在运行 Ubuntu 16.04 LTS 的 ARM Odroid XU4 上安装了 ELasticsearch 6 和 JDK 1.8.0_161。没有错误。
当我尝试将 Elasticsearch 作为服务启动时,我无法连接到端口 9200 上的 localhost 并且服务状态打印:
~ $ > sudo service elasticsearch status
● elasticsearch.service - LSB: Starts elasticsearch
Loaded: loaded (/etc/init.d/elasticsearch; bad; vendor preset: enabled)
Active: active (exited) since Mon 2018-01-22 10:43:18 UTC; 9min ago
Docs: man:systemd-sysv-generator(8)
Jan 22 10:43:18 lego systemd[1]: Starting LSB: Starts elasticsearch...
Jan 22 10:43:18 lego systemd[1]: Started LSB: Starts elasticsearch.
Jan 22 10:44:07 lego systemd[1]: Started LSB: Starts elasticsearch.
没有日志。不知道在哪里看。在/etc/security/limits.conf 中,nofile 限制设置为 65536。我不知道还能去哪里寻找诊断工具。
虽然,当我通过 sudo /usr/shared/elasticsearch/bin/elasticsearch 手动启动 Elasticsearch 时,它按预期工作:
~ $ > sudo /usr/share/elasticsearch/bin/elasticsearch
[2018-01-22 10:55:55,944][WARN ][bootstrap ] jvm uses the client vm, make sure to run `java` with the server vm for best performance by adding `-server` to the command line
[2018-01-22 10:55:56,073][INFO ][node ] [Ariel] version[1.7.3], pid[1126], build[NA/NA]
[2018-01-22 10:55:56,074][INFO ][node ] [Ariel] initializing ...
[2018-01-22 10:55:56,521][INFO ][plugins ] [Ariel] loaded [], sites []
[2018-01-22 10:55:56,638][INFO ][env ] [Ariel] using [1] data paths, mounts [[/ (/dev/mmcblk0p2)]], net usable_space
[54.4gb], net total_space [57.2gb], types [ext4]
[2018-01-22 10:56:01,853][INFO ][node ] [Ariel] initialized
[2018-01-22 10:56:01,854][INFO ][node ] [Ariel] starting ...
[2018-01-22 10:56:02,080][INFO ][transport ] [Ariel] bound_address {inet[/0:0:0:0:0:0:0:0:9300]}, publish_address {inet[/192.168.0.103:9300]}
[2018-01-22 10:56:02,125][INFO ][discovery ] [Ariel] elasticsearch/FtFOljAORnevIAOAFabptg
[2018-01-22 10:56:05,933][INFO ][cluster.service ] [Ariel] new_master [Ariel][FtFOljAORnevIAOAFabptg][lego]
[inet[/192.168.0.103:9300]], reason: zen-disco-join (elected_as_master)
[2018-01-22 10:56:05,987][INFO ][http ] [Ariel] bound_address {inet[/0:0:0:0:0:0:0:0:9200]}, publish_address {inet[/192.168.0.103:9200]}
[2018-01-22 10:56:05,988][INFO ][node ] [Ariel] started
[2018-01-22 10:56:06,014][INFO ][gateway ] [Ariel]
recovered [0] indices into cluster_state
我错过了什么重要的步骤?我在这里关注了所有内容:https://www.elastic.co/guide/en/elasticsearch/reference/current/deb.html
编辑:我尝试在/etc/default/elasticsearch 中设置START_DAEMON=true,这确实很重要,但这也没有奏效。深入研究/etc/default/elasticsearch 中设置的值,我发现了我的问题。请参阅我的最终答案,了解整个解决方案的完整细分。
【问题讨论】:
标签: ubuntu elasticsearch