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 Network Admin, Linux, Tech | no comments
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 Linux, Tech | Tags Dell, Inspiron Zino HD, itx, Linux, multimedia | no comments
Posted by BadReligion
Mon, 28 Sep 2009 21:21:00 GMT
For me the following do not work:
sed 's/(\[|\])//g'
sed 's/[[]]//g'
The following do work:
sed 's/[][]//g'
sed -e 's/\[//g' -e 's/\]//g'
Example:
echo '[foobar]' | sed 's/[][]//g'
>foobar
echo '[foo]bar' | sed 's/[][]//g'
>foobar
The environment is Debian 4.0, GNU sed version 4.1.5.
Posted in Linux, Tech | Tags sed | no comments
Posted by BadReligion
Tue, 15 Sep 2009 09:39:00 GMT
I finally configured amavisd-new with my Postfix configuration. It is a simple setup using only ClamAV and Spamassassin. However I do want to implement DKIM through amavisd-new of course that requires a newer version of amavisd-new than is in the packaging system of the release of Ubuntu I am running.
Further I would like to switch my Linode to Debian over Ubuntu.
It is safe to expect some downtime soon likely tonight as a result of upgrading through two releases.
I will post a part 2 once the upgrade is complete and I implement DKIM with the details of what I did.
Posted in Website, Network Admin, Linux, Tech | Tags amavisd, clamav, debian, dkim, domain keys, new, postfix, spamassassin, ubuntu | no comments
Posted by BadReligion
Fri, 10 Jul 2009 20:41:00 GMT
An excerpt from Mailing List Etiquette on FreeBSD.
Please use a standards-compliant Mail User Agent (MUA). A lot of badly formatted messages come from bad mailers or badly configured mailers. The following mailers are known to send out badly formatted messages without you finding out about them:
- * cc:Mail
- * Eudora� (older versions)
- * exmh
- * Microsoft� Exchange
- * Microsoft Internet Mail
- * Microsoft Outlook�
- * Netscape� (older versions)
As you can see, the mailers in the Microsoft world are frequent offenders. If at all possible, use a UNIX� mailer. If you must use a mailer under Microsoft environments, make sure it is set up correctly. Try not to use MIME: a lot of people use mailers which do not get on very well with MIME.
I just find this hilarious. I mean what exactly defines user friendly? Software that has shiny buttons or that formats its data in a way that complies with standards and is compatible with other users *standard compliant* software?!
Sean
Posted in General, Linux, Tech | no comments
Posted by BadReligion
Fri, 26 Jun 2009 08:42:00 GMT
I am working on a personal use Rails application that I use to create reminders using Cron...
There are a couple gems that are useful for dealing with Cron using Ruby. The first is rbcrontab which allows you to create crontab entries using Ruby. The other is trak3r-crontabr which actually maintains a crontab using Ruby. The latter of the two might be easier to use for those who do not understand Cron syntax but know Ruby well. I am leaning toward rbcrontab right now simply because I feel it may fit my needs better than trak3r-crontabr.
I'm not sure that I really need a full blown web interface or not. It would be nice but I think what I really need is just a mailer with templates. I don't know, once I figure out the details I will make a part 2.
Sean
Posted in Ruby on Rails, Linux, Tech | no comments
Posted by BadReligion
Tue, 16 Jun 2009 06:10:00 GMT
I recently had to configure Xorg to run a 40" LCD monitor. The monitor did not seem to support EDID queries. To my understanding this is essentially a protocol that most monitors support to explain what modes they support and give general information about the monitor.
After a little Google searching and not finding anything on the model number of the unit which is 40LC45S. I eventually found this this modeline generator in this link. All you need to know are the resolution and refresh rate combination(s).
Sean
Posted in Linux, Tech | no comments
Posted by BadReligion
Thu, 16 Apr 2009 12:34:00 GMT
My war with Postfix wages on. However I have resolved an issue that has been haunting my email server for quite some time now!
I constantly received a mail loop error when postmaster notifications were being sent to mail.skiblerspot.net. I knew it was something simple but never spent the time to track down what was missing. Perhaps I made the assumption that if Postfix knows to accept mail for skiblerspot.net it will automatically accept mail for mail.skiblerspot.net. This is an incorrect assumption and rightly so as this would be a terrible feature.
My problem was solved by simply changing:
mydestination = localhost, localhost.localdomain
to
mydestination = localhost, localhost.localdomain skiblerspot mail.skiblerspot.net
Adding skiblerspot was unnecessary to fix my immediate issue but I figured it doesn't hurt. Notice that I could have also added mail.skiblerspot.net to my virtual mail boxes database. I think in my case adding the hostname to mydestination is a better solution. Though if I were expecting mail for other users and wanted to create aliases for this domain I would then add it to virtual mail box database instead. Note that a domain should NEVER be in both places (mydestination and virtual mail box database).
This page notes on postfix configuration helped me realize my mistake.
Sean
Posted in Network Admin, Linux, Tech | no comments
Posted by BadReligion
Mon, 06 Apr 2009 04:20:00 GMT
I had a little trouble installing lm_sensors on my Acer 5610 laptop running Gentoo 2.6.27-r8. I will describe what I did to successfully install lm_sensors and its dependencies.
Stuttering on read-edid
My main issue with installing lm_sensors is that one of its dependencies x11-misc/read-edid-1.4.1-r1 seems to be broken for my kernel version. I found a patch Gentoo Bug 252701 and downloaded it. After messing around for a little bit I figured out how to have ebuild patch the install for me so I can stay within the Gentoo packaging system.
Note that package ebuilds and other data are stored under /usr/portage directory. In this case if one were to look in /usr/portage/x11-misc/read-edid/ they would find an ebuild for each version of read-edid as well as a files directory. In that files directory might reside some patch files. I noticed that during an emerge these patches are applied. So I took the patch I downloaded and tossed it in /usr/portage/x11-misc/read-edid/files.
Confessing to ebuild
Now don't think ebuild is so stupid as to just let you be on your jolly way emerging this package with the new patch. It will be sure to let you know that the checksums are incorrect. So lets have ebuild regenerate the manifest for this ebuild.
sudo ebuild /usr/portage/x11-misc/read-edid/read-edid-1.4.1-r1.ebuild manifest
Now that ebuild has been appeased try to emerge read-edid alone or lm_sensors and ebuild should apply the patch to read-edid and the package should compile and install. Unlike Debian and Ubuntu lm_sensors for Gentoo seems to require not only that you load modules but also that a daemon be run so you will need to start that.
sudo /etc/init.d/lm_sensors start
Notes
One note, I actually rsync'ed the patch file from the link above over whatever patch was in the files directory. I don't think this is recommended but if you must do so at least make a backup of whatever patch file currently exists there.
If any instructions here weren't clear enough for you then you may contact me. Don't necessarily expect a response though, I'm a busy person!
Hope this helps someone
Sean
Posted in Linux, Tech | no comments
Posted by BadReligion
Wed, 04 Mar 2009 10:11:00 GMT
I have managed to get Gentoo running on my Acer Aspire 5610 laptop. Here is an overview of the specs:
- CPU: Intel Core Duo 1.86Ghz
- RAM: 2GB PC25300
- HD: 160GB SATA 3G
- Network: Intel Pro/Wireless 3945ABG, Broadcom 44xx 10/100 Ethernet
- Removable Storage:Unknown 4-in-1 media card reader
I installed using the Gentoo 2008.0 i686 Live CD. I am wishing I would have taken the time to compile my own custom kernel but that can always be done later on. Anyway here are some tips to help anyone with the Acer 5610 series hoping to get Gentoo installed. I only ran into a couple of easy-to-fix problems after the install completed and I was booted into the system.
Getting Networking...Networked...
I had to manually insert the b44 module using
sudo modprobe b44
to get my wired network card to work properly. Before doing this eth0 did not exist and caused a few errors to spring up during boot up. This module can be loaded automatically by adding b44 into /etc/modules.autoload.d/kernel-2.6 as documented here.
Wireless networking has not been tested yet but I believe the 3945ABG is well supported among distributions. It seems to be recognized and I know there are modules for it. If you are having trouble try the following commands.
lsmod | grep 3945
If you don't see anything promising from that then try to find the appropriate module.
modprobe -l | grep 3945
Try inserting the modules that the previous command spat out, you only need to type in the module name not the extension nor the full path, look at this example.
modprobe iwl3945
Graphics Adapter Support?
I was very surprised with this one. Oddly letting Xorg -configure generate an xorg.conf clearly found an Intel 950 GMA integrated graphics controller. The xorg.conf looked pretty good, at least for now. However I got errors when trying to start X (errors will be posted later). I actually needed to also load a module for this as well, I forget the name of the module you can probably find it yourself though.
modprobe -l | grep intel
After loading that module my X server started up fine.
My laptop is not here, which is why some of the above information is not complete. The system was still updating before I left work and I wasn't about to pull the plug to the Inter Web. I will come back to this and update the information once I have it back. I need to see how the multimedia card reader works out so I will update with that info.
It might not be long before I have to take the Ubuntu stickers off the laptop and replace them with Gentoo counterparts.
Sean
Posted in Network Admin, Linux, Tech | no comments