Skip to content

Instantly share code, notes, and snippets.

@emmettbutler
Created January 11, 2016 17:31
Show Gist options
  • Save emmettbutler/6477d7125f0a5f15760b to your computer and use it in GitHub Desktop.
Save emmettbutler/6477d7125f0a5f15760b to your computer and use it in GitHub Desktop.
#!/bin/bash
startkafka() {
tmux new-window
tmux send-keys /opt/kafka-$VERSION/bin/zookeeper-server-start.sh Space /opt/kafka-$VERSION/config/zookeeper.properties C-m
sleep 3
tmux split-window -h
tmux send-keys /opt/kafka-$VERSION/bin/kafka-server-start.sh Space /opt/kafka-$VERSION/config/server.properties C-m
tmux split-window -h
tmux send-keys /opt/kafka-$VERSION/bin/kafka-server-start.sh Space /opt/kafka-$VERSION/config/server1.properties C-m
tmux split-window -h
tmux send-keys /opt/kafka-$VERSION/bin/kafka-server-start.sh Space /opt/kafka-$VERSION/config/server2.properties C-m
tmux select-layout main-vertical > /dev/null
sleep 3
tmux new-window "/opt/kafka-$VERSION/bin/kafka-topics.sh --create --zookeeper localhost:2181 --topic testtopic_replicated --replication-factor 2 --partitions 10"
tmux close-window
}
VERSION=$1
startkafka
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment