Logstash.service: Unit not found (ELK)

Issues related to applications and software problems
Post Reply
User avatar
weyderfs
Posts: 8
Joined: 2018/02/07 22:08:07
Location: Brazil
Contact:

Logstash.service: Unit not found (ELK)

Post by weyderfs » 2018/07/04 14:56:29

Hi everyone,
I'm having trouble starting Logstash in my Centos 7. I found several articles on Web, but not found a solution.

My configs:

Oracle Java 8

Code: Select all

$ echo $JAVA_HOME
$ /usr/bin/java

$java -version
java version "1.8.0_172"
Java(TM) SE Runtime Environment (build 1.8.0_172-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.172-b11, mixed mode)
I installed the Logstash by yum following this article: https://www.digitalocean.com/community/ ... n-centos-7

But when run:

Code: Select all

$ systemctl start logstash
Failed to start logstash.service: Unit not found
I try start manually Logstash:

Code: Select all

$/usr/share/logstash/bin/logstash
WARNING: Could not find logstash.yml which is typically located in $LS_HOME/config or /etc/logstash. You can specify the path using --path.settings. Continuing using the defaults
Could not find log4j2 configuration at path /usr/share/logstash/config/log4j2.properties. Using default config which logs errors to the console
ERROR: Failed to read pipelines yaml file. Location: /usr/share/logstash/config/pipelines.yml
usage:
bin/logstash -f CONFIG_PATH [-t] [-r] [] [-w COUNT] [-l LOG]
bin/logstash --modules MODULE_NAME [-M "MODULE_NAME.var.PLUGIN_TYPE.PLUGIN_NAME.VARIABLE_NAME=VALUE"] [-t] [-w COUNT] [-l LOG]
bin/logstash -e CONFIG_STR [-t] [--log.level fatal|error|warn|info|debug|trace] [-w COUNT] [-l LOG]
bin/logstash -i SHELL [--log.level fatal|error|warn|info|debug|trace]
bin/logstash -V [--log.level fatal|error|warn|info|debug|trace]
bin/logstash --help
[ERROR] 2018-07-03 16:43:51.955 [LogStash::Runner] Logstash - java.lang.IllegalStateException: Logstash stopped processing because of an error: (SystemExit) exit
Someone can help?
Last edited by weyderfs on 2018/07/04 16:47:35, edited 2 times in total.
LPIC-1 Linux Administrator - IT Enthusiast - DevOps

User avatar
TrevorH
Site Admin
Posts: 33219
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Logstash.service: Unit not found (ELK)

Post by TrevorH » 2018/07/04 15:02:28

What is the output from rpm -ql logstash | grep systemd (change the package name if it's not called logstash).
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

User avatar
weyderfs
Posts: 8
Joined: 2018/02/07 22:08:07
Location: Brazil
Contact:

Re: Logstash.service: Unit not found (ELK)

Post by weyderfs » 2018/07/04 16:44:41

Following output

Code: Select all

[root@scutum ~]# rpm -ql logstash | grep systemd
/usr/share/logstash/vendor/bundle/jruby/2.3.0/gems/pleaserun-0.0.30/lib/pleaserun/platform/systemd-user.rb
/usr/share/logstash/vendor/bundle/jruby/2.3.0/gems/pleaserun-0.0.30/lib/pleaserun/platform/systemd.rb
/usr/share/logstash/vendor/bundle/jruby/2.3.0/gems/pleaserun-0.0.30/spec/pleaserun/platform/systemd_spec.rb
/usr/share/logstash/vendor/bundle/jruby/2.3.0/gems/pleaserun-0.0.30/templates/systemd-user/default/prestart.sh
/usr/share/logstash/vendor/bundle/jruby/2.3.0/gems/pleaserun-0.0.30/templates/systemd-user/default/program.service
/usr/share/logstash/vendor/bundle/jruby/2.3.0/gems/pleaserun-0.0.30/templates/systemd/default/default
/usr/share/logstash/vendor/bundle/jruby/2.3.0/gems/pleaserun-0.0.30/templates/systemd/default/prestart.sh
/usr/share/logstash/vendor/bundle/jruby/2.3.0/gems/pleaserun-0.0.30/templates/systemd/default/program.service
LPIC-1 Linux Administrator - IT Enthusiast - DevOps

User avatar
TrevorH
Site Admin
Posts: 33219
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Logstash.service: Unit not found (ELK)

Post by TrevorH » 2018/07/04 18:46:37

So they are not shipping an file which installs under /usr/lib/systemd/system where package provided unit files should live. Nor are they providing any .service file under /etc/systemd/system either so that explains why it doesn't work. It is possible that the files ending in .service that show up in your grep are designed to be copied manually into place but it seems like a silly way to do it to me.

It's a packaging bug. They don't provide the file so there isn't one. You'll either need to raise it with logstash or write one yourself.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

User avatar
weyderfs
Posts: 8
Joined: 2018/02/07 22:08:07
Location: Brazil
Contact:

Re: Logstash.service: Unit not found (ELK)

Post by weyderfs » 2018/07/04 20:34:08

TrevorH wrote:
2018/07/04 18:46:37
So they are not shipping an file which installs under /usr/lib/systemd/system where package provided unit files should live. Nor are they providing any .service file under /etc/systemd/system either so that explains why it doesn't work. It is possible that the files ending in .service that show up in your grep are designed to be copied manually into place but it seems like a silly way to do it to me.

It's a packaging bug. They don't provide the file so there isn't one. You'll either need to raise it with logstash or write one yourself.
Thank you by awnser, I got around the problem following this steps:

Code: Select all

$ cd /usr/share/logstash/bin
$ ./system-install
This script "system-install" identifies what my service manager (init, SysV, Upstart, Systemd) and create the links with it. After run I could manager the service with systemctl.

Thanks by help.
Regards
LPIC-1 Linux Administrator - IT Enthusiast - DevOps

Post Reply