参考文档:https://github.com/yahoo/kafka-manager
一、下载源码
下载链接: https://github.com/yahoo/kafka-manager/releases
下载源码到/opt目录
|
1
2
|
ls /opt
kafka-manager-master |
二、修改配置文件
|
1
2
3
4
|
cd /opt/kafka-manager-master/conf/
vim application.conf#修改下面的配置为zookeeper集群地址kafka-manager.zkhosts="172.16.2.27:2181,172.16.2.28:2181,172.16.2.29:2181"
|
三、构建
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
./sbt clean dist
# lltotal 76drwxr-xr-x 9 root root 4096 Dec 2 02:11 app-rw-r--r-- 1 root root 3133 Dec 2 02:11 build.sbtdrwxr-xr-x 2 root root 4096 Dec 8 13:36 confdrwxr-xr-x 2 root root 4096 Dec 2 02:11 img-rw-r--r-- 1 root root 11307 Dec 2 02:11 LICENCEdrwxr-xr-x 4 root root 4096 Dec 8 11:46 projectdrwxr-xr-x 5 root root 4096 Dec 2 02:11 public-rw-r--r-- 1 root root 6658 Dec 2 02:11 README.md-rwxr-xr-x 1 root root 19460 Dec 2 02:11 sbtdrwxr-xr-x 4 root root 4096 Dec 2 02:11 srcdrwxr-xr-x 7 root root 4096 Dec 8 12:48 targetdrwxr-xr-x 4 root root 4096 Dec 2 02:11 test
cp /opt/kafka-manager-master/target/universal/kafka-manager-1.3.3.15.zip /opt
tar zxf kafka-manager-1.3.3.15.zip
|
构建完成后生成一个target目录,将该目录下的universal/kafka-manager-1.3.3.15.zip 压缩包拷贝到/opt
启动kafka-manager
bin/kafka-manager -Dconfig.file=/path/to/application.conf -Dhttp.port=8080
访问kafka-manager,创建一个cluster即可。Cluster Name和Cluster Zookeeper Hosts配置下即可,其他配置可以保持默认
JMX配置需要修改kafka启动脚本,设置JMX_PORT="9999"
|
1
2
3
4
5
|
vim /usr/local/kafka/bin/kafka-server-start.sh
if [ "x$KAFKA_HEAP_OPTS" = "x" ]; then
export KAFKA_HEAP_OPTS="-Xmx2G -Xms2G"
export JMX_PORT="9999"
fi |
本文转自 曾哥最爱 51CTO博客,原文链接:http://blog.51cto.com/zengestudy/2049760,如需转载请自行联系原作者