【常用命令】kafka

kafka启动

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

生产者启动

bin/kafka-console-producer.sh --broker-list localhost:20882 --topic test

消费者启动

bin/kafka-console-consumer.sh --zookeeper localhost:48890 --topic test --from-beginning

创建topic

bin/kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 3 --partitions 3 --topic test

删除topic

bin/kafka-topics.sh --zookeeper localhost:48889 --delete --topic topic_name

topic列表

bin/kafka-topics.sh --list --zookeeper localhost:48889

topic状态(列出分区、副本、Isr参数)

bin/kafka-topics.sh --zookeeper localhost:48889 --describe --topic topic_name

生产者吞吐量测试

bin/kafka-producer-perf-test.sh --topic test-topic --num-records 500000 --record-size 200 --throughput -1 --producer-props bootstrap.servers=kafka1:9092,kafka2:9093,kafka3:9094 acks=-1

消费者吞吐量测试

bin/kafka-consumer-perf-test.sh --topic test-topic --broker-list kafka1:9092,kafka2:9093,kafka3:9094 --message-size 200 --messages 500000 --topic test-topic
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值