简体   繁体   English

Elasticsearch 5.0.1 Java权限问题

[英]Elasticsearch 5.0.1 java permission issue

I have been trying to install and run Elasticsearch 5.0.1 in a docker container based on Centos 6.8. 我一直试图在基于Centos 6.8的Docker容器中安装并运行Elasticsearch 5.0.1。 I am getting the following error: 我收到以下错误:

[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)

Can anyone please help me to understand this error and how to fix it? 谁能帮助我了解此错误以及如何解决?

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")

So as per the error, you got to increase the vm.max_map_count plus the max number of threads . 因此,根据错误,您必须增加vm.max_map_count以及max number of threads

In order to increase vm.max_map_count type in the below command in your terminal as root : 为了增加vm.max_map_count ,以root身份在终端中输入以下命令:

sysctl -w vm.max_map_count=262144 sysctl -w vm.max_map_count = 262144

Source: configuration 来源: 配置

In order to increase the max number of threads , you got to increase the ulimit : 为了增加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. 这可以通过在启动Elasticsearch之前将ulimit -u 2048设置为root或在/etc/security/limits.conf中将nproc设置为2048来完成。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM