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

Adding option to include additional java_opts #52

Merged
merged 1 commit into from
Nov 4, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,10 @@ Sets the initial Java heap size (-Xms) for Graylog. Defaults to `1g`.

Sets the maximum Java heap size (-Xmx) for Graylog. Defaults to `1g`.

##### `java_opts`

Additional java options for Graylog. Defaults to ``.

##### `restart_on_package_upgrade`

This setting restarts the `graylog-server` service if the os package is upgraded.
Expand Down
1 change: 1 addition & 0 deletions manifests/allinone.pp
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,6 @@
config => $graylog['config'],
java_initial_heap_size => $graylog['java_initial_heap_size'],
java_max_heap_size => $graylog['java_max_heap_size'],
java_opts => $graylog['java_opts'],
}
}
1 change: 1 addition & 0 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,5 @@

$java_initial_heap_size = '1g'
$java_max_heap_size = '1g'
$java_opts = ''
}
7 changes: 5 additions & 2 deletions manifests/server.pp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
$enable = true,
$java_initial_heap_size = $graylog::params::java_initial_heap_size,
$java_max_heap_size = $graylog::params::java_max_heap_size,
$java_opts = $graylog::params::java_opts,
Boolean $restart_on_package_upgrade = false,
) inherits graylog::params {
if $config == undef {
Expand Down Expand Up @@ -61,7 +62,8 @@
content => epp("${module_name}/server/environment.epp",
{
'java_initial_heap_size' => $java_initial_heap_size,
'java_max_heap_size' => $java_max_heap_size
'java_max_heap_size' => $java_max_heap_size,
'java_opts' => $java_opts
}),
}
}
Expand All @@ -74,7 +76,8 @@
content => epp("${module_name}/server/environment.epp",
{
'java_initial_heap_size' => $java_initial_heap_size,
'java_max_heap_size' => $java_max_heap_size
'java_max_heap_size' => $java_max_heap_size,
'java_opts' => $java_opts
}),
}
}
Expand Down
5 changes: 4 additions & 1 deletion templates/server/environment.epp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<%- | String $java_initial_heap_size = '1g', String $java_max_heap_size = '1g' | -%>
<%- | String $java_initial_heap_size = '1g', String $java_max_heap_size = '1g', String $java_opts = "" | -%>
# Path to the java executable.
JAVA=/usr/bin/java

Expand All @@ -8,6 +8,9 @@ GRAYLOG_SERVER_JAVA_OPTS="-Xms<%= $java_initial_heap_size %> -Xmx<%= $java_max_h
# Avoid endless loop with some TLSv1.3 implementations.
GRAYLOG_SERVER_JAVA_OPTS="$GRAYLOG_SERVER_JAVA_OPTS -Djdk.tls.acknowledgeCloseNotify=true"

# Additional java opts
GRAYLOG_SERVER_JAVA_OPTS="$GRAYLOG_SERVER_JAVA_OPTS <%= $java_opts %>"

# Pass some extra args to graylog-server. (i.e. "-d" to enable debug mode)
GRAYLOG_SERVER_ARGS=""

Expand Down
1 change: 1 addition & 0 deletions tests/vagrant.pp
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,6 @@
},
java_initial_heap_size => '2g',
java_max_heap_size => '2g',
java_opts => '-Dcom.sun.management.jmxremote',
}
}