Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Specifying JMX parameters in LS_JAVA_OPTS causes Logstash not to restart properly #4319
We added LS_JAVA_OPTS here. When using the RPM, there are multiple places you can specify LS_JAVA_OPTS, eg. in the /etc/sysconfig/logstash and /etc/init.d/logstash files. But it looks like the /etc/init.d/logstash is the right place to specify it.
Here is an example when seeing up a JMX connection, if you specify it in /etc/sysconfig/logstash file, this causes issues when using /etc/init.d/logstash restart - it will eventually end up launching multiple RMI servers and fail with a bind exception, eg.
So I moved the LS_JAVA_OPTS settings for the JMX connection from /etc/sysconfig/logstash to /etc/init.d/logstash. After that, I am no longer able to reproduce the restart issue.
Not sure if this is a bug. If not, it will be nice to document this better in our guide (and as a comment within the sysconfig file, etc..).
They absolutely should go in /etc/sysconfig/logstash for RedHat variants, or /etc/default/logstash for Debian/Ubuntu variants. I'm not sure why it's failing for JMX in sysconfig, but we ought to fix that and verify the same isn't happening with Debian variants in /etc/default/logstash.
That said, using JMX to monitor Logstash leaves a bad taste in my mouth. It's going to give broad and potentially meaningless metrics. Sure, you can see how much heap you're using, but with Logstash that's really only useful if there's a memory leak. I don't even know if GC is instrumented in JMX, and if so, if it's even a valuable thing with Logstash. I hope we can get useful metrics out soon.