A new Squeeze with Postgres on VMware

I feel the need to note this down because two of these three are largely unfamiliar to me, and the other one bit me in the unmentionables. Hopefully this permutation will help others. Also, this is the setup I needed for my current $ork.

First, let’s download our operating system. I honestly can’t remember the last time I installed an operating system from physical media. My linuxes recently have been from downloaded ISO images, my Mac Lion upgrade was totally over the wire. Anyhow, I’ve had good results from Thoughtpolice with RedHat in the past, so I got my unfamiliar Debian Squeeze image from there:

http://www.thoughtpolice.co.uk/vmware/

When configuring the VM, I had three tasks:

  • Give it 4 cores and 2G RAM (on a late 2011 Powerbook with 8G RAM)
  • Enable sharing. As a legacy from the BBC, I share ~/workspace, but YMMV
  • For this project, I have a mahoozive database (to me), so I created a NEW 20G partition. This will appear in the VM as /dev/sdb. Format it as ext3 and put it in /etc/fstab. I mounted it straight over /var/lib/postgresql

Boot the aforementioned VM. To make it more civilised, we need to install the VMware tools. So:

  • Hit the “Install VMware tools” button
  • Mount /dev/cdrom on /media/cdrom
  • Untar the tarball into /tmp
  • apt-get install gcc-4.3 linux-headers-`uname -r` build-essenial make ssh curl

The gcc-4.3 is REALLY important. VMware tools don’t like and don’t see gcc 4.4! ssh is nice because you can shell in an do other stuff while the next LONG process happens. curl will be useful later.

I’m an old-school Unix guy and I like to be using the full Linux desktop when I’ve got it running. This is in mild contravention to BBC use, where it’s expected you’ll develop in, say Eclipse in the host OS and save to the guest OS that can pick up and execute your changes. So we install gnome which appears to be route 1 these days. And wait.

  • tasksel install gnome-desktop --new-install

This is a BIG install. So while that’s running, let’s ssh in and set to work on Postgres, the other thing that’s alien to me.

  • apt-get install postgresql libpq-dev

libpq-dev is important as we won’t get perl’s DBD::Pg installed without it. Create your user(s), create the database(s) and load the massive database into the shiny new partition.

And now, in the perl world, the next most important thing: install cpanm. This is important: it means you aren’t beholden to the level of CPAN modules shipped with your OS. Having come from a world that’s fairly hostile to perl and running a level of RedHat where the perl RPM’s can only be described as somewhat dusty, it’s really nice to be able to encapsulate one’s dependencies. So according to http://search.cpan.org/~miyagawa/App-cpanminus-1.5013/lib/App/cpanminus.pm:

If you don’t want to pollute system perl, the -l and -L options are well worth exploring. Hopefully at this point you have a comprehensive Makefile.PL and can just:

  • cpanm (-l and/or -L) .

At this point, the world should be good!

 

[Bloglines] [del.icio.us] [Digg] [Facebook] [Google] [Reddit] [Windows Live] [Yahoo!] [Email]

Related Posts:

Leave a Reply