Xen Virtualization and Linux Clustering, Part 2
We ended last time after configuring our first unprivileged Xen domain. In this article, we complete our cluster and then test it using an open-source parallel ray tracer. The first thing we need to do is create additional slave nodes to be used with the cluster. So, let's get down to business.
Once you have created and configured an unprivileged domain using the instructions from the previous section, you easily can duplicate this domain as described below. Start by making a backup image of the Debian_Slave1_Root filesystem. You only need to do this step once. Note that the tar command probably will take a few minutes to complete, as it is archiving an entire filesystem.
# mkdir /data/xen-images # mount /dev/VG/Debian_Slave1_Root /mnt/xen # cd /mnt/xen # tar jpcf /data/xen-images/debian-slave-root.tar.bz2 * # ls -sh /data/xen-images/debian-slave-root.tar.bz2 # cd / # umount /mnt/xen
You now have a working root filesystem archive that can be used to create additional domains with minimal effort. Let's use this archive to create our second unprivileged domain, which we call debian_slave2. Start by creating the logical volumes for the additional domain:
# lvcreate -L1024M -n Debian_Slave2_Root VG # lvcreate -L64M -n Debian_Slave2_Swap VG # mke2fs -j /dev/VG/Debian_Slave2_Root # mkswap /dev/VG/Debian_Slave2_Swap # mount /dev/VG/Debian_Slave2_Root /mnt/xen # cd /mnt/xen # tar jpxf /data/xen-images/debian-slave-root.tar.bz2
We now must modify two configuration files in the new domain root. This includes changing the IP address of eth0 in /mnt/xen/etc/network/interfaces to match the IP address we chose for the new domain--remember the Domain-0 /etc/hosts file we created earlier?. We also need to change the hostname in /mnt/xen/etc/hostname to debian_slave2.
Finally, create a Xen config file for the new domain and save it as debian_slave2.conf. Don't forget to give this domain a unique MAC address:
name="debian_slave2" memory=64 kernel="/boot/vmlinuz-2.6.11-xenU" nics=1 vif=[ 'mac=aa:00:00:00:00:02, bridge=xen-br0' ] disk=[ 'phy:VG/Debian_Slave2_Root,sda1,w', 'phy:VG/Debian_Slave2_Swap,sda2,w' ] root="/dev/sda1 ro"
You now are ready to boot the additional domain.
# umount /mnt/xen # xm create /etc/xen/debian_slave2.conf -c
The archive technique presented above can be repeated to create as many Debian Sarge unprivileged domains as you like. In addition, this technique also can be used in a more general sense to create complete backups of an OS. This might be useful, for example, before performing software installations/upgrades or other tasks that potentially may harm your system. If things don't work out, simply restore the domain to a previously working state. In fact, I completely erased all of the files on one of my unprivileged domains and was able to restore the entire filesystem within five minutes.
At this point, you should have PVM installed on Domain-0 and be able to boot at least one slave domain that is completely configured as described in the previous sections. Although one slave is sufficient, the next few sections definitely are more interesting if you have two or more slaves configured.
The first step to configuring the PVM cluster is to create a pvm.hosts configuration file, which lists the hostnames of the cluster nodes that you want to use. Note that the specified hostnames should match the hostnames as listed in the /etc/hosts file on Domain-0. In turn, those hostnames should match the hostname in the /etc/hostname file on each domain. An example pvm.hosts file is shown below:
# Master PVM Host master # Slaves debian_slave1 debian_slave2 debian_slave3
Lines beginning with # are comments. You can read the man page for pvmd3 for more details on the PVM configuration file. Your pvm.hosts config file now can be used to start PVM daemon processes (pvmd) on the master and all slave nodes. The PVM daemon provides the message passing interface that we discussed earlier. To start the PVM daemons on all nodes listed in the pvm.hosts file, use the command:
# $PVM_ROOT/lib/pvm pvm.hosts
Before running this command, be sure that all of your slaves are booted using the xm create command. You can get a list of currently booted domains by running xm list.
Today’s modular x86 servers are compute-centric, designed as a least common denominator to support a wide range of IT workloads. Those generic, virtualized IT workloads have much different resource optimization requirements than hyperscale and cloud applications. They have resulted in a “one size fits all” enterprise IT architecture that is not optimized for a specific set of IT workloads, and especially not emerging hyperscale workloads, such as web applications, big data, and object storage. In this report, you will learn how shifting the focus from traditional compute-centric IT architectures to an innovative disaggregated fabric-based architecture can optimize and scale your data center.
Sponsored by AMD
Built-in forensics, incident response, and security with Red Hat Enterprise Linux 6
Every security policy provides guidance and requirements for ensuring adequate protection of information and data, as well as high-level technical and administrative security requirements for a system in a given environment. Traditionally, providing security for a system focuses on the confidentiality of the information on it. However, protecting the data integrity and system and data availability is just as important. For example, when processing United States intelligence information, there are three attributes that require protection: confidentiality, integrity, and availability.
Learn more about catching the bad guy in this free white paper.
Sponsored by DLT Solutions
| Making Linux and Android Get Along (It's Not as Hard as It Sounds) | May 16, 2013 |
| Drupal Is a Framework: Why Everyone Needs to Understand This | May 15, 2013 |
| Home, My Backup Data Center | May 13, 2013 |
| Non-Linux FOSS: Seashore | May 10, 2013 |
| Trying to Tame the Tablet | May 08, 2013 |
| Dart: a New Web Programming Experience | May 07, 2013 |
- New Products
- A Topic for Discussion - Open Source Feature-Richness?
- Making Linux and Android Get Along (It's Not as Hard as It Sounds)
- Drupal Is a Framework: Why Everyone Needs to Understand This
- RSS Feeds
- New Products
- Python Programming for Beginners
- Mobile IPv6 with Linux
- Tech Tip: Really Simple HTTP Server with Python
- The Secret Password Is...
- Hey God - You may not be
2 hours 30 min ago - Reply to comment | Linux Journal
5 hours 3 min ago - Drupal is an Awesome CMS and a Crappy development framework
9 hours 42 min ago - IT industry leaders
12 hours 4 min ago - Reply to comment | Linux Journal
1 day 4 hours ago - Reply to comment | Linux Journal
1 day 7 hours ago - Reply to comment | Linux Journal
1 day 8 hours ago - great post
1 day 9 hours ago - Google Docs
1 day 9 hours ago - Reply to comment | Linux Journal
1 day 14 hours ago



Comments
how to copy fileto floppy based on linux redhat 7.3
when i copy, it show the drive is read only,any one can help me? urgent...
I also like the article,
I also like the article, very decent explanation in plain English.
Thanks, Ryan. Go ahead with part 3.