1.metricbeat中启动自动加载模块

metricbeat.config.modules:
path: ${path.config}/modules.d/*.yml
reload.enabled: true
reload.period: 10s

2.开启kibana中的dashboard功能

setup.dashboards.enabled: true

然后启动metricbeat

3.启动zookeeper模块

./metricbeat modules enable zookeeper

会看到目录modules.d下的zookeeper.yml.disabled变成zookeeper.yml

4.编辑zookeeper.yml,配置上监听的zookeeper地址

- module: zookeeper
metricsets:
- mntr
- server
period: 10s
hosts: ["172.17.107.187:2181","172.17.107.187:2182","172.17.107.187:2183"]

5.在kibana web界面创建索引metricbeat-7.3.0*模式

6.在kibana左侧导航仪表盘搜索zookeeper,出现如下信息,点开查看:

注意:若是出现如下之类的错误提示,可以按照文章(https://www.cnblogs.com/sanduzxcvbnm/p/12172935.html)说的方法进行修改

[esaggs] > Request to Elasticsearch failed: {"error":{"root_cause":[{"type":"illegal_argument_exception","reason":"Fielddata is disabled on text fields by default. Set fielddata=true on [zookeeper.server.version_date] in order to load fielddata in memory by uninverting the inverted index. Note that this can however use significant memory. Alternatively use a keyword field instead."}],"type":"search_phase_execution_exception","reason":"all shards failed","phase":"query","grouped":true,"failed_shards":[{"shard":0,"index":"metricbeat-7.3.0","node":"VD2R4MIiQEOh1rlL5YU2ow","reason":{"type":"illegal_argument_exception","reason":"Fielddata is disabled on text fields by default. Set fielddata=true on [zookeeper.server.version_date] in order to load fielddata in memory by uninverting the inverted index. Note that this can however use significant memory. Alternatively use a keyword field instead."}}],"caused_by":{"type":"illegal_argument_exception","reason":"Fielddata is disabled on text fields by default. Set fielddata=true on [zookeeper.server.version_date] in order to load fielddata in memory by uninverting the inverted index. Note that this can however use significant memory. Alternatively use a keyword field instead.","caused_by":{"type":"illegal_argument_exception","reason":"Fielddata is disabled on text fields by default. Set fielddata=true on [zookeeper.server.version_date] in order to load fielddata in memory by uninverting the inverted index. Note that this can however use significant memory. Alternatively use a keyword field instead."}}},"status":400}

7.但是在查看仪表盘中的[Metricbeat System] Overview ECS时出现的问题,却不知道要如何解决?

问题如下:

  • 当刷新这个仪表盘界面时会出现如下的提示:
"reason":"Fielddata is disabled on text fields by default. Set fielddata=true on [zookeeper.server.version_date

但是按照上一步说的执行如下命令后:

PUT metricbeat-7.3.0/_mapping
{
"properties": {
"zookeeper": {
"properties": {
"server": {
"properties": {
"version_date":{
"type": "text",
"fielddata": true,
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
}
}
}
}
}
}
}

这个错误不会出现了,但是会出现另一个错误:

"type":"illegal_argument_exception","reason":"Field [zookeeper.server.version_date] of type [text] does not support custom formats"

究其原因就是 [zookeeper.server.version_date] 的类型问题

官方给的该字段的参考值如下:

官方给的该字段的类型是:

创建索引时生成的mapping中该字段类型是text。

仪表盘中会使用到该字段进行聚合查询,因为默认的text类型没有开启fielddata=true。

开启后但是会出现字段类型的错误。

修改字段类型是date,这一步是无法进行操作的,报错:

{
"error": {
"root_cause": [
{
"type": "illegal_argument_exception",
"reason": "mapper [zookeeper.server.version_date] of different type, current_type [text], merged_type [date]"
}
],
"type": "illegal_argument_exception",
"reason": "mapper [zookeeper.server.version_date] of different type, current_type [text], merged_type [date]"
},
"status": 400
}

修改字段类型是date,并且开启fielddata=true。这一步也是无法进行操作的,报错:

{
"error": {
"root_cause": [
{
"type": "mapper_parsing_exception",
"reason": "Mapping definition for [version_date] has unsupported parameters: [fielddata : true]"
}
],
"type": "mapper_parsing_exception",
"reason": "Mapping definition for [version_date] has unsupported parameters: [fielddata : true]"
},
"status": 400
}

能做的操作就是给text类型开启fielddata=true。

感觉陷入死循环了,不修改不行,修改也不行。。。

使用Metricbeat监控zookeeper遇到的问题的更多相关文章

  1. 通过python脚本和zabbix配合监控zookeeper的节点数

    通过python脚本和zabbix配合监控zookeeper的节点数 需求描述: 在日常zabbix监控zookeeper的时候,无法通过shell来获取zookeeper的具体节点信息,没有开放具体 ...

  2. Prometheus jvm_exporter监控zookeeper

    Zookeeper Prometheus 监控zookeeper使用jvm_exporter来采集数据,jvm_exporter是一个可以配置抓取和暴露JMX目标的mBeans的收集器. 下载java ...

  3. 使用Zabbix监控ZooKeeper服务的健康状态

    一 应用场景描述 在目前公司的业务中,没有太多使用ZooKeeper作为协同服务的场景.但是我们将使用Codis作为Redis的集群部署方案,Codis依赖ZooKeeper来存储配置信息.所以做好Z ...

  4. Zabbix监控Zookeeper健康状况

    首先最简单的是监听服务端口,在zabbix界面直接添加监控项 item: zookeeper.status key: net.tcp.listen[2181]   ZooKeeper监控要点:   内 ...

  5. 使用Apache Curator监控Zookeeper的Node和Path的状态

    1.Zookeeper经常被我们用来做配置管理,配置的管理在分布式应用环境中很常见,例如同一个应用系统需要多台 PC Server 运行,但是它们运行的应用系统的某些配置项是相同的,如果要修改这些相同 ...

  6. zk 09之:Curator之二:Path Cache监控zookeeper的node和path的状态

    在实际应用开发中,当某个ZNode发生变化后我们需要得到通知并做一些后续处理,Curator Recipes提供了Path Cache 来帮助我们轻松实现watch ZNode. Path Cache ...

  7. zabbix 监控zookeeper

    1.监控脚本如下:check_zookeeper.sh 1 2 #!/bin/bash echo mntr | nc 127.0.0.1 2182 | grep "$1" |awk ...

  8. [Metricbeat] Metricbeat监控golang服务器

    0x0 前言 最近这几天研究了一下ElasticSearch相关的技术栈.前面一篇转发了别人些的非常详细的ElasticSearch和Kibana搭建的过程.发现Elastic家族还有Metricbe ...

  9. 使用metricbeat监控system和nginx

    下载并解压缩metricbeat metricbeat.yml配置文件设置: setup.kibana: host: "192.168.75.21:5601" output.ela ...

随机推荐

  1. Elasticsearch深度应用(下)

    Query文档搜索机制剖析 1. query then fetch(默认搜索方式) 搜索步骤如下: 发送查询到每个shard 找到所有匹配的文档,并使用本地的Term/Document Frequer ...

  2. SSH隧道代理

    应用场景: A机器可以通过SSH连接到B机器,然后A想用B的身份访问B所在的资源(主要用于浏览器访问) 命令: A机器通过ssh与B建立连接,并暴露3128端口:ssh -N -D 127.0.0.1 ...

  3. 关于(Java)方法的再认识

    1.方法的调用(图中两个方法在一个包中) 2.静态与非静态 两个非静态可以调用 但是静态不可以同时调用非静态 package com.oop;public class Way02 { public s ...

  4. 常用的函数式接口_Function接口练习_自定义函数模型拼接

    package com.yang.Test.FunctionStudy; import java.util.function.Function; /** * 练习:自定义函数模型拼接 * 题目: * ...

  5. python3.7爬虫:使用Selenium带Cookie登录并且模拟进行表单上传文件

    原文转载自「刘悦的技术博客」https://v3u.cn/a_id_142 前文再续,书接上一回,之前一篇文章我们尝试用百度api智能识别在线验证码进行模拟登录:Python3.7爬虫:实时api(百 ...

  6. JavaScript 里三个点 ...,可不是省略号啊···

    摘要:Three dots ( - ) in JavaScript. 本文分享自华为云社区<JavaScript 里三个点 ... 的用法>,作者: Jerry Wang . Rest P ...

  7. javaScript 事件循环机制

    JavaScript是单线程的编程语言,只能同一时间内做一件事.但是在遇到异步事件的时候,js线程并没有阻塞,还会继续执行,这就是因为JS有事件循环机制. 事件循环流程总结 主线程开始执行一段代码, ...

  8. (一)esp32开发环境搭建(VSCode+IDF实现单步调试)

    保姆级手把手教学视频 https://www.bilibili.com/video/BV1RL411A7CU 前言 因为碰上一个学长,跟他聊了会儿天,推荐我做一点物联网的项目,想来想去,那就用WiFi ...

  9. Luogu2574 XOR的艺术 (分块)

    本是要练线段树的,却手贱打了个分块 //#include <iostream> #include <cstdio> #include <cstring> #incl ...

  10. RS485自动收发切换电路 [原创www.cnblogs.com/helesheng]

    RS485是最常见的一种远距离可靠传输和组网的UART串口信号接口协议.与同样传输UART串口信号的RS422协议相比,RS485使用半双工通信,即只有一个信道,在同一时刻要么从A到B,要么从B到A传 ...