1.查看某个主题下面的消息
bin/kafka-console-consumer.sh --bootstrap-server localhost:9092 --topic web_douyin_author --from-beginning
2.查看所有主题
bin/kafka-topics.sh --list --zookeeper localhost:2181
3.删除 某个主题
./bin/kafka-topics.sh --delete --topic web_douyin_author --zookeeper localhost:2181
4.启动kafak
nohup bin/kafka-server-start.sh config/server.properties 1>/dev/null 2>&1 &
kafka如果直接启动会出现问题,就是信息会打印在控制台,就会出现在控制台。
然后关闭窗口,kafka随之关闭,然后启动以下的命令就可以实现。
发现以下亦可以:
./kafka-server-start.sh -daemon ../config/server.properties
如果使用kafka自带的zookeeper则需要先后台启动zookeeper:
./zookeeper-server-start.sh -daemon ../config/zookeeper.properties
然后启动kafka