【es】es 5.x kibana、x-pack插件的安装和简单使用

一、背景

es集群已经安装完成,版本为5.2.2。

192.168.100.176:9200

192.168.100.177:9200

192.168.100.178:9200

es、kiban和x-pack版本一定要对应,保持一样。

二、安装kibana

# yum -y install  https://artifacts.elastic.co/downloads/kibana/kibana-5.2.2-x86_64.rpm

# grep -Ev "#|^$" /etc/kibana/kibana.yml

########################################

server.port: 5601

server.host: "192.168.100.153"

elasticsearch.url: "http://192.168.100.177:9200"

#########################################

三、es集群、kibana节点安装x-pack插件

x-pack是一个集安全,警报,监视,报告和图形功能为一体的软件包。

在es5.0.0之前,必须安装各种插件才有x-pack所具有的功能,有了x-pack后,减少了很多不必要的麻烦。

如果是第一次安装x-pack,整个集群内的服务都需要重新启动(建议第一次装es等插件就把x-pack装上),并且每个节点上的es都要安装x-pack插件,不然不会成功组成一个集群。

在kibanna节点

# /usr/share/kibana/bin/kibana-plugin install x-pack

#################################################################################

Attempting to transfer from x-pack

Attempting to transfer from https://artifacts.elastic.co/downloads/kibana-plugins/x-pack/x-pack-5.2.2.zip

Transferring 108045644 bytes....................

Transfer complete

Retrieving metadata from plugin archive

Extracting plugin archive

Extraction complete

Optimizing and caching browser bundles...

Plugin installation complete

#################################################################################

# chown -R kibana:kibana /usr/share/kibana/plugins/

# ll /usr/share/kibana/plugins/x-pack/

在es集群各节点

$  bin/elasticsearch-plugin  install  x-pack

es01 

$  cat  elasticsearch/config/elasticsearch.yml

################################################################

cluster.name: es

node.name: 192.168.100.176

bootstrap.memory_lock: true

bootstrap.system_call_filter: false

thread_pool.bulk.queue_size: 2000

network.host: 0.0.0.0

network.publish_host: 192.168.100.176

http.port: 9200

transport.tcp.port: 9300

http.cors.enabled: true

http.cors.allow-origin: '*'

discovery.zen.ping.unicast.hosts: ['192.168.100.178:9300', '192.168.100.177:9300', '192.168.100.176:9300']

# x-pack

xpack.security.enabled: false

xpack.monitoring.enabled: true

xpack.graph.enabled: false

xpack.watcher.enabled: false

################################################################

es02

$  cat  elasticsearch/config/elasticsearch.yml

######################################################################

cluster.name: es

node.name: 192.168.100.177

bootstrap.memory_lock: true

bootstrap.system_call_filter: false

thread_pool.bulk.queue_size: 2000

network.host: 0.0.0.0

network.publish_host: 192.168.100.177

http.port: 9200

transport.tcp.port: 9300

http.cors.enabled: true

http.cors.allow-origin: '*'

discovery.zen.ping.unicast.hosts: ['192.168.100.178:9300', '192.168.100.177:9300', '192.168.100.176:9300']

# x-pack

xpack.security.enabled: false

xpack.monitoring.enabled: true

xpack.graph.enabled: false

xpack.watcher.enabled: false

#######################################################################

es03

$  cat  elasticsearch/config/elasticsearch.yml

#######################################################################

cluster.name: es

node.name: 192.168.100.178

bootstrap.memory_lock: true

bootstrap.system_call_filter: false

thread_pool.bulk.queue_size: 2000

network.host: 0.0.0.0

network.publish_host: 192.168.100.178

http.port: 9200

transport.tcp.port: 9300

http.cors.enabled: true

http.cors.allow-origin: '*'

discovery.zen.ping.unicast.hosts: ['192.168.100.178:9300', '192.168.100.177:9300', '192.168.100.176:9300']

# x-pack

xpack.security.enabled: false

xpack.monitoring.enabled: true

xpack.graph.enabled: false

xpack.watcher.enabled: false

#######################################################################

重启es集群个节点上es进程

重启kibaba

# systemctl restart kibana

# systemctl status kibana 

访问http://xx.xx.xx.xx:5601

四、监控数据es索引

我们具体看一下monitor索引内容以及kibana自带的监控功能

kibana监控功能

kibana监控模块通过调用es索引存储的监控数据,制作了许多开箱即用报表供用户使用。主要分为集群层面、节点层面和索引层面。

kibana通过es索引中存储的数据计算出了许多指标报表,如图所示包含了查询(加载)速率查询(加载)延时,除此之外还有cpu、内存、存储以及负载占用等等许多指标。

# curl http://127.0.0.1:9200/_cat/indices | grep kibana

# curl http://127.0.0.1:9200/_cat/shards | grep kibana

monitor索引

es的监控数据是以统一的索引模板构造的按天分区索引存储的,如下如所示

# curl http://127.0.0.1:9200/_cat/indices | grep monitoring-es

# curl http://127.0.0.1:9200/_cat/shards | grep monitoring-es

默认索引只保留最近七天的数据,每隔10s会生成一个新的文档。

.monitoring-es模板mapping包含一些元数据信息如集群id、时间戳和hosts信息等,当前文档类型由type字段标记。

每类的数据都有自己独立的一些mapping,如索引信息汇总类数据indices_stats具有主分片和总的数据量、存储占用以及加载查询数据量统计信息。

kibana怎么关闭monitoring?

使用这个功能,自己的index还没监控的index大,所以不想让它一直监控。

########################################################

PUT _cluster/settings

{

  "transient": {

    "xpack.monitoring.collection.enabled": false  

  }

}

##########################################################

###########################################################

PUT _cluster/settings

{

  "persistent": {

    "xpack.monitoring.collection.enabled": false 

  }

}

###########################################################

五、参考 

Kibana怎么关闭monitoring?

https://elasticsearch.cn/question/7442

monitoring原理讲解及kibana可视化实战

https://www.jianshu.com/p/3cf1e1fefe2b

安装x-pack的注意项

https://blog.csdn.net/wang454592297/article/details/78804906

kibana monitoring页面

https://www.cnblogs.com/1zhangwenjing/p/12316461.html

ELK 集群 Kibana 使用 X-Pack 权限控制,监控集群状态,警报,监视,cpu,内存,磁盘空间,报告和的可视化图形

https://segmentfault.com/a/1190000010981283

ElasticSearch 5.2.2 之 kibana

https://www.cnblogs.com/sunmmi/articles/7090530.html

Kibana安装及简单使用

https://www.cnblogs.com/yangxiaoyi/p/7234222.html

Kibana User Guide [5.6] » Set Up Kibana » Configuring Kibana

https://www.elastic.co/guide/en/kibana/5.6/settings.html

安装kibana,X-pack和elasticsearch插件的全过程

https://www.pianshen.com/article/12551577571

おすすめ

転載: blog.csdn.net/michaelwoshi/article/details/121306948
おすすめ