Building a cluster

How to configure your Ganeti cluster.

© 2010-2011 Google
Use under GPLv2+ or CC-by-SA
Some images borrowed/modified from Lance Albertson and Iustin Pop

Overview

  1. Each node
    1. Configure the OS & disks
    2. Configure networking
    3. Load software
  2. The cluster
    1. Initialize the cluster
    2. Add the nodes.
    3. Test
  3. Profit!

Preparing the nodes

Configuring the replication network

Configuring the instance bridges

Configuring LVM

If you're not using the system's volume group initialize a VG for instances. For example:

$ pvcreate /dev/sdb1
$ pvcreate /dev/sdc1
$ vgcreate xenvg /dev/sdb1 /dev/sdc1

Installing Ganeti

Use packages. These exist for Debian, Ubuntu, Centos+RHEL, Suse. If you need customized ones create them, and put them in a local repository.

Initializing your cluster

The node needs to be set up following our installation guide:

gnt-cluster init [-s ip] ... \
  --enabled-hypervisors=kvm cluster
cluster0.png

Check your cluster

# gnt-cluster verify

Try to fix any problems it reports. This will save you time for later.

Adding nodes

gnt-node add [-s ip] node2
gnt-node add [-s ip] node3
nodes.png

Enabling the ganeti cronjobs

Make sure you have a ganeti.cron file:

# Restart failed instances (every 5 minutes)
*/5 * * * * root /usr/sbin/ganeti-watcher

# Clean job archive (at 01:45 AM)
45 1 * * * root /usr/sbin/ganeti-cleaner

Testing your cluster

You can run "burnin" to check the cluster:

/usr/lib/ganeti/tools/burnin -o debootstrap+squeeze -p \
--reboot-types=hard,full --disk-size 1G \
instance-{1,2,3}.example.com

Adding instances

# install instance-{debootstrap, image}
gnt-os list
gnt-instance add -t drbd \
  {-n node3:node2 | -I hail } \
  -o debootstrap+default web
ping i0
ssh i0 # easy with OS hooks
newinstance.png

Conclusion

Questions?

© 2010-2011 Google
Use under GPLv2+ or CC-by-SA
Some images borrowed/modified from Lance Albertson and Iustin Pop
cc-by-sa.png