欢迎光临
我们一直在努力

logstash7.x版本启动时找不到系统默认java

因项目需要,在openEuler系统环境中部署logstash等服务,启动时报错:

Sep 29 14:32:06 localhost logstash[22492]: Using bundled JDK: /home/test/logstash-7.xx.x/jdk
Sep 29 14:32:06 localhost logstash[22501]: /home/test/logstash-7.xx.x/bin/logstash.lib.sh: line 141: /home/test/logstash-7.xx.x/jdk/bin/java: cannot execute binary file: Exec format error
Sep 29 14:32:06 localhost logstash[22501]: /home/test/logstash-7.xx.x/bin/logstash.lib.sh: line 141: /home/test/logstash-7.xx.x/jdk/bin/java: Success
Sep 29 14:32:06 localhost logstash[22492]: /home/test/logstash-7.xx.x/bin/logstash: line 60: /home/test/logstash-7.xx.x/jdk/bin/java: cannot execute binary file: Exec format error
Sep 29 14:32:06 localhost logstash[22492]: /home/test/logstash-7.xx.x/bin/logstash: line 60: /home/test/logstash-7.xx.x/jdk/bin/java: Success

解决办法

编辑bin/logstash文件,在开头添加如下内容即可。

JAVA_CMD=`readlink /etc/alternatives/java |sed -r 's#java$##g'`
JAVA_HOME=`readlink /etc/alternatives/java |sed -r 's#bin/java$##g'`

文章来源于互联网:logstash7.x版本启动时找不到系统默认java

赞(0)
未经允许不得转载:莱卡云 » logstash7.x版本启动时找不到系统默认java