Kafka操作命令
1. 主题操作
1.1. 创建主题
./kafka-topics.sh --zookeeper 172.18.233.118:2181,172.18.233.119:2181,172.18.233.120:2181 \
--create --replication-factor 1 --partitions 3 --topic test
./kafka-topics.sh --create --zookeeper localhost:2181 --config max.message.bytes=12800000 --config flush.messages=1 --replication-factor 1 --partitions 3 --topic test
命令解析:
–create: 指定创建topic动作
–topic:指定新建topic的名称
–zookeeper: 指定kafka连接zk的连接url,该值和server.properties文件中的配置项{zookeeper.connect}一样
–config:指定当前topic上有效的参数值,参数列表可以查看