Last active
March 11, 2017 16:12
-
-
Save BlackMaria/e34cbf5d543888659ba7d3658e94b6a1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# source for doc http://wurstmeister.github.io/kafka-docker/ | |
# | |
# I personally suggest you create all of these containers, but for simplicity I show you how to use them by the author | |
# | |
YOUR_IP=192.168.1.2 | |
git clone https://github.com/wurstmeister/kafka-docker | |
cd kafka-docker | |
perl -pi -e "s/192.168.99.100/${YOUR_IP}/g" docker-compose.yml | |
# Or to expose ZK use this instead | |
# perl -pi -e "s/192.168.99.100/${YOUR_IP}/g ; s/zookeeper:2181/${YOUR_IP}:2181/g" docker-compose.yml | |
docker-compose up -d | |
docker-compose scale kafka=2 | |
# This script seems to do too much and could be replaced | |
./start-kafka-shell.sh ${YOUR_IP} ${YOUR_IP}:2181 | |
# INSIDE CONTAINER | |
kafka-topics.sh --create --topic topic --partitions 4 --zookeeper $ZK --replication-factor 2 | |
kafka-topics.sh --describe --topic topic --zookeeper $ZK | |
# I added this little test to show it worked | |
kafka-topics.sh --list --zookeeper $ZK | |
kafka-console-producer.sh --topic=topic --broker-list=`broker-list.sh` | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment