Skip to content

Instantly share code, notes, and snippets.

@orasik
Created December 15, 2017 15:26
Show Gist options
  • Save orasik/595e27c1339c6f5372cba012faaad597 to your computer and use it in GitHub Desktop.
Save orasik/595e27c1339c6f5372cba012faaad597 to your computer and use it in GitHub Desktop.
Kafka Useful CLI Commands

Kafka CLI useful commands

List all messages in a topic from begining

kafka-console-consumer.sh --zookeeper {zookeeper-ip}:2181 --topic {topic-name} --from-beginning

Describe a topic

kafka-topics.sh --describe --zookeeper {zookeeper-ip}:2181 --topic {topic-name}

Adding new partitions to a topic

kafka-topics.sh --alter --zookeeper {zookeeper-ip}:2181 --topic {topic-name} --partitions {number-of-partition}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment