最近一直在学习kafka,也知道kafka-manager,但是用的版本都是别人编译好的,最近自己把kafka版本升级到1.0.0版本,别人的编译的版本不太适应了,总不能老是等着别人编译发布吧。网上很多人都说编译要翻墙,别人说的是别人说的,我不翻墙看看能不能编译成功,在网上收集大家的资料做个总结,在此感谢革命道路上的同志们。
1、安装sbt
curl https://bintray.com/sbt/rpm/rpm > bintray-sbt-rpm.repo
mv bintray-sbt-rpm.repo /etc/yum.repos.d/
yum install sbt
2、修改仓库地址
sbt 默认下载库文件很慢, 还时不时被打断
我们可以在用户目录下创建 touch ~/.sbt/repositories, 填上阿里云的镜像
# vi ~/.sbt/repositories
[repositories]
local
aliyun-nexus: http://maven.aliyun.com/nexus/content/groups/public/
jcenter: https://jcenter.bintray.com/
typesafe-ivy-releases: https://repo.typesafe.com/typesafe/ivy-releases/, [organization]/[module]/[revision]/[type]s/[artifact](-[classifier]).[ext], bootOnly
maven-central
3、下载编译
git clone https://github.com/yahoo/kafka-manager.git
也可以在Windows下载好上传到Linux,解压
cd kafka-manager
sbt clean dist
看到打印这个消息 Getting org.scala-sbt sbt 0.13.9 (this may take some time)... 就慢慢等吧,可以到~/.sbt/boot/update.log 查看sbt更新日志。sbt更新好,就开始下载各种jar包,最后看到:[info] Your package is ready in /usr/local/src/kafka-manager-master/target/universal/kafka-manager-1.3.3.17.zip 证明编译好了。
4、配置
解压并修改配置文件
unzip kafka-manager-1.3.3.17.zip
vim kafka-manager-1.3.3.17.zip/conf/application.conf
将application.conf中的kafka-manager.zkhosts的值设置为你的zk地址
kafka-manager.zkhosts="zk1:2181,zk2:2181,zk3:2181"
再增加一项:
http.port=9001 #修改HTTP访问端口号为9001,默认端口是9000
启动kafka-manager:/usr/local/kafka-manager-1.3.3.17/bin/kafka-manager &
到此结束了,全程没有翻墙,最后上一张图。