使用Metricbeat监控zookeeper遇到的问题
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遇到的问题的更多相关文章
- 通过python脚本和zabbix配合监控zookeeper的节点数
通过python脚本和zabbix配合监控zookeeper的节点数 需求描述: 在日常zabbix监控zookeeper的时候,无法通过shell来获取zookeeper的具体节点信息,没有开放具体 ...
- Prometheus jvm_exporter监控zookeeper
Zookeeper Prometheus 监控zookeeper使用jvm_exporter来采集数据,jvm_exporter是一个可以配置抓取和暴露JMX目标的mBeans的收集器. 下载java ...
- 使用Zabbix监控ZooKeeper服务的健康状态
一 应用场景描述 在目前公司的业务中,没有太多使用ZooKeeper作为协同服务的场景.但是我们将使用Codis作为Redis的集群部署方案,Codis依赖ZooKeeper来存储配置信息.所以做好Z ...
- Zabbix监控Zookeeper健康状况
首先最简单的是监听服务端口,在zabbix界面直接添加监控项 item: zookeeper.status key: net.tcp.listen[2181] ZooKeeper监控要点: 内 ...
- 使用Apache Curator监控Zookeeper的Node和Path的状态
1.Zookeeper经常被我们用来做配置管理,配置的管理在分布式应用环境中很常见,例如同一个应用系统需要多台 PC Server 运行,但是它们运行的应用系统的某些配置项是相同的,如果要修改这些相同 ...
- zk 09之:Curator之二:Path Cache监控zookeeper的node和path的状态
在实际应用开发中,当某个ZNode发生变化后我们需要得到通知并做一些后续处理,Curator Recipes提供了Path Cache 来帮助我们轻松实现watch ZNode. Path Cache ...
- zabbix 监控zookeeper
1.监控脚本如下:check_zookeeper.sh 1 2 #!/bin/bash echo mntr | nc 127.0.0.1 2182 | grep "$1" |awk ...
- [Metricbeat] Metricbeat监控golang服务器
0x0 前言 最近这几天研究了一下ElasticSearch相关的技术栈.前面一篇转发了别人些的非常详细的ElasticSearch和Kibana搭建的过程.发现Elastic家族还有Metricbe ...
- 使用metricbeat监控system和nginx
下载并解压缩metricbeat metricbeat.yml配置文件设置: setup.kibana: host: "192.168.75.21:5601" output.ela ...
随机推荐
- gpg加解密异常
在本地windows电脑和开发环境(linux) ,都不报错,但是在测试环境(linux) 上报错. 报错信息 org.bouncycastle.openpgp.PGPException: Excep ...
- 如何用全国天气预报API接口进行快速开发
最近公司项目有一个全国天气预报的小需求,想着如果用现成的API就可以大大提高开发效率,在网上的API商店搜索了一番,发现了 APISpace,它里面的全国天气预报API非常符合我的开发需求. 全国 ...
- day05 Java网络编程socket 与多线程
java网络编程 java.net.Socket Socket(套接字)封装了TCP协议的通讯细节,是的我们使用它可以与服务端建立网络链接,并通过 它获取两个流(一个输入一个输出),然后使用这两个流的 ...
- Scala的基础用法 和 Java相对应学习(二)变量、循环、语法
一.配置相关环境 1.增加项目 在idea里面创建新的maven项目 2. 在pom文件中增加依赖 <?xml version="1.0" encoding="UT ...
- CSDN 原力(声望,影响力) -- 设计草案
目标 CSDN 希望成为开发者学习,成长和成就的平台.我们已经有很多功能来支持开发者的职业成长了, 如何衡量成就呢?我们希望用 原力 (以前也叫 影响力,声望) 来体现用户的成就, 并希望用原力来帮助 ...
- linux 安装redis及问题收集
contos 7 下安装redis教程可参照https://www.cnblogs.com/hxun/p/11075755.html值得注意的是在第6步方法一(所以建议使用方法二),如果直接使用xft ...
- 一文搞懂│php 中的 DI 依赖注入
目录 什么是 DI / 依赖注入 依赖注入出现的原因 简单的依赖注入 高阶的依赖注入 依赖注入的应用 依赖注入高阶优化 什么是 DI / 依赖注入 依赖注入DI 其实本质上是指对类的依赖通过构造器完成 ...
- 我和Apache DolphinScheduler的缘分
关于 DolphinScheduler社区 Apache DolphinScheduler(incubator) 于17年在易观数科立项,19年3月开源, 19 年8月进入Apache 孵化器,社区发 ...
- LuoguP1020 导弹拦截 (LIS)
最长不降和单升 #include <iostream> #include <cstdio> #include <cstring> #include <algo ...
- Excel 逻辑函数(一):IF 和 IFS
IF IF 函数有三个参数,第一个为条件判断,第二个是当条件为真时执行的表达式,第三个是条件为假时执行的表达式. IF(A1="是", A2 * 0.8, 0),如果 A1 单元格 ...