Kafka学习之四_Grafana监控相关的学习


背景

想一并学习一下kafaka的监控.
又重新开始学习grafana了:
下载地址:
https://grafana.com/grafana/download
https://prometheus.io/download/
https://github.com/danielqsj/kafka_exporter 利用这三个网站下载较新的资源,然后进行测试与安装使用. 之前写过很多rpm还有docker的方式方法,想着这次使用一下二进制方式安装.
在某些机器上面可能更加方便一点 这次主要是想在 鲲鹏上面验证, 所以下载的文件如下: alertmanager-0.25.0.linux-arm64.tar.gz
grafana-enterprise-10.0.1.linux-arm64.tar.gz
kafka_exporter-1.7.0.linux-arm64.tar.gz
prometheus-2.44.0.linux-arm64.tar.gz

安装-grafana

解压缩 grafana的压缩包
然后查看部分命令的帮助信息 ./grafana server -h
NAME:
grafana server - run the grafana server USAGE:
grafana server [command options] [arguments...] OPTIONS:
--config value Path to config file
--homepath value Path to Grafana install/home path, defaults to working directory
--pidfile value Path to Grafana pid file
--packaging value describes the way Grafana was installed (default: "unknown")
--configOverrides value Configuration options to override defaults as a string. e.g. cfg:default.paths.log=/dev/null
--version, -v print the version
--vv prints current version, all dependencies and exits (default: false)
--profile Turn on pprof profiling (default: false)
--profile-addr value Define custom address for profiling (default: "localhost")
--profile-port value Define custom port for profiling (default: 6060)
--tracing Turn on tracing (default: false)
--tracing-file value Define tracing output file (default: "trace.out")
--help, -h show help 最简单的启动脚本为
cd /grafana-xx-xx/bin
nohup ./grafana server --config ../conf/defaults.ini 2>&1 >/devnull & 注意可以修改 ../conf/defaults.ini 内的文件制定很多配置. 默认密码是 admin/admin 第一次登录需要修改密码

安装kafka-exporter

启动脚本为:
nohup ./kafka_exporter --sasl.enabled --web.listen-address=":9308" --sasl.username="admin" --sasl.password="Test20131127" --sasl.mechanism="plain" --kafka.server=127.0.0.1:9093 2>&1 >/devnull &
解压缩先查看帮助然后根据帮助进行处理 Flags:
-h, --[no-]help Show context-sensitive help (also try --help-long and --help-man).
--web.listen-address=":9308"
Address to listen on for web interface and telemetry.
--web.telemetry-path="/metrics"
Path under which to expose metrics.
--topic.filter=".*" Regex that determines which topics to collect.
--topic.exclude="^$" Regex that determines which topics to exclude.
--group.filter=".*" Regex that determines which consumer groups to collect.
--group.exclude="^$" Regex that determines which consumer groups to exclude.
--[no-]log.enable-sarama Turn on Sarama logging, default is false.
--kafka.server=kafka:9092 ...
Address (host:port) of Kafka server.
--[no-]sasl.enabled Connect using SASL/PLAIN, default is false.
--[no-]sasl.handshake Only set this to false if using a non-Kafka SASL proxy, default is true.
--sasl.username="" SASL user name.
--sasl.password="" SASL user password.
--sasl.mechanism="" The SASL SCRAM SHA algorithm sha256 or sha512 or gssapi as mechanism
--sasl.service-name="" Service name when using kerberos Auth
--sasl.kerberos-config-path=""
Kerberos config path
--sasl.realm="" Kerberos realm
--sasl.kerberos-auth-type=""
Kerberos auth type. Either 'keytabAuth' or 'userAuth'
--sasl.keytab-path="" Kerberos keytab file path
--[no-]sasl.disable-PA-FX-FAST
Configure the Kerberos client to not use PA_FX_FAST, default is false.
--[no-]tls.enabled Connect to Kafka using TLS, default is false.
--tls.server-name="" Used to verify the hostname on the returned certificates unless tls.insecure-skip-tls-verify is given. The kafka server's name
should be given.
--tls.ca-file="" The optional certificate authority file for Kafka TLS client authentication.
--tls.cert-file="" The optional certificate file for Kafka client authentication.
--tls.key-file="" The optional key file for Kafka client authentication.
--[no-]server.tls.enabled Enable TLS for web server, default is false.
--[no-]server.tls.mutual-auth-enabled
Enable TLS client mutual authentication, default is false.
--server.tls.ca-file="" The certificate authority file for the web server.
--server.tls.cert-file="" The certificate file for the web server.
--server.tls.key-file="" The key file for the web server.
--[no-]tls.insecure-skip-tls-verify
If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure. Default is
false
--kafka.version="2.0.0" Kafka broker version
--[no-]use.consumelag.zookeeper
if you need to use a group from zookeeper, default is false
--zookeeper.server=localhost:2181 ...
Address (hosts) of zookeeper server.
--kafka.labels="" Kafka cluster name
--refresh.metadata="30s" Metadata refresh interval
--[no-]offset.show-all Whether show the offset/lag for all consumer group, otherwise, only show connected consumer groups, default is true
--[no-]concurrent.enable If true, all scrapes will trigger kafka operations otherwise, they will share results. WARN: This should be disabled on large
clusters. Default is false
--topic.workers=100 Number of topic workers
--[no-]kafka.allow-auto-topic-creation
If true, the broker may auto-create topics that we requested which do not already exist, default is false.
--verbosity=0 Verbosity log level
--log.level=info Only log messages with the given severity or above. One of: [debug, info, warn, error]
--log.format=logfmt Output format of log messages. One of: [logfmt, json]
--[no-]version Show application version.

