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
IFS=$'\n'; for i in `psql -Upostgres -Atc "select concat(sequence_schema,'.','\"',sequence_name,'\"') from information_schema.sequences;"`; do echo $i; psql -Upostgres -c "select sequence_name, last_value, max_value, (last_value/max_value)*100 as percentage from $i;"; done; $IFS |
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
# Usage | |
# host supply IP | |
# -t(tags) run specific tasks ie. db=master, dbslave=slave1/2, promote=update slave to master, remove= remove host | |
# ansible-playbook pg.yml -e "host=192.169.99.2 -t db ##Build Master | |
# ansible-playbook pg.yml -e "host=192.168.99.3" -t dbslave ##Build Slave | |
# ansible-playbook pg.yml -e "host=192.168.99.3" -t promote ##Promoe slave to master | |
# ansible-playbook pg.yml -e "host=192.168.99.2" -t remove ##Remove node from cluster | |
# ansible-playbook /var/lib/pgsql/pg.yml -e "host=192.168.99.4" -s -t db --user=user1 --ask-sudo-pass ##Ubuntu | |
# Created Bimal Patel | |
--- |