Logstash container cant read jvm.options correctly

here is my dockerfile:

FROM docker.elastic.co/logstash/logstash:6.2.1

SHELL ["/bin/bash", "-c"]

COPY ./jvm.options /etc/logstash/jvm.options

Copied my jvm options right from https://github.com/elastic/logstash/blob/master/config/jvm.options

First thing I get is Invalid initial heap size: -Xms1g and my docker service is allocated 2.5 gigs, so should have enough.

THen I comment out the memory settings and get a new error:
'nrecognized VM option 'UseParNewGC
Did you mean '(+/-)UseParNewGC'?

Is this even supposed to work? Your docs are broken too: https://www.elastic.co/guide/en/logstash/current/_configuring_logstash_for_docker.html

What does "java -version" produce?

Inside the container?
If i add RUN java -version I see this:

openjdk version "1.8.0_161"

OpenJDK Runtime Environment (build 1.8.0_161-b14)

OpenJDK 64-Bit Server VM (build 25.161-b14, mixed mode)

The jvm.options assume a HotSpot JVM. They will not work as-is for OpenJDK (or J9 or any other JVM). So for example, HotSpot allows a heap size of 2g, whereas OpenJDK appears to expect 2048m instead.

You would have to go through the man page for the JVM to work out the equivalent of the HotSpot options you are setting.

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