kafka管理工具Kafka Eagle安装及使用
安装
下载
解压
- tar -zxf kafka-eagle-bin-1.2.3.tar.gz
- tar -zxf kafka-eagle-web-1.2.3-bin.tar.gz
配置环境变量
vi /etc/profile export JAVA_HOME=/usr/java/latest export KE_HOME=/data/soft/new/kafka-eagle export PATH=$PATH:$KE_HOME/bin:$JAVA_HOME/bin
配置文件
vi system-config.properties
###################################### #zookeeper&kafka cluster list ###################################### kafka.eagle.zk.cluster.alias=cluster1 cluster1.zk.list=p6.ambari:2181,p5.ambari:2181,p2.ambari:2181 ###################################### # zk client thread limit ###################################### kafka.zk.limit.size=25 ###################################### # kafka eagle webui port ###################################### kafka.eagle.webui.port=8048 ###################################### # kafka offset storage ###################################### kafka.eagle.offset.storage=kafka ###################################### # enable kafka metrics ###################################### kafka.eagle.metrics.charts=true kafka.eagle.sql.fix.error=true ###################################### # delete kafka topic token ###################################### kafka.eagle.topic.token=keadmin ###################################### # kafka sasl authenticate ###################################### kafka.eagle.sasl.enable=false kafka.eagle.sasl.protocol=SASL_PLAINTEXT kafka.eagle.sasl.mechanism=PLAIN ###################################### # kafka jdbc driver address ###################################### kafka.eagle.driver=com.mysql.jdbc.Driver kafka.eagle.url=jdbc:mysql://p6.ambari:3306/ke?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull kafka.eagle.username=root kafka.eagle.password=123456
注意:
offset是保存在kafka还是zookeeper;
mysql创建数据库ke,无需创建表。
启动
cd ${KE_HOME}/bin chmod +x ke.sh ./ke.sh start
使用
- 登陆页面
- sql
- select * from “ke_test_topic” where “partition” in (0,1,2) limit 100
- 注意”partition” in,必须不能多于创建的partition。如只创建了一个partition 0,in里只能写(0)。