kafka常用命令

来源:互联网 发布:js将 json转换对象数组 编辑:程序博客网 时间:2024/05/17 07:55

kafka 0.8.2

//kafka后台启动命令

bin/kafka-server-start.sh -daemonconfig/server.properties

//kafka停止命令,

bin/kafka-server-stop.sh

//创建topic命令

bin/kafka-topics.sh --create --zookeeper10.0.128.32:2181/kafka --replication-factor 3 --partitions 10 --topic wyptest

//查看topic列表

bin/kafka-topics.sh --list --zookeeper10.0.128.32:2181/kafka

//修改topic

bin/kafka-topics.sh --alert --zookeeper10.0.128.32:2181/kafka --partitions 800 --topic sdk_default

//查看topic信息

bin/kafka-topics.sh --describe --zookeeper10.0.128.32:2181/kafka --topic wyptest

//删除topic

bin/kafka-topics.sh --delete --zookeeper10.0.128.32:2181/kafka --topic sdk_default

//控制台生产者

bin/kafka-console-producer.sh --broker-list10.0.128.32:9092 --topic wyptest

//控制台消费者

bin/kafka-console-consumer.sh --zookeeper10.0.128.32:2181/kafka --from-beginning --topic sdk_default

0 0