diff --git a/migrator.py b/migrator.py index 010f463..88fbfeb 100755 --- a/migrator.py +++ b/migrator.py @@ -1,4 +1,4 @@ -#!/usr/bin/python3 +#!/usr/bin/env python3 import datetime import os diff --git a/postgresql-cluster-setup.sh b/postgresql-cluster-setup.sh index 92bf15b..465dfd3 100755 --- a/postgresql-cluster-setup.sh +++ b/postgresql-cluster-setup.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash PG01="172.28.33.11" PG02="172.28.33.12" @@ -198,6 +198,9 @@ service { } EOF + # Make sure pacemaker starts on boot (Corosync's start priority is 19 so set pacemaker higher) + sudo update-rc.d pacemaker defaults 20 01 + # start corosync / pacemaker service corosync start # TODO: check output of corosync-cfgtool -s says "no faults" diff --git a/tmux-session.sh b/tmux-session.sh index f5ca4ad..41a0ca9 100755 --- a/tmux-session.sh +++ b/tmux-session.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash set -eu @@ -23,6 +23,10 @@ function setup-session() { } if [ "$ARG" == "start" ]; then + if ! vagrant box list | grep -q "^ubuntu/trusty64" ; then + echo "Installing ubuntu/trusty64 box..." + vagrant box add ubuntu/trusty64 + fi (tmux new-session -d -s pg -n cluster && setup-session) || tmux attach -t pg elif [ "$ARG" == "stop" ]; then echo "Stopping all VMs..."