kafka常用命令
1.启动zookeeper
bin/zookeeper-server-start.sh config/zookeeper.properties
2.启动kafka
bin/kafka-server-start.sh config/server.properties
3.创建topic
bin/kafka-topics.sh \ --create \ --zookeeper localhost:2181 \ --replication-factor 1 \ --partitions 1 \ --topic gang_gang_topic
4.查看所有topic
bin/kafka-topics.sh \ --list \ --zookeeper localhost:2181
5.启动生产者
bin/kafka-console-producer.sh \ --broker-list localhost:9092 \ --topic gang_gang_topic
6.启动消费者
bin/kafka-console-consumer.sh \ --zookeeper localhost:2181 \ --topic gang_gang_topic
7.partition
bin/kafka-topics.sh \ --zookeeper localhost:2181 \ --alter \ --topic gang_gang_topic \ --partitions 3
8.test
bin/kafka-producer-perf-test.sh \ --producer.config config/producer-test.properties \ --topic gnus-test \ --throughput 2000000 \ --num-records 6000000 \ --payload-file message.txt bin/kafka-producer-perf-test.sh --producer.config config/producer-test2.properties \ --topic gnus-test \ --throughput 2000000 \ --num-records 6000000 \ --payload-file message.txt
相关推荐
jiangkai00 2020-04-15
sweetgirl0 2020-02-09
ljcsdn 2020-07-27
woaishanguosha 2020-07-18
qingyuerji 2020-06-14
MojitoBlogs 2020-06-14
MojitoBlogs 2020-06-09
猫咪的一生 2020-06-03
guicaizhou 2020-05-05
猫咪的一生 2020-05-03
方新德 2020-04-08
jiangkai00 2020-03-20
那年夏天0 2020-02-22
sweetgirl0 2020-02-21
MrZhangAdd 2020-01-13
jiangkai00 2020-01-12
GoatSucker 2020-01-11
yangyutong00 2019-12-30