can not run elasticsearch as root at org.elasticsearch.boots

安装elasticsearch的时候运行./elasticsearch报错
解决办法参考:CENTOS安装ElasticSearch https://my.oschina.net/topeagle/blog/591451

[root@ELK bin]# ./elasticsearch
OpenJDK 64-Bit Server VM warning: If the number of processors is expected to increase from one, then you should configure the number of parallel GC threads appropriately using -XX:ParallelGCThreads=N
[2017-05-25T05:21:54,647][WARN ][o.e.b.ElasticsearchUncaughtExceptionHandler] [] 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:127) ~[elasticsearch-5.4.0.jar:5.4.0]
    at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:114) ~[elasticsearch-5.4.0.jar:5.4.0]
    at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:67) ~[elasticsearch-5.4.0.jar:5.4.0]
    at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:122) ~[elasticsearch-5.4.0.jar:5.4.0]
    at org.elasticsearch.cli.Command.main(Command.java:88) ~[elasticsearch-5.4.0.jar:5.4.0]
    at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:91) ~[elasticsearch-5.4.0.jar:5.4.0]
    at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:84) ~[elasticsearch-5.4.0.jar:5.4.0]
Caused by: java.lang.RuntimeException: can not run elasticsearch as root
    at org.elasticsearch.bootstrap.Bootstrap.initializeNatives(Bootstrap.java:106) ~[elasticsearch-5.4.0.jar:5.4.0]
    at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:204) ~[elasticsearch-5.4.0.jar:5.4.0]
    at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:360) ~[elasticsearch-5.4.0.jar:5.4.0]
    at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:123) ~[elasticsearch-5.4.0.jar:5.4.0]
    ... 6 more

提示报错:java.lang.RuntimeException: can not run elasticsearch as root
将elasticsearch所在的文件夹所属用户和组都改为admin,切换到admin再启动

  • 创建elsearch用户组及elsearch用户
cd /usr/local
chown -R admin:admin elasticsearch

切换到admin用户再运行

[admin@ELK bin]$ ./elasticsearch
OpenJDK 64-Bit Server VM warning: If the number of processors is expected to increase from one, then you should configure the number of parallel GC threads appropriately using -XX:ParallelGCThreads=N
[2017-05-25T05:25:38,824][INFO ][o.e.n.Node               ] [] initializing ...
[2017-05-25T05:25:38,989][INFO ][o.e.e.NodeEnvironment    ] [cUN3nln] using [1] data paths, mounts [[/ (rootfs)]], net usable_space [23.1gb], net total_space [27.7gb], spins? [unknown], types [rootfs]
[2017-05-25T05:25:38,989][INFO ][o.e.e.NodeEnvironment    ] [cUN3nln] heap size [1.9gb], compressed ordinary object pointers [true]
[2017-05-25T05:25:38,991][INFO ][o.e.n.Node               ] node name [cUN3nln] derived from node ID [cUN3nlnKQAmkk-YEP-v9uQ]; set [node.name] to override
[2017-05-25T05:25:38,992][INFO ][o.e.n.Node               ] version[5.4.0], pid[19619], build[780f8c4/2017-04-28T17:43:27.229Z], OS[Linux/3.10.0-514.el7.x86_64/amd64], JVM[Oracle Corporation/OpenJDK 64-Bit Server VM/1.8.0_131/25.131-b11]
[2017-05-25T05:25:41,049][INFO ][o.e.p.PluginsService     ] [cUN3nln] loaded module [aggs-matrix-stats]
[2017-05-25T05:25:41,049][INFO ][o.e.p.PluginsService     ] [cUN3nln] loaded module [ingest-common]
[2017-05-25T05:25:41,049][INFO ][o.e.p.PluginsService     ] [cUN3nln] loaded module [lang-expression]
[2017-05-25T05:25:41,049][INFO ][o.e.p.PluginsService     ] [cUN3nln] loaded module [lang-groovy]
[2017-05-25T05:25:41,049][INFO ][o.e.p.PluginsService     ] [cUN3nln] loaded module [lang-mustache]
[2017-05-25T05:25:41,050][INFO ][o.e.p.PluginsService     ] [cUN3nln] loaded module [lang-painless]
[2017-05-25T05:25:41,050][INFO ][o.e.p.PluginsService     ] [cUN3nln] loaded module [percolator]
[2017-05-25T05:25:41,050][INFO ][o.e.p.PluginsService     ] [cUN3nln] loaded module [reindex]
[2017-05-25T05:25:41,050][INFO ][o.e.p.PluginsService     ] [cUN3nln] loaded module [transport-netty3]
[2017-05-25T05:25:41,050][INFO ][o.e.p.PluginsService     ] [cUN3nln] loaded module [transport-netty4]
[2017-05-25T05:25:41,051][INFO ][o.e.p.PluginsService     ] [cUN3nln] no plugins loaded
[2017-05-25T05:25:44,144][INFO ][o.e.d.DiscoveryModule    ] [cUN3nln] using discovery type [zen]
[2017-05-25T05:25:45,204][INFO ][o.e.n.Node               ] initialized
[2017-05-25T05:25:45,204][INFO ][o.e.n.Node               ] [cUN3nln] starting ...
[2017-05-25T05:25:45,501][INFO ][o.e.t.TransportService   ] [cUN3nln] publish_address {127.0.0.1:9300}, bound_addresses {[::1]:9300}, {127.0.0.1:9300}
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值