Created
January 15, 2019 16:15
-
-
Save bborysenko/6079f13b09b1137a750ebac4c787a78f to your computer and use it in GitHub Desktop.
Ansible Percona XtraDB Cluster local fact
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 | |
set -e | |
set -o pipefail | |
WSREP=$(mysql --unbuffered --skip-column-names --batch --connect-timeout=3 -e "SHOW GLOBAL STATUS LIKE 'wsrep_%';" 2> /dev/null | sed 's/^/ "/g; s/\t/": "/g; ;s/$/",/g' | sed -z 's/\(.*\),/\1/') | |
cat <<EOF | |
{ | |
$WSREP | |
} | |
EOF |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment