2016-11-28 76 views
0

我一直在试图安装和运行Elasticsearch 5.0.1在基于Centos 6.8的docker container中。我收到以下错误:Elasticsearch 5.0.1 java权限问题

[2016-11-23T10:01:40,696][INFO ][i.n.u.i.PlatformDependent] Your platform does not provide complete low-level API for accessing direct buffers reliably. Unless explicitly requested, heap buffer will always be preferred to avoid potential system unstability. 
[2016-11-23T10:01:40,825][INFO ][o.e.t.TransportService ] [bZesYxH] publish_address {172.17.0.147:9300}, bound_addresses {[::]:9300} 
[2016-11-23T10:01:40,830][INFO ][o.e.b.BootstrapCheck ] [bZesYxH] bound or publishing to a non-loopback or non-link-local address, enforcing bootstrap checks 
ERROR: bootstrap checks failed 
initial heap size [2109734912] not equal to maximum heap size [32210157568]; this can cause resize pauses and prevents mlockall from locking the entire heap 
max number of threads [1024] for user [seceon] is too low, increase to at least [2048] 
max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144] 
[2016-11-23T10:01:40,836][INFO ][o.e.n.Node ] [bZesYxH] stopping ... 
2016-11-23 10:01:40,837 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:457) 
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) 

任何人都可以请帮我理解这个错误以及如何解决它?

2016-11-23 10:01:40,837 pool-1-thread-1 ERROR Unable to unregister MBeans java.security.AccessControlException: access denied ("javax.management.MBeanServerPermission" "createMBeanServer") 
+0

你什么时候得到错误?当试图建立容器?运行容器?你的dockerfile是什么样的?你为什么不使用ES官方图片? –

+0

我已经做了很小的修改来提高英语水平;但这个问题可以通过一些更多的背景信息得到很大的改善,例如对Yaron Idan的澄清请求的回答。请记住 - 此网站鼓励您[编辑]并重新编辑您的问题,使其尽可能清晰,易于理解和有用。 –

回答

0

所以根据错误,你必须增加vm.max_map_countmax number of threads

为了在终端增加vm.max_map_count键入以下命令root

sysctl -w vm.max_map_count=262144

来源:configuration

为了增加max number of threads,就要增加ulimit

This can be done by setting ulimit -u 2048 as root before starting Elasticsearch, or by setting nproc to 2048 in /etc/security/limits.conf.