Java error in installing Elasticserach 5 beta verion


(Sara Thomas) #1

Hi,

I am trying to install Elasticsearch 5.0.0-beta1 but I am getting the following error:

root@ip-x-x-x-x:/opt/elasticsearch-5.0.0-beta1/bin# ./elasticsearch

[2016-10-04T16:37:31,891][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:116) ~[elasticsearch-5.0.0-beta1.jar:5.0.0-beta1]
at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:103) ~[elasticsearch-5.0.0-beta1.jar:5.0.0-beta1]
at org.elasticsearch.cli.SettingCommand.execute(SettingCommand.java:54) ~[elasticsearch-5.0.0-beta1.jar:5.0.0-beta1]
at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:96) ~[elasticsearch-5.0.0-beta1.jar:5.0.0-beta1]
at org.elasticsearch.cli.Command.main(Command.java:62) ~[elasticsearch-5.0.0-beta1.jar:5.0.0-beta1]
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:80) ~[elasticsearch-5.0.0-beta1.jar:5.0.0-beta1]
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:73) ~[elasticsearch-5.0.0-beta1.jar:5.0.0-beta1]
Caused by: java.lang.RuntimeException: can not run elasticsearch as root
at org.elasticsearch.bootstrap.Bootstrap.initializeNatives(Bootstrap.java:96) ~[elasticsearch-5.0.0-beta1.jar:5.0.0-beta1]
at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:155) ~[elasticsearch-5.0.0-beta1.jar:5.0.0-beta1]
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:286) ~[elasticsearch-5.0.0-beta1.jar:5.0.0-beta1]
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:112) ~[elasticsearch-5.0.0-beta1.jar:5.0.0-beta1]
... 6 more

root@ip-x-x-x-x:/opt/elasticsearch-5.0.0-beta1/bin#


(David Pilato) #2

Please format your code using </> icon. It will make your post more readable.

The error message is clear: "can not run elasticsearch as root"

Don't start it as root.


(Rajeshkumar) #3

How to start it as non-root user?


(system) #4