先上一张图
FATAL Error: listen EADDRNOTAVAIL 123.57.251.57:5601
配置文件我是这样配置的:
[root@head-kib ~]# cd /usr/local/kibana-6.5.4-linux-x86_64/config/
[root@head-kib config]# vim kibana.yml
server.port: 5601
server.host: "123.57.251.57"
elasticsearch.url: "http://192.168.246.234:9200" #ES节点
kibana.index: ".kibana"
因为用的是云虚拟机,所以这里的123.57.251.57是外网ip,我们应该用内网ip才行。
但是如果写localhost的话,虽然不会报错,5601端口也是正常启动,但是你访问5601端口会被拒绝。
[root@head-kib kibana-6.5.4-linux-x86_64]# netstat -nlp | grep 5601 #5601端口正常
tcp 0 0 127.0.0.1:5601 0.0.0.0:* LISTEN 11188/./bin/../node
[root@head-kib kibana-6.5.4-linux-x86_64]# curl -i http://123.57.251.57:5601
curl: (7) Failed connect to 123.57.251.57:5601; 拒绝连接
把ip改为0.0.0.0就能顺利访问到了。
必须先杀掉占用5601的进程才能重启,要不然会报错,说5601端口被占用
[root@head-kib kibana-6.5.4-linux-x86_64]# netstat -nlp | grep 5601
tcp 0 0 127.0.0.1:5601 0.0.0.0:* LISTEN 11188/./bin/../node
[root@head-kib kibana-6.5.4-linux-x86_64]# kill -9 11188 #杀掉
[root@head-kib kibana-6.5.4-linux-x86_64]# netstat -nlp | grep 5601
[3]+ 已杀死 nohup ./bin/kibana
[root@head-kib kibana-6.5.4-linux-x86_64]# nohup ./bin/kibana &
[3] 26192
[root@head-kib kibana-6.5.4-linux-x86_64]# nohup: 忽略输入并把输出追加到"nohup.out"
[root@head-kib kibana-6.5.4-linux-x86_64]# tail -f nohup.out
{"type":"log","@timestamp":"2020-04-01T04:41:25Z","tags":
["status","plugin:spaces@6.5.4","info"],"pid":26192,"state":"green","message":"Status changed from yellow to green - Ready","prevState":"yellow","prevMsg":"Waiting for Elasticsearch"}
日志没报错,再访问页面就出来了。