Quick Start
Last updated
Last updated
Install
and unzip the latest Kafka.
Start the Zookeeper service.
Start the Kafka broker.
Manage the topics.
Write some events into the topic.
Separate lines are sent as separate events. Press Ctrl-C
to quit the program.
Read the events.
Press Ctrl-C
to quit the program.
Stop the Kafka broker.
Copy config/server.properties
as config/server.a.properties
, config/server.b.properties
and config/server.c.properties
.
Update the corresponding lines in the property files.
config/server.a.properties
config/server.b.properties
config/server.c.properties
Start the brokers (in separate terminals).
Since we have 3 brokers, we can create the topic with the replication factor of 3
, so that each partition will have 1 leader and 2 extra replicas.
You should see a similar output when you describe the topic.
The first line shows the topic configuration that we have provided.
The second line shows that partition 0
is led by broker 2
. The replicas are expected to be found on brokers 2
, 0
and 1
. Isr indicates the set of in-sync brokers.
Play around with the producer and consumer scripts.
Stop the Kafka brokers.
NOTE: If you setup the brokers on separate nodes, you might bind the listener to the 0.0.0.0
interface for example. In this case, you need to configure as well.