Created
October 9, 2015 22:37
-
-
Save fornarat/7e7be98fc970df44b2b7 to your computer and use it in GitHub Desktop.
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 | |
for HOST in $(< /opt/hadoop/hadoop-1.0.3/conf/slaves); do | |
echo "" | |
echo "###############" | |
echo "# HOSTNAME: $HOST" | |
echo "###############" | |
# This line is for back grounding each command to execute them on all systems at once | |
# ssh -q -o ConnectTimeout=3 $HOST "echo password | sudo -S $* >/dev/null 2>&1 &" | |
ssh -t -q -o ConnectTimeout=3 $HOST "echo hadoop | sudo -S $*" | |
if [ $? -ne 0 ]; then | |
echo "---- COULD NOT CONNECT TO $HOST ----" | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment