Launch Kibana 4 after disconnecting an SSH session

I installed versions of ElasticSearch and Kibana in the Ubuntu Linux 14 field. So Kibana 4 on ElasticSearch 1.4.4.

Works and works like a charm: ./bin/kibana

However, as soon as I disconnect the Putty session, Kibana stops working. ElasticSearch continues to listen on port 9200, but Kibana can no longer be reached at 5601.

It seems that the difference is that Kibana is in the foreground - because as soon as you run it, you see that the log messages are constantly flying. Using -q will make it really calm - but it does not work in the background.

So, I read somewhere that working in the background can work: ./bin/kibana & . This is not true. Also does not work CTRL-Z and then bg .

Therefore, perhaps the reason is that I run Kibana as a registered user, and when I log out, it kills all processes of this user. So I tried sudo adduser kibanarunner and sudo -u kibanarunner ./bin/kibana , but that didn't help either.

I want Kibana to stay out of work after stopping an SSH session - how can I do this?

+6
source share
5 answers

You can disconnect the process from the session.

 ./bin/kibana & disown 
+7
source

Louis-Philippe Huberdo's answer did not work for me, so this is my solution:

 sh kibana-4.0.1-linux-x64/bin/kibana >> /var/log/kibana.log(or /dev/null) & 
+8
source

I find working Kibana4 as a service the most convenient practice. It works (almost flawlessly) even after disabling SSH. You can (re) start / stop it with one simple command. To start Kibana as a service, first download the kibana4 init script:

 cd /etc/init.d sudo wget https://gist.githubusercontent.com/thisismitch/8b15ac909aed214ad04a/raw/bce61d85643c2dcdfbc2728c55a41dab444dca20/kibana4 

Turn on the Kibana4 service and you will be fine:

 sudo chmod +x /etc/init.d/kibana4 sudo update-rc.d kibana4 defaults 96 9 sudo service kibana4 start 

Full credits for this answer are sent by this wonderful step-by-step ELK installation guide. You can do the same for Elasticsearch, Logstash and Logstash-forwarder.

+4
source

You should try using

screen -d -m./bin/kibana

Or another useful way:

nohup./bin/kibana> kibana.log 2> & 1 &

+3
source

I recommend this command (ubuntu): nohup ./kibana/bin/kibana &

0
source

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


All Articles