二丫讲梵 二丫讲梵
首页
  • 最佳实践
  • 迎刃而解
  • Nginx
  • Php
  • Zabbix
  • AWS
  • Prometheus
  • Grafana
  • CentOS
  • Systemd
  • Docker
  • Rancher
  • Ansible
  • Ldap
  • Gitlab
  • GitHub
  • Etcd
  • Consul
  • RabbitMQ
  • Kafka
  • MySql
  • MongoDB
  • OpenVPN
  • KVM
  • VMware
  • Other
  • ELK
  • K8S
  • LLM
  • Nexus
  • Jenkins
  • 随写编年
  • 家人物语
  • 追忆青春
  • 父亲的朋友圈
  • 电影音乐
  • 效率工具
  • 博客相关
  • Shell
  • 前端实践
  • Vue学习笔记
  • Golang学习笔记
  • Golang编程技巧
  • 学习周刊
  • Obsidian插件周刊
关于
友链
  • 本站索引

    • 分类
    • 标签
    • 归档
  • 本站页面

    • 导航
    • 打赏
  • 我的工具

    • 备忘录清单 (opens new window)
    • json2go (opens new window)
    • gopher (opens new window)
    • 微信MD编辑 (opens new window)
    • 国内镜像 (opens new window)
    • 出口IP查询 (opens new window)
    • 代码高亮工具 (opens new window)
  • 外站页面

    • 开往 (opens new window)
    • ldapdoc (opens new window)
    • HowToStartOpenSource (opens new window)
    • vdoing-template (opens new window)
GitHub (opens new window)

二丫讲梵

行者常至,为者常成
首页
  • 最佳实践
  • 迎刃而解
  • Nginx
  • Php
  • Zabbix
  • AWS
  • Prometheus
  • Grafana
  • CentOS
  • Systemd
  • Docker
  • Rancher
  • Ansible
  • Ldap
  • Gitlab
  • GitHub
  • Etcd
  • Consul
  • RabbitMQ
  • Kafka
  • MySql
  • MongoDB
  • OpenVPN
  • KVM
  • VMware
  • Other
  • ELK
  • K8S
  • LLM
  • Nexus
  • Jenkins
  • 随写编年
  • 家人物语
  • 追忆青春
  • 父亲的朋友圈
  • 电影音乐
  • 效率工具
  • 博客相关
  • Shell
  • 前端实践
  • Vue学习笔记
  • Golang学习笔记
  • Golang编程技巧
  • 学习周刊
  • Obsidian插件周刊
关于
友链
  • 本站索引

    • 分类
    • 标签
    • 归档
  • 本站页面

    • 导航
    • 打赏
  • 我的工具

    • 备忘录清单 (opens new window)
    • json2go (opens new window)
    • gopher (opens new window)
    • 微信MD编辑 (opens new window)
    • 国内镜像 (opens new window)
    • 出口IP查询 (opens new window)
    • 代码高亮工具 (opens new window)
  • 外站页面

    • 开往 (opens new window)
    • ldapdoc (opens new window)
    • HowToStartOpenSource (opens new window)
    • vdoing-template (opens new window)
GitHub (opens new window)
  • 最佳实践

  • 迎刃而解

  • Nginx

  • Php

  • Zabbix

  • AWS

  • Prometheus

  • Grafana

  • Loki

  • CentOS

  • Supervisord

  • Systemd

  • Docker

  • Docker-Compose

  • Rancher

  • Ansible

  • OpenLdap

  • GitLab

  • GitHub

  • Etcd

  • Consul

  • RabbitMQ

  • Kafka

    • kafka-2-11单机部署
    • kafka-2-11集群部署
    • kafka-2-11集群监控
      • 1,资料。
      • 2,部署。
        • 1,下载包。
        • 2,解压包。
        • 3,配置环境变量。
        • 4,配置 system-config.properties 文件。
        • 5,启动 Kafka Eagle。
        • 6,访问。
        • 7,监控趋势图。
      • 3,参考。
    • kafka历史数据清理策略以及配置
    • 如何删除kafka消费组
  • Mysql

  • MongoDB

  • OpenVPN

  • Kvm

  • VMware

  • 配置文件详解

  • Other

  • 运维观止
  • Kafka
二丫讲梵
2019-07-07
目录

kafka-2-11集群监控

文章发布较早,内容可能过时,阅读注意甄别。

集群监控有不少方案,这里介绍一种国人研发的,经常看到有人推荐的一个方案,Kafka Eagle。

# 1,资料。

  • 官网:https://www.kafka-eagle.org/index.html
  • Github:https://github.com/smartloli/kafka-eagle/
  • 官方文档:https://docs.kafka-eagle.org/
  • 下载地址:http://download.kafka-eagle.org/

# 2,部署。

当我们把 kafka 集群部署完成之后,就可以部署Kafka Eagle监控系统了。

