Skip to content

Instantly share code, notes, and snippets.

@velotiotech
Created June 11, 2020 04:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save velotiotech/2e9053d37a37face5b245b56c13a45c4 to your computer and use it in GitHub Desktop.
Save velotiotech/2e9053d37a37face5b245b56c13a45c4 to your computer and use it in GitHub Desktop.
#!/bin/bash
# Run any shell command on all slave nodes (private and public)
# Usage : dcosRunOnAllSlaves.sh <CMD= any shell command to run, Ex: ulimit -a >
CMD=$1
for i in `dcos node | egrep -v "TYPE|master" | awk '{print $1}'`; 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