# Can't set up ES service on CentOS 7

**URL:** <https://discuss.elastic.co/t/cant-set-up-es-service-on-centos-7/289>\
**Category:** Elasticsearch\
**Created:** [May 6, 2015, 12:59pm UTC](https://discuss.elastic.co/t/cant-set-up-es-service-on-centos-7/289 "2015-05-06T12:59:35Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![davisjs](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davisjs/32/44912_2.png) [@davisjs](https://discuss.elastic.co/u/davisjs)\
**Post date:** [May 6, 2015, 12:59pm UTC](https://discuss.elastic.co/t/cant-set-up-es-service-on-centos-7/289/1 "2015-05-06T12:59:35Z")

</div>

I've had success with older versions of ElasticSearch (1.0.x) on Fedora. I now need to install ES 1.5 on CentOS 7. Getting ES to run on CentOS 7 is easy but I'm having trouble running it as a service. I'm aware of the following page for setting up ES as a service on Linux:

[http://www.elastic.co/guide/en/elasticsearch/reference/1.3/setup-service.html](http://www.elastic.co/guide/en/elasticsearch/reference/1.3/setup-service.html)

CentOS 7 has moved from chkconfig to systemd. I've tried installing via rpm but I'm getting an error when starting via `/bin/systemctl`; when running `sudo /bin/systemctl start elasticsearch.service` (after running daemon-reload and enable) the service is not starting. Alternatively, I've tried installing ES via a tarball but in that case I can't find the elasticsearch service unit file that should be placed in /etc/sysconfig. It appears that the tarball doesn't contain the service file that used to exist for ES 1.0.

Are there recommendations on how to set up a systemd service via a tarball? What should the service unit file look like.

Thanks!

and run it as a service. When I use the RPM installation method,

---

<div class="post-metadata">

**Author:** ![tylerjl](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tylerjl/32/44965_2.png) [@tylerjl](https://discuss.elastic.co/u/tylerjl)\
**Post date:** [May 6, 2015, 4:30pm UTC](https://discuss.elastic.co/t/cant-set-up-es-service-on-centos-7/289/2 "2015-05-06T16:30:23Z")

</div>

You're on the right track - elasticsearch should be started via a systemd unit on CentOS 7. In the case of the tarball, the service files aren't normally contained because the tarball is distribution-agnostic and thus doesn't come bundled with a service file (whether that be sysv, systemd, upstart, or otherwise.)

If you're following the [guide for installing via the official repositories](http://www.elastic.co/guide/en/elasticsearch/reference/current/setup-repositories.html), the package should have installed the systemd unit for you and your `start` command should be working.

You say that the service isn't starting, however - if that's the case, take a look at the output of `systemctl status elasticsearch` or, if you need more info, look at the logs in `/var/log/elasticsearch`. Does any of that output clarify what's happening?

---

<div class="post-metadata">

**Author:** ![davisjs](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davisjs/32/44912_2.png) [@davisjs](https://discuss.elastic.co/u/davisjs)\
**Post date:** [May 6, 2015, 11:28pm UTC](https://discuss.elastic.co/t/cant-set-up-es-service-on-centos-7/289/3 "2015-05-06T23:28:52Z")

</div>

Thank you. This helped!

---

<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:** [July 6, 2017, 12:15am UTC](https://discuss.elastic.co/t/cant-set-up-es-service-on-centos-7/289/4 "2017-07-06T00:15:16Z")

</div>


