Massiv ups for Phusion Passenger
I hadn’t worked with a Rails application server since back when Mongrel was the cool thing. Boy, is Phusion Passenger (mod_rails) a wonderful surprise! It is exceedingly rare to see software have such clearly presented installation and support documentation. The installer executable is non-confusingly verbose, telling you what it’s checking for and precisely what to do to fix what’s broken. Bravo, Hongli Lai and Ninh Bui.
Their site design is nifty-looking, too.
/usr/bin/file rules, even when it’s wrong
‘file’ is a great utility. Even when it’s wrong, it can at least be good for an audible laugh:
$ dd if=/dev/urandom of=fakefile.bullshit bs=4096 count=400 400+0 records in 400+0 records out 1638400 bytes (1.6 MB) copied, 0.307462 s, 5.3 MB/s $ file fakefile.bullshit fakefile.bullshit: DOS executable (COM)
How to learn (and not get burned by) LVM
LVM2 is a very useful thingy indeed. I sort of misunderstood its utility for a while. It’s not just for managing storage on mongo SAN clusters; it can be very useful for managing storage on a workgroup box with several drives.
However, on Linux, beware: You cannot boot from an LVM logical volume. You need to have a regular filesystem (ext2/ext3/xfs/jfs/reiserfs/etc.) partition for /boot. I’m not quite sure why I didn’t grasp this when planning my first LVM layout.
The Red Hat documentation on LVM2 is excellent, but is not the first thing that comes up on searches, because it’s buried in the weirdo RHEL system documentation. There’s a similar, RedHat-generated doc which is also good at the CentOS project, available here.
It takes some getting used to to understand LVM, and if you’re like me, it doesn’t hurt to practice. There is some degree of overlap with what RAID can do for you, and using them both together makes one’s head spin at first. Drawing a map of your planned layout is extremely helpful.
For wrangling your storage layouts, the Parted Magic live CD can be very helpful. Unfortunately, not all installers want to respect what you’ve laid out with it. Fedora 9 played nice. Ubuntu 8.10 (alternate install CD — essential for RAID installs) was not; it kept not respecting the /dev/md software RAID devices that I’d previously set up, then would create some new bogus md devices.
DHCP on VMware Fusion
VMware Fusion is a wonderful thing. I am happily running three Linux instances at once under my MacBook with 4GB of RAM (though, as best I can tell, the mobo can actually only address 3GB of RAM).
One glitch that was driving me crazy, though, was that it seemed like DHCP leases were being allocated flakily to the guest machines. When you’re doing database replication, you can’t have master/slave IP addresses changing all the time. (And you certainly don’t want two machines with the same IP address!)
Some digging around turned this up. I don’t remember exactly where — I believe snippets of it were in an official VMware forum — but it was harder to find than it should have been. Hence my posting, to add another path to help those who need it.
On OS X, the file you need to change should be in /Library/Application Support/VMware Fusion/vmnet8/dhcpd.conf. (vmnet8 is the virtual interface for NAT networking in the guest machines.) You should have a subnet clause in it already like this:
subnet 172.16.253.0 netmask 255.255.255.0 {
range 172.16.253.129 172.16.253.254;
option broadcast-address 172.16.253.255;
option domain-name-servers 172.16.253.2;
option domain-name "localdomain";
option routers 172.16.253.2;
}
Now, for each virtual machine, set up a new host clause, e.g. :
host ubuntu64-vm {
hardware ethernet 00:0F:FF:EF:00:00;
fixed-address 172.16.253.20;
}
Be sure to assign an IP address (fixed-address) outside the range specified in the subnet clause at top.
Get the Ethernet MAC address from ifconfig eth0 inside the guest machine, or from ~/Documents/Virtual Machines/GUESTMACHINENAME/GUESTMACHINENAME.vmx (it’s the line with ethernet0.generatedAddress).
Finally, restart the requisite VMware daemons by running
sudo "/Library/Application Support/VMware Fusion/boot.sh" --restart
