Can't set up ES service on CentOS 7

(John Sid) #1

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:

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.


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

(Tyler Langlois) #2

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, 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?

(John Sid) #3

Thank you. This helped!

(system) #4