Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

...

The following is a diagram of the clustering scenario we will be setting up: Image Removed

Image Added

Install OS

Install CentOS 5.6 on two identical servers. You may also configure the NICs at this point. One NIC will be for the iSCSI storage network (eth2), one will be for clustering heartbeat (eth1), and one NIC will be for all other communications, including sipXecs (eth0).

...

When prompted for software selection, deselect desktop - Gnome and select Clustering and Storage Clustering. Perform the install.

...

Code Block
chkconfig iscsi on
onserviceservice iscsi start

On each server you need to connect to a blank (fresh) shared iSCSI disk. For example, if your iSCSI shared disk is located at IP address 172.16.5.10 you would run the following command on each server:

...

Code Block
#!/bin/bash
#
#       
#
#       Simple script for cluster services to use for bare metal ethernet interface
#
#  chkconfig: 345 89 14
#  description: Starts and stops the clustered service network interface
#  processname: net
#

# Source function library.
. /etc/init.d/functions

SIPX_IP='172.16.1.5'
SIPX_INTERFACE=eth0
CLUS_INTERFACE=eth2
ISCSI_INTERFACE=eth1
PROG_NAME=clusnet
RETVAL=0

DEFAULT_GW=`cat /etc/sysconfig/network-scripts/ifcfg-$SIPX_INTERFACE | grep GATEWAY | sed 's/GATEWAY=//g'`
SUBNET_MASK=`cat /etc/sysconfig/network-scripts/ifcfg-$SIPX_INTERFACE | grep NETMASK | sed 's/NETMASK=//g'`
INTUP=`/sbin/ifconfig | grep -c $SIPX_INTERFACE`;

# <define any local shell functions used by the code that follows>

start() {
        echo -n "Starting $SIPX_INTERFACE: "
	ip address flush dev eth0
	sleep 3
	ip address addifconfig $SIPX_INTERFACE $SIPX_IP/ netmask $SUBNET_MASK brd + dev eth0 
	ip up 
	sleep 3
        route add default viagw $DEFAULT_GW dev $SIPX_INTERFACE
	echo
        echo -n $"$SIPX_INTERFACE is up.";
        success $"$SIPX_INTERFACE is up.";
        echo
        chkconfig postgresql off
        return $RETVAL
}


stop() {
        echo -n "Shutting down $SIPX_INTERFACE: "
        ifdown $SIPX_INTERFACE
	ifup $SIPX_INTERFACE
	ifup $ISCSI_INTERFACE
	ifup $CLUS_INTERFACE
	echo
	echo -n $"Interface $SIPX_INTERFACE is down.";
        success $"Interface $SIPX_INTERFACE is down.";
        echo
        chkconfig postgresql off
        return $RETVAL
}

getstatus() {
	    if [ $INTUP -lt 1 ]
            then
                echo
                echo -n $"Interface $SIPX_INTERFACE is down."
                failure $"Interface $SIPX_INTERFACE is down."
                echo
                return 1;
            fi
            echo
	    echo -n $"Interface $SIPX_INTERFACE is up.";
            success $"Interface $SIPX_INTERFACE is up.";
            echo
            return $RETVAL
}

case "$1" in
    start)
        start
        ;;
    stop)
        stop
        ;;
    status)
        getstatus
        ;;
    restart)
        stop
        sleep 5
        start
        ;;
    *)
        echo "Usage: $PROG_NAME {start|stop|status|restart}"
        exit 1
        ;;
esac
exit $RETVAL

...

Code Block
Cluster Status for uc_cluster @ Sun Jul  3 14:46:41 2011
Member Status: Quorate

 Member Name                             ID   Status
 ------ ----                             ---- ------
 172.16.4.5                                  1 Online, Local, rgmanager
 172.16.4.8                                  2 Online, rgmanager

 Service Name                   Owner (Last)                   State
 ------- ----                   ----- ------                   -----
 service:sipXpbx                172.16.4.5                     starteddisabled

Create Clustered Storage

As of this writing the best filesystem to use for cluster storage is GFS. This is because unlike most other filesystems, GFS is safe to mount on both nodes at the same time without risking data corruption. This allows for quick failover with less risk of data corruption.

...

Code Block
/dev/sipx-vol/freeswitch /opt/freeswitch  gfs     defaults 0 0
/dev/sipx-vol/openfire  /opt/openfire  gfs     defaults 0 0
/dev/sipx-vol/sipxdata  /var/sipxdata  gfs     defaults 0 0
/dev/sipx-vol/etc_sipxpbx /etc/sipxpbx  gfs     defaults 0 0
/dev/sipx-vol/pgsql  /var/lib/pgsql  gfs     defaults 0 0

...

You'll also need to change the IP address of your primary node's communication interface (eth0) to an IP address that's different than the sipXecs system's IP address (but on the same subnet). This is so sipXecs can function on both nodes.back to the original settings by running:

Code Block
/usr/local/bin/clusnet stop

DNS Caching Nameserver Configuration

...