卡夫卡的管理策略备忘录
确定话题
背景:Kafka集群管理
cd /usr/hdp/current/kafka-broker/
# Access Kafka Cluster
bin/kafka-topics.sh --zookeeper zzeng-hdp-1.field.hortonworks.com:2181,zzeng-hdp-2.field.hortonworks.com:2181,zzeng-hdp-3.field.hortonworks.com:2181 --describe
主题创建
bin/kafka-topics.sh --create --zookeeper zzeng-hdp-1.field.hortonworks.com:2181,zzeng-hdp-2.field.hortonworks.com:2181,zzeng-hdp-3.field.hortonworks.com:2181 --replication-factor 3 --partitions 1 --topic zzeng01
话题列表展示
bin/kafka-topics.sh --zookeeper zzeng-hdp-1.field.hortonworks.com:2181,zzeng-hdp-2.field.hortonworks.com:2181,zzeng-hdp-3.field.hortonworks.com:2181 --list
主题内容:消费者
### Kafka 1.x
bin/kafka-console-consumer.sh --zookeeper zzeng-hdp-1.field.hortonworks.com:2181,zzeng-hdp-2.field.hortonworks.com:2181,zzeng-hdp-3.field.hortonworks.com:2181 --from-beginning --topic meetup_rsvp_avro
### Kafka 2.x
bin/kafka-console-consumer.sh --bootstrap-server zzeng-hdp-1.field.hortonworks.com:6667 --topic meetup_rsvp_avro