Skip to content

Instantly share code, notes, and snippets.

@apergos
Created August 18, 2020 10:19
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 apergos/e1f14670c430d53ccbb163d4ffea95f1 to your computer and use it in GitHub Desktop.
Save apergos/e1f14670c430d53ccbb163d4ffea95f1 to your computer and use it in GitHub Desktop.
#!/bin/bash
usage() {
echo "Show which db hosts in which dc are in some group, for a given section"
echo
echo "Usage:"
echo "$0 section_number group"
echo
echo " section_number should be one of s1,s2,... or DEFAULT"
echo " this argument is required"
echo
echo " groups known: api contributions dump logpager recentchanges"
echo " recentchangeslinked vslow watchlist"
echo " default value: vslow"
exit 1
}
if [ -z "$1" ]; then
usage
exit 1
fi
section="$1"
group="$2"
if [ -z "$group" ]; then
group="vslow"
fi
ssh cumin1001.eqiad.wmnet "/usr/bin/dbctl config get | /usr/bin/jq '.eqiad,.codfw|.groupLoadsBySection|.'$section'|.'$group'|keys' "
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment