Bashton Blog

TAG | centos

Feb/12

15

CentOS 6.2 EC2 AMI

I think Amazon Web Services is superb. We’re doing a lot of new customer deployments to it, and for creating a scalable, highly available infrastructure there’s really nothing that can match it.
But for a lot of our use cases Amazon Linux doesn’t really fit. We don’t want new versions of packages every six months, we want to set something up and be confident that it’ll continue working with backported security fixes for several years.
To fill that need, I’ve created Amazon Machine Images for CentOS 6. There were already some public images out there, but they all seemed to be pretty hacky in nature – random repositories enabled, random extra packages installed, no instance based swap etc etc.
These images are as close to a minimal CentOS 6 install as I think makes sense on AWS – CentOS6, with cloud-init and ec2-utils. Ephemeral storage will be mounted under /media/ephemeral0, swap will be mounted too. The EBS backed images include a small amount (~256MB) of swap to make them more useful on t1.micro – to disable this just run ‘swapoff LABEL=ebs-swap’.
I’ll be writing a separate blog post detailing how these images were created, and how you can create your own in the next few days.
Log in with the username ‘ec2-user’, using your SSH keypair. You’ll have full sudo access without a password.

Region EBS-Backed (32-bit) EBS-Backed (64-bit) Instance Store (32-bit) Instance Store (64-bit)
eu-west-1 ami-bda09ec9 ami-afa09edb ami-7fa09e0b ami-1ba09e6f
us-east-1 ami-94cf1cfd ami-eece1d87 ami-62cd1e0b ami-3ecd1e57
us-west-2 ami-c80d80f8 ami-c00d80f0 ami-e20d80d2 ami-c473fef4

, , , ,

As pretty much always with Linux there’s more than one way to do this, but here’s how I got a nicely working para-virtualized Ubuntu Hardy domU running under a CentOS 5.2 dom0:

  • Install hardy under an HVM using the standard ISO
  • Boot into your new hardy install and run sudo apt-get install linux-image-xen (make sure you have universe enabled)
  • Add appropriate settings to your /boot/grub/menu.lst – here’s what I added:


title Ubuntu 8.04.1, kernel 2.6.24-19-xen
root (hd0,0)
kernel /vmlinuz-2.6.24-19-xen root=/dev/mapper/dsk-root ro
initrd /initrd.img-2.6.24-19-xen

  • Add a console on xvc0: sed -e 's/tty1/xvc0/' /etc/event.d/tty1 | sudo tee /etc/event.d/xvc0
  • Power off your Ubuntu VM
  • On your CentOS dom0, alter the Xen VM configuration file to boot using pygrub, very basic example below:


bootloader = '/usr/bin/pygrub'
memory = 1024
name = "ubuntu-test"
vif = [ '' ]
disk = [ 'phy:/dev/san1/ubuntu-test,xvda1,w']

  • Restart your Hardy VM and enjoy massively improved performance

One thing missing from the para-virtualized VM is VNC support – you have to use the console via the ‘xm console’ command.

The procedure should be similar for Citrix XenServer, although it will involve some messing with the xe vm-param-set command rather than editing the config file.  When I have a chance I’ll document this too.

Update, 30/9/08:

To enable a VNC console, do the following as well as the above:

  • Add the framebuffer drivers into the initramfs

echo "fbcon" | sudo tee -a /etc/initramfs-tools/modules
echo "vga16fb" | sudo tee -a /etc/initramfs-tools/modules
sudo sed -ie 's/^blacklist vga16fb$/#&/' /etc/modprobe.d/blacklist-framebuffer

  • Re-generate the initramfs

sudo update-initramfs -u -k all

  • Alter your grub menu.lst to include the boot options console=tty1 vga=normal (best done via the defoptions line, I tend to remove quiet and splash from here too)

Reboot, and you can now use a VNC console as well as the Xen xm console command.

, , ,

Some of you may have heard about the kerfuffle surrounding poor Perl performance on Red Hat 5/CentOS 5 – it got a bit of attention on reddit/digg.  Red Hat had been issuing hot fixes to people who complained, but now Karanbir Singh has created an updated Perl package.

This issue should be fixed in RHEL/CentOS 5.3, but until then, if you’re experiencing slowness I’d advise installing this – after appropriate testing on staging/UAT servers of course.

, ,

Sep/08

4

Django 1.0 Released

The final version of Django 1.0 has been released.  Debian packages are available from the unstable repository and these should install cleanly on Ubuntu too.

As I noted previously with the Alpha releases, an RPM for RHEL5/Centos can be built by doing:

python setup.py bdist_rpm

Note you’ll need an updated MySQL-python library installed, which can be found below.

MySQL-python-1.2.2-1.x86_64.rpm

If you’re not using a 64bit server, you can download this source RPM and rebuild via rpmbuild –rebuild:

MySQL-python-1.2.2-1.src.rpm

, , ,

I’ve just put up an long-ish article I’ve written comparing five different server distributions.  I fully realise that by doing so I’m opening myself up to hundreds of flames from outraged fans of <insert OS here>, all complaining that I’ve treated their pet distro unfairly.

Given that I’ll probably be accused of bias anyway, I better declare mine: the server that is serving you this page runs Ubuntu, as does the one running the main Bashton site. Many of our internal-facing servers run CentOS. My desktop runs Ubuntu, and my laptop runs Debian. Other staff have their own bias of course (particularly those who are Debian developers..), but as it was just me writing the article I don’t see that as relevant.

Please make your comments here and hopefully we can start some form of a useful debate, rather than the ‘distro X is the best’ discussions these things usually descend into.

, , , , , ,

Older posts >>

Find it!

Theme Design by devolux.nh2.me