kafka常用命令
创建toptic
kafka-topics.sh --bootstrap-server xnode1:9092,xnode2:9092,xnode3:9092,xnode4:9092 --create --replication-factor 1 --partitions 2 --topic stu_sec
WARNING: Due to limitations in metric names, topics with a period (’.’) or underscore (’_’) could collide. To avoid issues it is best to use either, but not both.
Created topic stu_sec.
WARNING是说topic名字含有下滑线,将stu_sec改成java的驼峰规范就行啦
查看topic
kafka-topics.sh --list --bootstrap-server xnode1:9092,xnode2:9092,xnode3:9092,xnode4:9092
stuSec
stu_sec
9092端口是kafka的
2182是zookeeper, kafka server.properties
zookeeper.connect=xnode2:2181,xnode2:2181,xnode3:2181,xnode4:2181