T.L.Bean
Services | Contact

How to Rapidly Deploy an Ubuntu Server, High-Availability Cluster with LinuxHA

This tutorial will guide you how to configure the Ubuntu Server platform necessary for running LinuxHA. These instructions are written for installing VirtualBox Ubuntu Server virtual machines (VMs).

Download and install VirtualBox.

VirtualBox installation guide.

Create two VirtualBox VMs of identical size.

Enable four network adapters per VM.

Download and install Ubuntu Server.

Ubuntu Server installation guide.

Start the Ubuntu Server installation on both VMs.

During Ubuntu Server installation, it is important to partition your hard drive correctly to support this script. Allocate your hard drive's free space to a boot partition, a physical volume (PV), a volume group (VG), and logical volumes (LVs). For example, create a VG named vg_system, and add to this VG a swap LV named lv_swap that is at least 1.5 times as big as your physical memory, a root LV named lv_root, and a DRBD LV named lv_drbd. Do not format and mount lv_drbd, as this volume will be automatically formatted and mounted by this script.

After installation is complete, set a root password with the sudo passwd root command, unless you chose F6 Other Options/Expert mode at the beginning of Ubuntu Server installation and already have this root password set.

Login as root to change your user account directory path. For example, use the usermod ubuntu-admin --move-home --home /ubuntu-admin command to move /home/ubuntu-admin to /ubuntu-admin. This is necessary, as LinuxHA mounts a DRBD volume onto the /home directory. After moving your user account directory, add the ubuntu-admin user to the sudo group with usermod -aG sudo ubuntu-admin.

Logout root, and login this time with your user account before you run LinuxHA.

Take a snapshot of your VMs before proceeding. This will allow you to quickly revert to a fresh Ubuntu Server image before testing an updated LinuxHA revision.

Download LinuxHA.

Transfer LinuxHA to your VMs. Issue a ip addr show command, and take note of what your VM's IP address is. For example, if your VM is set to IP address 192.168.0.1, and you moved your user account directory from /home/ubuntu-admin to /ubuntu-admin, use the following command to copy LinuxHA to your VM: sudo scp LinuxHA.sh ubuntu-admin@192.168.0.1:/ubuntu-admin.

Set LinuxHA to executable with the sudo chmod u+x LinuxHA.sh, command and start the script with the sudo sh LinuxHA.sh command on both VMs at the same time. If there is a delay starting the script on a VM, LinuxHA is designed to wait until the second VM is connected.

LinuxHA uses functions that only work with Bash. To switch from Dash to Bash, use the sudo dpkg-reconfigure dash command and choose No.

If you are using a slow computer, make sure you close all web browsers, email programs, etc. before you run LinuxHA on a VM. The DRBD replicated storage is sensitive to a high load average and will issue a fencing routine if too many tasks bog down your computer while LinuxHA is running.

Save time and bandwidth when testing LinuxHA by installing and configuring Apt-Cacher-Server.

 
Copyfree T.L. Bean. All Rights Reversed.