docker-elasticsearch-alpine icon indicating copy to clipboard operation
docker-elasticsearch-alpine copied to clipboard

7.3 image does not work with overlay2 driver

Open alexandru-2016 opened this issue 5 years ago • 3 comments

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

alexandru-2016 avatar Mar 03 '20 10:03 alexandru-2016

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

alexandru-2016 avatar Mar 03 '20 10:03 alexandru-2016

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

alexandru-2016 avatar Mar 03 '20 11:03 alexandru-2016

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.

blacktop avatar Mar 13 '20 19:03 blacktop