Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker image 2.5.0-1 ignoring environment variable GRAYLOG_SERVER_JAVA_OPTS #50

Closed
bksts opened this issue Dec 20, 2018 · 4 comments
Closed
Labels

Comments

@bksts
Copy link

bksts commented Dec 20, 2018

If upgrading from version 2.4.6-1 to 2.5.0-1, the evnironmental variable GRAYLOG_SERVER_JAVA_OPTS is disregarded, not used.

Output for 2.4.6-1, env variable GRAYLOG_SERVER_JAVA_OPTS is used

user@graylog-node-2: docker run -it -e GRAYLOG_SERVER_JAVA_OPTS="-Xms8G -Xmx8G -Djavax.net.ssl.trustStore=/usr/share/graylog/extern-data/security/cacerts.jks" graylog/graylog:2.4.6-1
2018-12-20 11:42:07,457 INFO : org.graylog2.bootstrap.CmdLineTool - Loaded plugin: AWS plugins 2.4.6 [org.graylog.aws.plugin.AWSPlugin]
2018-12-20 11:42:07,460 INFO : org.graylog2.bootstrap.CmdLineTool - Loaded plugin: Elastic Beats Input 2.4.6 [org.graylog.plugins.beats.BeatsInputPlugin]
2018-12-20 11:42:07,461 INFO : org.graylog2.bootstrap.CmdLineTool - Loaded plugin: CEF Input 2.4.6 [org.graylog.plugins.cef.CEFInputPlugin]
2018-12-20 11:42:07,462 INFO : org.graylog2.bootstrap.CmdLineTool - Loaded plugin: Collector 2.4.6 [org.graylog.plugins.collector.CollectorPlugin]
2018-12-20 11:42:07,463 INFO : org.graylog2.bootstrap.CmdLineTool - Loaded plugin: Enterprise Integration Plugin 2.4.6 [org.graylog.plugins.enterprise_integration.EnterpriseIntegrationPlugin]
2018-12-20 11:42:07,464 INFO : org.graylog2.bootstrap.CmdLineTool - Loaded plugin: MapWidgetPlugin 2.4.6 [org.graylog.plugins.map.MapWidgetPlugin]
2018-12-20 11:42:07,465 INFO : org.graylog2.bootstrap.CmdLineTool - Loaded plugin: NetFlow Plugin 2.4.6 [org.graylog.plugins.netflow.NetFlowPlugin]
2018-12-20 11:42:07,472 INFO : org.graylog2.bootstrap.CmdLineTool - Loaded plugin: Pipeline Processor Plugin 2.4.6 [org.graylog.plugins.pipelineprocessor.ProcessorPlugin]
2018-12-20 11:42:07,473 INFO : org.graylog2.bootstrap.CmdLineTool - Loaded plugin: Threat Intelligence Plugin 2.4.6 [org.graylog.plugins.threatintel.ThreatIntelPlugin]
===> 2018-12-20 11:42:07,725 INFO : org.graylog2.bootstrap.CmdLineTool - Running with JVM arguments: -Xms8G -Xmx8G -Djavax.net.ssl.trustStore=/usr/share/graylog/extern-data/security/cacerts.jks -Dlog4j.configurationFile=/usr/share/graylog/data/config/log4j2.xml -Djava.library.path=/usr/share/graylog/lib/sigar/ -Dgraylog2.installation_source=docker
2018-12-20 11:42:07,957 INFO : org.hibernate.validator.internal.util.Version - HV000001: Hibernate Validator 5.1.3.Final
2018-12-20 11:42:09,945 INFO : org.graylog2.shared.buffers.InputBufferImpl - Message journal is enabled.
<....>

Output for 2.5.0-1, env variable GRAYLOG_SERVER_JAVA_OPTS is not used

