39-kafka-监控Eagle:
Eagle的安装
1.修改 kafka 启动命令
修改 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"
注意:修改之后在启动 Kafka 之前要分发之其他节点
2.上传压缩包 kafka-eagle-bin-1.3.7.tar.gz 到集群/opt/software 目录
3.解压到本地
[root@hadoop102 software]# tar -zvxf kafka-eagle-bin-1.3.7.tar.gz
4.进入刚才解压的目录
[root@hadoop102 software]# cd kafka-eagle-bin-1.3.7/
5.将 kafka-eagle-web-1.3.7-bin.tar.gz 解压至/opt/module
[root@hadoop102 kafka-eagle-bin-1.3.7]# tar -zvxf kafka-eagle-web-1.3.7-bin.tar.gz -C /opt/module/
6.修改名称
[root@hadoop102 module]# mv kafka-eagle-web-1.3.7/ kafka-eagle
7.给启动文件执行权限
[root@hadoop102 module]$ cd bin/
[root@hadoop102 module]$ ll
总用量 12
-rw-r–r–. 1 root root 1848 8 月 22 2017 ke.bat
-rw-r–r–. 1 root root 7190 7 月 30 20:12 ke.sh
[root@hadoop102 module]$ chmod 777 ke.sh
8.修改配置文件
######################################
# multi zookeeper&kafka cluster list
######################################
kafka.eagle.zk.cluster.alias=cluster1
cluster1.zk.list=hadoop102:2181,hadoop103:2181,hadoop104:2181
######################################
# kafka offset storage
######################################
cluster1.kafka.eagle.offset.storage=kafka
######################################
# enable kafka metrics
#####################################
kafka.eagle.metrics.charts=true
kafka.eagle.sql.fix.error=false
######################################
# kafka jdbc driver address
######################################
kafka.eagle.driver=com.mysql.jdbc.Driver
kafka.eagle.url=jdbc:mysql://hadoop102:3306/ke?useUnicode=true&ch
aracterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull
kafka.eagle.username=root
kafka.eagle.password=000000
9.添加环境变量
#KAFKA_HOME
export KAFKA_HOME=/opt/module/kafka
export PATH=$PATH:$KAFKA_HOME/bin
#kafka_eagle
export KE_HOME=/opt/module/kafka-eagle
export PATH=$PATH:$KE_HOME/bin
#HADOOP_HOME
export HADOOP_HOME=/opt/module/hadoop-3.1.4
export path=$PATH:$HADOOP_HOME/bin
export path=$PATH:$HADOOP_HOME/sbin
注意:source /etc/profile
10.启动
[root@hadoop102 kafka-eagle]# bin/ke.sh start
注意:启动之前需要先启动 ZK 以及 KAFKA
11.登录页面查看监控数据
http://192.168.9.102:8048/ke
学习路径:https://space.bilibili.com/302417610/,如有侵权,请联系q进行删除:3623472230