# Start ES on Centos 7.4 problem

**URL:** <https://discuss.elastic.co/t/start-es-on-centos-7-4-problem/125709>\
**Category:** Elasticsearch\
**Created:** [March 27, 2018, 7:45am UTC](https://discuss.elastic.co/t/start-es-on-centos-7-4-problem/125709 "2018-03-27T07:45:56Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mojster](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mojster/32/21209_2.png) [@Mojster](https://discuss.elastic.co/u/Mojster)\
**Post date:** [March 27, 2018, 7:45am UTC](https://discuss.elastic.co/t/start-es-on-centos-7-4-problem/125709/1 "2018-03-27T07:45:57Z")

</div>

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:

```auto
[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.

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [March 27, 2018, 8:24am UTC](https://discuss.elastic.co/t/start-es-on-centos-7-4-problem/125709/2 "2018-03-27T08:24:07Z")

</div>

> [@Mojster](#):
>
> can not run elasticsearch as root

See [Scripting and security | Elasticsearch Reference [6.2] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/6.2/modules-scripting-security.html#_do_not_run_as_root).

---

<div class="post-metadata">

**Author:** ![Mojster](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mojster/32/21209_2.png) [@Mojster](https://discuss.elastic.co/u/Mojster)\
**Post date:** [March 27, 2018, 8:34am UTC](https://discuss.elastic.co/t/start-es-on-centos-7-4-problem/125709/3 "2018-03-27T08:34:10Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Mojster](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mojster/32/21209_2.png) [@Mojster](https://discuss.elastic.co/u/Mojster)\
**Post date:** [March 28, 2018, 5:29am UTC](https://discuss.elastic.co/t/start-es-on-centos-7-4-problem/125709/4 "2018-03-28T05:29:17Z")

</div>

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](https://www.elastic.co/guide/en/elasticsearch/reference/6.2/bootstrap-checks.html) 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.

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [March 28, 2018, 6:32am UTC](https://discuss.elastic.co/t/start-es-on-centos-7-4-problem/125709/5 "2018-03-28T06:32:26Z")

</div>

What is the exact trace you are getting?

---

<div class="post-metadata">

**Author:** ![Mojster](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mojster/32/21209_2.png) [@Mojster](https://discuss.elastic.co/u/Mojster)\
**Post date:** [March 28, 2018, 6:45am UTC](https://discuss.elastic.co/t/start-es-on-centos-7-4-problem/125709/6 "2018-03-28T06:45:17Z")

</div>

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 🙂

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [April 25, 2018, 6:45am UTC](https://discuss.elastic.co/t/start-es-on-centos-7-4-problem/125709/7 "2018-04-25T06:45:23Z")

</div>

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