kafka-manager配置和使用

kafka-manager配置

  最主要配置就是用於kafka管理器狀態的zookeeper主機。這能夠在conf目錄中的application.conf文件中找到。java

kafka-manager.zkhosts="my.zookeeper.host.com:2181"

  固然也能夠聲明爲zookeeper集羣。git

kafka-manager.zkhosts="my.zookeeper.host.com:2181,other.zookeeper.host.com:2181"

  另外也能夠經過環境變量ZK_HOSTS來表示。
github

ZK_HOSTS="my.zookeeper.host.com:2181"

  自定義kafka-manager功能,相似於權限管理。oracle

application.features=["KMClusterManagerFeature","KMTopicManagerFeature","KMPreferredReplicaElectionFeature","KMReassignPartitionsFeature"]
  • KMClusterManagerFeature - allows adding, updating, deleting cluster from Kafka Manager
  • KMTopicManagerFeature - allows adding, updating, deleting topic from a Kafka cluster
  • KMPreferredReplicaElectionFeature - allows running of preferred replica election for a Kafka cluster
  • KMReassignPartitionsFeature - allows generating partition assignments and reassigning partitions

kafka-manager打包

  下面的命令將建立一個zip文件,可用於部署應用程序。app

./sbt clean dist

  更多的玩法配置請參考:production deployment/configuration.spa

  這個命令執行的會很慢,並且可能會失敗,要反覆執行幾回。不過我已經執行好了,訪問連接: https://pan.baidu.com/s/1123fRCT9ywEgiV6HjzSluw 提取碼: r86e 。日誌

kafka-manager運行

  通過上一步打包好以後會生成一個zip,具體zip的位置能夠看輸出日誌。解壓zip文件,進入kafka-manager目錄。code

bin/kafka-manager

  或者指定配置文件位置和端口blog

bin/kafka-manager -Dconfig.file=/path/to/application.conf -Dhttp.port=8080

  也能夠指定java home的位置ip

 bin/kafka-manager -java-home /usr/local/oracle-java-8

  修改conf/application.conf以下屬性

play.http.context = "/kafka-manager"
kafka-manager.zkhosts="localhost:2181"
kafka-manager.zkhosts=${?ZK_HOSTS}
application.features=["KMClusterManagerFeature","KMTopicManagerFeature","KMPreferredReplicaElectionFeature","KMReassignPartitionsFeature"]

  默認的端口是9000

kafka-manager界面詳情

  集羣監控信息

   

  

   Topic配置信息

  

   Topic對應的消費分組信息

   

   消費者消費詳情

  

  消費者列表信息

   

   Borker信息

  

  

 

  附:Kafka-Manager API

相關文章
相關標籤/搜索