github 上的 releases 中事实上还是源码,而源码可能不容易编译成功,因此可以直接通过官网的下载地址下载作者已经提供的编译好的包进行部署。

# 1,下载包。

$ wget https://codeload.github.com/smartloli/kafka-eagle-bin/tar.gz/v1.3.3
1

# 2,解压包。

[root@localhost opt]$ tar xf v1.3.3
l[root@localhost opt]$ ls
kafka-eagle-bin-1.3.3  v1.3.3
[root@localhost opt]$ cd kafka-eagle-bin-1.3.3/
[root@localhost kafka-eagle-bin-1.3.3]$ ls
kafka-eagle-web-1.3.3-bin.tar.gz
[root@localhost kafka-eagle-bin-1.3.3]$ tar xf kafka-eagle-web-1.3.3-bin.tar.gz
l[root@localhost kafka-eagle-bin-1.3.3]$ ls
kafka-eagle-web-1.3.3  kafka-eagle-web-1.3.3-bin.tar.gz
[root@localhost kafka-eagle-bin-1.3.3]$ mv kafka-eagle-web-1.3.3 /opt/kafka-eagle
1
2
3
4
5
6
7
8
9
10

# 3,配置环境变量。

cat >> /etc/profile << EOF
export JAVA_HOME=/usr/local/jdk1.8.0_192
export KE_HOME=/opt/kafka-eagle
export PATH=$PATH:$JAVA_HOME/bin:$KE_HOME
EOF
source /etc/profile
1
2
3
4
5
6

# 4,配置 system-config.properties 文件。

######################################
# 配置多个Kafka集群所对应的Zookeeper
######################################
kafka.eagle.zk.cluster.alias=cluster1
cluster1.zk.list=192.168.106.7:2181,192.168.106.8:2181,192.168.106.9:2181
#cluster2.zk.list=xdn10:2181,xdn11:2181,xdn12:2181
######################################
# 设置Zookeeper线程数
######################################
kafka.zk.limit.size=25
######################################
# 设置Kafka Eagle浏览器访问端口
######################################
kafka.eagle.webui.port=8048
######################################
# 如果你的offsets存储在Kafka中,这里就配置
# 属性值为kafka,如果是在Zookeeper中,可以
# 注释该属性。一般情况下,Offsets的也和你消
# 费者API有关系,如果你使用的Kafka版本为0.10.x
# 以后的版本,但是,你的消费API使用的是0.8.2.x
# 时的API,此时消费者依然是在Zookeeper中
######################################
cluster1.kafka.eagle.offset.storage=kafka
#cluster2.kafka.eagle.offset.storage=zk
######################################
# 是否启动监控图表,默认是不启动的
######################################
kafka.eagle.metrics.charts=true
######################################
# 在使用Kafka SQL查询主题时,如果遇到错误,
# 可以尝试开启这个属性,默认情况下,不开启
######################################
kafka.eagle.sql.fix.error=true
######################################
# kafka sql topic records max
######################################
kafka.eagle.sql.topic.records.max=5000
######################################
# 邮件服务器设置,用来告警
######################################
kafka.eagle.mail.enable=false
kafka.eagle.mail.sa=alert_sa@163.com
kafka.eagle.mail.username=alert_sa@163.com
kafka.eagle.mail.password=mqslimczkdqabbbh
kafka.eagle.mail.server.host=smtp.163.com
kafka.eagle.mail.server.port=25
######################################
# alarm im configure
######################################
#kafka.eagle.im.dingding.enable=true
#kafka.eagle.im.dingding.url=https://oapi.dingtalk.com/robot/send?access_token=
#kafka.eagle.im.wechat.enable=true
#kafka.eagle.im.wechat.token=https://qyapi.weixin.qq.com/cgi-bin/gettoken?corpid=xxx&corpsecret=xxx
#kafka.eagle.im.wechat.url=https://qyapi.weixin.qq.com/cgi-bin/message/send?access_token=
#kafka.eagle.im.wechat.touser=
#kafka.eagle.im.wechat.toparty=
#kafka.eagle.im.wechat.totag=
#kafka.eagle.im.wechat.agentid=
######################################
# 超级管理员删除主题的Token
######################################
kafka.eagle.topic.token=keadmin
######################################
# 如果启动Kafka SASL协议,开启该属性
######################################
cluster1.kafka.eagle.sasl.enable=false
cluster1.kafka.eagle.sasl.protocol=SASL_PLAINTEXT
cluster1.kafka.eagle.sasl.mechanism=PLAIN
cluster2.kafka.eagle.sasl.enable=false
cluster2.kafka.eagle.sasl.protocol=SASL_PLAINTEXT
cluster2.kafka.eagle.sasl.mechanism=PLAIN
######################################
# Kafka Eagle默认存储在Sqlite中,如果要使用
# MySQL可以替换驱动、用户名、密码、连接地址
######################################
kafka.eagle.driver=org.sqlite.JDBC
kafka.eagle.url=jdbc:sqlite:/opt/kafka-eagle/db/ke.db
kafka.eagle.username=root
kafka.eagle.password=smartloli
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79

