启动elasticsearch异常: main ERROR Could not register mbeans java.security.AccessControlException: access denied
或批处理文件。
2021-02-23 11:27:26,909 main ERROR Could not register mbeans java.security.AccessControlException: access denied ("javax.management.MBeanTrustPermission" "register")
at java.security.AccessControlContext.checkPermission(AccessControlContext.java:472)
at java.lang.SecurityManager.checkPermission(SecurityManager.java:585)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.checkMBeanTrustPermission(DefaultMBeanServerInterceptor.java:1848)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerMBean(DefaultMBeanServerInterceptor.java:322)
at com.sun.jmx.mbeanserver.JmxMBeanServer.registerMBean(JmxMBeanServer.java:522)
at org.apache.logging.log4j.core.jmx.Server.register(Server.java:389)
at org.apache.logging.log4j.core.jmx.Server.reregisterMBeansAfterReconfigure(Server.java:167)
at org.apache.logging.log4j.core.jmx.Server.reregisterMBeansAfterReconfigure(Server.java:140)
at org.apache.logging.log4j.core.LoggerContext.setConfiguration(LoggerContext.java:556)
at org.apache.logging.log4j.core.LoggerContext.start(LoggerContext.java:261)
at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:206)
at org.apache.logging.log4j.core.config.Configurator.initialize(Configurator.java:220)
at org.apache.logging.log4j.core.config.Configurator.initialize(Configurator.java:197)
at org.elasticsearch.common.logging.LogConfigurator.configureStatusLogger(LogConfigurator.java:172)
at org.elasticsearch.common.logging.LogConfigurator.configure(LogConfigurator.java:141)
at org.elasticsearch.common.logging.LogConfigurator.configure(LogConfigurator.java:120)
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:290)
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:130)
at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:121)
at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:69)
at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:134)
at org.elasticsearch.cli.Command.main(Command.java:90)
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:92)
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:85)
2021-02-23 11:27:27,146 main ERROR Could not register mbeans java.security.AccessControlException: access denied ("javax.management.MBeanTrustPermission" "register")
at java.security.AccessControlContext.checkPermission(AccessControlContext.java:472)
at java.lang.SecurityManager.checkPermission(SecurityManager.java:585)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.checkMBeanTrustPermission(DefaultMBeanServerInterceptor.java:1848)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerMBean(DefaultMBeanServerInterceptor.java:322)
at com.sun.jmx.mbeanserver.JmxMBeanServer.registerMBean(JmxMBeanServer.java:522)
at org.apache.logging.log4j.core.jmx.Server.register(Server.java:389)
at org.apache.logging.log4j.core.jmx.Server.reregisterMBeansAfterReconfigure(Server.java:167)
at org.apache.logging.log4j.core.jmx.Server.reregisterMBeansAfterReconfigure(Server.java:140)
at org.apache.logging.log4j.core.LoggerContext.setConfiguration(LoggerContext.java:556)
at org.apache.logging.log4j.core.LoggerContext.start(LoggerContext.java:261)
at org.elasticsearch.common.logging.LogConfigurator.configure(LogConfigurator.java:164)
at org.elasticsearch.common.logging.LogConfigurator.configure(LogConfigurator.java:120)
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:290)
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:130)
at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:121)
at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:69)
at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:134)
at org.elasticsearch.cli.Command.main(Command.java:90)
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:92)
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:85)
[2021-02-23T11:27:28,777][INFO ][o.e.n.Node ] [] initializing ...
[2021-02-23T11:27:29,593][INFO ][o.e.e.NodeEnvironment ] [Z_H1vTV] using [1] data paths, mounts [[(D:)]], net usable_space [344.9gb], net total_space [931gb], types [NTFS]
[2021-02-23T11:27:29,594][INFO ][o.e.e.NodeEnvironment ] [Z_H1vTV] heap size [3.5gb], compressed ordinary object pointers [true]
[2021-02-23T11:27:29,601][INFO ][o.e.n.Node ] node name [Z_H1vTV] derived from node ID [Z_H1vTVEQ2qZLxcosesTmQ]; set [node.name] to override
[2021-02-23T11:27:29,602][INFO ][o.e.n.Node ] version[6.0.1], pid[9644], build[601be4a/2017-12-04T09:29:09.525Z], OS[Windows 10/10.0/amd64], JVM[Oracle Corporation/Java HotSpot(TM) 64-Bit Server VM/1.8.0_60/25.60-b23]
[2021-02-23T11:27:29,603][INFO ][o.e.n.Node ] JVM arguments [-Delasticsearch, -Des.path.home=D:\Program\janusgraph-0.2.3-hadoop2\elasticsearch, -Des.path.conf=D:\Program\janusgraph-0.2.3-hadoop2\elasticsearch\config]
[2021-02-23T11:27:31,592][INFO ][o.e.p.PluginsService ] [Z_H1vTV] loaded module [aggs-matrix-stats]
[2021-02-23T11:27:41,023][INFO ][o.e.p.PluginsService ] [Z_H1vTV] loaded module [analysis-common]
[2021-02-23T11:27:41,024][INFO ][o.e.p.PluginsService ] [Z_H1vTV] loaded module [ingest-common]
[2021-02-23T11:27:41,024][INFO ][o.e.p.PluginsService ] [Z_H1vTV] loaded module [lang-expression]
[2021-02-23T11:27:41,024][INFO ][o.e.p.PluginsService ] [Z_H1vTV] loaded module [lang-mustache]
[2021-02-23T11:27:41,024][INFO ][o.e.p.PluginsService ] [Z_H1vTV] loaded module [lang-painless]
[2021-02-23T11:27:41,024][INFO ][o.e.p.PluginsService ] [Z_H1vTV] loaded module [parent-join]
[2021-02-23T11:27:41,024][INFO ][o.e.p.PluginsService ] [Z_H1vTV] loaded module [percolator]
[2021-02-23T11:27:41,025][INFO ][o.e.p.PluginsService ] [Z_H1vTV] loaded module [reindex]
[2021-02-23T11:27:41,025][INFO ][o.e.p.PluginsService ] [Z_H1vTV] loaded module [repository-url]
[2021-02-23T11:27:41,025][INFO ][o.e.p.PluginsService ] [Z_H1vTV] loaded module [transport-netty4]
[2021-02-23T11:27:41,025][INFO ][o.e.p.PluginsService ] [Z_H1vTV] loaded module [tribe]
[2021-02-23T11:27:41,026][INFO ][o.e.p.PluginsService ] [Z_H1vTV] no plugins loaded
[2021-02-23T11:27:47,464][INFO ][o.e.d.DiscoveryModule ] [Z_H1vTV] using discovery type [zen]
[2021-02-23T11:27:50,267][INFO ][o.e.n.Node ] initialized
[2021-02-23T11:27:50,268][INFO ][o.e.n.Node ] [Z_H1vTV] starting ...
[2021-02-23T11:27:50,304][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 instability.
[2021-02-23T11:27:51,941][INFO ][o.e.t.TransportService ] [Z_H1vTV] publish_address {127.0.0.1:9300}, bound_addresses {127.0.0.1:9300}, {[::1]:9300}
[2021-02-23T11:27:51,968][WARN ][o.e.b.BootstrapChecks ] [Z_H1vTV] initial heap size [266338304] not equal to maximum heap size [4259315712]; this can cause resize pauses and prevents mlockall from locking the entire heap
解决方案:
看了很多帖子说是权限的问题,或者和java jdk/jre有关,但是我在windows下修改了文件夹权限没有起作用,后来右键选择管理员身份运行,解决问题~
所以以后遇到权限问题,类似access denied的问题,可以管理员身份试试~~大家好运~