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-6.2.3.jar:6.2.3]
        at org.elasticsearch.bootstrap.Elasticsearch.execute( ~[elasticsearch-6.2.3.jar:6.2.3]
        at org.elasticsearch.cli.EnvironmentAwareCommand.execute( ~[elasticsearch-6.2.3.jar:6.2.3]
        at org.elasticsearch.cli.Command.mainWithoutErrorHandling( ~[elasticsearch-cli-6.2.3.jar:6.2.3]
        at org.elasticsearch.cli.Command.main( ~[elasticsearch-cli-6.2.3.jar:6.2.3]
        at org.elasticsearch.bootstrap.Elasticsearch.main( ~[elasticsearch-6.2.3.jar:6.2.3]
        at org.elasticsearch.bootstrap.Elasticsearch.main( ~[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( ~[elasticsearch-6.2.3.jar:6.2.3]
        at org.elasticsearch.bootstrap.Bootstrap.setup( ~[elasticsearch-6.2.3.jar:6.2.3]
        at org.elasticsearch.bootstrap.Bootstrap.init( ~[elasticsearch-6.2.3.jar:6.2.3]
        at org.elasticsearch.bootstrap.Elasticsearch.init( ~[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.


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:

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 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 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.