elasticsearch启动报错解决方案

1.启动找不到Java环境

Could not find any executable java binary. Please install java in your PATH or set JAVA_HOME

解决:安装java环境

https://blog.csdn.net/admin1992/article/details/80390212


2.拒绝访问异常(当前用户没有操作el安装文件目录的权限)

ubuntu@exo:~/workspace/exo/elasticsearch-5.6.4/bin$ ./elasticsearch
Exception in thread "main" 2018-05-21 04:38:09,228 main ERROR No log4j2 configuration file found. Using default configuration: logging only errors to the console. Set system property 'log4j2.debug' to show Log4j2 internal initialization logging.
2018-05-21 04:38:09,790 main ERROR Could not register mbeans java.security.AccessControlException: access denied ("javax.management.MBeanTrustPermission" "register")
	at java.base/java.security.AccessControlContext.checkPermission(AccessControlContext.java:472)
	at java.base/java.lang.SecurityManager.checkPermission(SecurityManager.java:371)
	at java.management/com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.checkMBeanTrustPermission(DefaultMBeanServerInterceptor.java:1805)
	at java.management/com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerMBean(DefaultMBeanServerInterceptor.java:318)
	at java.management/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.reconfigure(LoggerContext.java:617)
	at org.apache.logging.log4j.core.LoggerContext.reconfigure(LoggerContext.java:634)
	at org.apache.logging.log4j.core.LoggerContext.start(LoggerContext.java:229)
	at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:242)
	at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:45)
	at org.apache.logging.log4j.LogManager.getContext(LogManager.java:174)
	at org.apache.logging.log4j.LogManager.getLogger(LogManager.java:648)
	at org.elasticsearch.common.logging.ESLoggerFactory.getLogger(ESLoggerFactory.java:54)
	at org.elasticsearch.common.logging.ESLoggerFactory.getLogger(ESLoggerFactory.java:62)
	at org.elasticsearch.common.logging.Loggers.getLogger(Loggers.java:101)
	at org.elasticsearch.ExceptionsHelper.<clinit>(ExceptionsHelper.java:42)
	at org.elasticsearch.ElasticsearchException.toString(ElasticsearchException.java:663)
	at java.base/java.lang.String.valueOf(String.java:2788)
	at java.base/java.io.PrintStream.println(PrintStream.java:897)
	at java.base/java.lang.Throwable$WrappedPrintStream.println(Throwable.java:752)
	at java.base/java.lang.Throwable.printStackTrace(Throwable.java:659)
	at java.base/java.lang.Throwable.printStackTrace(Throwable.java:648)
	at java.base/java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:1059)
	at java.base/java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:1050)
	at java.base/java.lang.Thread.dispatchUncaughtException(Thread.java:2053)

解决:给当前用户添加操作elasticsearch安装目录的权限 我当前使用的是默认的ubuntu 也可以新建用户及用户组

##我的安装路径
ubuntu@exo:~/workspace/exo$ pwd
/home/ubuntu/workspace/exo    

ubuntu@exo:~/workspace/exo$ ls
elasticsearch-5.6.4  platform-community-5.1.x-SNAPSHOT  zip

##给当前ubuntu用户权限 elasticsearch-5.6.4为安装包根目录
ubuntu@exo:~/workspace/exo$ sudo chown -R ubuntu elasticsearch-5.6.4/

