kafka常用命令记录

启动:./bin/kafka-server-start.sh ./config/server.properties &

停止:./bin/kafka-server-stop.sh

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

列出所有的topic: ./bin/kafka-topics.sh --list --zookeeper localhost:2181

生产者生产消息:./bin/kafka-console-producer.sh --broker-list localhost:9092 --topic test

更改分区数:

bin/kafka-topics.sh --zookeeper node01:2181 --alter --topic t_cdr --partitions 10

多个topic进行数据同步:

bin/kafka-replay-log-producer.sh --broker-list localhost:9092 --zookeeper zookeeper:2181 --inputtopic topic1 --outputtopic topic2

增加topic分区数:

bin/kafka-topics.sh --zookeeper node01:2181 --alter --topic t_cdr --partitions 10

你可能感兴趣的:(kafka)