本文介绍kafka-manager
工具的使用。
SOA
面向服务架构(Service-Oriented Architecture,SOA)
EDA
事件驱动架构(Event-Driven Architecture,EDA)
从kafka-manager GitHub下载的源码包需要编译,此处使用已经编译好的kafka-manager-1.3.3.18.zip
,安装步骤如下:
- 使用Bitvise SSH Client工具将编译好的
kafka-manager-1.3.3.18.zip
复制到/usr/local/
路径,此处使用192.168.80.129
- 将
kafka-manager-1.3.3.18.zip
包解压至/usr/local/
路径:
[root@localhost local]# unzip kafka-manager-1.3.3.18.zip
Archive: kafka-manager-1.3.3.18.zip
inflating: kafka-manager-1.3.3.18/lib/kafka-manager.kafka-manager-1.3.3.18-sans-externalized.jar
inflating: kafka-manager-1.3.3.18/lib/com.typesafe.play.twirl-api_2.11-1.1.1.jar
inflating: kafka-manager-1.3.3.18/lib/org.apache.commons.commons-lang3-3.4.jar
inflating: kafka-manager-1.3.3.18/lib/com.typesafe.play.play-server_2.11-2.4.6.jar
inflating: kafka-manager-1.3.3.18/lib/com.typesafe.play.play_2.11-2.4.6.jar
inflating: kafka-manager-1.3.3.18/lib/com.typesafe.play.build-link-2.4.6.jar
inflating: kafka-manager-1.3.3.18/lib/com.typesafe.play.play-exceptions-2.4.6.jar
inflating: kafka-manager-1.3.3.18/lib/org.javassist.javassist-3.19.0-GA.jar
inflating: kafka-manager-1.3.3.18/lib/com.typesafe.play.play-iteratees_2.11-2.4.6.jar
inflating: kafka-manager-1.3.3.18/lib/org.scala-stm.scala-stm_2.11-0.7.jar
...
- 进入
/usr/local/kafka-manager-1.3.3.18/conf
目录,修改application.conf
,保存并关闭:
kafka-manager.zkhosts="192.168.80.129:2181,192.168.80.130:2181,192.168.80.131:2181"
启动kafka-manager
kafka-manager
默认访问端口是9000
,开放此端口:
[root@localhost conf]# firewall-cmd --query-port=9000/tcp
no
[root@localhost conf]# firewall-cmd --permanent --zone=public --add-port=9000/tcp
success
[root@localhost conf]# firewall-cmd --reload
success
[root@localhost conf]# firewall-cmd --query-port=9000/tcp
yes
使用以下命令启动kafka-manager
,浏览器中输入http://192.168.80.129:9000
即可访问kafka-manager
:
[root@localhost bin]# ./kafka-manager
使用kafka-manager
Add Cluster
点击Cluster
->Add Cluster
,进入上图中所示的新增集群界面,依次输入Cluster Name
、Cluster Zookeeper Hosts
、Kafka Version
,点击Save
保存,新增集群后的界面如下图所示:
点击集群名称进入Summary
界面:
在Summary
界面可查看Topics
、Brokers
:
Create Topic
点击Topic
->Create Topic
,进入上图中所示的新增主题界面,依次输入Topic
、Partitions
、Replication Factor
,点击Create
保存,新增主题后的界面如下图所示: