Xen Cluster Management With Ganeti On Debian Lenny
|
Submitted by falko (Contact Author) (Forums) on Sun, 2009-03-01 19:27. :: Debian | Xen | High-Availability | Virtualization
Xen Cluster Management With Ganeti On Debian LennyVersion 1.0 Ganeti is a cluster virtualization management system based on Xen. In this tutorial I will explain how to create one virtual Xen machine (called an instance) on a cluster of two physical nodes, and how to manage and failover this instance between the two physical nodes. This document comes without warranty of any kind! I do not issue any guarantee that this will work for you!
1 Preliminary NoteIn this tutorial I will use the physical nodes node1.example.com and node2.example.com:
Both have a 500GB hard drive of which I use 20GB for the / partition, 1GB for swap, and leave the rest unpartitioned so that it can be used by Ganeti (the minimum is 20GB!). Of course, you can change the partitioning to your liking, but remember about the minimum unused space. The cluster I'm going to create will be named cluster1.example.com, and it will have the IP address 192.168.0.102. The cluster IP 192.168.0.102 will always be bound to the cluster master, so even if you don't know which node is the master, you can use the cluster IP (or the hostname cluster1.example.com) to connect to the master using SSH. The Xen virtual machine (called an instance in Ganeti speak) will be named inst1.example.com with the IP address 192.168.0.105. inst1.example.com will be mirrored between the two physical nodes using DRBD - you can see this as a kind of network RAID1. As you see, node1.example.com will be the cluster master, i.e. the machine from which you can control and manage the cluster, and node2.example.com will be the primary node of inst1.example.com, i.e. inst1.example.com will run on node2.example.com (with all changes on inst1.example.com mirrored back to node1.example.com with DRBD) until you fail it over to node1.example.com (if you want to take down node2.example.com for maintenance, for example). This is an active-passive configuration. I think it's good practice to split up the roles between the two nodes, so that you don't lose the cluster master and the primary node at once should one node go down. It is important that all hostnames mentioned here should be resolvable to all hosts, which means that they must either exist in DNS, or you must put all hostnames in all /etc/hosts files on all hosts (which is what I will do here). All cluster nodes must use the same network interface (e.g. eth0). If one node uses eth0 and the other one eth1, then Ganeti won't work correctly anymore. Ok, let's start...
2 Preparing The Physical Nodesnode1: I want node1 to have the static IP address 192.168.0.100, therefore my /etc/network/interfaces file looks as follows (please note that I replace allow-hotplug eth0 with auto eth0; otherwise restarting the network doesn't work, and we'd have to reboot the whole system): vi /etc/network/interfaces
If you've modifed the file, restart your network: /etc/init.d/networking restart Then edit /etc/hosts. Make it look like this: vi /etc/hosts
Next we must make sure that the commands hostname and hostname -f print out the full hostname (node1.example.com). If you get something different (e.g. just node1), do this: echo node1.example.com > /etc/hostname Afterwards, the hostname commands should show the full hostname. Then update the system: aptitude update aptitude safe-upgrade node2: Now we do the same again on node2.example.com (please keep in mind that node2 has a different IP!): vi /etc/network/interfaces
/etc/init.d/networking restart vi /etc/hosts
echo node2.example.com > /etc/hostname aptitude update aptitude safe-upgrade
3 Setting Up LVM On The Free HDD Spacenode1/node2: Let's find out about our hard drive: fdisk -l node1:~# fdisk -l We will now create the partition /dev/sda3 (on both physical nodes) using the rest of the hard drive and prepare it for LVM: fdisk /dev/sda node1:~# fdisk /dev/sda Now let's take a look at our hard drive again: fdisk -l node1:~# fdisk -l Looks good. Now we must reboot both physical nodes so that the kernel can read in the new partition table: reboot After the reboot, we install LVM (probably it's already installed, but it's better to go sure): aptitude install lvm2 After the reboot, we prepare /dev/sda3 for LVM on both nodes and add it to the volume group xenvg: pvcreate /dev/sda3 (Ganeti wants to use a volume group of its own, that's why we create xenvg; theoretically we could use an existing volume group with enough unallocated space, but the gnt-cluster verify command will complain about this.)
|
www.seamlessenterprise.com
One number. One voicemail. Seize the lead. Sprint Mobile Integration.
www.seamlessenterprise.com
One Number. One Voicemail.
Make it easier for clients to reach you. Turn your desk phone and mobile phone into one with Sprint Mobile Integration.
www.seamlessenterprise.com
One number. One voicemail. Sprint Mobile Integration.
www.seamlessenterprise.com
One number. one voicemail. Seize the lead with Sprint. Learn more
AT&T Synaptic Compute as a Service. Boost your power on demand.
Trial: IBM Cognos Express Reporting, Analysis & Planning
Learn benefits of Simpana software.
View the Gartner Video
Sprint 4G - The Ultimate Mobile Broadband
Click here
SAP-Business Objects Crystal Reports Server
Complete reporting without hidden costs. Free Trial




print: 

Recent comments
20 hours 46 min ago
1 day 31 min ago
1 day 5 hours ago
1 day 8 hours ago
2 days 12 hours ago
2 days 12 hours ago
2 days 12 hours ago
2 days 12 hours ago
2 days 13 hours ago
2 days 21 hours ago