user@graylog-node-2: docker run -it -e GRAYLOG_SERVER_JAVA_OPTS="-Xms8G -Xmx8G -Djavax.net.ssl.trustStore=/usr/share/graylog/extern-data/security/cacerts.jks" graylog/graylog:2.5.0-1
2018-12-20 11:49:27,291 INFO : org.graylog2.bootstrap.CmdLineTool - Loaded plugin: AWS plugins 2.5.0 [org.graylog.aws.plugin.AWSPlugin]
2018-12-20 11:49:27,293 INFO : org.graylog2.bootstrap.CmdLineTool - Loaded plugin: Elastic Beats Input 2.5.0 [org.graylog.plugins.beats.BeatsInputPlugin]
2018-12-20 11:49:27,293 INFO : org.graylog2.bootstrap.CmdLineTool - Loaded plugin: CEF Input 2.5.0 [org.graylog.plugins.cef.CEFInputPlugin]
2018-12-20 11:49:27,294 INFO : org.graylog2.bootstrap.CmdLineTool - Loaded plugin: Collector 2.5.0 [org.graylog.plugins.collector.CollectorPlugin]
2018-12-20 11:49:27,295 INFO : org.graylog2.bootstrap.CmdLineTool - Loaded plugin: Enterprise Integration Plugin 2.5.0 [org.graylog.plugins.enterprise_integration.EnterpriseIntegrationPlugin]
2018-12-20 11:49:27,295 INFO : org.graylog2.bootstrap.CmdLineTool - Loaded plugin: MapWidgetPlugin 2.5.0 [org.graylog.plugins.map.MapWidgetPlugin]
2018-12-20 11:49:27,296 INFO : org.graylog2.bootstrap.CmdLineTool - Loaded plugin: NetFlow Plugin 2.5.0 [org.graylog.plugins.netflow.NetFlowPlugin]
2018-12-20 11:49:27,302 INFO : org.graylog2.bootstrap.CmdLineTool - Loaded plugin: Pipeline Processor Plugin 2.5.0 [org.graylog.plugins.pipelineprocessor.ProcessorPlugin]
2018-12-20 11:49:27,302 INFO : org.graylog2.bootstrap.CmdLineTool - Loaded plugin: Threat Intelligence Plugin 2.5.0 [org.graylog.plugins.threatintel.ThreatIntelPlugin]
===> 2018-12-20 11:49:27,584 INFO : org.graylog2.bootstrap.CmdLineTool - Running with JVM arguments: -XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap -XX:NewRatio=1 -XX:MaxMetaspaceSize=256m -XX:+ResizeTLAB -XX:+UseConcMarkSweepGC -XX:+CMSConcurrentMTEnabled -XX:+CMSClassUnloadingEnabled -XX:+UseParNewGC -XX:-OmitStackTraceInFastThrow -Dlog4j.configurationFile=/usr/share/graylog/data/config/log4j2.xml -Djava.library.path=/usr/share/graylog/lib/sigar/ -Dgraylog2.installation_source=docker
2018-12-20 11:49:27,762 INFO : org.hibernate.validator.internal.util.Version - HV000001: Hibernate Validator 5.1.3.Final
2018-12-20 11:49:29,773 INFO : org.graylog2.shared.buffers.InputBufferImpl - Message journal is enabled.
<....>
@elcamlost
Copy link

elcamlost commented Dec 21, 2018

Startup script redefines variable when initializing bash for graylog user. I workarounded this behavior by mounting another file in /etc/profile.d/zzzz-graylog.sh with this content.

export GRAYLOG_SERVER_JAVA_OPTS="$GRAYLOG_SERVER_JAVA_OPTS -Xms8G -Xmx8G -Djavax.net.ssl.trustStore=/usr/share/graylog/extern-data/security/cacerts.jks"

and then

docker run -it -v zzzz-graylog.sh:/etc/profile.d/zzzz-graylog.sh graylog/graylog:2.5

@bodsch
Copy link
Collaborator

bodsch commented Dec 21, 2018

Yes, i see the problem.
I will work for an fix immediately.

@jalogisch jalogisch added the bug label Dec 22, 2018
@bodsch
Copy link
Collaborator

bodsch commented Dec 22, 2018

This problem exists also in the 2.4 branch.
I define here default values for GRAYLOG_SERVER_JAVA_OPTS
My (coming) fix should merge the default values with the settings over the environment by simple adding the env values at the end of the parameter string.
But I don't know if that's enough already!
I might have to sort out duplicate variables here.

@bodsch
Copy link
Collaborator

bodsch commented Dec 22, 2018

With this environment overwrite my graylog instance died without any message:
GRAYLOG_SERVER_JAVA_OPTS=-Xms2G -Xmx4G
With GRAYLOG_SERVER_JAVA_OPTS=-Xmx4G not.
I'm confused

jalogisch pushed a commit that referenced this issue Dec 24, 2018
This fix should fix the ignoring of the GRAYLOG_SERVER_JAVA_OPTS environment variable

FIX #50
jalogisch added a commit that referenced this issue Dec 24, 2018
This fix should fix the ignoring of the GRAYLOG_SERVER_JAVA_OPTS environment variable

FIX #50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants