Logstash 启动报错

 使用 journalctl  -xe | grep logstash  命令查看日志如下

Sep 13 16:37:23 am02 logstash[298460]: could not find java; set JAVA_HOME or ensure java is in PATH
Sep 13 16:37:23 am02 systemd[1]: logstash.service: main process exited, code=exited, status=1/FAILURE
Sep 13 16:37:23 am02 systemd[1]: Unit logstash.service entered failed state.
Sep 13 16:37:23 am02 systemd[1]: logstash.service failed.
Sep 13 16:37:23 am02 systemd[1]: logstash.service holdoff time over, scheduling restart.
Sep 13 16:37:23 am02 systemd[1]: start request repeated too quickly for logstash.service
Sep 13 16:37:23 am02 systemd[1]: Failed to start logstash.

我们看第一行内容,could not find java; set JAVA_HOME or ensure java is in PATH

使用echo $JAVA_HOME 查看是有值的. JAVA 的环境变量配置没有问题.

我们进入到/usr/share/logstash/bin 查看logstash.lib.sh 文件.

Logstash 启动报错_第1张图片

加上如上这段

   JAVA_HOME=/usr/java/jdk1.8.0_181

再次启动logstash ,恢复正常.

systemctl   start logstsh 

 

 

 

你可能感兴趣的:(Elasticsearch,学习笔记)