Kafka监控Eagle

图片

大数据技术AI

Flink/Spark/Hadoop/数仓,数据分析、面试,源码解读等干货学习资料

115篇原创内容

公众号

Kafka-Eagle框架可以监控Kafka集群的整体运行情况,在生产环境中经常使用。

1、MySQL环境准备

Kafka-Eagle的安装依赖于MySQL,MySQL主要用来存储可视化展示的数据。如果集群中之前安装过MySQL可以跨过该步。

2、Kafka环境准备

1)关闭Kafka集群

[duo@hadoop01 kafka]$ kf.sh stop

2)修改/opt/data/kafka/bin/kafka-server-start.sh命令中

[duo@hadoop01 kafka]$ vim bin/kafka-server-start.sh

修改如下参数值:

if [ "x$KAFKA_HEAP_OPTS" = "x" ]; then
    export KAFKA_HEAP_OPTS="-Xmx1G -Xms1G"
fi
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

注意:修改之后在启动Kafka之前要分发之其他节点

[duo@hadoop01 bin]$ xsync kafka-server-start.sh

3、Kafka-Eagle安装

官网:https://www.kafka-eagle.org/

(1)上传压缩包kafka-eagle-bin-2.0.8.tar.gz到集群

(2)解压到本地

[duo@hadoop01 software]$ tar -zxvf kafka-eagle-bin-2.0.8.tar.gz

(3)将efak-web-2.0.8-bin.tar.gz解压至/opt/data

[duo@hadoop01 kafka-eagle-bin-2.0.8]$ tar -zxvf efak-web-2.0.8-bin.tar.gz -C /opt/data/

(4)修改配置文件 system-config.properties

[duo@hadoop01 conf]$ vim system-config.properties

######################################
# multi zookeeper & kafka cluster list
# Settings prefixed with 'kafka.eagle.' will be deprecated, use 'efak.' instead
######################################
efak.zk.cluster.alias=cluster1
cluster1.zk.list=hadoop01:2181,hadoop02:2181,hadoop03:2181/kafka

# EFAK webui port
######################################
efak.webui.port=8048


# 配置mysql连接
efak.driver=com.mysql.jdbc.Driver
efak.url=jdbc:mysql://hadoop01:3306/ke?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull
efak.username=root
efak.password=000000

图片

图片

(5)添加环境变量

# kafkaEFAK
export KE_HOME=/opt/data/efak-web-2.0.8
export PATH=$PATH:$KE_HOME/bin

注意:source /etc/profile

[duo@hadoop01 conf]$ source /etc/profile

(6)启动

注意:启动之前需要先启动ZK以及KAFKA。

图片

启动efak

[duo@hadoop01 efak]$ bin/ke.sh start

Welcome to
    ______    ______    ___     __ __
   / ____/   / ____/   /   |   / //_/
  / __/     / /_      / /| |  / ,<
 / /___    / __/     / ___ | / /| |
/_____/   /_/       /_/  |_|/_/ |_|
( Eagle For Apache Kafka® )

Version 2.0.8 -- Copyright 2016-2021
*******************************************************************
* EFAK Service has started success.
* Welcome, Now you can visit 'http://192.168.88.111:8048'
* Account:admin ,Password:123456
*******************************************************************
* <Usage> ke.sh [start|status|stop|restart|stats] </Usage>
* <Usage> https://www.kafka-eagle.org/ </Usage>
*******************************************************************

说明:如果停止efak,执行命令。

[duo@hadoop01 efak]$ bin/ke.sh stop

图片

4、Kafka-Eagle页面操作

(1)登录页面查看监控数据 http://192.168.88.111:8048/

(2)登录

图片

(3)主页

图片

(4)broker

图片

(5)topic

图片

(6)监控

图片

图片

猜你喜欢

转载自blog.csdn.net/hyunbar/article/details/124910594