1.下载编译好的kafka-manager-2.0.0.0.zip
2.将kafka-manager-2.0.0.0.zip移动到/usr/local目录解压
3.修改配置文件
vim conf/application.conf
主要配置,只配置了简单使用,如需其他功能参考github
kafka-manager.zkhosts="zk1:2181,zk2:2181,zk3:2181"
关闭对kafka的增删改功能
注调#application.features=["KMClusterManagerFeature","KMTopicManagerFeature","KMPreferredReplicaElectionFeature","KMReassignPartitionsFeature"]
application.features=[]
4.启动
①
bin/kafka-manager -Dconfig.file=conf/application.conf -Dhttp.port=9000
后台运行:bin/kafka-manager -Dconfig.file=conf/application.conf -Dhttp.port=9000 1>/dev/null 2>&1 &
②
启动脚本:
-> #!/bin/bash
nohup bin/kafka-manager -Dconfig.file=/home/y/kafkaManager/conf/application.conf -Dhttp.port=8181 >> started.log &
停止脚本:
-> #!/bin/bash
PID=$(ps -ef|grep kafkaManager |grep -v grep |awk '{print $2}')
PID=${PID%"
"}
if [ "${PID}" != "" ]; then
echo "stopping kafkaManager..."
kill -9 $PID && rm -f /home/y/kafka-manager-1.3.3.17/RUNNING_PID
echo "kafkaManager is stopped"
fi