# 启动

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

关注

关注下方微信公众号,可以及时获取到各种技术的干货哦,如果你有想推荐的帖子,也可以联系我。

Kafka操作

相关文章: