Apache Kafka 2.10 Installation
Installation of Apache Kafka 2.10
1. Download the kafka package from the below url
# wget http://apache.petsads.us/kafka/0.8.1.1/kafka_2.10-0.8.1.1.tgz
2. Extract the kafka package
# tar zxf kafka_2.10-0.8.1.1.tgz
3. Navigate to extracted directory
# cd kafka_2.10-0.8.1.1/
If zookeeper is not started means,execute the below command in terminal. Else skip the next step.
# bin/zookeeper-server-start.sh config/zookeeper.properties
To start the kafka server
# bin/kafka-server-start.sh config/server.properties
To create a new topic
# bin/kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic anytopic
where anytopic should be unique
you can check the topic is listed by
# bin/kafka-topics.sh --list --zookeeper localhost:2181
To send any messages by
# bin/kafka-console-producer.sh --broker-list localhost:9092 --topic anytopic
type any mesaages and press enter. To stop, Press ctrl+c
To start the consumer. Execute the below command in new terminal window
# bin/kafka-console-consumer.sh --zookeeper localhost:2181 --topic anytopic --from-beginning
No comments