When starting elasticsearch - 'can not run elasticsearch as root'

How to resolve ??

I am centos 6...
just removed elasticsearch older version and installed v6.5.4

now trying to start service as -
[root@localhost elasticsearch]# bin/elasticsearch &

but getting error as -
[1] 10317
[root@localhost elasticsearch]# [2019-02-04T13:24:23,997][WARN ][o.e.b.ElasticsearchUncaughtExceptionHandler] [unknown] 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:140) ~[elasticsearch-6.5.4.jar:6.5.4]
at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:127) ~[elasticsearch-6.5.4.jar:6.5.4]
at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:86) ~[elasticsearch-6.5.4.jar:6.5.4]
at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:124) ~[elasticsearch-cli-6.5.4.jar:6.5.4]
at org.elasticsearch.cli.Command.main(Command.java:90) ~[elasticsearch-cli-6.5.4.jar:6.5.4]
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:93) ~[elasticsearch-6.5.4.jar:6.5.4]
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:86) ~[elasticsearch-6.5.4.jar:6.5.4]
Caused by: java.lang.RuntimeException: can not run elasticsearch as root
at org.elasticsearch.bootstrap.Bootstrap.initializeNatives(Bootstrap.java:103) ~[elasticsearch-6.5.4.jar:6.5.4]
at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:170) ~[elasticsearch-6.5.4.jar:6.5.4]
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:333) ~[elasticsearch-6.5.4.jar:6.5.4]
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:136) ~[elasticsearch-6.5.4.jar:6.5.4]
... 6 more

can not run elasticsearch as root
then How to run?

when i'm checking version
Version: 6.5.4, Build: default/tar/d2ef93d/2018-12-17T21:17:40.758843Z, JVM: 1.8.0_161

How did you install it? Did you read and follow the installation guide?
Elasticsearch must run as a user like elasticsearch but not root.

ok let me reinstall it.

please let me know the proper steps for the same..

i want to use is as rpm

I don't have much to say then what is available in the documentation. See https://www.elastic.co/guide/en/elasticsearch/reference/current/rpm.html

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.