Kibana(Win/Linux)连接远程Elasticsearch

本文详细介绍在Windows和Linux环境下安装及配置Kibana的过程,包括版本匹配、环境准备、下载与解压、配置文件修改及启动方法。特别强调解决Kibana连接Elasticsearch时的常见错误。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

这篇文章演示Window/Linux安装Kibana

环境准备

1.Win环境
2.Linux环境
3.ES一台

前言

注意:这里不管是Linux还是Win环境下使用Kibana,这个Kibana的版本必须和ES的版本一致
查看ES版本
在这里插入图片描述
Kibana和ES版本不一致启动报错
在这里插入图片描述

Win启动Kibana

1.下载程序包
官网地址

2.查询对应的ES版本
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
这个下载速度有点慢!!!这里提供一种方法下载速度会快很多!!!
复制这个下载地址(我这是谷歌浏览器)
在这里插入图片描述
使用迅雷下载
在这里插入图片描述
3.解压(这个最好不要放在中文目录)
在这里插入图片描述
4.基本操作目录
在这里插入图片描述
5.修改config中的kibana.yml配置文件
这个文件修改网上的有设置url的,这里win版的就是hosts
在这里插入图片描述
一个是默认端口,一个是连接远程ES地址,这里注意空格,被ES的配置文件搞怕了
6.启动Win版的Kibana
两种方法
1.进入bin目录点击kibana.bat脚本文件运行
在这里插入图片描述
2.CMD进入bin命令运行kibana.bat脚本,结果一样

Linux启动Kibana

1.拉起kibana镜像

docker pull kibana:7.4.2

这里如果是私有仓库可能没有权限拉取这个镜像,会拉取这个镜像失败,同时这个镜像拉取时间也比较长,如果一次不行就多pull几次,这里需要注意,版本与ES的版本一致

这里先不用docker命令启动,使用外部挂载配置的方式,演示一个docker安装程序本机访问的一个坑

2.创建外部config、kibana.yml文件
在这里插入图片描述
3.Docker启动Kibana

docker run --name ki -v /data/ki/kibana.yml:/usr/share/kibana/config/kibana.yml -p 5601:5601 -d kibana:7.4.2
-v为外部挂载目录

4.查看日志,报错,连接不上ES

