Backport PR #14738 to 7.17: [Doc] Document the usage of LS_JAVA_OPTS environment variable #14750

* [Doc] Document the usage of LS_JAVA_OPTS environment variable

Co-authored-by: Rob Bavey <rob.bavey@elastic.co>
(cherry picked from commit 9242105c3c)

Co-authored-by: Andrea Selva <selva.andre@gmail.com>
This commit is contained in:
github-actions[bot] 2022-11-15 09:45:09 +01:00 committed by GitHub
parent 810e005aab
commit a6db1b0db5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,7 +1,8 @@
[[jvm-settings]]
=== JVM settings
Configure the jvm settings in the `jvm.options` <<settings-files,settings file>>.
Configure JVM settings in the `jvm.options` <<settings-files,settings file>>. JVM settings can also be set via the <<ls-java-opts, `LS_JAVA_OPTS`>> environment variable.
This file contains a line-delimited list of JVM arguments following a special syntax:
* lines consisting of whitespace only are ignored
@ -100,6 +101,18 @@ java -XX:+PrintFlagsFinal -version | grep ThreadStackSize
Depending on the default stack size, start by multiplying by 4x, then 8x, and
then 16x until the overflow error resolves.
[[ls-java-opts]]
==== Using `LS_JAVA_OPTS`
The `LS_JAVA_OPTS` environment variable can also be used to override JVM settings in the `jvm.options` file <<settings-files,settings file>>.
The content of this variable is additive to options configured in the `jvm.options` file, and will override any settings that exist in both places.
For example to set a different locale to launch {ls} instance:
[source,sh]
-----
LS_JAVA_OPTS="-Duser.country=DE -Duser.language=de" bin/logstash -e 'input { stdin { codec => json } }'
-----