Last active
August 29, 2015 13:57
-
-
Save cwolferh/9374507 to your computer and use it in GitHub Desktop.
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 | |
# On el6, to be run on the bare metal host after you have virtual networking | |
# set up. | |
yum install -y fence-virt fence-virtd fence-virtd-libvirt fence-virtd-multicast | |
for i in `ls /sys/class/net/*br*/bridge/multicast_querier`; do echo 1 > $i; done | |
if [ ! -f /etc/cluster/fence_xvm.key ]; then | |
mkdir -p /etc/cluster | |
dd if=/dev/random bs=512 count=1 of=/etc/cluster/fence_xvm.key | |
if [ -d /mnt/vm-share ]; then | |
cp /etc/cluster/fence_xvm.key /mnt/vm-share | |
fi | |
fi | |
# alternatively, you could generate this file from "fence_virtd -c" | |
cat > /etc/fence_virt.conf <<EOF | |
fence_virtd { | |
listener = "multicast"; | |
backend = "libvirt"; | |
module_path = "/usr/lib64/fence-virt"; | |
} | |
listeners { | |
multicast { | |
key_file = "/etc/cluster/fence_xvm.key"; | |
address = "225.0.0.12"; | |
family = "ipv4"; | |
interface = "virbr0"; | |
port = "1229"; | |
} | |
} | |
backends { | |
libvirt { | |
uri = "qemu:///system"; | |
} | |
} | |
EOF | |
# you'll need to make this persistent | |
iptables -A INPUT -d 225.0.0.12/32 -p igmp -j ACCEPT | |
/sbin/service fence_virtd restart | |
# verify on your cluster vm's with: | |
# fence_xvm -o list |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment