Following are steps to install and configure KAFKA on Ubuntu:

  1. Download KAFKA:
    wget http://mirror.softaculous.com/apache/kafka/0.10.2.1/kafka_2.10-0.10.2.1.tgz
  2. Extract downloaded file:
    tar -xvzf kafka_2.10-0.10.2.1.tgz
  3. Goto extracted Kafka folder and start Zookeeper:
    ./bin/zookeeper-server-start.sh config/zookeeper.properties
  4. Open another Terminal. Goto extracted Kafka folder and start Kafka:
    ./bin/kafka-server-start.sh config/server.properties
  5. Create topic “emailGrabber”
    ./bin/kafka-topics.sh --create --topic emailGrabber --zookeeper locahost:2181 --partitions 1 --replication-factor 1
  6. Consumer
    ./bin/kafka-console-consumer.sh --zookeeper localhost:2181 --topic emailGrabber --from beginning
  7. Producer
    ./bin/kafka-console-producer.sh --broker-list localhost:9092 --topic emailGrabber
  8. Check the message sequence order:
    > cd /tmp/kafka-logs/emailGrabber
    > ls
    > cat *.log
  9. Happy Coding!

Leave a Comment