- docker-compose up -d
- should run from the box as is
docker-compose build
# builddocker run -it <container ref> bash
# run a bash shell on a container itselfdocker-compose run zookeeper
# run zookeeper in the foregrounddocker-compose run kafka
# run kafka in the foregrounddocker-compose up -d
# run all in the background
- SSH to container:
docker exec -it kafkasandbox_kafka_1 /bin/bash
- Tail logs:
docker logs -f kafkasandbox_kafka_1
anddocker logs -f kafkasandbox_zookeeper_1
All these are based on being ssh'd onto the kafka container
cd /opt/kafka*/bin
./kafka-topics.sh --list --zookeeper localhost:2181
# list all the topics./kafka-topics.sh --zookeeper localhost:2181 --create --replication-factor 1 --partitions 1 --topic test
# create a test topic called test./kafka-topics.sh --describe --zookeeper localhost:2181 --topic test
# describe the topic
./kafka-console-producer.sh --broker-list localhost:9092 --topic test
# enter this and write some messages./kafka-console-consumer.sh --bootstrap-server localhost:9092 --topic test --from-beginning