Skip to content

Commit

Permalink
Update documentation around JVM usage to reflect changes (#13350)
Browse files Browse the repository at this point in the history
* Update documentation around JVM usage to reflect changes

For Logstash `8.0`, java 8 will no longer be supported, and the documentation should
reflect that.

Update troubleshooting documentation - changes made in #13349 should remove the warnings
at startup for fresh installs of Logstash, but upgrading may still have the same issues.

Co-authored-by: João Duarte <jsvd@users.noreply.github.com>
Co-authored-by: Karen Metts <35154725+karenzone@users.noreply.github.com>
  • Loading branch information
3 people authored Oct 26, 2021
1 parent dd2245c commit 15be7a9
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 24 deletions.
25 changes: 11 additions & 14 deletions docs/static/jvm.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@

{ls} requires one of these versions:

* Java 8
* Java 11
* Java 15 (see <<jdk15-upgrade>> for settings info)
* Java 17 (see <<jdk17-upgrade>> for settings info)

Use the
http://www.oracle.com/technetwork/java/javase/downloads/index.html[official
Expand All @@ -19,8 +18,8 @@ for the official word on supported versions across releases.
[NOTE]
=====
{ls} offers architecture-specific
https://staging-website.elastic.co/downloads/logstash[downloads] that include
AdoptOpenJDK 11, the latest long term support (LTS) release of JDK.
https://www.elastic.co/downloads/logstash[downloads] that include
Adoptium Eclipse Temurin 17, the latest long term support (LTS) release of the JDK.
Use the LS_JAVA_HOME environment variable if you want to use a JDK other than the
version that is bundled.
Expand Down Expand Up @@ -61,25 +60,23 @@ install the correct startup method (SysV init scripts, Upstart, or systemd). If
installation, you may get an error message, and {ls} will not start properly.

[float]
[[jdk15-upgrade]]
==== Using JDK 15
[[jdk17-upgrade]]
==== Using JDK 17

{ls} supports JDK 15, but you need to update settings in `jvm.options` and
`log4j2.properties` if:
{ls} supports JDK 17, but you need to update settings in `jvm.options` and
`log4j2.properties` if you are upgrading from {ls} 7.11.x (or earlier) to 7.12 or later.

* you are upgrading from {ls} 7.11.x (or earlier) to 7.12 or later, and
* you are using JDK 15 or later.

[float]
===== Updates to `jvm.options`
In the `config/jvm.options` file, replace all CMS related flags with:
In the `config/jvm.options` file, remove all CMS related flags:

[source,shell]
-----
## GC configuration
8-13:-XX:+UseConcMarkSweepGC
8-13:-XX:CMSInitiatingOccupancyFraction=75
8-13:-XX:+UseCMSInitiatingOccupancyOnly
-XX:+UseConcMarkSweepGC
-XX:CMSInitiatingOccupancyFraction=75
-XX:+UseCMSInitiatingOccupancyOnly
-----

For more information about how to use `jvm.options`, please refer to <<jvm-settings>>.
Expand Down
19 changes: 9 additions & 10 deletions docs/static/troubleshoot/ts-logstash.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,17 @@ Operation not permitted

* Change setting to mount `/tmp` with `exec`.
* Specify an alternate directory using the `-Djava.io.tmpdir` setting in the `jvm.options` file.
[[ts-startup]]
[[ts-startup]]
==== {ls} start up
[[ts-illegal-reflective-error]]

[[ts-illegal-reflective-error]]
===== 'Illegal reflective access' errors

// https://github.com/elastic/logstash/issues/10496 and https://github.com/elastic/logstash/issues/10498

Running Logstash with Java 11 results in warnings similar to these:
After an upgrade, Logstash may show warnings similar to these:

[source,sh]
-----
Expand All @@ -60,15 +60,14 @@ Try adding these values to the `jvm.options` file.
-----
--add-opens=java.base/java.security=ALL-UNNAMED
--add-opens=java.base/java.io=ALL-UNNAMED
--add-opens=java.base/java.nio.channels=org.jruby.dist
--add-opens=java.base/sun.nio.ch=org.jruby.dist
--add-opens=java.management/sun.management=org.jruby.dist
--add-opens=java.base/java.nio.channels=ALL-UNNAMED
--add-opens=java.base/sun.nio.ch=org.ALL-UNNAMED
--add-opens=java.management/sun.management=ALL-UNNAMED
-----

*Notes:*

* These settings allow Logstash to start without warnings in Java 11, but they
prevent Logstash from starting on Java 8.
* These settings allow Logstash to start without warnings.
* This workaround has been tested with simple pipelines. If you have experiences
to share, please comment in the
https://github.com/elastic/logstash/issues/10496[issue].
Expand Down

0 comments on commit 15be7a9

Please sign in to comment.