安装以及监控kafaka-prometheus

1. prometheus的日志留存时间和大小限制
--storage.tsdb.retention.time=15d
其实默认值就是 15天, 可以根据情况适当进行调整. 2. 存放目录
--storage.tsdb.path="/prometheusdata/" 3.大小
--storage.tsdb.retention.size=15GB 4. 修改端口
--web.listen-address="0.0.0.0:9095" 5. 设置监控kafka scrape_configs:
# 监控业务kafka
- job_name: 'kafka'
static_configs:
- targets:
- 127.0.0.1:9308 整体命令为:
nohup ./prometheus --storage.tsdb.retention.time=15d --storage.tsdb.path="/prometheusdata/" --storage.tsdb.retention.size=15GB --web.listen-address="0.0.0.0:9095" 2>&1 >/dev/null &

增加数据源

增加prometheus的数据源
然后grafana导入: 7589 监控就可以了.

结果展示

Kafka学习之四_Grafana监控相关的学习的更多相关文章

  1. Python学习笔记--PySpark的相关基础学习(一)

    PySpark包的下载 下载PySpark第三方包: 构建PySpark的执行环境入口对象 PySpark的编程模型 数据输入 对于SparkContext对象里面的成员方法parallelize,支 ...

  2. 支持向量机(SVM)相关免费学习视频集锦

    http://www.matlabsky.com/thread-36823-1-1.html [其它] 支持向量机(SVM)相关免费学习视频集锦    [复制链接]     faruto 签到天数: ...

  3. DSP EPWM学习笔记2 - EPWM相关寄存器设置问题解析

    DSP EPWM学习笔记2 - EPWM相关寄存器设置问题解析 彭会锋 本篇主要针对不太熟悉的TZ 故障捕获 和 DB 死区产生两个子模块进行学习研究 感觉TI的寄存器命名还是有一定规律可循的 SEL ...

  4. 学习笔记之html5相关内容

    写一下昨天学习的html5的相关内容,首先谈下初次接触html5的感受.以前总是听说html5是如何的强大,如何的将要改变世界.总是充满了神秘感.首先来谈一下我接触的第一个属性是  input的里面的 ...

  5. [转]Docker学习之四:使用docker安装mysql

    本文转自:https://blog.csdn.net/qq_19348391/article/details/82998391 Docker学习之一:注册Docker Hub账号 Docker学习之二 ...

  6. github相关指令学习

    正在廖雪峰官网学习关于git的相关知识,已经不是第一次来学习,但是忘得太快,索性这次边学边记录笔记,加深记忆,方便后期查看 1.找到一个合适的地方,鼠标右键 Git Bush Here ,新建文件夹, ...

  7. jackson学习之四:WRAP_ROOT_VALUE(root对象)

    欢迎访问我的GitHub https://github.com/zq2599/blog_demos 内容:所有原创文章分类汇总及配套源码,涉及Java.Docker.Kubernetes.DevOPS ...

  8. linux专题(一):小白的开始以及相关的学习链接

    转载自:https://www.cnblogs.com/ggjucheng/archive/2011/12/16/2290158.html 学习Linux也有一阵子了,这过程中磕磕撞撞的,遇到了问题, ...

  9. 《Java学习笔记(第8版)》学习指导

    <Java学习笔记(第8版)>学习指导 目录 图书简况 学习指导 第一章 Java平台概论 第二章 从JDK到IDE 第三章 基础语法 第四章 认识对象 第五章 对象封装 第六章 继承与多 ...

  10. (转)如何学习Java技术?谈Java学习之路

    51CTO编者注:这篇文章已经是有数年“网龄”的老文,不过在今天看来仍然经典.如何学习Java?本篇文章可以说也是面对编程初学者的一篇指导文章,其中对于如何学习Java的步骤的介绍,很多也适用于开发领 ...

