Port 5601 is already in use. Another instance of Kibana may be running!\n

Hello,

I am having an issue with the Open Distro setup. The Kibana service automatically down after the restart, pasting the error log from /var/log/kibana/kibana.stdout below,

{“type”:“log”,“@timestamp”:“2019-08-13T19:34:49Z”,“tags”:[“fatal”,“root”],“pid”:12604,“message”:“Error: Port 5601 is already in use. Another instance of Kibana may be running!\n at Root.shutdown (/usr/share/kibana/src/core/server/root/index.js:53:26)\n at Root.start (/usr/share/kibana/src/core/server/root/index.js:45:24)\n at process._tickCallback (internal/process/next_tick.js:68:7)”}

Need a helping hand!

When that happens to me, it has been a zombie process. You can check for any other kibana instances running with systemctl or ps.

$ systemctl status | grep kibana
├─kibana.service
│ └─2360 /usr/share/kibana/bin/…/node/bin/node --no-warnings --max-http-header-size=65536 --max_old_space_size=4096 /usr/share/kibana/bin/…/src/cli -c /etc/kibana/kibana.yml

$ ps aux | grep kibana
kibana 2360 8.9 0.2 1387792 324436 ? Ssl Aug01 032:50 /usr/share/kibana/bin/…/node/bin/node --no-warnings --max-http-header-size=65536 --max_old_space_size=4096 /usr/share/kibana/bin/…/src/cli -c /etc/kibana/kibana.yml

You can also check for any other process that could have the port open. Kibana will show up as a node app in a netstat list.

$ netstat -tlnp | grep 5601
tcp 0 0 127.0.0.1:5601 0.0.0.0:* LISTEN 2360/node

You may have to kill it if systemctl stop kibana.service doesn’t work and it is a zombie process that is holding the port open.