Enabling sar Stats on Debian

Many CentOS and RHEL Linux administrators have come to rely on the sar tool as an easy way to see historical load, io, and memory statistics.  On Debian, sar functionality isn’t available by default but is easy to install.

apt-get install sysstat
dpkg-reconfigure sysstat

(select yes to activate sysstat’s cronjob)

After several minutes, you’ll have access to:

  • Check historical load averages: sar -q
  • Check historical memory utilization: sar -r
  • Check historical disk utilization: sar -u

As a side note, the sysstat package we installed also includes additional helpful utilities such as: iostat, mpstat, and pidstat.

HAProxy & Heartbeat on Cloud Servers

High availability load balancing can be easily configured on virtualized computing instances in the Cloud.  This post explores deploying HAProxy and Heartbeat on Rackspace Cloud Servers running Debian 5.0 Lenny.

The desired result of this project is to have a redundant load balancer pair in active/passive configuration, distributing requests across two Apache web servers where any one load balancer and any one web server can fail with the environment still operational.

Example Server List

Server Public IP Private IP
lb1 175.200.90.50 10.180.75.200
lb2 175.200.90.51 10.180.75.201
web-a 175.200.90.52 10.180.75.202
web-b 175.200.90.53 10.180.75.203

Virtual IP: 175.200.90.100

Step 1: Obtaining a Virtual IP

A Virtual IP is a static, public failover IP which can move between load balancers as needed.  This is the IP you will use for your ‘A’ records when configuring DNS for your domain(s).  You can easily request the failover IP via the Rackspace Cloud ticketing system (http://manage.rackspacecloud.com), but make sure to be very deliberate in the wording of your ticket or you may just get an additional IP provisioned which won’t share properly. Here is some sample ticket verbiage which may help: “Please provision a failover IP for lb1 and ensure that it is also shared with lb2.  I understand and agree to the $2/mo additional charge for the IP.”

Continue reading HAProxy & Heartbeat on Cloud Servers

Upgrading to Ubuntu 10.04 on VirtualBox

Now that the production release of Ubuntu 10.04 Lucid Lynx is out, users should consider upgrading.  Luckily, Ubuntu/Debian (unlike some other distros) makes it really easy to perform an upgrade without breaking things or retaining extra clutter from the pervious version.

I am running Ubuntu 9.04 Karmic Koala in a VirtualBox instance on my Macbook Pro.  The first set of commands can be used universally for all users running Ubuntu on any platform and the second are specifically for upgrading the VBox tools to work with the new kernel.

Upgrading Ubuntu (steps for all users):

apt-get clean
apt-get autoremove
nano -w /etc/apt/sources.lst

(change all references of “karmic” to “lucid”)

apt-get update
apt-get dist-upgrade
reboot
apt-get autoremove

Upgrading VBox Tools (for VirtualBox users only):

cd /cdrom
./autorun.sh
reboot

Once you log back in, verify that window resizing and mouse traversal in and out of the VM work correctly. If so, you should be all set and your upgrade is now complete. If you run into any issues, feel free to email me and I’ll do my best to give you a hand.