Apache Kafka
2.生成集群id,并格式化存储目录
bin/kafka-storage.sh random-uuid
#生成的uuid
Z4gIsrl6Rz-_09ns03OWlQ
格式化存储目录
bin/kafka-storage.sh format -t Z4gIsrl6Rz-_09ns03OWlQ -c config/kraft/server.properties3.启动服务
bin/kafka-server-start.sh config/kraft/server.properties & #查看服务启动状态,返回kafka启动成功 jps4.创建一个主题(topic)
#创建一个名为“test”的Topic,只有一个分区和一个备份: bin/kafka-topics.sh --create --bootstrap-server localhost:9092 --replication-factor 1 --partitions 1 --topic test #创建好之后,可以通过运行以下命令,查看已创建的topic信息: bin/kafka-topics.sh --describe --topic test --bootstrap-server localhost:9092 #查看所有topic bin/kafka-topics.sh --list --bootstrap-server localhost:9092 #删除topic bin/kafka-topics.sh --bootstrap-server localhost:2181 --delete --topic test



