Use this at your own risk. The script on this page is only intended to be run in a test environment, it will format partitions on your hard disk and is only intended to be run on a fresh install of Trixbox 2.6! For a more complete clustering solution check out Asterisk High Availability Solutions
I am not in anyway an expert in setting up clusters on linux, but thought I would share my little script in an attempt to get some feedback for improvements and to share with other users wanting to try setting up a similar system.
I am testing this on two identical Dell Poweredge R200 servers installing Trixbox using the advanced option so I could specify the disk partitions I wanted to create.
The server has two network interfaces
eth0 is used to communication to the LAN
eth1 is used for DRBD disk replication and is connected via a crossover cable
Enjoy! - Royce
References Used:
TrixBox Forum Post
Elastix Forum Post
I am not in anyway an expert in setting up clusters on linux, but thought I would share my little script in an attempt to get some feedback for improvements and to share with other users wanting to try setting up a similar system.
I am testing this on two identical Dell Poweredge R200 servers installing Trixbox using the advanced option so I could specify the disk partitions I wanted to create.
/dev/sda1 /boot
/dev/sda2 /
/dev/sda3 /share
/dev/sda4 swap
The server has two network interfaces
eth0 is used to communication to the LAN
eth1 is used for DRBD disk replication and is connected via a crossover cable
Enjoy! - Royce
References Used:
TrixBox Forum Post
Elastix Forum Post
#!/bin/bash
# Make sure you edit this section to your requirements! Start
cluster_ip='192.168.16.30'
domain_name="domain.local"
gateway='192.168.16.254'
primary_dns='192.168.16.2'
secondary_dns='192.168.16.2'
master_hostname='asterisk-master'
master_ip_address_eth0='192.168.16.31'
master_ip_address_eth1='10.10.10.1'
slave_hostname='asterisk-slave'
slave_ip_address_eth0='192.168.16.32'
slave_ip_address_eth1='10.10.10.2'
subnet_mask_eth0='255.255.255.0'
subnet_mask_eth1='255.255.255.0'
drbd_disk='/dev/sda3'
drbd_device='/dev/drbd0'
# Make sure you edit this section to your requirements! End
clear
echo "TrixBox High Availability Installation Script"
echo
echo "1. Master node"
echo "2. Master node (pause after each section)"
echo "3. Slave node"
echo "4. Slave node (pause after each section)"
echo "5. Exit"
echo
echo -n "Please select the installation type. "
keypress="0"
until [ $keypress = "1" ] || [ $keypress = "2" ] || [ $keypress = "3" ] || [ $keypress = "4" ] || [ $keypress = "5" ]; do
read -s -n 1 keypress
done
case $keypress in
1)
node='master'
debug=0
server_hostname=$master_hostname
server_ip_address_eth0=$master_ip_address_eth0
server_ip_address_eth1=$master_ip_address_eth1
;;
2)
node='master'
debug=1
server_hostname=$master_hostname
server_ip_address_eth0=$master_ip_address_eth0
server_ip_address_eth1=$master_ip_address_eth1
;;
3)
node='slave'
debug=0
server_hostname=$slave_hostname
server_ip_address_eth0=$slave_ip_address_eth0
server_ip_address_eth1=$slave_ip_address_eth1
;;
4)
node='slave'
debug=1
server_hostname=$slave_hostname
server_ip_address_eth0=$slave_ip_address_eth0
server_ip_address_eth1=$slave_ip_address_eth1
;;
5)
echo
exit
;;
esac
clear
echo "Installation will continue with the following settings:"
echo
echo "Cluster IP address -" $cluster_ip
echo
echo "Node name -" $server_hostname.$domain_name
echo "Node IP address (eth0) -" $server_ip_address_eth0
echo "Node IP address (eth1) -" $server_ip_address_eth1
echo "Node Subnet mask (eth0) -" $subnet_mask_eth0
echo "Node Subnet mask (eth1) -" $subnet_mask_eth1
echo "Node Gateway -" $gateway
echo "Node Primary DNS -" $primary_dns
echo "Node Secondary DNS -" $secondary_dns
echo "Master node name -" $master_hostname. ...