Although installing logstash, I get "logstash: unrecognized service"

Since I will need to install a logstash with out internet I downloaded the rpm (for version 5.2.0) and wrote "rpm -i ..." without running yum install. LogStash was installed, also after writing a test.conf I was able to run LogStash through command: " ./bin/logstash -f test.conf &". Through ps -ef | grep logstash I saw that LogStash was up.

The problem was when I pressed "service logstash status" etc. I received: " "logstash: unrecognized service".

Any help will be appreciated.

You've installed Logstash on a RHEL or CentOS box, I presume. Which version?

The bottom line is that for RHEL/CentOS 6.x, Logstash is installed as an upstart service, which you can start with initctl start logstash (or is it initctl logstash start? I never can remember the order).

If you installed on a RHEL/CentOS 7.x system, Logstash will be installed as a systemd service, which you can start with systemctl start logstash.

service start logstash does not work with either, though you can force install a SysV init script by running: /usr/share/logstash/bin/system-install /etc/logstash/startup.options sysv as root (or with sudo). You may still need to go through some hoops to make your system recognize it as a "service" after this. I recommend sticking with upstart/systemd.

3 Likes

Thanks!
This did the trick! (it is initctl start logstash at least on CentOS 6)
Also the manual build of the service did the trick!

Hi,

I know a long time passed from when you answered, but I was curios for the reasoning why by default logstash works like this?

Many Thanks,

Tomer

Logstash, being Ruby/JRuby based, uses a Ruby util called pleaserun to detect and automagically install the proper startup files.

1 Like

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