docker-elasticsearch-alpine
docker-elasticsearch-alpine copied to clipboard
7.3 image does not work with overlay2 driver
Hello,
There seems to be a bug in java, which causes this error when running on overlay2 docker driver
[2020-03-03T09:49:24,727][ERROR][org.elasticsearch.bootstrap.Bootstrap] Exception java.lang.IllegalStateException: failed to obtain node locks, tried [[/usr/share/elasticsearch/data]] with lock id [0]; maybe these locations are not writable or multip at org.elasticsearch.env.NodeEnvironment.
(NodeEnvironment.java:299) ~[elasticsearch-7.3.2.jar:7.3.2] ..... Caused by: java.io.IOException: failed to obtain lock on /usr/share/elasticsearch/data/nodes/0 at org.elasticsearch.env.NodeEnvironment$NodeLock. (NodeEnvironment.java:221) ~[elasticsearch-7.3.2.jar:7.3.2] at org.elasticsearch.env.NodeEnvironment. (NodeEnvironment.java:269) ~[elasticsearch-7.3.2.jar:7.3.2] ... 12 more Caused by: java.io.IOException: Mount point not found at sun.nio.fs.LinuxFileStore.findMountEntry(LinuxFileStore.java:105) ~[?:?]
Seems to be discussed here: https://stackoverflow.com/questions/41022393/mount-point-not-found https://bugs.openjdk.java.net/browse/JDK-8165852
Similar issue is also discussed here: https://github.com/pires/kubernetes-elasticsearch-cluster/issues/89
Maybe the version of Java used in this image doesn't include the fix for this bug
alpine 3.11 doesn't have the fix either
I was able to workaround using java 8, and changed the Dockerfile like this
-RUN apk add --no-cache openjdk11-jre-headless su-exec +RUN apk add --no-cache openjdk8-jre su-exec
I do get this warning now, but I can live with it
future versions of Elasticsearch will require Java 11; your Java version from [/usr/lib/jvm/java-1.8-openjdk/jre] does not meet this requirement
Also, as a bonus, the image size decreased an extra 90 MB, and is 197MB now
Thank you for doing this research! Hopefully alpine 3.11 or 3.12's java will fix this? I'll pin this for now, as I am not sure it is better to use old Java to support overlay2 or to wait for better Java 11.