How can I install systemd module into the ES serverinstalled from the archive?

I've installed Elasticsearch 7.6 from archive (not RPM) on Cent OS 7 and configuring it.
( I cannot use RPM release of ES in this case, due to a requrement from other software.)

Now I could launch the server via command-line and tried to make it autostart through systemd, but I couldn't.
The cause seems for me that "systemd" module is missing in the "archive" release of ES...
Is there any way to manually install the module ?

What I've tried:
1.
copied the service unit file (/usr/lib/systemd/system/elasticsearch.service) and some related files from RPM installed environment

modified some path configurations in the unit file and env files.

systemctl daemon-reload
systemctl start elasticsearch.service

After that, the start command will fail due to "timeout" and the ES server fell into stopped, even though it once seemed successfully launched and accessible.
So, I suspect the failure occurred by that systemd failed to catch the process status of ES.
And now, I found the "systemd" module which notifies systemd of the service status was not installed in the Linux-x64 "archive" version. It seems to be installed only in the RPM and Debian Package releases.
So, I think I can implement autostart even in the "install from archive" environment if I can install the systemd module into it.
Does anyone have any idea ?
Or I have no choice but to use OS package (RPM or DEB) if I want to configure it autostart ?

Welcome to our community! :smiley:

There is no init scripts included in the tar.gz as it's not intended to be run in that manner.

Can't you just install RPM on another VM or Docker container and 'borrow' the systemd parts from there? Or from the debian/ubuntu versions if you want, as I think they use it, too.

Also, wondering why you can't use RPM - what kind of conflict and is that really hard to get around with a bit of RPM fun?

Mark, Steve, Thank you so much for the replies.
I see. I understand the standard way is to use RPM build if I need the auto-start functionality.

Also, wondering why you can't use RPM - what kind of conflict and is that really hard to
get around with a bit of RPM fun?

The reason comes from the software I would like to use with Elasticsearch... It will make some configuration changes by a installation script in it, but it rigidly assumes the directory structure of archive build (e.g. the config files must be under $ES_HOME/config/)
But I know, it's the software that is slightly mad. The conclusion is completely understandable for me. Thank you!

Not sure I understand as RPM is not related to autostart - you should always use RPMs if possible for many reasons; installing init scripts is one of them (auto start is from chkconfig/systemd), but also dependencies, paths, future upgrades, and lots of other things.

After you install with RPM you can still re-configure ES config to use various paths, etc. But of course, it all depends.

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