Logstash does not start as a service

running logstash as a service with a chef through

service 'logstash' do
  supports :status => true, :restart => true, :reload => true
  action [:enable, :restart]
end

I get

$ systemctl status logstash
logstash.service - LSB: Starts Logstash as a daemon.
   Loaded: loaded (/etc/rc.d/init.d/logstash)
   Active: active (exited) since Thu 2016-08-25 15:33:11 UTC; 1min 42s ago
  Process: 3235 ExecStart=/etc/rc.d/init.d/logstash start (code=exited, status=0/SUCCESS)

via systemctl restart logstash

$ systemctl status logstash
logstash.service - LSB: Starts Logstash as a daemon.
   Loaded: loaded (/etc/rc.d/init.d/logstash)
   Active: active (running) since Thu 2016-08-25 15:35:03 UTC; 4s ago
  Process: 3769 ExecStop=/etc/rc.d/init.d/logstash stop (code=exited, status=0/SUCCESS)
  Process: 3773 ExecStart=/etc/rc.d/init.d/logstash start (code=exited, status=0/SUCCESS)
   CGroup: /system.slice/logstash.service
           └─3780 /bin/java -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -Djava.awt.headless=true -XX:CMSInitiatingOccupancyFraction=7...

which then leads to logstash working properly

journalctl -u logstash (before manually restarting) gives

-- Logs begin at Thu 2016-08-25 15:15:03 UTC. --
Aug 25 15:26:58 machine_ip systemd[1]: Starting LSB: Starts Logstash as a daemon....
Aug 25 15:26:58 machine_ip logstash[3300]: logstash started.
Aug 25 15:26:58 machine_ip systemd[1]: Started LSB: Starts Logstash as a daemon..

what's wrong with him?

+4
source share
1 answer

what you are really looking for here ::

: start

Start the service and continue to work until it stops or shuts down.

: reboot

will restart it only when it detects a need, which, I believe, depends on some services.

using: start, make sure it starts the first time.

0
source

Source: https://habr.com/ru/post/1652594/


All Articles