随机推荐

  1. 手动实现BERT

      本文重点介绍了如何从零训练一个BERT模型的过程,包括整体上BERT模型架构.数据集如何做预处理.MASK替换策略.训练模型和保存.加载模型和测试等. 一.BERT架构   BERT设计初衷是作为 ...

  2. LeetCode DP篇(62、63、322、887)

    62. 不同路径 一个机器人位于一个 m x n 网格的左上角 (起始点在下图中标记为"Start" ). 机器人每次只能向下或者向右移动一步.机器人试图达到网格的右下角(在下图中 ...

  3. 如何花“一点点小钱”突破华为云CCE服务的“防线”

    摘要:有没有方法绕开CCE的限制,自由的调用K8s的API呢?有还便宜,2.4元/集群/天. 申明:所有的一切都是为了使得华为云可以更好,而不是为了diss它. 通过华为云购买多个K8s集群,又想使用 ...

  4. 技术解读丨GaussDB数仓高可用容灾利器之逻辑备份

    摘要:GaussDB数仓的Roach工具,同时提供物理备份和逻辑备份两种主要形态的备份.逻辑备份针对数据库的逻辑对象进行抽取和备份,能够有效地应对单表.schema级等较细粒度的备份,较为灵活和便利. ...

  5. Python 没有函数重载?如何用装饰器实现函数重载?

    摘要:Python 不支持函数重载.当我们定义了多个同名的函数时,后面的函数总是会覆盖前面的函数,因此,在一个命名空间中,每个函数名仅会有一个登记项(entry). 本文分享自华为云社区<为什么 ...

  6. update 没有索引导致业务崩了,老板骂了一个小时

    摘要:有天,一朋友在线上执行一条 update 语句修改数据库数据的时候,where 条件没有带上索引,导致业务直接崩了,被老板教训了一波. 本文分享自华为云社区<update 没有索引,会锁全 ...

  7. Koa、koa-router、koa-jwt 鉴权详解:分模块鉴权实践总结

    首先看koa-router koa-router use 熟悉Koa的同学都知道use是用来注册中间件的方法,相比较Koa中的全局中间件,koa-router的中间件则是路由级别的. koa-rout ...

  8. Hive查看,删除分区

    查看所有分区 show partitions 表名; 删除一般会有两种方案 1.直接删除hdfs文件 亲测删除hdfs路径后 查看分区还是能看到此分区 可能会引起其他问题 此方法不建议 2. 使用删除 ...

  9. 火山引擎DataTester:无需研发人力,即刻开启企业A/B实验

    近日,火山引擎A/B测试平台-- DataTester 对产品内A/B实验的"可视化编辑器"进行了新的升级,对交互.预览.Xpath的层次结构视图等能力均做了优化.   据介绍,火 ...

  10. Kubernetes(K8S) 安装 Metrics-Server kubectl top (metrics-server) node NotFound

    kubectl top (metrics-server) node NotFound components.yaml 网上的各种方法都有问题,找到了一个完整版的 yaml apiVersion: v1 ...