Created
October 22, 2018 09:15
-
-
Save pkazi/cec9fa5278972de59d12f925a3a79e8f to your computer and use it in GitHub Desktop.
DCOS Run any shell command on all master nodes
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 | |
# Run any shell command on all master nodes | |
# Usage : dcosRunOnAllSlaves.sh <CMD= any shell command to run, Ex: ulimit -a > | |
CMD=$1 | |
for i in `dcos node | egrep -v "TYPE|agent" | awk '{print $2}'` | |
do | |
echo -e "\n###> Running command [ $CMD ] on $i" | |
dcos node ssh --option StrictHostKeyChecking=no --option LogLevel=quiet --master-proxy --private-ip=$i "$CMD" | |
echo -e "======================================\n" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment