-
Notifications
You must be signed in to change notification settings - Fork 0
Kafka Setup Overview
Ajay Anand edited this page Dec 19, 2024
·
1 revision
- The Kafka cluster refers to the collection of Kafka brokers that handle the storage and management of messages.
- In this setup, we are running a single Kafka broker as part of the cluster.
- The Kafka broker is defined by the
KAFKA_BROKER_ID=1environment variable when starting the Kafka container.
- The bootstrap server is the initial Kafka broker address that clients (producers and consumers) connect to in order to discover the rest of the Kafka cluster.
- In this setup, the bootstrap server is configured as
localhost:9092, wherelocalhostrefers to the host machine, and9092is the port exposed by the Kafka container. - The bootstrap server is used to establish the connection between clients and the Kafka broker:
podman exec -it kafka kafka-topics --create --topic test-topic --bootstrap-server localhost:9092 --partitions 1 --replication-factor 1
- A Kafka topic is a category or stream to which messages are sent by producers and consumed by consumers.
- In this setup, we create a Kafka topic named
test-topic:podman exec -it kafka kafka-topics --create --topic test-topic --bootstrap-server localhost:9092 --partitions 1 --replication-factor 1 - Topics are managed by Kafka brokers, and messages are stored in partitions within those topics.
-
Kafka Cluster: The Kafka container running as the broker (
podman run -d --name=kafka ...). -
Bootstrap Server: The address
localhost:9092specified in the--bootstrap-serverflag. -
Topic: The
test-topicthat is created with thekafka-topics --createcommand.