使用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 ...
随机推荐
- 第五天python3 内建函数总结
id() 返回对象在内存中的地址 hash() 返回对象的hash值 type() 返回对象的类型 float() int() bin() hex() oct() bool() list() tup ...
- for循环和while循环dowhile循环
第四章 循环语句 4.1循环概述 循环语句可以在满足循环条件的情况下,反复执行某一段代码,这段代码被重复执行的代码被称为循环体语句,当反复执行这个循环体的时候,需要在核实的时候吧循环判断条件修改为fa ...
- MYSQL常见可优化场景
1.应尽量避免在 where 子句中对字段进行 null 值判断,否则将导致引擎放弃使用索引而进行全表扫描,如:select id from t where num is null 可以在num上设置 ...
- YII behaviors使用
文件 frontend/libs/FilterTest.php <?php /** * Created by PhpStorm. * Date: 2016/5/27 * Time: 14:16 ...
- ETCD快速入门-02 ETCD安装
2.ETCD安装 etcd 安装可以通过源码构建也可以使用官方构建的二进制文件进行安装.我们以二进制文件为例,系统为CentOS 7.9,操作步骤如下所示: 2.1 Linux ETCD_VE ...
- 结束语句之 break
C 语言自学之 break Dome1: 找出0-50之间的所有素数,所谓素数就是只能被1和它本身整除的数字,比如:7,13,23等. 运行结果: 2 3 5 7 ...
- 感谢有你!Apache DolphinScheduler 项目 GitHub star 突破 8k
本周伊始,Apache DolphinScheduler 项目在 GitHub 上的 Github Star 总数首次突破 8K.目前,Apache DolphinScheduler 社区已经拥有 C ...
- zabbix 报表动作日志 报错”503“
- React报错之Unexpected default export of anonymous function
正文从这开始~ 总览 当我们尝试使用默认导出来导出一个匿名函数时,会导致"Unexpected default export of anonymous function"警告.为了 ...
- Spring 01: Spring配置 + IOC控制反转 + Setter注入
简介 Spring框架是一个容器,是整合其他框架的框架 他的核心是IOC(控制反转)和AOP(面向切面编程),由20多个模块构成,在很多领域都提供了优秀的问题解决方案 特点 轻量级:由20多个模块构成 ...