一.kafka常用命令
1.kafka下载指定版本地址
http://archive.apache.org/dist/kafka/
zk下载地址 ;
https://mirrors.tuna.tsinghua.edu.cn/apache/zookeeper/stable/
2.创建一个topic
./bin/kafka-topics.sh --zookeeper 192.168.20.71:2181 --create --topic test1 --partitions 3 --replication-factor 1
3.查看topic详情
./bin/kafka-topics.sh --zookeeper 192.168.20.71:2181 --describe --topic test1
4.模拟消费者consumer
/bin/kafka-console-consumer.sh --bootstrap-server 192.168.20.71:2181,192.168.20.72:2181,192.168.20.73:2181 --topic test1
5.模拟生产者producer
./bin/kafka-console-producer.sh --broker-list 192.168.20.71:9092,192.168.20.72:9092,192.168.20.73:2 --topic test1
6.高性能原因
顺序写磁盘,性能高于随机写内存
Kafka基础操作命令
最新推荐文章于 2024-06-16 10:41:46 发布