docker logs ki
{"type":"log","@timestamp":"2020-07-09T02:54:42Z","tags":["warning","elasticsearch","admin"],"pid":7,"message":"Unable to revive connection: http://localhost:9200/"}
{"type":"log","@timestamp":"2020-07-09T02:54:42Z","tags":["warning","elasticsearch","admin"],"pid":7,"message":"No living connections"}
{"type":"log","@timestamp":"2020-07-09T02:54:44Z","tags":["warning","elasticsearch","admin"],"pid":7,"message":"Unable to revive connection: http://localhost:9200/"}
{"type":"log","@timestamp":"2020-07-09T02:54:44Z","tags":["warning","elasticsearch","admin"],"pid":7,"message":"No living connections"}
{"type":"log","@timestamp":"2020-07-09T02:54:47Z","tags":["warning","elasticsearch","admin"],"pid":7,"message":"Unable to revive connection: http://localhost:9200/"}
{"type":"log","@timestamp":"2020-07-09T02:54:47Z","tags":["warning","elasticsearch","admin"],"pid":7,"message":"No living connections"}
{"type":"log","@timestamp":"2020-07-09T02:54:49Z","tags":["warning","elasticsearch","admin"],"pid":7,"message":"Unable to revive connection: http://localhost:9200/"}
{"type":"log","@timestamp":"2020-07-09T02:54:49Z","tags":["warning","elasticsearch","admin"],"pid":7,"message":"No living connections"}
{"type":"log","@timestamp":"2020-07-09T02:54:52Z","tags":["warning","elasticsearch","admin"],"pid":7,"message":"Unable to revive connection: http://localhost:9200/"}
{"type":"log","@timestamp":"2020-07-09T02:54:52Z","tags":["warning","elasticsearch","admin"],"pid":7,"message":"No living connections"}
{"type":"log","@timestamp":"2020-07-09T02:54:54Z","tags":["warning","elasticsearch","admin"],"pid":7,"message":"Unable to revive connection: http://localhost:9200/"}
{"type":"log","@timestamp":"2020-07-09T02:54:54Z","tags":["warning","elasticsearch","admin"],"pid":7,"message":"No living connections"}
{"type":"log","@timestamp":"2020-07-09T02:54:57Z","tags":["warning","elasticsearch","admin"],"pid":7,"message":"Unable to revive connection: http://localhost:9200/"}
{"type":"log","@timestamp":"2020-07-09T02:54:57Z","tags":["warning","elasticsearch","admin"],"pid":7,"message":"No living connections"}
{"type":"log","@timestamp":"2020-07-09T02:54:59Z","tags":["warning","elasticsearch","admin"],"pid":7,"message":"Unable to revive connection: http://localhost:9200/"}
{"type":"log","@timestamp":"2020-07-09T02:54:59Z","tags":["warning","elasticsearch","admin"],"pid":7,"message":"No living connections"}
{"type":"log","@timestamp":"2020-07-09T02:55:02Z","tags":["warning","elasticsearch","admin"],"pid":7,"message":"Unable to revive connection: http://localhost:9200/"}
{"type":"log","@timestamp":"2020-07-09T02:55:02Z","tags":["warning","elasticsearch","admin"],"pid":7,"message":"No living connections"}
{"type":"log","@timestamp":"2020-07-09T02:55:04Z","tags":["warning","elasticsearch","admin"],"pid":7,"message":"Unable to revive connection: http://localhost:9200/"}
{"type":"log","@timestamp":"2020-07-09T02:55:04Z","tags":["warning","elasticsearch","admin"],"pid":7,"message":"No living connections"}
{"type":"log","@timestamp":"2020-07-09T02:55:07Z","tags":["warning","elasticsearch","data"],"pid":7,"message":"Unable to revive connection: http://localhost:9200/"}
{"type":"log","@timestamp":"2020-07-09T02:55:07Z","tags":["warning","elasticsearch","data"],"pid":7,"message":"No living connections"}
{"type":"log","@timestamp":"2020-07-09T02:55:07Z","tags":["license","warning","xpack"],"pid":7,"message":"License information from the X-Pack plugin could not be obtained from Elasticsearch for the [data] cluster. Error: No Living connections"}
{"type":"log","@timestamp":"2020-07-09T02:55:07Z","tags":["warning","elasticsearch","admin"],"pid":7,"message":"Unable to revive connection: http://localhost:9200/"}
{"type":"log","@timestamp":"2020-07-09T02:55:07Z","tags":["warning","elasticsearch","admin"],"pid":7,"message":"No living connections"}
{"type":"log","@timestamp":"2020-07-09T02:55:09Z","tags":["warning","elasticsearch","admin"],"pid":7,"message":"Unable to revive connection: http://localhost:9200/"}
{"type":"log","@timestamp":"2020-07-09T02:55:09Z","tags":["warning","elasticsearch","admin"],"pid":7,"message":"No living connections"}
{"type":"log","@timestamp":"2020-07-09T02:55:10Z","tags":["warning","elasticsearch","admin"],"pid":7,"message":"Unable to revive connection: http://localhost:9200/"}
{"type":"log","@timestamp":"2020-07-09T02:55:10Z","tags":["warning","elasticsearch","admin"],"pid":7,"message":"No living connections"}
{"type":"log","@timestamp":"2020-07-09T02:55:10Z","tags":["reporting","esqueue","queue-worker","error"],"pid":7,"message":"kce74dcc000797761e9xzw61 - job querying failed: Error: No Living connections\n    at sendReqWithConnection (/usr/share/kibana/node_modules/elasticsearch/src/lib/transport.js:266:15)\n    at next (/usr/share/kibana/node_modules/elasticsearch/src/lib/connection_pool.js:243:7)\n    at process._tickCallback (internal/process/next_tick.js:61:11)"}
{"type":"log","@timestamp":"2020-07-09T02:55:12Z","tags":["warning","elasticsearch","admin"],"pid":7,"message":"Unable to revive connection: http://localhost:9200/"}
{"type":"log","@timestamp":"2020-07-09T02:55:12Z","tags":["warning","elasticsearch","admin"],"pid":7,"message":"No living connections"}
{"type":"log","@timestamp":"2020-07-09T02:55:14Z","tags":["warning","elasticsearch","admin"],"pid":7,"message":"Unable to revive connection: http://localhost:9200/"}
{"type":"log","@timestamp":"2020-07-09T02:55:14Z","tags":["warning","elasticsearch","admin"],"pid":7,"message":"No living connections"}
{"type":"log","@timestamp":"2020-07-09T02:55:17Z","tags":["warning","elasticsearch","admin"],"pid":7,"message":"Unable to revive connection: http://localhost:9200/"}
{"type":"log","@timestamp":"2020-07-09T02:55:17Z","tags":["warning","elasticsearch","admin"],"pid":7,"message":"No living connections"}
{"type":"log","@timestamp":"2020-07-09T02:55:19Z","tags":["warning","elasticsearch","admin"],"pid":7,"message":"Unable to revive connection: http://localhost:9200/"}
{"type":"log","@timestamp":"2020-07-09T02:55:19Z","tags":["warning","elasticsearch","admin"],"pid":7,"message":"No living connections"}

这是肯定会在本机上来个curl http://localhost:9200来测试ES是否能找的到,那么恭喜,试了这个curl命令,那么你就更加坚信kibana中配置 http://localhost:9200没错,事实上是能curl访问,但是就是docker自动分配的容器ip有问题导致的
在这里插入图片描述

很多文章这里都是本机ip或者localhost,但是这就是坑,我们这是使用的是docker装载的ES,而且Kibnan也是在同一台机器,这里就会有问题!!!

5.查看Docker中ES容器的IP

docker inspect es  |grep IPAddress

在这里插入图片描述
得到Docker为ES容器分配的IP为172.17.0.11

6.修改ES连接配置为Docker分配的IP
在这里插入图片描述

7.重启Kibana

docker restart ki

http://服务器ip:5601
在这里插入图片描述

8.使用Docker命令设置ES地址启动kibana
这个前提是知道Docker给ES分配的IP,关于其他Docker启动参数如下,官网在这里插入图片描述

docker run --name ki -e ELASTICSEARCH_HOSTS=http://172.17.0.11:9200 -p 5601:5601 -d kibana:7.4.2

在这里插入图片描述
9.访问测试
在这里插入图片描述

这里有两个选项,一个是导入默认数据,一个是导入自己的数据,这里我们选择导入自己的,也就是右边的

10.如果访问不到那么需要设置一下host
在这里插入图片描述
因为默认挂载的配置文件中采用的是localhost,也就是只有本机能够访问

补充汉化
在这里插入图片描述
开始汉化,这里不过是win版还是lin版的都一样,修改配置重启就可以了
在这里插入图片描述
在这里插入图片描述
这里注意有一个空格!没空格重启是这样的!
在这里插入图片描述
搞定!

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

程序员劝退师-TAO

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值