无法在Ubuntu 16.04中将Elasticsearch作为服务启动
我最近将计算机从Ubuntu升级14.04
到16.04
。我面临使用elasticsearch
服务即服务的问题。我安装 elasticsearch
使用:
sudo apt-get install elasticsearch
现在sudo service elasticsearch status
命令显示了这个结果:
elasticsearch.service - LSB: Starts elasticsearch Loaded: loaded (/etc/init.d/elasticsearch; bad; vendor preset: enabled)
Active: active (exited) since Sat 2016-07-30 18:28:13 BDT; 1h 19min ago
Docs: man:systemd-sysv-generator(8)
Main PID: 7988 (code=exited, status=1/FAILURE)
CGroup: /system.slice/elasticsearch.service
Jul 30 18:28:13 dimik elasticsearch[10266]: [warning] /etc/init.d/elasticsearch: No java runtime was found
Jul 30 18:28:13 dimik systemd[1]: Started LSB: Starts elasticsearch.
Jul 30 18:28:46 dimik systemd[1]: Started LSB: Starts elasticsearch.
Jul 30 18:35:30 dimik systemd[1]: Started LSB: Starts elasticsearch.
Jul 30 19:04:36 dimik systemd[1]: Started A search engine.
Jul 30 19:07:48 dimik systemd[1]: Started A search engine.
Jul 30 19:27:01 dimik systemd[1]: Started A search engine.
Jul 30 19:27:51 dimik systemd[1]: Started A search engine.
Jul 30 19:28:54 dimik systemd[1]: Started A search engine.
Jul 30 19:29:18 dimik systemd[1]: Started LSB: Starts elasticsearch.
尽管我的机器上安装了Java,但是我可以使用此命令启动服务器。
sudo /usr/share/elasticsearch/bin/elasticsearch
我有点卡在这里。任何帮助将不胜感激。
设置后JAVA_HOME
根的错误:
elasticsearch.service - LSB: Starts elasticsearch Loaded: loaded (/etc/init.d/elasticsearch; bad; vendor preset: enabled)
Active: active (exited) since Sat 2016-07-30 18:28:13 BDT; 3h 32min ago
Docs: man:systemd-sysv-generator(8)
Main PID: 7988 (code=exited, status=1/FAILURE)
CGroup: /system.slice/elasticsearch.service
Jul 30 18:35:30 dimik systemd[1]: Started LSB: Starts elasticsearch.
Jul 30 19:04:36 dimik systemd[1]: Started A search engine.
Jul 30 19:07:48 dimik systemd[1]: Started A search engine.
Jul 30 19:27:01 dimik systemd[1]: Started A search engine.
Jul 30 19:27:51 dimik systemd[1]: Started A search engine.
Jul 30 19:28:54 dimik systemd[1]: Started A search engine.
Jul 30 19:29:18 dimik systemd[1]: Started LSB: Starts elasticsearch.
Jul 30 20:02:07 dimik systemd[1]: Started LSB: Starts elasticsearch.
Jul 30 20:20:21 dimik systemd[1]: Started LSB: Starts elasticsearch.
Jul 30 21:59:21 dimik systemd[1]: Started LSB: Starts elasticsearch.
回答:
我找到了解决此问题的方法。解决方案来自该讨论线程- 无法在Elastic网站上使用Ubuntu
16.04启动Elasticsearch。
似乎要让Elasticsearch运行,
16.04
您必须START_DAEMON
将true 设置为true
/etc/default/elasticsearch
。默认情况下,它会被注释掉,并且取消注释会使Elasticsearch再次正常启动。一定要使用
systemctl
restart,而不是仅仅
start
因为服务是正确安装后启动,而且显然有一些socket/pidfile/something
是systemd
保持必须能够再次启动该服务之前发布。
以上是 无法在Ubuntu 16.04中将Elasticsearch作为服务启动 的全部内容, 来源链接: utcz.com/qa/422517.html