Created
June 6, 2019 11:02
-
-
Save dvainrub/787b75fb7a84763f134d572379f4d34e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# From your terminal run: | |
> docker exec -i -t -u root $(docker ps | grep docker_kafka | cut -d' ' -f1) /bin/bash | |
# $(docker ps | grep docker_kafka | cut -d' ' -f1) - Will return the docker process ID of the Kafka Docker running so you can acces it | |
# Create a topic | |
bash> $KAFKA_HOME/bin/kafka-topics.sh --create --partitions 4 --bootstrap-server kafka:9092 --topic test | |
# Create a consumer | |
bash> $KAFKA_HOME/bin/kafka-console-consumer.sh --from-beginning --bootstrap-server kafka:9092 --topic=test | |
# Create a producer | |
bash> $KAFKA_HOME/bin/kafka-console-producer.sh --broker-list kafka:9092 --topic=test |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment