Logstash on Centos 6 with non-default java


We have an old Centos 6 server where java 1.7 is crucial and we can't update it to java 1.8 so we are using alternatives. Configure alternative with logstash is quite difficult ( at least for me)

Problem is that I can start my logstash from CLI:

JAVA_HOME=/usr/java/jdk1.8.0_252-x86_64/jre /usr/share/logstash/bin/logstash -e 'input { stdin { } } output { stdout {} }' --path.settings=/etc/logstash

but I can't manage my logstash via initctl

startup configuration looks:

/etc/init/logstash.conf after /usr/share/logstash/bin/system-install:
exec chroot --userspec logstash:logstash / /usr/share/logstash/bin/logstash >> /var/log/logstash-stdout.log 2>> /var/log/logstash-stderr.log


Exception in thread "main" java.lang.UnsupportedClassVersionError: org/logstash/Logstash : Unsupported major.minor version 52.0


Looks tricky but i think you can do it by simply creating a systemd service with exec params mannually ?

Looks like he is not detecting java8 here, logstash will need access to a java-8 binary somehow.

Are you forced to use initctl ?

I am not forced to use initctl

It's just not very easy to configure systemd service. I put this command near exec, but still getting error with Java version

exec=JAVA_HOME=/usr/java/jdk1.8.0_252-x86_64/jre /usr/share/logstash/bin/logstash -e 'input { stdin { } } output { stdout {} }' --path.settings=/etc/logstash

ok, I miseed quotes

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.