Home Get Started Kafka - enriquehadoop/kafkaproject GitHub Wiki

Welcome to the kafkaproject wiki!

Steps to install Kafka simple

1.- Install Java

2.- Check java is installed type:

$java -version

3 .- Install zookeeper

$sudo apt-get install zookeeperd

4.- check zookeeper is running after installing

$netstat -ant | grep :2181

5.- Install Kafka Server:

wget http://www-eu.apache.org/dist/kafka/1.1.0/kafka_2.11-1.1.0.tgz

6.- Create Kafka Directory

sudo mkdir /opt/Kafka

sudo tar -xvf kafka_2.11-1.1.0.tgz -C /opt/Kafka

cd /opt/Kafka

7.- #within bin folder #run kafka-server-start

./kafka-server-start.sh /home/ubuntu/kafka_2.11-2.0.0/config/server.properties

8.- Create topic

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

9.- Consume topic

./kafka-console-consumer.sh --bootstrap-server localhost:9092 --topic mexico—​from-beginning

10.- list topics

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

11.- Run producer

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

12.- Import / Export Data. Command below will trigger the process, the file standalone.properties will contain the target file

./connect-standalone.sh /home/ubuntu/kafka_2.11-2.0.0/config/connect-standalone.properties /home/ubuntu/kafka_2.11-2.0.0/config/connect-file-source.properties

13.- In different window run command below, if you modified the target file, changes will be reflected on console below:

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

⚠️ **GitHub.com Fallback** ⚠️