Created
August 14, 2011 00:11
-
-
Save dehowell/1144400 to your computer and use it in GitHub Desktop.
Script to initiate a single node Hadoop cluster in a tmux session
This file contains 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 | |
# | |
# Script to initiate (or connect to) a single node Hadoop cluster in a | |
# tmux session. Requires that tmux and hadoop are on your path. | |
SESSION=hadoop | |
tmux has-session -t $SESSION | |
if [ $? -eq 0 ]; then | |
echo "Session $SESSION already exists. Attaching." | |
sleep 1 | |
tmux attach -t $SESSION | |
exit 0; | |
fi | |
tmux new-session -d -s $SESSION 2> /dev/null | |
tmux new-window -t $SESSION:0 -k -n namenode 'hadoop namenode' | |
tmux new-window -t $SESSION:1 -n datanode 'hadoop datanode' | |
tmux new-window -t $SESSION:2 -n jobtracker 'hadoop jobtracker' | |
tmux new-window -t $SESSION:3 -n tasktracker 'hadoop tasktracker' | |
tmux attach -t $SESSION |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment