Simple Vagrant and Ansible playbook to provision a Apache Kafka environment with VirtualBox.
Creates a 2 node cluster for Apache Kafka
Requires Virtual Apache ZooKeeper cluster.
Note: This is a proof of concept and test installation only. Do ot use in production.
- System: 2x Ubuntu 14.04 server
- Memory: 1024 MB each host
- IP address: 192.168.5.200-201
- Hostnames:
kafka-node-[x]
werex
have values of 1 or 2 - Kafka version: 0.10.1.1
- JVM: Oracle Java-8
- Install VirtualBox
- Install Vagrant
- Install Ansible
- Clone this repository
- Enter cloned repository
- Execute
vagrant provision && vagrant up
With
vagrant halt
you stop the cluster and can restart the cluster with
vagrant reload
- Connect to Kafka service with:
vagrant ssh kafka-node-1
- Change to Kafka
bin
directory: `cd //opt/kafka_2.10-0.10.1.1/bin - List existing topics:
./kafka-topics.sh --list --zookeeper 192.168.5.100:2181
- Create new topic:
./kafka-topics.sh --create --topic firsttopic --zookeeper 192.168.5.100:2181 --partitions 1 --replication-factor 1
Output:Created topic "firsttopic".
- Show created topic:
./kafka-topics.sh --list --zookeeper 192.168.5.100:2181
Output:firsttopic