##进入到bin目录进行启动
ubuntu@exo:~/workspace/exo$ cd elasticsearch-5.6.4/bin/
ubuntu@exo:~/workspace/exo/elasticsearch-5.6.4/bin$ ./elasticsearch
Java HotSpot(TM) 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release.
[2018-05-21T05:50:29,712][INFO ][o.e.n.Node               ] [] initializing ...
[2018-05-21T05:50:30,003][INFO ][o.e.e.NodeEnvironment    ] [9CxDa4m] using [1] data paths, mounts [[/ (/dev/vda1)]], net usable_space [45.6gb], net total_space [48.4gb], spins? [possibly], types [ext4]
[2018-05-21T05:50:30,005][INFO ][o.e.e.NodeEnvironment    ] [9CxDa4m] heap size [1.9gb], compressed ordinary object pointers [true]
[2018-05-21T05:50:30,012][INFO ][o.e.n.Node               ] node name [9CxDa4m] derived from node ID [9CxDa4m_Qm2Ad1-KWXGkXw]; set [node.name] to override
[2018-05-21T05:50:30,012][INFO ][o.e.n.Node               ] version[5.6.4], pid[1565], build[8bbedf5/2017-10-31T18:55:38.105Z], OS[Linux/4.4.0-83-generic/amd64], JVM["Oracle Corporation"/Java HotSpot(TM) 64-Bit Server VM/10.0.1/10.0.1+10]
[2018-05-21T05:50:30,013][INFO ][o.e.n.Node               ] JVM arguments [-Xms2g, -Xmx2g, -XX:+UseConcMarkSweepGC, -XX:CMSInitiatingOccupancyFraction=75, -XX:+UseCMSInitiatingOccupancyOnly, -XX:+AlwaysPreTouch, -Xss1m, -Djava.awt.headless=true, -Dfile.encoding=UTF-8, -Djna.nosys=true, -Djdk.io.permissionsUseCanonicalPath=true, -Dio.netty.noUnsafe=true, -Dio.netty.noKeySetOptimization=true, -Dio.netty.recycler.maxCapacityPerThread=0, -Dlog4j.shutdownHookEnabled=false, -Dlog4j2.disable.jmx=true, -Dlog4j.skipJansi=true, -XX:+HeapDumpOnOutOfMemoryError, -Des.path.home=/home/ubuntu/workspace/exo/elasticsearch-5.6.4]
[2018-05-21T05:50:34,461][INFO ][o.e.p.PluginsService     ] [9CxDa4m] loaded module [aggs-matrix-stats]
[2018-05-21T05:50:34,462][INFO ][o.e.p.PluginsService     ] [9CxDa4m] loaded module [ingest-common]
[2018-05-21T05:50:34,462][INFO ][o.e.p.PluginsService     ] [9CxDa4m] loaded module [lang-expression]
[2018-05-21T05:50:34,463][INFO ][o.e.p.PluginsService     ] [9CxDa4m] loaded module [lang-groovy]
[2018-05-21T05:50:34,463][INFO ][o.e.p.PluginsService     ] [9CxDa4m] loaded module [lang-mustache]
[2018-05-21T05:50:34,467][INFO ][o.e.p.PluginsService     ] [9CxDa4m] loaded module [lang-painless]
[2018-05-21T05:50:34,467][INFO ][o.e.p.PluginsService     ] [9CxDa4m] loaded module [parent-join]
[2018-05-21T05:50:34,467][INFO ][o.e.p.PluginsService     ] [9CxDa4m] loaded module [percolator]
[2018-05-21T05:50:34,467][INFO ][o.e.p.PluginsService     ] [9CxDa4m] loaded module [reindex]
[2018-05-21T05:50:34,468][INFO ][o.e.p.PluginsService     ] [9CxDa4m] loaded module [transport-netty3]
[2018-05-21T05:50:34,468][INFO ][o.e.p.PluginsService     ] [9CxDa4m] loaded module [transport-netty4]
[2018-05-21T05:50:34,469][INFO ][o.e.p.PluginsService     ] [9CxDa4m] no plugins loaded
[2018-05-21T05:50:37,980][INFO ][o.e.d.DiscoveryModule    ] [9CxDa4m] using discovery type [zen]
[2018-05-21T05:50:39,171][INFO ][o.e.n.Node               ] initialized
[2018-05-21T05:50:39,178][INFO ][o.e.n.Node               ] [9CxDa4m] starting ...
[2018-05-21T05:50:39,649][INFO ][o.e.t.TransportService   ] [9CxDa4m] publish_address {127.0.0.1:9300}, bound_addresses {[::1]:9300}, {127.0.0.1:9300}
[2018-05-21T05:50:39,680][WARN ][o.e.b.BootstrapChecks    ] [9CxDa4m] max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
[2018-05-21T05:50:43,045][INFO ][o.e.c.s.ClusterService   ] [9CxDa4m] new_master {9CxDa4m}{9CxDa4m_Qm2Ad1-KWXGkXw}{hGiu9wXUTmKHZ8ThOGLEcA}{127.0.0.1}{127.0.0.1:9300}, reason: zen-disco-elected-as-master ([0] nodes joined)
[2018-05-21T05:50:43,105][INFO ][o.e.g.GatewayService     ] [9CxDa4m] recovered [0] indices into cluster_state
[2018-05-21T05:50:43,115][INFO ][o.e.h.n.Netty4HttpServerTransport] [9CxDa4m] publish_address {127.0.0.1:9200}, bound_addresses {[::1]:9200}, {127.0.0.1:9200}
[2018-05-21T05:50:43,116][INFO ][o.e.n.Node               ] [9CxDa4m] started





  

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值