# 5,启动 Kafka Eagle。

配置完成后,可以执行 Kafka Eagle 脚本 ke.sh。如果首次执行,需要给该脚本赋予执行权限,命令如下:

chmod +x $KE_HOME/bin/ke.sh
1

在 ke.sh 脚本中,支持以下命令:

命令 说明
ke.sh start 启动 Kafka Eagle 系统
ke.sh stop 停止 Kafka Eagle 系统
ke.sh restart 重启 Kafka Eagle 系统
ke.sh status 查看 Kafka Eagle 系统运行状态
ke.sh stats 统计 Kafka Eagle 系统占用 Linux 资源情况
ke.sh find [ClassName] 查看 Kafka Eagle 系统中的类是否存在
[root@localhost kafka-eagle]$./bin/ke.sh start
[2019-07-07 17:21:03] INFO: Starting  kafka eagle environment check ...
  created: META-INF/
 inflated: META-INF/MANIFEST.MF
  created: WEB-INF/
 。
 。中间输出省略
 。
  created: META-INF/maven/org.smartloli.kafka.eagle/
  created: META-INF/maven/org.smartloli.kafka.eagle/kafka-eagle-web/
 inflated: META-INF/maven/org.smartloli.kafka.eagle/kafka-eagle-web/pom.xml
 inflated: META-INF/maven/org.smartloli.kafka.eagle/kafka-eagle-web/pom.properties
*******************************************************************
* Kafka Eagle system monitor port successful...
*******************************************************************
[2019-07-07 17:21:03] INFO: Status Code[0]
[2019-07-07 17:21:03] INFO: [Job done!]
Welcome to
    __ __    ___     ____    __ __    ___            ______    ___    ______    __     ______
   / //_/   /   |   / __/   / //_/   /   |          / ____/   /   |  / ____/   / /    / ____/
  / ,<     / /| |  / /_    / ,<     / /| |         / __/     / /| | / / __    / /    / __/
 / /| |   / ___ | / __/   / /| |   / ___ |        / /___    / ___ |/ /_/ /   / /___ / /___
/_/ |_|  /_/  |_|/_/     /_/ |_|  /_/  |_|       /_____/   /_/  |_|\____/   /_____//_____/
Version 1.3.3
*******************************************************************
* Kafka Eagle Service has started success.
* Welcome, Now you can visit 'http://<your_host_or_ip>:port/ke'
* Account:admin ,Password:123456
*******************************************************************
* <Usage> ke.sh [start|status|stop|restart|stats] </Usage>
* <Usage> https://www.kafka-eagle.org/ </Usage>
*******************************************************************
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32

# 6,访问。

接着就可以通过http://<your_host_or_ip>:port/ke进行访问了。

用户名密码是 Account:admin ,Password:123456。

image

# 7,监控趋势图。

Kafka 系统默认是没有开启 JMX 端口的,所以 Kafka Eagle 的监控趋势图默认采用不启用的方式,即kafka.eagle.metrics.charts=false。

如果需要查看监控趋势图,需要开启 Kafka 系统的 JMX 端口,设置该端口在 $KAFKA_HOME/bin/kafka-server-start.sh 脚本中,设置内容如下:

if [ "x$KAFKA_HEAP_OPTS" = "x" ]; then
    export KAFKA_HEAP_OPTS="-server -Xms2G -Xmx2G -XX:PermSize=128m -XX:+UseG1GC -XX:MaxGCPauseMillis=200 -XX:ParallelGCThreads=8 -XX:ConcGCThreads=5 -XX:InitiatingHeapOccupancyPercent=70"
    export JMX_PORT="9999"
    #export KAFKA_HEAP_OPTS="-Xmx1G -Xms1G"
fi
1
2
3
4
5

然后将集群的 kafka 重启,在重启 kafka eagle,就能看到相关的监控了。

image

# 3,参考。

  • http://t.cn/RDbk79P
微信 支付宝
#kafka
上次更新: 2024/07/04, 22:40:37
kafka-2-11集群部署
kafka历史数据清理策略以及配置

← kafka-2-11集群部署 kafka历史数据清理策略以及配置→

最近更新
01
记录二五年五一之短暂回归家庭
05-09
02
学习周刊-总第210期-2025年第19周
05-09
03
学习周刊-总第209期-2025年第18周
05-03
更多文章>
Theme by Vdoing | Copyright © 2017-2025 | 点击查看十年之约 | 浙ICP备18057030号
  • 跟随系统
  • 浅色模式
  • 深色模式
  • 阅读模式