參考 : kafka管理器kafka-manager部署安裝html
下載Kafka Manager,並進行打包,因爲Kafka manager是由scala寫的,因此須要由sbt的支持git
git clone https://github.com/yahoo/kafka-manager cd kafka-manager ./sbt clean dist
關於sbt的的安裝,請移步github
http://www.cnblogs.com/tonglin0325/p/8884470.html
配置zk的地址vim
在conf/application.conf中將kafka-manager.zkhosts的值設置爲localhost
打包完成後,對kafka-manager-1.3.3.17.zip包進行解壓,位置在bash
kafka-manager/target/universal
修改配置app
vim kafka-manager-1.3.3.17/conf/application.conf
啓動Kafka managerssh
bin/kafka-manager -Dconfig.file=/home/lintong/software/kafka-manager-1.3.3.17/conf/application.conf -Dhttp.port=7778
訪問fetch
http://localhost:9000
而後在cluster中add cluster,好比.net
啓動Kafka的JMX,只須要修改kafka的啓動命令就行,注意給kafka添加jmx須要在kafka manager以前scala
啓動kafka服務時指定JMX_PORT值:
JMX_PORT=9999 bin/kafka-server-start.sh -daemon config/server.properties //一臺機器部署多個server採用此方法
或者修改kafka-server-start.sh,在前面加上:
export JMX_PORT=9999 //若是一臺機器部署一個server 建議採用此方法
關於Kafka Manager中的一些參數說明:
Replication (副本數)
Number of Partitions (分區數)
Sum of partition offsets (offset大小,須要開啓JMX支持)
Total number of Brokers (Broker總數)
Number of Brokers for Topic (Topic所佔Broker數)
Preferred Replicas % ()
Brokers Skewed % (Broker 均衡率)
Brokers Spread % (Broker 擴散率)
Under-replicated % (處於同步狀態的比率)
Message in /sec 消息數據流量
Bytes in /sec kafka輸入數據流量
Bytes out /sec kafka輸出數據流量
Bytes rejected /sec 拒絕的流量
Failed fetch request /sec 失敗的獲取請求
Failed produce request /sec 失敗的生產請求