Can't restart kibana

I've just started to learn elasticsearch and kibana yesterday,
Today, when i try to restart kibana server, it's return me error:
FATAL Error: Port 5601 is already in use. Another instance of Kibana may be running!
Then, when i use this port i need to run bin/kibana-verification-code in terminal
but when i run it in terminal i have this error

Couldn't find verification code.

If Kibana hasn't been configured yet, restart Kibana to generate a new code.

Otherwise, you can safely ignore this message and start using Kibana.

I try to kill the process in linux,
sudo kill -9 $(sudo lsof -t -i:5601)
and after i reboot my computer,
but i can't stop and restart kibana.
what should i do?

Hello there!

First of all please disable service start at boot:

systemctl disable kibana

and reboot:

systemctl reboot

your machine. After that Kibana shoudn't start.
Please check once again what service uses 5601.
I've got another question: why do you use default port?

Hey, this work,
would i still need to run this command if i face this kind of thing again tomorrow?
I use default port because that's what it says in documentation,
am i doing wrong?
I need elasticsearch and kibana to send data in kafka so i need to learn first about elasticsearch,
As i learned in documentation yesterday, they say that kibana is used to send data in elasticsearch using dev-tools.
You can correct me if I'm wrong
Thanks

Please don't use default ports, for security reasons. For example I use for Elasticsearch port greater than 10000 and for Kibana port greater than 8000.

Now we should check what other service uses 5601 (you should know what is happening on your server):

sudo lsof -i:5601

result should look like this:

COMMAND   PID   USER   FD   TYPE  DEVICE SIZE/OFF NODE NAME
node    26758 kibana   29u  IPv4 1290480      0t0  TCP your.domain.address:port->your.ip.address:35060 (ESTABLISHED)
node    26758 kibana   33u  IPv4 1290481      0t0  TCP your.domain.address:port->your.ip.address:35026 (ESTABLISHED)
node    26758 kibana   51u  IPv4  697029      0t0  TCP your.domain.address:port (LISTEN)
node    26758 kibana  104u  IPv4 1290482      0t0  TCP your.domain.address:port->your.ip.address:35042 (ESTABLISHED)
node    26758 kibana  105u  IPv4 1290483      0t0  TCP your.domain.address:port->your.ip.address:35058 (ESTABLISHED)
node    26758 kibana  130u  IPv4 1359418      0t0  TCP your.domain.address:port->your.ip.address:44362 (ESTABLISHED)

then the right thing to do is to change all the default ports of elasticsearch and kibana is that it?
I change them by modifying their yml files isn't?

The right thing is NOT to use any default ports. Everyone knows that SSH uses port 22... Please considire security of your cluster.

Yes, you can change it in *.yml files.
How about Kibana now? Does it start properly?

Good!
yeah, kibana work properly!
thanks ^^

OK, so please reboot your server.
Command that we used says it should not start at boot time.
If it will than you have something wrong or you had enabled it as a service many times.

Hey!
I still have the same problem even if I changed the port.
I would like to know why does kibana return this error?

So... you changed KIbana port and you got same message that port is already in use?

Yes i've already change port,
I found the problem and this fix it:

systemctl disable kibana
systemctl reboot 
bin/elasticsearch-reset-password -u elastic

I think is the password which needs to change

Why?

pt., 26 sie 2022 o 09:43 Sarindra Therese Randriambeloson via Discuss the Elastic Stack <notifications@elastic.discoursemail.com> napisał(a):

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.