This repository contains the source code needed for the "Apache Kafka® Administration By Confluent" Instructor-Led Training Course.
docker compose up -ddocker compose downOr, destroy your cluster completely (lose all topic data):
docker compose down -vFirst, enable the container by removing the comments on the tools container definition in docker-compose.yml .
Then, enter the tools container to run commands against the Kafka cluster:
docker compose exec tools bash
Don't forget to exit the tools container and clean up with docker compose down -v on your host.
Each command can be run from within the tools container.
Create a topic "my-topic":
kafka-topics \
--bootstrap-server kafka-1:19092 \
--create \
--topic my-topic \
--replication-factor 3 \
--partitions 2Create a consumer with group.id=my-group:
kafka-console-consumer \
--bootstrap-server \
kafka-3:39092 \
--group my-group \
--topic my-topic \
--from-beginningCreate a producer that produces to "my-topic":
kafka-console-producer \
--bootstrap-server \
kafka-1:19092,kafka-2:29092 \
--topic my-topicDo a producer performance test to topic "my-topic"
kafka-producer-perf-test \
--topic my-topic \
--num-records 1000000 \
--throughput 10000 \
--record-size 1000 \
--producer-props \
bootstrap.servers=kafka-2:29092How might you do a consumer performance test, I wonder?
-
Enter the broker host
kafka-1:docker compose exec kafka-1 bash -
Take a look at
server.propertes:root@kafka-1:/# less /etc/kafka/server.propertiesThis is just an example broker configuration file. For complicated reasons, the actual configuration file the container uses is called
kafka.propertiesand is created from environment variables indocker-compose.yml. -
Take a look at
docker-compose.ymlenvironment variables and compare that tokafka.properties:root@kafka-1:/# less /etc/kafka/kafka.properties -
Other components of the cluster have similar configuration files. Explore them, too! Look up what the configuration properties do in more detail in the Confluent docs
Open up Google Chrome and go to localhost:9021 to monitor your cluster with Confluent Control Center!
- Training Page
- Start with the free Apache Kafka Fundamentals course for a great conceptual foundation of Kafka!
- Apache Kafka Administration by Confluent
- Setting Data in Motion with Confluent Cloud
- Confluent Developers Skills for Building Apache Kafka
- Mastering Flink SQL on Confluent Cloud
- Remember that more courses are being developed all the time!
- Configurations!
- So many configurations! Become friends with the configurations. Brokers. Consumers. Producers. Topics. Oh, my! Our docs can generally be a little intimidating at first, but they are superb once you learn where everything is.