Elasticsearch 5.0 on Docker does not run


#1

Hi,

I'm trying to upgrade elasticsearch from 2.3 to 5.0. I've elasticsearch In Docker container.
I'm building my Dockerfile from the Docker Official Image , and when I run it I get this error :

ERROR: bootstrap checks failed
memory locking requested for elasticsearch process but memory is not locked
[2016-11-21T16:02:42,412][INFO ][o.e.n.Node               ] [Node0] stopping ...
2016-11-21 16:02:42,414 pool-1-thread-1 ERROR Unable to unregister MBeans java.security.AccessControlException: access denied ("javax.management.MBeanServerPermission" "createMBeanServer")
        at java.security.AccessControlContext.checkPermission(AccessControlContext.java:472)
        at java.security.AccessController.checkPermission(AccessController.java:884)
        at java.lang.SecurityManager.checkPermission(SecurityManager.java:549)
        at java.lang.management.ManagementFactory.getPlatformMBeanServer(ManagementFactory.java:465)
        at org.apache.logging.log4j.core.jmx.Server.unregisterLoggerContext(Server.java:246)
        at org.apache.logging.log4j.core.LoggerContext.stop(LoggerContext.java:300)
        at org.apache.logging.log4j.core.LoggerContext$1.run(LoggerContext.java:265)
        at org.apache.logging.log4j.core.util.DefaultShutdownCallbackRegistry$RegisteredCancellable.run(DefaultShutdownCallbackRegistry.java:102)
        at org.apache.logging.log4j.core.util.DefaultShutdownCallbackRegistry.run(DefaultShutdownCallbackRegistry.java:72)
        at java.lang.Thread.run(Thread.java:745)


Exception: java.security.AccessControlException thrown from the UncaughtExceptionHandler in thread "Thread-2"

I'm running my Docker like this :

sudo docker run --privileged=true -d --name=es -p 9200:9200 -p 9300:9300 --net=host -v /data/ESdata/Node0/:/usr/share/elasticsearch/data -v /backupes/esrepo/:/usr/share/elasticsearch/backup -e ES_JAVA_OPTS='-Xms31g -Xmx31g' elasticsearch:V5

My limits.conf has this :

* - nofile 65535
* - memlock unlimited
* - nproc 64000 

and my elasticsearch.yml has the line :

bootstrap.memory_lock: true

Do you have any clue why I'm getting this ?
Thank you.


#2

Here is the beginning of the log trace :

sudo docker logs es

[2016-11-22T09:32:59,412][WARN ][o.e.b.JNANatives         ] Unable to lock JVM Memory: error=12, reason=Cannot allocate memory
[2016-11-22T09:32:59,414][WARN ][o.e.b.JNANatives         ] This can result in part of the JVM being swapped out.
[2016-11-22T09:32:59,414][WARN ][o.e.b.JNANatives         ] Increase RLIMIT_MEMLOCK, soft limit: 65536, hard limit: 65536
[2016-11-22T09:32:59,414][WARN ][o.e.b.JNANatives         ] These can be adjusted by modifying /etc/security/limits.conf, for example:
        # allow user 'esearchqalr' mlockall
        esearchqalr soft memlock unlimited
        esearchqalr hard memlock unlimited

I do not understand why I'm getting this error while my limits.conf contains the unlimited memlock... I tried overriding it inside my Dockerfile but it did not work...


(Isabel Drost-Fromm) #3

Not a docker expert at all here - but maybe looking at

helps you?

Isabel


#4

Thank you mainec for your answer but unfortunately no.
I've found a "fix" by adding --ulimit memlock=-1:-1 to my run command. But I don't know id it's a viable option once in production (Not sure...)


(system) #5

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