kafka监控(一):kafka-eagle

afka-eagle是一款kafka监控软件,是笔者在接触kafka这几年来,使用的最好的一款开源监控工具。它可以同时监控多个集群,监控 Kafka 集群中 Topic 被消费的情况。包含 Lag 的产生,Offset 的变动,Partition 的分布。并且包含KafkaMonitor 和 Kafka Manager 的相关功能。可以说是既可以管理集群,又可以监控kafka的性能和消费情况,同时又支持sql查询。居家旅行必备。

kafka-eagle官方文档:https://ke.smartloli.org/3.Manuals/9.KafkaSQL.html

kafka-eagle官方下载:http://download.smartloli.org/

kafka-eagle安装

解压

tar -zxvf kafka-eagle-${version}-bin.tar.gz

配置环境变量

vi /etc/profile

export KE_HOME=/data/soft/new/kafka-eagle
export PATH=$PATH:$KE_HOME/bin

修改配置文件

cd ${KE_HOME}/conf
vi system-config.properties

# Multi zookeeper&kafka cluster list -- The client connection address of the Zookeeper cluster is set here

#可以配置多个集群,单集群这里可以把cluster2注释掉
kafka.eagle.zk.cluster.alias=cluster1,cluster2
cluster1.zk.list=tdn1:2181,tdn2:2181,tdn3:2181
cluster2.zk.list=xdn1:2181,xdn2:2181,xdn3:2181

# Zkcli limit -- Zookeeper cluster allows the number of clients to connect to

#zookeeper线程数
kafka.zk.limit.size=25

# Kafka Eagle webui port -- WebConsole port access address

#kafka-eagle页面访问端口
kafka.eagle.webui.port=8048

# Kafka offset storage -- Offset stored in a Kafka cluster, if stored in the zookeeper, you can not use this option

#配置存储偏移量位置,注意低版本的api存储的还是zookeeper。不同集群可以分开配置
cluster1.kafka.eagle.offset.storage=kafka
cluster2.kafka.eagle.offset.storage=kafka

# Whether the Kafka performance monitoring diagram is enabled

#是否启用监控图表
kafka.eagle.metrics.charts=false

# If offset is out of range occurs, enable this property -- Only suitable for kafka sql

#使用kafka-sql时可以考虑开启
kafka.eagle.sql.fix.error=false

# Delete kafka topic token -- Set to delete the topic token, so that administrators can have the right to delete

#删除topic操作超级管理员token
kafka.eagle.topic.token=keadmin

# kafka sasl authenticate, current support SASL_PLAINTEXT

#是否启用SASL协议
kafka.eagle.sasl.enable=false
kafka.eagle.sasl.protocol=SASL_PLAINTEXT
kafka.eagle.sasl.mechanism=PLAIN
kafka.eagle.sasl.client=<kafka_client_jaas.conf file path>

#邮件服务,用户报警发送

kafka.eagle.mail.enable=true
kafka.eagle.mail.sa=alert_sa
[email protected]
kafka.eagle.mail.password=mqslimczkdqabbbh
kafka.eagle.mail.server.host=smtp.163.com
kafka.eagle.mail.server.port=25

#kafka-eagle默认存储在sqlite,注意配置路径

# Default use sqlite to store data
kafka.eagle.driver=org.sqlite.JDBC
# It is important to note that the '/hadoop/kafka-eagle/db' path must exist.
kafka.eagle.url=jdbc:sqlite:/{安装路径}/db/ke.db
kafka.eagle.username=root
kafka.eagle.password=smartloli

# <Optional> set mysql address

#也可以存储在mysql中。
#kafka.eagle.driver=com.mysql.jdbc.Driver
#kafka.eagle.url=jdbc:mysql://127.0.0.1:3306/ke?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull
#kafka.eagle.username=root
#kafka.eagle.password=smartloli

启动

cd ${KE_HOME}/bin
chmod +x ke.sh
./ke.sh start
 

猜你喜欢

转载自blog.csdn.net/h952520296/article/details/84821740