java.lang.RuntimeException can not run elasticsearch as root - 优化 - 方帮信


大厂面试直通卡 本周拉勾免费课:《深入浅出搞定React》 7月6号下线 【腾讯云】2021新春采购节,爆款产品特惠,助力企业上云
当前位置: 首页 >  > 技术 > 优化

java.lang.RuntimeException can not run elasticsearch as root

2021/6/10 14:10:45 浏览

at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:124) ~[elasticsearch-cli-6.6.1.jar:6.6.1] at org.elasticsearch.cli.Command.main(Command.java:90) ~[elasticsearch-cli-6.6.1.jar:6.6.1] at org.elasticsearch.bootstrap.Elasticse…

站长送干货喽:

1.拉勾教育7天VIP

2.大场面试题第一季-阿里篇视频讲解

站长的微信:changyandoublog

 at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:124) ~[elasticsearch-cli-6.6.1.jar:6.6.1]
   at org.elasticsearch.cli.Command.main(Command.java:90) ~[elasticsearch-cli-6.6.1.jar:6.6.1]
   at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:116) ~[elasticsearch-6.6.1.jar:6.6.1]
   at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:93) ~[elasticsearch-6.6.1.jar:6.6.1]
   Caused by: java.lang.RuntimeException: can not run elasticsearch as root
       at org.elasticsearch.bootstrap.Bootstrap.initializeNatives(Bootstrap.java:103) ~[elasticsearch-6.6.1.jar:6.6.1]
       at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:170) ~[elasticsearch-6.6.1.jar:6.6.1]
       at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:333) ~[elasticsearch-6.6.1.jar:6.6.1]
       at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:159) ~[elasticsearch-6.6.1.jar:6.6.1]
       ... 6 more
groupadd elsearch
useradd elsearch -g elsearch
passwd elsearch
cd /opt
chown -R elsearch:elsearch  elasticsearch-6.8.0
su elsearch
cd /opt/elasticsearch-6.8.0/bin
./elasticsearch

启动如下:

image-20210609135558900.png

来源:方帮信(微信:changyandoublog,邮箱:changyandou@126.com),欢迎分享!