Skip to content

Instantly share code, notes, and snippets.

@bbejeck
Created December 11, 2015 18:40
Show Gist options
  • Save bbejeck/0ed144c047763702a042 to your computer and use it in GitHub Desktop.
Save bbejeck/0ed144c047763702a042 to your computer and use it in GitHub Desktop.
A script for using tmux with kafka
#!/bin/sh
KAFKA_DIR=/usr/local/kafka_2.11-0.9.0.0-SNAPSHOT
START_ZK="./bin/zookeeper-server-start.sh"
ZK_PROPS="config/zookeeper.properties"
START_KAFKA="./bin/kafka-server-start.sh"
KAFKA_PROPS="config/server.properties"
tmux new-session -s kafka-work -d
tmux split-window -v
tmux split-window -v
tmux split-window -h -t 0
tmux split-window -v
tmux send-keys -t 1 "cd $KAFKA_DIR" C-m
tmux send-keys -t 1 "$START_ZK $ZK_PROPS" C-m
tmux send-keys -t 2 "cd $KAFKA_DIR" C-m
tmux send-keys -t 2 "$START_KAFKA $KAFKA_PROPS" C-m
tmux send-keys -t 3 "cd $KAFKA_DIR" C-m
tmux send-keys -t 4 "cd $KAFKA_DIR" C-m
tmux attach -t kafka-work
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment