Kafka Eagle 的安装部署

kafka eagle 官网下载地址http://download.kafka-eagle.org/

需要为kafka添加JMX
进入kafka的安装目录/bin
vi kafka-server-start.sh 修改KAFKA_HEAP_OPTS参数选项

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="12991"

下载kafka-eagle-bin-1.4.6.tar.gz到机器上

解压到目录中进入bin目录,赋予脚本执行权限chmod +x ke.sh

[hadoop@bigdata01 bin]$ tree
.
├── ke.bat
├── ke.pid
├── ke.sh
└── zookeeper.out

0 directories, 4 files

ke.sh 为kafka eagle的启动和停止脚本

命令帮助
[hadoop@bigdata01 bin]$ ./ke.sh 
Usage: ./ke.sh {start|stop|restart|status|stats|find|gc|jdk|version}

启动kafka eagle : ./ke.sh start
停止kafka eagle: ./ke.sh stop

进入到conf目录下面kafka-eagle-web-1.4.6/conf
修改配置文件 vi system-config.properties

######################################
# multi zookeeper & kafka cluster list
######################################
#如果只有一个集群的话,就写一个cluster1就行了
#设置集群名称
kafka.eagle.zk.cluster.alias=cluster1

#这里填上刚才上zookeeper.connect地址
cluster1.zk.list=bigdata01:2181,bigdata01:2182,bigdata01:2183
#cluster2.zk.list=xdn10:2181,xdn11:2181,xdn12:2181

######################################
# broker size online list
######################################
cluster1.kafka.eagle.broker.size=20

######################################
# zk client thread limit
######################################
kafka.zk.limit.size=25

######################################
# kafka eagle webui port
######################################
kafka.eagle.webui.port=8048

######################################
# kafka offset storage
######################################
cluster1.kafka.eagle.offset.storage=kafka
#cluster2.kafka.eagle.offset.storage=zk

######################################
# kafka metrics, 30 days by default
######################################
kafka.eagle.metrics.charts=false
kafka.eagle.metrics.retain=30

######################################
# kafka sql topic records max
######################################
kafka.eagle.sql.topic.records.max=5000
kafka.eagle.sql.fix.error=false

######################################
# delete kafka topic token
######################################
kafka.eagle.topic.token=keadmin

######################################
# kafka sasl authenticate
######################################
#如果kafka开启了sasl认证,需要在这个地方配置sasl认证文件
cluster1.kafka.eagle.sasl.enable=false
cluster1.kafka.eagle.sasl.protocol=SASL_PLAINTEXT
cluster1.kafka.eagle.sasl.mechanism=SCRAM-SHA-256
cluster1.kafka.eagle.sasl.jaas.config=org.apache.kafka.common.security.scram.ScramLoginModule required username="kafka" password="kafka-eagle";
cluster1.kafka.eagle.sasl.client.id=
cluster1.kafka.eagle.sasl.cgroup.enable=false
cluster1.kafka.eagle.sasl.cgroup.topics=

cluster2.kafka.eagle.sasl.enable=false
cluster2.kafka.eagle.sasl.protocol=SASL_PLAINTEXT
cluster2.kafka.eagle.sasl.mechanism=PLAIN
cluster2.kafka.eagle.sasl.jaas.config=org.apache.kafka.common.security.plain.PlainLoginModule required username="kafka" password="kafka-eagle";
cluster2.kafka.eagle.sasl.client.id=
cluster2.kafka.eagle.sasl.cgroup.enable=false
cluster2.kafka.eagle.sasl.cgroup.topics=

######################################
# kafka sqlite jdbc driver address
######################################
#下面两项是配置数据库的,默认使用sqlite,如果量大,建议使用mysql
kafka.eagle.driver=com.mysql.jdbc.Driver
kafka.eagle.url=jdbc:mysql://bigdata01:3306/ke?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull
kafka.eagle.username=root
kafka.eagle.password=123456

######################################
# kafka mysql jdbc driver 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=XXX
#kafka.eagle.password=XXX

启动前需要在mysql数据库中创建好kafka eagle对应的数据库

create database ke DEFAULT CHARACTER SET utf8; 
grant all on *.* TO 'root'@'%' IDENTIFIED BY '123456'; 
flush privileges;

检查Java环境变量

[hadoop@bigdata01 conf]$ echo $JAVA_HOME 
/usr/java/jdk1.8.0_121

在启动前确保zookeeper 集群和kafka集群已经启动

以上配置好之后进入bin目录,启动kafka eagle
./ke.sh start

 inflated: META-INF/maven/org.smartloli.kafka.eagle/kafka-eagle-web/pom.properties
