Kafka操作

# 启动
nohup bin/kafka-server-start.sh -daemon config/server.properties &

# 连接数修改(若无,添加)
queued.max.requests=1000

//创建topic 创建一个"test"的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

# 消费topic
bin/kafka-console-consumer.sh --zookeeper localhost:2181 --topic topicName --from beginning

//创建topic 创建一个"test"的topic,一个分区一个副本
bin/kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic test

//查看主题详情
bin/kafka-topics.sh --describe --zookeeper localhost:2181 --topic test



//创建topic 创建一个"test"的topic,一个分区一个副本
bin/kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic test

猜你喜欢

转载自blog.csdn.net/u012516524/article/details/80164842