1.下载相应的版本:https://github.com/yahoo/kafka-manager/releases?after=1.3.3.14
2.解压到相应的目录下面
3.添加启动脚本start-kafka-manager.sh 8787 是对应的端口可以自己修改
#!/bin/bash
./kafka-manager -Dconfig.file=/home/kafka-manager-1.3.3.7/conf/application.conf -Dhttp.port=8787 > /dev/null 2>&1 &
4.添加守护脚本kafka-manager-dog.sh
#!/bin/bash
num=`netstat -ntlp | grep -w 8787 | wc -l`
echo $num
if [ $num -ne 1 ];then
cd /home/kafka-manager-1.3.3.7/bin
./star-kafka-manager.sh
fi
5.添加定时运行job
crontab -l //查看定时任务
crontab -e //编辑定时任务
6.启动start-kafka-manager.sh
可能遇见异常:
kafka-manager_1 | akka.ConfigurationException: Logger specified in config can't be loaded [akka.event.slf4j.Slf4jLogger] due to [akka.event.Logging$LoggerInitializationException: Logger log1-Slf4jLogger did not respond with LoggerInitialized, sent instead [TIMEOUT]]
解决 添加下面的超时时间