#!/bin/bash PSW=`< /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c10` . /usr/src/mor/sh_scripts/install_configs.sh echo "[server_ha-clustering] name=High Availability/Clustering server technologies (CentOS_5) type=rpm-md baseurl=http://$KOLMISOFT_IP/packets/heartbeat/ gpgcheck=0 gpgkey=http://$KOLMISOFT_IP/packets/heartbeat/repodata/repomd.xml.key enabled=1" >/etc/yum.repos.d/server:ha-clustering.repo yum -y install heartbeat yum -y install pacemaker # yes, install this for future yum -y install iptraf # authkeys echo "auth 2 2 sha1 $PSW" >/etc/ha.d/authkeys chmod 600 /etc/ha.d/authkeys # 600 or no start # ha.cf echo "logfile /var/log/heartbeat.log logfacility local0 keepalive 2 deadtime 5 # depends on load, so be careful! initdead 20 # start time bcast eth0 # make sure you will bind heartbeat on correct interface!!! udpport 694 auto_failback on node node01 node node02" >/etc/ha.d/ha.cf # haresources echo "node01 IPaddr2::192.168.0.14 # just for testing, remember this ip can't be used in your network!!! node01 192.168.0.14 asterisk # just for testing, remember this ip can't be used in your network!!!" >/etc/ha.d/haresources checkhosts=`cat /etc/hosts | grep "192.168.0.131 node01 #change to correct IP"` if [ "$checkhosts" = "" ]; then # /etc/hosts has no nodes echo "192.168.0.131 node01 #change to correct IP 192.168.0.132 node02 #change to correct IP here aswell" >>/etc/hosts fi echo "Installation completed."