Kopite Kopite的博客

Esper入门

2018-12-06
Kopite

本文介绍kafka-manager工具的使用。

安装kafka-manager

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 NameCluster Zookeeper HostsKafka Version,点击Save保存,新增集群后的界面如下图所示:

点击集群名称进入Summary界面:

Summary界面可查看TopicsBrokers

Create Topic

点击Topic->Create Topic,进入上图中所示的新增主题界面,依次输入TopicPartitionsReplication Factor,点击Create保存,新增主题后的界面如下图所示:


Similar Posts

Comments