1. 安装包下载
官网地址:EFAK
本文使用3.0.1版本
2. 开启kafka JMX
在启动Kafka的脚本前,打开JMX端口,本文将其写在一键启动中,将以下代码写在自定义的kafka-start.sh中,即可实现一键启动,这里还涉及一个文件slave中已经写明了各个主机名称,这里一键启动不做多余赘述。
cat /export/onekey/slave | while read line
do
{
echo $line
ssh $line "source /etc/profile;export JMX_PORT=9988;nohup ${KAFKA_HOME}/bin/kafka-server-start.sh ${KAFKA_HOME}/config/server.properties >/dev/nul* 2>&1 & "
}&
wait
done
3. 安装JDK,配置JAVA_HOME
本机已安装好环境
4. 上传安装包、解压
cd /app
wget https://archive.fastgit.org/smartloli/kafka-eagle-bin/archive/v3.0.1.tar.gz
将其解压到 /app 文件夹下
tar -zxvf kafka-eagle-bin-3.0.1.tar.gz
cd kafka-eagle-bin-3.0.1/
tar -zxvf efak-web-3.0.1-bin.tar.gz
5. 配置Kafka-eagle环境变量
vim /etc/profile
export KE_HOME=/app/kafka-eagle-bin-3.0.1/efak-web-3.0.1
export PATH=$PATH:$KE_HOME/bin
source /etc/profile
6. 配置Kafka_eagle
使用vi打开conf目录下的system-config.properties
cd /app/kafka-eagle-bin-3.0.1/efak-web-3.0.1
vim conf/system-config.properties
第一处改动,第五行附近:之前版本都是kafka.eagle 现在默认称为efak,名称改了,另外把cluster2注释
efak.zk.cluster.alias=cluster1
cluster1.zk.list=localhost:2181,localhost:2182,localhost:2183
#cluster2.zk.list=xdn10:2181,xdn11:2181,xdn12:2181
第二处改动,54行注释
第三处:81-111行,全部注销
######################################
79 # kafka sasl authenticate
80 ######################################
81 #cluster1.efak.sasl.enable=false
82 #cluster1.efak.sasl.protocol=SASL_PLAINTEXT
83 #cluster1.efak.sasl.mechanism=SCRAM-SHA-256
84 #cluster1.efak.sasl.jaas.config=org.apache.kafka.common.security.scram.ScramLoginModule required usern
ame="kafka" password="kafka-eagle";
85 #cluster1.efak.sasl.client.id=
86 #cluster1.efak.blacklist.topics=
87 #cluster1.efak.sasl.cgroup.enable=false
88 #cluster1.efak.sasl.cgroup.topics=
89 #cluster2.efak.sasl.enable=false
90 #cluster2.efak.sasl.protocol=SASL_PLAINTEXT
91 #cluster2.efak.sasl.mechanism=PLAIN
92 #cluster2.efak.sasl.jaas.config=org.apache.kafka.common.security.plain.PlainLoginModule required usern
ame="kafka" password="kafka-eagle";
93 #cluster2.efak.sasl.client.id=
94 #cluster2.efak.blacklist.topics=
95 #cluster2.efak.sasl.cgroup.enable=false
96 #cluster2.efak.sasl.cgroup.topics=
97
98 ######################################
99 # kafka ssl authenticate
100 ######################################
101 #cluster3.efak.ssl.enable=false
102 #cluster3.efak.ssl.protocol=SSL
103 #cluster3.efak.ssl.truststore.location=
104 #cluster3.efak.ssl.truststore.password=
105 #cluster3.efak.ssl.keystore.location=
106 #cluster3.efak.ssl.keystore.password=
107 #cluster3.efak.ssl.key.password=
108 #cluster3.efak.ssl.endpoint.identification.algorithm=https
109 #cluster3.efak.blacklist.topics=
110 #cluster3.efak.ssl.cgroup.enable=false
111 #cluster3.efak.ssl.cgroup.topics=
第四处:125行
efak.driver=com.mysql.cj.jdbc.Driver
efak.url=jdbc:mysql://127.0.0.1:3306/ke?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull
efak.username=root
efak.password=123456
说明:这里node1上的MySQL用户名和密码要正确,123456是文件给的默认值,记得改,不然无法登录Kafka_eagle
7. 配置ke.sh
cd kafka-eagle-bin-3.0.1/efak-web-3.0.1/bin
vim ke.sh
在25行添加JAVA_HOME
export JAVA_HOME=/app/jdk1.8.0_301
添加执行脚本的权限
chmod u+x ke.sh
8. 启动Kafka_eagle
./ke.sh start
9. 防火墙
开放端口(开放后需要要重启防火墙才生效) 、重新启动防火墙
firewall-cmd --zone=public --add-port=8048/tcp --permanent
firewall-cmd --reload
10. 访问Kafka eagle
访问之前,查看kafka和zookeeper是否启动,Kafka未启动不能访问
默认用户未admin 密码为123456
#访问地址
http://node1:8048
或
http://ip地址:8048
转载:https://blog.csdn.net/weixin_40816738/article/details/127751869
查看评论