码迷,mamicode.com
首页 > 其他好文 > 详细

ElasticSearch异常归纳(能力工场小马哥)

时间:2018-08-04 22:30:14      阅读:212      评论:0      收藏:0      [点我收藏+]

标签:jar   一个   ini   1.2   bsp   .com   handle   nat   创建   

  • 异常1: can not run elasticsearch as root
[WARN ][o.e.b.ElasticsearchUncaughtExceptionHandler] [node-2] uncaught exception in thread [main]
org.elasticsearch.bootstrap.StartupException: java.lang.RuntimeException: can not run elasticsearch as root
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:125) ~[elasticsearch-5.1.2.jar:5.1.2]
at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:112) ~[elasticsearch-5.1.2.jar:5.1.2]
at org.elasticsearch.cli.SettingCommand.execute(SettingCommand.java:54) ~[elasticsearch-5.1.2.jar:5.1.2]
at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:122) ~[elasticsearch-5.1.2.jar:5.1.2]
at org.elasticsearch.cli.Command.main(Command.java:88) ~[elasticsearch-5.1.2.jar:5.1.2]
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:89) ~[elasticsearch-5.1.2.jar:5.1.2]
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:82) ~[elasticsearch-5.1.2.jar:5.1.2]
Caused by: java.lang.RuntimeException: can not run elasticsearch as root
at org.elasticsearch.bootstrap.Bootstrap.initializeNatives(Bootstrap.java:100) ~[elasticsearch-5.1.2.jar:5.1.2]
at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:176) ~[elasticsearch-5.1.2.jar:5.1.2]
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:306) ~[elasticsearch-5.1.2.jar:5.1.2]
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:121) ~[elasticsearch-5.1.2.jar:5.1.2]
... 6 more

 

  • 异常1解决方式: 

在es-linux环境中,不允许使用root用户运行ElasticSearch,所以添加一个新的普通用户就可以了(linux命令如下)

1 groupadd es      -- 创建一个用户组(我使用的es作为组名)
2 useradd -g es es   -- 创建一个用户(我使用es作为用户名,并加入到es组里面)
3 passwd es       -- 为刚刚创建的es用户添加密码
4 su es         -- 切换到es用户下
5 $ElasticSearch_Home/bin/elasticsearch  --启动ElasticSearch

 

ElasticSearch异常归纳(能力工场小马哥)

标签:jar   一个   ini   1.2   bsp   .com   handle   nat   创建   

原文地址:https://www.cnblogs.com/hadoop2015/p/9420287.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!