停止
./bin/kafka-server-stop.sh
启动
nohup sh kafka-server-start.sh ../config/server.properties &
创建topic ,并指定partion
sh kafka-topics.sh --create --zookeeper 192.168.67.74:2182,192.168.67.68:2182,192.168.67.73:2182/kafka08 --replication-factor 3 --partitions 9 --topic DS.crawl_news_download_queue_v2_6
查看kafka 一个groupid 消费的偏移量
sh
kafka-run-class.sh kafka.tools.ConsumerOffsetChecker --zookeeper192.168.67.74:2182,192.168.67.68:2182,192.168.67.73:2182/kafka08 --group parse_group
跟读
sh kafka-console-consumer.sh --zookeeper 192.168.67.35:2182,192.168.67.36:2182,192.168.67.37:2182/kafka08 --topic DS.crawl.output.mf.self
查看某个topic的partion情况
sh kafka-topics.sh --describe --zookeeper 192.168.67.35:2182,192.168.67.36:2182,192.168.67.37:2182/kafka08 --topic DS.crawl.output.mf.self
增加topic的partition
./kafka-topics.sh --alter --topic topic1 --zookeeper zkip:2181/kafka --partitions 6
删除topic
sh kafka-topics.sh --delete --zookeeper 192.168.67.74:2182,192.168.67.68:2182,192.168.67.73:2182/kafka08 --topic DS.crawl_parseToTopic_v2_metasearch
写
sh kafka-console-producer.sh --broker-list 192.168.67.35:8791,192.168.67.36:8791,192.168.67.37:8791 --topic test、
跟读
sh kafka-console-consumer.sh --zookeeper 192.168.67.35:2182,192.168.67.36:2182,192.168.67.37:2182/kafka08