Xen cluster |
![]() |
see this reference: http://www.asplund.nu/xencluster/xen-cluster-howto.html Below only differences whith this how-to are outlined Install and configure DRBDTo install DRBD run: root@serv1:~# apt-get install drbd8-utils The configuration file for DRBD is located in /etc/drbb.conf. We will now configure it to use the LVs we created and later we will change the Xen configuration of our test DomU to use the DRBD device instead of directly the LVs. Edit /etc/drbd.conf: root@serv1:/# nano /etc/drbd.conf global { We have given the DRBD resource the same name as its corresponding LV. So, for example, DRBD resource debianvdd-root is using LV debianvdd-root. Next we will create a separate volume where we store DRBD's meta data. Meta data is used by DRBD to store information about the device. This can either be internal or external. Internal mode is easier to setup for a new devices but requires resizing operations when using an already formatted device. Read further about this on: http://www.drbd.org/users-guide/ch-internals.html As we already have data on our LVs, created by XEN tools, we will use external meta data. So we create another LV with 1GB of space: lvcreate -L 1G -n meta serv1 The next configuration steps are equal to those in the how-to, except the differences in the names of the resources. Then we have to configure DomU to use the DRBD resources Configure DomU to use your DRBD deviceThe configuration files for your DomUs? are stored in /etc/xen/. So we first change to that directory: cd /etc/xen In here we have, for example, our debianvdd.cfg file. Edit /etc/xen/debianvdd.cfg root@serv1:/# nano /etc/xen/debianvdd.cfg In the section disk, we substitute all the entries "phy" with entries "drbd" followed by the names of the resources, as in following: disk = [ Now we can follow again the mentioned how-to in configuring DomU on your other Dom0 node (copy conf files to the 2nd node) and configuring Live Migration. By default XEN does not allow live migration, we have to enable this is /etc/xen/xend-config.sxp. Make sure the following line is commented, it should look like this: #(xend-relocation-hosts-allow '^localhost$ ^localhost\\.localdomain$') and that the following line is not commented, it should look like this: (xend-relocation-port 8002) Put also this: (xend-relocation-server yes) Make sure to do this two changes above on both nodes, both ha1 & ha2.
Install and Configure HeartbeatWe use Heartbeat, part of the Linux High Availability project (http://www.linux-ha.org/), to monitor our XEN resources and provide failover between our two nodes. root@serv1:/# apt-get install heartbeat Again only specific configurations for our job are outlined. For the rest just follow the above mentioned how-to and modify names, IPs and other server-specific options. Edit /etc/ha.d/authkeys root@serv1:# nano /etc/ha.d/authkeys Note: Make sure to copy the exact same copy to your 2nd node. Edit /etc/ha.d/ha.cf root@serv1:# nano /etc/ha.d/ha.cf logfacility local0 Edit /etc/ha.d/haresources root@serv1:/# nano /etc/ha.d/haresources serv1.cae.locale xendomainsServ1 Then we followed the how-to, with the requested modifications (names, IP, etc) according to our specific environment. Bug in default xendomains scriptWe applied the patch reported here http://xenbits.xensource.com/xen-unstable.hg?diff/01c8ccb551b0/tools/examples/init.d/xendomains Edit /etc/init.d/xendomains root@serv1:/# nano /etc/init.d/xendomains [...] Still we have some problems with that ... see http://vdd-project.org/index.php/blog/comments/10 |