Linux High Availability Part 1

Posted by BadReligion Mon, 14 Dec 2009 13:09:00 GMT

 I have been itching to dive into high availability clusters for quite some time now. As a network administrator uptime is a crucial part of my field. My goal in this series of blogs is to share my experience with setting up a high availability cluster using Linux systems.

Debriefing:

I will set up two virtual machines using VirtualBox. The two machines will both run Debian 5.0.2 i386 and will be on their own private network 192.168.2.0/24. The two nodes will together provide a high availability web and database service via Apache2 and MySQL using HA. With clustering an important factor is keeping data synchronized, that will be handled by DRDB.

 

Getting Up To Speed:

At this point I have setup my two virtual machines, Bravo and Echo, yes very original. I am using iptables on the host machine to masquerade the packets that need to go out to the Internet for the virtual machines. I have installed HA and drbd8 via the Debian packaging system. I configured HA using the Installing Heartbeat (Newbie) screencast tutorial. Similarly I configured a very simple setup of DRBD following the documentation. Now then, lets get into the details of my progress so far.

Networking Woes:

Ok, so the networking part of this mission was a slight barrier. I recall in the past I struggled to get multiple virtual machines to communicate with each other with VirtualBox. This time I seem to have planted that issue right on its ass, and I'm going to explain just how I did it.

In order to get virtual machines to network we need to change the guest operating systems from "NAT" to "Host Interface" in the "Network" settings. If only it were this simple! Well we actually need a "TAP" interface for the guest operating system to use. Lets hop into the trenches shall we?

First we need to let the kernel know wish to act like a router, forwarding packets:

Note this can also be set in /etc/sysctl.conf then it will not have to be set at every boot.
echo 1 > /proc/sys/net/ipv4/ip_forward

Next we need to create our TAP interfaces:

The interface names are arbitrary but it is important that the same name is used when assigning them to each virtual machine.
tunctl -t tap0 -u username
tunctl -t tap1 -u username
ifconfig tap0 up
ifconfig tap1 up

Now lets create a bridge interface and add our TAP interfaces:

The IP assigned is arbitrary but do make note of it
brctl addbr br0
brctl addif br0 tap0
brctl addif br0 tap1
ifconfig br0 up
ifconfig br0 192.168.2.1

Now assign each one of the TAP interfaces to each virtual machine and start them up. Assign an IP address to each virtual machine that is in the same network as the bridge interface on the host system. The virtual machines should be able to ping each other as well as the host system. Notice that they can not get out to the Internet though. For this we will need some help from iptables:

Beware that using MASQUERADE target is not technically proper with static IP addresses, however its the only way I can get NAT to work properly in this situation. The rule below should not be considered a permanent solution, I don't plan on leaving it that way at least.
iptables -t nat -A POSTROUTING -s 192.168.2.0/24 -j MASQUERADE

Now the virtual machines should be able to ping each other, and also make it out to the Internet, assuming that other barriers do not exist like firewalls etc.

I will end part 1 at this point. I will catch up on configuring HA and DRBD in part 2 and hopefully at that point also have some more information to share, for now its off to bed and preparing for Monday.

So long

 

Posted in , ,  | no comments

Dell Inspiron Zino HD Where Is Linux

Posted by BadReligion Wed, 02 Dec 2009 01:36:00 GMT

Although I was extraordinarily excited about Dell's Zino HD I was quickly let down to find out Linux is NOT offered as an operating system choice.

At the base model (even adding some some features) the price point is great in my opinion. The base model of the Inspiron Zino HD can be had for just a little more than $200. I had read rumors that Linux was offered on the Zino HD, after attempting to customize one of the models I found there was no Linux option available. After a few days I called Dell and spoke to sales representative who assured me the Zino HD was not available with Linux. The rep was quick to push me toward another Inspiron for around $500 that came with Linux. At this point I explained that my interest was more involved with purchasing a unit that does NOT come with Windows, than a unit that is offered with Linux, even if a discount is not granted.

Still the response was the same.

If Dell does offer the Inspiron Zino HD with Linux or at least without Windows I will most certainly purchase a unit. Of course this assumes they will not only offer Linux on a high priced model. My guess is that Dell has some contract with Microsoft on the Inspiron Zino HD in relation to the new release of Windows 7.

Until then I'm off to find other low priced mini/multimedia computing solutions that are more open to the idea that not EVERYONE wants a Microsoft product.

Posted in ,  | Tags , , , ,  | 1 comment