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
SELECT | |
sip.ip, | |
CASE | |
WHEN sip.alloc_type = 0 THEN 'AUTO' | |
WHEN sip.alloc_type = 1 THEN 'STICKY' | |
WHEN sip.alloc_type = 4 THEN 'USER_RESERVED' | |
WHEN sip.alloc_type = 5 THEN 'DHCP' | |
WHEN sip.alloc_type = 6 THEN 'DISCOVERED' | |
ELSE CAST(sip.alloc_type as CHAR) | |
END "alloc_type", |
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
size=$(stat -Lc%s centos.iso) | |
virsh vol-create-as default centos $size --format raw | |
virsh vol-upload --pool default centos centos.iso |
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
Some notes from engineering. | |
1) Identify the partition | |
Mnesia('rabbit@juju-machine-30-lxd-11'): ** ERROR ** mnesia_event got {inconsistent_database, running_partitioned_network, 'rabbit@juju-machine-29-lxd-9'} | |
$ sudo rabbitmqctl cluster_status | |
2) Pick the most reliable node as the master. |
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
function charmislatest() { | |
if [ ! ${#@} -ge 2 ]; then | |
echo -e "Please provide a charm name and a branch" && return; | |
fi | |
q=$(curl -s https://api.github.com/repos/openstack/charm-$1/commits/stable/$2 | python -c "import sys, json; q=json.load(sys.stdin); print q['sha']") | |
head=$(curl -s https://api.jujucharms.com/charmstore/v5/$1/meta/extra-info | python -c "import sys, json; q=json.load(sys.stdin)['vcs-revisions'][-1]; print q['commit'];") | |
if [ "$head" == "$q" ]; then | |
echo "OK - $1 (Charmstore: $head == Github($2): $q)" | |
else | |
echo "Not OK - Charm is not latest: $q != $head" |
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
/var/log/juju/*.log { | |
daily | |
minsize 5M | |
maxsize 50M | |
copytruncate | |
rotate 7 | |
missingok | |
compress | |
delaycompress | |
} |
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
juju run --application rabbitmq-server 'relation-get -r `relation-ids cluster` - rabbitmq-server/1' | |
juju run --service nova-compute 'relation-get -r `relation-ids amqp` - rabbitmq-server/1' |
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
erl -sname tester -setcookie $(cat /var/lib/rabbitmq/.erlang.cookie) -remsh rabbit@$(hostname) | |
io:format("~p", [dict:find(rabbit, dict:from_list(rabbit:environment()))]). |
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
export MYSQLPWD=$(juju run --unit percona-cluster/0 leader-get | grep "mysql.passwd" | cut -d' ' -f2 | tail -n 1) | |
juju ssh percona-cluster/0 sudo mysql -p$MYSQLPWD -e 'show\ databases;' |
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
# For non-systemd based systems, prefix export to each enabled line | |
#==#==# Variables that control logging | |
# Enable debug logging globally or per-subsystem | |
# Multiple subsystems may me listed separated by commas | |
# eg. PCMK_debug=crmd,pengine | |
PCMK_debug=yes | |
# Send INFO (and higher) messages to the named log file |
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
$ juju ssh ubuntu@$(juju status -m controller | grep -E '(started)'| awk '{print $3}') | |
$ sudo /usr/lib/juju/mongo3.2/bin/mongodump -h 127.0.0.1 --port 37017 --ssl -u admin -p $(sudo grep oldpassword | |
/var/lib/juju/agents/machine-*/agent.conf | cut -d' ' -f2) --authenticationDatabase admin --db juju |