Skip to content

Instantly share code, notes, and snippets.

@InKolev
Last active April 10, 2017 14:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save InKolev/da67cb844418b921cc2e303d2c1e0a4e to your computer and use it in GitHub Desktop.
Save InKolev/da67cb844418b921cc2e303d2c1e0a4e to your computer and use it in GitHub Desktop.

Local IP addresses

Kafka: 172.18.0.4
Zookeeper: 172.18.0.2

Useful commands

  • Create a topic named integration-test-topic with two partitions:

    • kafka-topics --create --zookeeper 172.18.0.2:3001 --replication-factor 1 --partitions 2 --topic integration-test-topic
  • Check topic information:

    • kafka-topics --zookeeper 172.18.0.2:3001 --describe --topic integration-test-topic
  • Changed the number of integration-test-topic topic's partitions:

    • kafka-topics --zookeeper 172.18.0.2:3001 --alter --topic integration-test-topic --partitions 10
  • Produce messages to integration-test-topic topic:

    • kafka-console-producer --broker-list 172.18.0.4:3002 --topic integration-test-topic
  • Listen to messages on integration-test-topic topic:

    • kafka-console-consumer --bootstrap-server 172.18.0.4:3002 --topic integration-test-topic --from-beginning
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment