按照下文设置es开机自启之后, https://blog.csdn.net/jiankunking/article/details/84374354
使用
systemctl status elasticsearch
启动失败,查看服务状态,报出以下错误:
[root@jiankunking logs]# systemctl status elasticsearch
● elasticsearch.service - elasticsearch
Loaded: loaded (/etc/systemd/system/elasticsearch.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Mon 2019-02-11 09:11:34 CST; 3min 49s ago
Process: 16665 ExecStart=/home/es/elasticsearch/bin/elasticsearch (code=exited, status=1/FAILURE)
Main PID: 16665 (code=exited, status=1/FAILURE)
Feb 11 09:11:34 cargo systemd[1]: Started elasticsearch.
Feb 11 09:11:34 cargo systemd[1]: Starting elasticsearch...
Feb 11 09:11:34 cargo elasticsearch[16665]: which: no java in (/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin)
Feb 11 09:11:34 cargo systemd[1]: elasticsearch.service: main process exited, code=exited, status=1/FAILURE
Feb 11 09:11:34 cargo systemd[1]: Unit elasticsearch.service entered failed state.
Feb 11 09:11:34 cargo systemd[1]: elasticsearch.service failed.
解决方法: 查看java安装位置
[root@jiankunking logs]# which java
/usr/local/java/jdk1.8.0_121/bin/java
建立软连接
ln -s /usr/local/java/jdk1.8.0_121/bin/java /usr/bin/java
搞定 个人微信公众号:
作者:jiankunking 出处:http://blog.csdn.net/jiankunking