Start ES on Centos 7.4 problem

I'm running ES 6.2.3 stack on Windows server for more then half a year.
Now when ma stack is fully configured and running, we've decided to move to Centos.

So far I've installed ES and KB with X-Pack. KB is working, but I have some problems with ES.
I've installed both according to official guide.

If I run ES sudo bin/elasticsearch I get:

[2018-03-27T09:37:51,455][WARN ][o.e.b.ElasticsearchUncaughtExceptionHandler] [cheshire_cat] 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-6.2.3.jar:6.2.3]
        at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:112) ~[elasticsearch-6.2.3.jar:6.2.3]
        at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:86) ~[elasticsearch-6.2.3.jar:6.2.3]
        at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:124) ~[elasticsearch-cli-6.2.3.jar:6.2.3]
        at org.elasticsearch.cli.Command.main(Command.java:90) ~[elasticsearch-cli-6.2.3.jar:6.2.3]
        at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:92) ~[elasticsearch-6.2.3.jar:6.2.3]
        at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:85) ~[elasticsearch-6.2.3.jar:6.2.3]
Caused by: java.lang.RuntimeException: can not run elasticsearch as root
        at org.elasticsearch.bootstrap.Bootstrap.initializeNatives(Bootstrap.java:105) ~[elasticsearch-6.2.3.jar:6.2.3]
        at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:172) ~[elasticsearch-6.2.3.jar:6.2.3]
        at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:323) ~[elasticsearch-6.2.3.jar:6.2.3]
        at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:121) ~[elasticsearch-6.2.3.jar:6.2.3]
        ... 6 more

And if I run it bin/elasticsearch I get a lot of errors with insufficient rights.
This is for me quite logical becaut the log folder have o/g elasticsearch.

But I still cannot figure out what is a proper way to run ES. Can someone guide me.

See Scripting and security | Elasticsearch Reference [6.2] | Elastic.

Thanks, got it.
So no sudo in the run command.

But I've tried to run it without sudo and I get a bunch of errors.
As I suggested, this could be, because I'm running it in console from my userprofile.
So how can I run it as elasticsearch user.

I've also installed ES as service:
https://www.elastic.co/guide/en/elasticsearch/reference/current/rpm.html#rpm-running-systemd

If i run it using sudo systemctl start elasticsearch.service
I get nothing.
Logs are empty. /var/log/elasticsearch has only gc.log.0.current.

I've removed it all.
And make a clean install.

By default it was working. And now I'm doing it step by step.

1.When I set network.host to elastic1.domain.xy it won't start again.
I get a message about non-loopback address.
And yes, before I get it here. I've read the Boostrap Checks but still it has only an explanation and not a guide to fix this.
@warkolm: Would you be so kind, to advice me further. Thanks.

What is the exact trace you are getting?

Got it.
I've added 127.0.0.1 elastic1.domain.xy to /etc/hosts and now it's working.

And now to my next step :slight_smile:

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