[2020-04-20 12:41:09] INFO: Port Progress: [##################################################] | 100%
[2020-04-20 12:41:12] INFO: Config Progress: [##################################################] | 100%
[2020-04-20 12:41:15] INFO: Startup Progress: [##################################################] | 100%
[2020-04-20 12:41:05] INFO: Status Code[0]
[2020-04-20 12:41:05] INFO: [Job done!]
Welcome to
    __ __    ___     ____    __ __    ___            ______    ___    ______    __     ______
   / //_/   /   |   / __/   / //_/   /   |          / ____/   /   |  / ____/   / /    / ____/
  / ,<     / /| |  / /_    / ,<     / /| |         / __/     / /| | / / __    / /    / __/   
 / /| |   / ___ | / __/   / /| |   / ___ |        / /___    / ___ |/ /_/ /   / /___ / /___   
/_/ |_|  /_/  |_|/_/     /_/ |_|  /_/  |_|       /_____/   /_/  |_|\____/   /_____//_____/   
                                                                                             

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

启动成功后访问对应的url使用默认的用户名和密码进行登录
在这里插入图片描述
接下来可以在web界面看到我们kafka的一些信息,包括topic、zookeeper、kafka集群、consumer、偏移量等信息

下面是一份更加详细的配置信息

######################################
# 设置Kafka多集群,这里只需要设置Zookeeper,
# 系统会自动识别Kafka Broker
######################################
kafka.eagle.zk.cluster.alias=cluster1
cluster1.zk.list=127.0.0.1:2181
cluster2.zk.list=127.0.0.1:2181/plain
cluster3.zk.list=127.0.0.1:2181/scram
cluster4.zk.list=vmn4:2181

######################################
# Zookeeper线程池最大连接数
######################################
kafka.zk.limit.size=25

######################################
# Kafka Eagle的页面访问端口
######################################
kafka.eagle.webui.port=8048

######################################
# 存储消费信息的类型,一般在0.9版本之前,消费
# 信息会默认存储在Zookeeper中,所以存储类型
# 设置zookeeper即可,如果是在0.10版本之后,
# 消费者信息默认存储在Kafka中,所以存储类型
# 设置为kafka。而且,在使用消费者API时,尽量
# 客户端Kafka API版本和Kafka服务端的版本保持
# 一致性。
######################################
cluster1.kafka.eagle.offset.storage=kafka
cluster2.kafka.eagle.offset.storage=kafka
#cluster3.kafka.eagle.offset.storage=kafka
cluster4.kafka.eagle.offset.storage=kafka

######################################
# 开启性能监控,数据默认保留30天
######################################
kafka.eagle.metrics.charts=true
kafka.eagle.metrics.retain=30


######################################
# KSQL查询Topic数据默认是最新的5000条,如果
# 在使用KSQL查询的过程中出现异常,可以将下面
# 的false属性修改为true,Kafka Eagle会在
# 系统中自动修复错误。
######################################
kafka.eagle.sql.topic.records.max=5000
kafka.eagle.sql.fix.error=false

######################################
# 删除Kafka Topic时需要输入删除密钥,由
# 管理员执行
######################################
kafka.eagle.topic.token=keadmin

######################################
# 开启Kafka ACL特性,例如SCRAM或者PLAIN,
# 一般生产环境会使用SCRAM来做ACL,应为SCRAM
# 可以动态创建和管理用户。
######################################
cluster1.kafka.eagle.sasl.enable=false
cluster1.kafka.eagle.sasl.protocol=SASL_PLAINTEXT
cluster1.kafka.eagle.sasl.mechanism=SCRAM-SHA-256
cluster1.kafka.eagle.sasl.jaas.config=org.apache.kafka.common.security.scram.ScramLoginModule required username="admin" password="admin-secret";
cluster1.kafka.eagle.sasl.client.id=

cluster2.kafka.eagle.sasl.enable=true
cluster2.kafka.eagle.sasl.protocol=SASL_PLAINTEXT
cluster2.kafka.eagle.sasl.mechanism=PLAIN
cluster2.kafka.eagle.sasl.jaas.config=org.apache.kafka.common.security.plain.PlainLoginModule required username="admin" password="admin-secret";
cluster2.kafka.eagle.sasl.client.id=

######################################
# 存储Kafka Eagle元数据信息的数据库,目前支持
# MySQL和Sqlite,默认使用Sqlite进行存储
######################################
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=123456

#kafka.eagle.driver=org.sqlite.JDBC
#kafka.eagle.url=jdbc:sqlite:/Users/dengjie/webserver/hadoop/sqlite/ke.db
#kafka.eagle.username=root
#kafka.eagle.password=root

猜你喜欢

转载自blog.csdn.net/qq_43081842/article/details/105632383