Skip to content

Instantly share code, notes, and snippets.

@ianunruh
Last active September 7, 2016 15:15
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save ianunruh/2162add34d1c55e387b9 to your computer and use it in GitHub Desktop.
Save ianunruh/2162add34d1c55e387b9 to your computer and use it in GitHub Desktop.
Corosync + Pacemaker basics on Ubuntu 14.04
#!/bin/bash
BIND_NETWORK="192.168.5.0"
SHARED_VIP="192.168.5.30"
apt-get update
apt-get install -y pacemaker ntp
# Configure Corosync
echo "START=yes" > /etc/default/corosync
sed -i "s/bindnetaddr: 127.0.0.1/bindnetaddr: $BIND_NETWORK/g" /etc/corosync/corosync.conf
# Start clustering software
service corosync start
service pacemaker start
crm configure <<EOF
primitive virtual-ip ocf:heartbeat:IPaddr \
params ip="$SHARED_VIP"
property stonith-enabled=false
commit
EOF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment