ElasticSearch 6.x 学习笔记:3.Kibana插件

3.1 下载Kibana插件

https://www.elastic.co/downloads/kibana

这里写图片描述

注意,ElasticSearch版本是6.1.1,kibana的版本必须对应,所以,此处下载kibana-6.1.1-linux-x86_64.tar.gz

[es@node1 ~]$ wget https://artifacts.elastic.co/downloads/kibana/kibana-6.1.1-linux-x86_64.tar.gz
--2018-01-06 04:30:47--  https://artifacts.elastic.co/downloads/kibana/kibana-6.1.1-linux-x86_64.tar.gz
Resolving artifacts.elastic.co (artifacts.elastic.co)... 184.73.156.41, 54.235.82.130, 184.72.218.26, ...
Connecting to artifacts.elastic.co (artifacts.elastic.co)|184.73.156.41|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 65947685 (63M) [application/x-gzip]
Saving to: ‘kibana-6.1.1-linux-x86_64.tar.gz’

100%[============================================================================================>] 65,947,685   190KB/s   in 16m 34s

2018-01-06 04:47:24 (64.8 KB/s) - ‘kibana-6.1.1-linux-x86_64.tar.gz’ saved [65947685/65947685]

[es@node1 ~]$ 

3.2 解压缩

[es@node1 ~]$ tar -zxvf kibana-6.1.1-linux-x86_64.tar.gz

进入kibana根目录

[es@node1 ~]$ cd kibana-6.1.1-linux-x86_64
[es@node1 kibana-6.1.1-linux-x86_64]$

3.3 修改配置

修改kibana配置文件kibana.yml

[es@node1 kibana-6.1.1-linux-x86_64]$ vi config/kibana.yml 

需要配置两处
(1)kibana向外提供服务,运行远程用户访问

# To allow connections from remote users, set this parameter to a non-loopback address.
server.host: "node1"

(2)配置elasticsearch.url

# The URL of the Elasticsearch instance to use for all your queries.
elasticsearch.url: "http://node1:9200"

3.4 启动kibana

[es@node1 kibana-6.1.1-linux-x86_64]$ bin/kibana
  log   [15:10:36.975] [info][status][plugin:kibana@6.1.1] Status changed from uninitialized to green - Ready
  log   [15:10:37.109] [info][status][plugin:elasticsearch@6.1.1] Status changed from uninitialized to yellow - Waiting for Elasticsearch
  log   [15:10:37.154] [info][status][plugin:console@6.1.1] Status changed from uninitialized to green - Ready
  log   [15:10:37.227] [info][status][plugin:metrics@6.1.1] Status changed from uninitialized to green - Ready
  log   [15:10:37.279] [info][status][plugin:elasticsearch@6.1.1] Status changed from yellow to green - Ready
  log   [15:10:38.033] [info][status][plugin:timelion@6.1.1] Status changed from uninitialized to green - Ready
  log   [15:10:38.057] [info][listening] Server running at http://node1:5601

这里写图片描述

3.5 简单应用

这里写图片描述

这里写图片描述

curl -XGET “http://node1:9200/test/_search

[root@node1 ~]# curl -XGET "http://node1:9200/test/_search"
{"took":3,"timed_out":false,"_shards":{"total":5,"successful":5,"skipped":0,"failed":0},"hits":{"total":0,"max_score":null,"hits":[]}}[root@node1 ~]# 

3.6 可能遇到的问题

启动kibana后关闭shell窗口后kibana自动关闭
解决办法:退出当前登录窗口用exit命令,不要直接点击窗口上的叉来关闭

[elastic@node1 kibana-5.6.9]$ bin/kibana &
[1] 9709
[elastic@node1 kibana-5.6.9]$   log   [14:50:31.223] [info][status][plugin:kibana@5.6.9] Status changed from uninitialized to green - Ready
  log   [14:50:31.343] [info][status][plugin:elasticsearch@5.6.9] Status changed from uninitialized to yellow - Waiting for Elasticsearch
  log   [14:50:31.401] [info][status][plugin:console@5.6.9] Status changed from uninitialized to green - Ready
  log   [14:50:31.448] [info][status][plugin:metrics@5.6.9] Status changed from uninitialized to green - Ready
  log   [14:50:31.489] [info][status][plugin:elasticsearch@5.6.9] Status changed from yellow to green - Kibana index ready
  log   [14:50:31.737] [info][status][plugin:timelion@5.6.9] Status changed from uninitialized to green - Ready
  log   [14:50:31.743] [info][listening] Server running at http://node1:5601
  log   [14:50:31.745] [info][status][ui settings] Status changed from uninitialized to green - Ready

[elastic@node1 kibana-5.6.9]$ 
[elastic@node1 kibana-5.6.9]$ exit
logout
Connection closing...Socket close.

Connection closed by foreign host.

Disconnected from remote host(ES-5.6) at 22:52:23.

Type `help' to learn how to use Xshell prompt.
[d:\~]$ 

这样的话,http://node1:5601页面依然可以访问


为了操作方便,也可以设置环境变量

[root@elastic1 ~]# vi /etc/profile.d/custom.sh 
[root@elastic1 ~]# cat /etc/profile.d/custom.sh
#!/bin/bash
#java path
export JAVA_HOME=/opt/jdk1.8.0_192
export PATH=$PATH:$JAVA_HOME/bin
export CLASSPATH=.:$CLASSPATH:$JAVA_HOME/lib

#kibana
export PATH=$PATH:/opt/kibana-6.4.3/bin
[root@elastic1 ~]#
[root@elastic1 ~]# source /etc/profile.d/custom.sh 
[elastic@elastic1 ~]$ kibana &
[1] 15969
[elastic@elastic1 ~]$
  • 4
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 7
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 7
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值