http://www.cnblogs.com/yinchengzhe/p/5126360.html
参考site:https://github.com/yahoo/kafka-manager
1. Function
- Manage multiple kafka clusters
- Conveniently check kafka cluster status (topics, brokers, backup distribution, partition distribution)
- Choose the copy you want to run
- Based on current partition status
- You can select the topic configuration and create a topic (the configurations of 0.8.1.1 and 0.8.2 are different)
- Delete topic (only supports versions above 0.8.2 and set delete.topic.enable=true in the broker configuration)
- Topic list will indicate which topics are deleted (applicable in version 0.8.2 and above)
- Add a partition to an existing topic
- Update configuration for an existing topic
- Batch repartition on multiple topics
- Batch repartition on multiple topics (optional partition broker location)
2. Environmental requirements
- Kafka 0.8.1.1 or 0.8.2.*
- sbt 0.13.x
- Java 8+
3. Installation and deployment
1. Install sbt
> curl https://bintray.com/sbt/rpm/rpm > bintray-sbt-rpm.repo
> mv bintray-sbt-rpm.repo /etc/yum.repos.d/
> yum install sbt
2. Download and compile
> git clone https://github.com/yahoo/kafka-manager.git
> cd kafka-manager
> sbt clean dist
Note: Executing sbt compilation and packaging may take a long time, if you hang in the following situations
Modify the logLevel parameter in project/plugins.sbt to logLevel := Level.Debug (default is Warn)
3. Installation configuration
After the compilation is successful, a zip package will be generated under target/universal
Personally compiled: http://pan.baidu.com/s/1o6RZze i
Unzip and modify the configuration file
> unzip kafka-manager-1.3.0.4.zip
> vim kafka-manager-1.3.0.4/conf/application.conf
Set the value of kafka-manager.zkhosts in application.conf to your zk address
如: kafka-manager.zkhosts="h2:2181"
kafka-manager.zkhosts=${?ZK_HOSTS}
pinned-dispatcher.type="PinnedDispatcher"
pinned-dispatcher.executor="thread-pool-executor"
4. Start, specify the location of the configuration file and the startup port number, the default is 9000
> nohup bin/kafka-manager -Dconfig.file=conf/application.conf -Dhttp.port 9001 &
The first time you enter the web UI, you need to configure the kafka cluster and configure it according to your own information.