Elasticsearch with OpenJDK Early Access build

Elasticsearch does not allow OpenJDK Early access build to start with. Is there a way to bypass this check?

You can create a custom build that has this check disabled/removed - I do not see another possibility after a quick check.

Thanks Alex. Bit tedious task.
Can this be taken as a request to have additional configuration for allowing OpenJDK EA build. This will give more flexibility to users and can be easily manageable.

This bootstrap check has been added intentionally and thus it is unlikely to be removed, feel free to open a github issue and start a discussion.

First, can you explain why you want to run an early access build in production instead of the openjdk that is shipped with Elasticsearch?

Second, if you do not bind to an external interface and thus run a one-node cluster, the bootstrap checks are omitted. Would that work for you? You could still bind the http address to an external one, and leave the transport address at localhost.

Thanks again Alex for your reply. I'll open a github issue and give justification.

Btw, meanwhile I added following in elasticsearch.yml, but still unable to start Elasticsearch.

network.host: 127.0.0.1
discovery.type: single-node

Am I missing anything here?

$ grep '^[^#]' config/elasticsearch.yml
discovery.type: single-node
network.host: 0.0.0.0
$ java -version
openjdk version "14-ea" 2020-03-17
OpenJDK Runtime Environment (build 14-ea+34-1452)
OpenJDK 64-Bit Server VM (build 14-ea+34-1452, mixed mode, sharing)
$ ./bin/elasticsearch
OpenJDK 64-Bit Server VM warning: Ignoring option UseConcMarkSweepGC; support was removed in 14.0
OpenJDK 64-Bit Server VM warning: Ignoring option CMSInitiatingOccupancyFraction; support was removed in 14.0
OpenJDK 64-Bit Server VM warning: Ignoring option UseCMSInitiatingOccupancyOnly; support was removed in 14.0

[2020-02-07T16:16:24,310][INFO ][o.e.n.Node               ] [rhincodon] JVM home [/Users/alr/.sdkman/candidates/java/14.ea.34-open]
...
[2020-02-07T16:16:30,806][WARN ][o.e.b.BootstrapChecks    ] [rhincodon] Java version [14-ea] is an early-access build, only use release builds
...
[2020-02-07T16:16:31,094][INFO ][o.e.h.AbstractHttpServerTransport] [rhincodon] publish_address {192.168.178.30:9200}, bound_addresses {[::]:9200}

anything I missed out in your configuration? This is on 7.5.2

Looks like Bootstrap checks are skipped, but got Access Denied. Looks like java.policy needs change.

[2020-02-07T06:45:04,276][WARN ][o.e.b.BootstrapChecks ] Java version [14-ea] is an early-access build, only use release builds
[2020-02-07T06:45:04,487][INFO ][o.e.n.Node ] started
[2020-02-07T06:45:04,636][INFO ][o.e.x.s.s.SecurityStatusChangeListener] Active license is now [BASIC]; Security is disabled
[2020-02-07T06:45:04,642][INFO ][o.e.g.GatewayService ] recovered [10] indices into cluster_state
[2020-02-07T06:45:04,823][ERROR][o.e.b.ElasticsearchUncaughtExceptionHandler] fatal error in thread [elasticsearch[generic][T#3]], exiting
java.lang.InternalError: java.security.AccessControlException: access denied ("java.lang.reflect.ReflectPermission" "suppressAccessChecks")
at jdk.internal.misc.ExtendedMapMode.(ExtendedMapMode.java:46) ~[?:?]
at sun.nio.ch.FileChannelImpl.isSync(FileChannelImpl.java:1119) ~[?:?]
at sun.nio.ch.FileChannelImpl.map(FileChannelImpl.java:994) ~[?:?]
at org.apache.lucene.store.MMapDirectory.map(MMapDirectory.java:267) ~[lucene-core-8.3.0.jar:8.3.0 2aa586909b911e66e1d8863aa89f173d69f86cd2 - ishan - 2019-10-25 23:10:03]
at org.apache.lucene.store.MMapDirectory.openInput(MMapDirectory.java:242) ~[lucene-core-8.3.0.jar:8.3.0 2aa586909b911e66e1d8863aa89f173d69f86cd2 - ishan - 2019-10-25 23:10:03]

Fixed Access Denied issue, but got into another :frowning:

[2020-02-07T08:09:30,828][ERROR][o.e.b.ElasticsearchUncaughtExceptionHandler] fatal error in thread [elasticsearch[generic][T#2]], exiting
java.lang.NoClassDefFoundError: Could not initialize class jdk.internal.misc.ExtendedMapMode
at sun.nio.ch.FileChannelImpl.isSync(FileChannelImpl.java:1119) ~[?:?]
at sun.nio.ch.FileChannelImpl.map(FileChannelImpl.java:994) ~[?:?]
at org.apache.lucene.store.MMapDirectory.map(MMapDirectory.java:267) ~[lucene-core-8.3.0.jar:8.3.0 2aa586909b911e66e1d8863aa89f173d69f86cd2 - ishan - 2019-10-25 23:10:03]

That looks like a known JDK issue. Apparently it's fixed in build 32 so maybe you need to update? Such is life when running EA builds - you're a long way from the recommended path on this one.

Agreed David!
With openjdk version "14" 2020-03-17 OpenJDK Runtime Environment (build 14+36-1461), ES started working magically. Although Build 36 is not an EA build, but I managed ES to skip bootstrap checks.
Thanks to both of you for your help.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.