启动:
bin/kafka-server-start.sh -daemon config/server-0.properties
bin/kafka-server-start.sh -daemon config/server-1.properties (如果有多个server/broker)
bin/kafka-server-start.sh -daemon config/server-2.properties (如果有多个server/broker)
停止:
bin/kafka-server-stop.sh
查看已经创建的topic列表:
bin/kafka-topics.sh –list –zookeeper 192.168.0.9:2181
创建topic:
bin/kafka-topics.sh –create –zookeeper 192.168.0.9:2181 –replication-factor 1 –partitions 1 –topic test
查看topic明细:
bin/kafka-topics.sh –describe –zookeeper 192.168.0.9:2181 –topic test
修改topic参数:
bin/kafka-topics.sh –zookeeper 192.168.0.9:2181 –partition 4 –topic test –alter
删除topic:
bin/kafka-topics.sh –zookeeper 192.168.0.9:2181 –delete –topic test
永久删除topic:
删除kafka存储目录(server.properties文件log.dirs配置,默认为”/tmp/kafka-logs”)相关topic目录
删除zookeeper “/brokers/topics/”目录下相关topic节点
cd /usr/lib/zookeeper,或 cd