娃哈哈好喝-真的!
技术够用就行,吃好喝好睡好!

kafka-manager

本例版本:3.0.0.6,下载地址:https://github.com/yahoo/CMAK/tags

这里使用源码包安装,依赖jdk11版本,还需要使用sbt环境,sbt使用版本1.7.1,下载地址:https://github.com/sbt/sbt/tags

sbt下载的是bin包,保存路径:

[root@rockettest-167 sbt]# pwd
/data/sbt
[root@rockettest-167 sbt]# ls
bin conf LICENSE NOTICE target
[root@rockettest-167 sbt]#

将sbt加入环境变量,/etc/profile文件最后加入下面两行

export SBT_HOME=/data/sbt
export PATH=$PATH:$SBT_HOME/bin

重载

[root@rockettest-167 sbt]# source /etc/profile
#查看sbt版本好及是否配置正确
[root@rockettest-167 sbt]# sbt sbtVersion
[warn] No sbt.version set in project/build.properties, base directory: /data/sbt
[info] welcome to sbt 1.7.1 (Oracle Corporation Java 11.0.16)
[info] set current project to sbt (in build file:/data/sbt/)
[info] 1.7.1
[root@rockettest-167 sbt]#

下载好cmak源码包后解压

[root@rockettest-167 CMAK-3.0.0.6]# ls
app build.sbt conf img LICENSE project public README.md sbt screwdriver.yaml src test
#编译
[root@rockettest-167 CMAK-3.0.0.6]# sbt clean dist
[info] Loading settings for project cmak-3-0-0-6-build from plugins.sbt ...
[info] Loading project definition from /data/dl/CMAK-3.0.0.6/project
[warn] There may be incompatibilities among your library dependencies; run 'evicted' to see detailed eviction warnings.
[info] Loading settings for project root from build.sbt ...
[info] Set current project to cmak (in build file:/data/dl/CMAK-3.0.0.6/)
[success] Total time: 0 s, completed Jul 23, 2022, 2:06:57 AM
[info] Wrote /data/dl/CMAK-3.0.0.6/target/scala-2.12/cmak_2.12-3.0.0.6.pom
Warning: node.js detection failed, sbt will use the Rhino based Trireme JavaScript engine instead to run JavaScript assets compilation, which in some cases may be orders of magnitude slower than using node.js.
[warn] There may be incompatibilities among your library dependencies; run 'evicted' to see detailed eviction warnings.
[info] Main Scala API documentation to /data/dl/CMAK-3.0.0.6/target/scala-2.12/api...
[info] Compiling 136 Scala sources and 2 Java sources to /data/dl/CMAK-3.0.0.6/target/scala-2.12/classes ...
[info] LESS compiling on 1 source(s)
model contains 645 documentable templates
[info] Main Scala API documentation successful.
[success] All package validations passed
[info] Your package is ready in /data/dl/CMAK-3.0.0.6/target/universal/cmak-3.0.0.6.zip
[success] Total time: 48 s, completed Jul 23, 2022, 2:07:45 AM
[root@rockettest-167 CMAK-3.0.0.6]#

如果看到上面的信息说明编译成功了,编译后的可执行文件保存在当前目录下的target目录中

CMAK-3.0.0.6/target/universal/cmak-3.0.0.6.zip

cmak-3.0.0.6.zip就是我们需要的可执行程序,将cmak解压保存在指定路径

[root@rockettest-167 cmak]# pwd
/data/cmak
[root@rockettest-167 cmak]# ls
application.home_IS_UNDEFINED bin conf lib logs README.md share
[root@rockettest-167 cmak]# vim conf/application.conf
#只需要修改这两行,填写zookeeper地址
kafka-manager.zkhosts="172.20.20.166:2181,172.20.20.167:2181,172.20.20.168:2181"
cmak.zkhosts="172.20.20.166:2181,172.20.20.167:2181,172.20.20.168:2181"

启动服务,默认服务监听在9000端口

[root@rockettest-167 bin]# pwd
/data/cmak/bin
[root@rockettest-167 bin]#
[root@rockettest-167 bin]# ./cmak
cmak -Dhttp.port=9998 -java-home /usr/java/jdk-11.0.9

可以加参数来改变端口和使用的java版本

[root@rockettest-167 bin]# ./cmak -Dhttp.port=8080 -java-home /data/java11

服务启动后可以使用浏览器打开9000端口来访问

注意kafka要开启jmx端口,开启方法:

修改kafka的启动文件:kafka-server-start.sh

#找到此段内容,加入export JMX_PORT="9999",表示jmx使用9999端口
if [ "x$KAFKA_HEAP_OPTS" = "x" ]; then
    export KAFKA_HEAP_OPTS="-Xmx1G -Xms1G"
    export JMX_PORT="9999"                                                                                            
fi

重启kafka之后可以用过kafka-manager来管理,首次打开后需要手动创建集群

赞(0)
未经允许不得转载:娃哈哈好喝 » kafka-manager
分享到: 更多 (0)