Kafka-Topic操作-kafka-topics.sh

帮助信息:./kafka-topic.sh --help

  1. --alter
  2. --bootstrap-server <String: server to connect to>
  3. --command-config <String: command config property file>
  4. --config <String: name=value>
  5. --create
  6. --delete
  7. --delete-config <Strign: name>
  8. --describe
  9. --disable-rack-awre
  10. --exclude-interval
  11. --force
  12. --if-exists
  13. --if-not-exists
  14. --list
  15. --partitions <Integer :of partitions>
  16. --replica-assignment
  17. --replication-factor <Integer: replication factor>
  18. --topic <String:topic>
  19. --topics-with-overrides
  20. --unavailable-partitions
  21. --under-replicated-partitions
  22. --zookeeper <String: hosts >

常用:

./bin/kafka-topics.sh --create --bootstrap-server node01:9092 --replication-factor 3 --partitions 10 --topic topic_5
./bin/kafka-topics.sh --bootstrap-server localhost:9092 --topic SP2 --describe