1. Download the kafka from the Apache
Binary downloads:
Scala 2.12 - kafka_2.12-1.1.0.tgz (asc, sha512)
2. unzip the kafka_2.12-1.1.0.tgz
3. Start the zookeeper
bin/zookeeper-server-start.sh config/zookeeper.properties
4. Start the brokers
cp config/server.properties config/serve-1.properties
vim config/serve-1.properties[broker.id=1, listeners=PLAINTEXT://:9093, log.dirs=/tmp/kafka-logs-1]
bin/kafka-server-start.sh config/server.properties
5. Create a new topic and set the partitions number & replications number
bin/kafka-topics.sh --zookeeper localhost:2181 --create --topic MyFirstTopic --partitions 2 --replication-factor 3
6. Start the producer processer
bin/kafka-console-producer.sh --broker-list localhost:9092 --topic MyFirstTopic
7. Start the consumer processer
bin/kafka-console-consumer.sh --bootstrap-server localhost:9092 --topic MyFirstTopic
Binary downloads:
Scala 2.12 - kafka_2.12-1.1.0.tgz (asc, sha512)
2. unzip the kafka_2.12-1.1.0.tgz
3. Start the zookeeper
bin/zookeeper-server-start.sh config/zookeeper.properties
4. Start the brokers
cp config/server.properties config/serve-1.properties
vim config/serve-1.properties[broker.id=1, listeners=PLAINTEXT://:9093, log.dirs=/tmp/kafka-logs-1]
bin/kafka-server-start.sh config/server.properties
5. Create a new topic and set the partitions number & replications number
bin/kafka-topics.sh --zookeeper localhost:2181 --create --topic MyFirstTopic --partitions 2 --replication-factor 3
6. Start the producer processer
bin/kafka-console-producer.sh --broker-list localhost:9092 --topic MyFirstTopic
7. Start the consumer processer
bin/kafka-console-consumer.sh --bootstrap-server localhost:9092 --topic MyFirstTopic