1

I'm trying to use Kibana 4 as a service. I've tried this repository code https://github.com/cjcotton/init-kibana/blob/master/kibana changing KIBANA_BIN to KIBANA_BIN=/usr/local/kibana/bin but it doesn't work. I dont know what to put in the DAEMON_USER.

When I use /etc/init.d/kibana status it appears kibana dead but pid file exists

Do you have any idea about it? Thank you

billy6
  • 103
  • 3
  • 10

3 Answers3

2

I actually am the owner of that repo. This script is specifically to run Kibana4 as a non-root user on CentOS (or RHEL-based distros).

There's a few problems that you might be running into.

First, /usr/local/kibana/bin. You'll want to make sure that that location + file is owned by the user you want to run Kibana as (aka the DAEMON_USER).

Second, DAEMON_USER is the name of the user you want to run the Kibana process as. You need to be able to run sudo service kibana start|stop|restart, however, normally it would run that process as root (per sudo). This script passes it off to the defined user so the process is running as app_kibana, rather than root. If you are having an issue with pidfiles, are you not running sudo service kibana start?

Per the example, if I installed kibana4 to lets say -- /opt and wanted to run it with the user app_kibana, it would be something like this;

# Configure location of Kibana bin
KIBANA_BIN=/opt/kibana/current/bin
# Configure User to run daemon process
DAEMON_USER=app_kibana

Then I would run

sudo service kibana start 

and if you did a

ps aux | grep kibana 

you'd see that the process was running under app_kibana.

app_kib+ 12425  0.0  0.1 113116  1420 ?        Ss   02:38   0:00 bash -c ulimit -S -c 0 >/dev/null 2>&1 ; /opt/kibana/bin/kibana
app_kib+ 12426 28.0  4.9 844212 50040 ?        Sl   02:38   0:01 /opt/kibana/bin/../node/bin/node /opt/kibana/bin/../src/bin/kibana.js

Sorry for the long explanation, but that's how it goooeees...!

Ethabelle
  • 325
  • 1
  • 2
  • 9
  • I get the same error.. " kibana dead but pid file exists" – billy6 Aug 28 '15 at 09:26
  • Right, I don't have this error. I cannot replicate it on any of the production servers this script exists on. If you have an issue, you need to give more than just the same error you've given before or I'm going to assume it's not a script-related issue, but a user one. – Ethabelle Aug 30 '15 at 01:20
-1

Set DAEMON_USER=kibana_user

Then start Kibana service using /etc/init.d/kibana start

Yuvraj Gupta
  • 2,475
  • 16
  • 26
  • It doesn't work...that is the problem.. with '/etc/init.d/kibana' it says me ' status kibana dead but pid file exists' – billy6 Aug 18 '15 at 11:08
  • Have you set the daemon_user as mentioned? You can check your settings using this tutorial :- http://sysads.co.uk/2015/07/install-elasticsearch-1-7-x-and-kibana-4-1-x-on-centos-6-5/ – Yuvraj Gupta Aug 18 '15 at 11:47
  • I have tried it but appears [root@radelog01 bin]# nano /etc/init.d/kibana [root@radelog01 bin]# /etc/init.d/kibana restart Stopping Kibana4 : [FAILED] Starting Kibana4 : [ OK ] [root@radelog01 bin]# /etc/init.d/kibana status kibana dead but pid file exists – billy6 Aug 20 '15 at 14:09
  • Maybe you can kill the pid file and try again. Sorry i am unable to solve your error. – Yuvraj Gupta Aug 21 '15 at 12:42
  • I I had the same error. I checked `/var/log/kibana.log` and it told me exactly what the issue was. In my case I had incorrectly set the value of KIBANA_BIN. After that it worked fine. – Steve E. Jan 12 '16 at 13:53
-2

Solution:

nohup ./kibana &

billy6
  • 103
  • 3
  • 10