Skip to content

Quick Start Kafka

Christina Daskalaki edited this page Mar 27, 2017 · 1 revision

Step 1: Download the code

wget http://mirror.vorboss.net/apache/kafka/0.10.2.0/kafka_2.11-0.10.2.0.tgz

tar -xzf kafka_2.11-0.10.2.0.tgz

cd kafka_2.11-0.10.2.0

Step 2: Start the server

Start the ZK:

bin/zookeeper-server-start.sh config/zookeeper.properties

Start the broker:

bin/kafka-server-start.sh config/server.properties

Step 3: Create a topic

bin/kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic test

Verify the topic

bin/kafka-topics.sh --list --zookeeper localhost:2181

Step 4: Send some messages (can take input from a file or from standard input )

bin/kafka-console-producer.sh --broker-list localhost:9092 --topic test

Step 5: Start a consumer

bin/kafka-console-consumer.sh --bootstrap-server localhost:9092 --topic test --from-beginning

check your disk

ls /tmp/kafka-logs/