Continuing with our focus on Cloud Computing, this month we deploy a Cloud
Computing infrastructure with a web-based graphical client. This makes using the
setup a breeze.
Last month we talked about deploying an EC2 compatible cloud computing
infrastructure using Eucalyptus. The deployment of Eucalyptus was tedious but
easy due to the Rocks ISOs. But the only problem with Eucalyptus is that the
client for using it is Amazon's EC2 which is completely command line based and
as a result difficult to run.
So, this time we decided to deploy a Cloud Computing infrastructure which has
a neat web based graphical client, which can make usage of the setup pretty
simple. We selected Enomalism for the same. I cannot guarantee a complete
graphical usage due to some bugs and you might still need to use the command
line, but if you compare it against Eucalyptus, it's far more easier to use. The
other good thing is that if you plan to do a production class deployment with
Enomalism, you can first try out the free version and if you like it but are too
bothered by the management and troubleshooting part of it, you may buy the paid
support from Enomalism. But before we begin, let me warn you that deployment is
not going to be a cakewalk this time.
Prerequisites
There are a couple of things which you have to first identify and arrange before
we can start with the deployment. The first is the base OS on top of which you
want to run Enomalism. One can technically install it on any Linux distro.
However, the preferred distros for installing Enomalism are Fedora 9, CentOS 5.2
and RedHat 5.2.
We first tried installing it on top of a Fedora Box but due to some problem
with the Xen available on Fedora 9 repository, we shifted to CentOS 5.2, where
Enomalism installation worked perfectly. The second thing you need in place is
to have a couple of servers/machines with hardware virtualization support and
identify a machine as the master node which will have the database and the repo
directory on it. All other machines will connect to the master node. In our
setup we used a 24 Core Dunnington server as the master node and a couple of
Core 2 Duo machines as other nodes.
Step 1: Installing the Master Node
First do a base installation of CentOS 5.2 on all machines. I would recommend a
64-bit installation. Once the installation is done, identify one machine as the
master node and configure it first. The master node should have a good amount of
RAM and hard drive space because all of your virtual machines and the Enomalism
database is going to reside on that.
Now download and import two sets of public keys from the enomalism repository
and import them to your system by running following commands:
#wget
http://downloads.sourceforge.net/enomalism/enomalism.public
#wget
http://downloads.sourceforge.net/enomalism/enomalism001.pubkey.asc
# rpm --import enomalism.public
#rpm --import enomalism001.pubkey.asc
Once done, download libvirt 0.4.1 and libvirt-python 0.4.1 for CentOS 5.x for
x64 by running the following commands:
#wget
http://downloads.sourceforge.net/enomalism/libvirt-0.4.1-1.CentOS5.x86_64.rpm?modtime=1205833130&big_mirror=0
#wget
http://downloads.sourceforge.net/enomalism/libvirt-python-0.4.1-1.Cen
tOS5.x86_64.rpm?modtime=1205833291&big_mirror=0
But don't install it at this point, because if you do so you will not be able
to install Xen on this machine due to dependency troubles.
Now download Enomalism build for Python 2.4 (as CentOS 5.2 doesn't have Python
2.5) from http://tinyurl.com/enomalism2 and install it using yum so that all
dependencies for enomalism can be take care automatically. You can do so by
running the following command from the location where you just downloaded
enomalism rpm:
# yum install Enomalism2-2.1.1-3595-noarch-py24.rpm
Now this is the time to install Xen, Qemu and KVM on these machines.
Enomalism supports all these hypervisors. You can install them by running the
following commands:
#yum install yum install kernel-xen xen kvm kmod-kvm
qemu
# ln —s /usr/bin/qemu-kvm /usr/bin/kvm
Now install lib-virt 01.4.1 by running the following command from the
location where you have downloaded the libvirt and libvirt-python packages:
#yum install libvirt-0.4.1-1.CentOS5.x86_64.rpm
libvirt-python-0.4.1-1.CentOS5.x86_64.rpm
This entire procedure forms part of the first step and it is going to be same
for both nodes and the master server.
Step 2: Configuring SQL
Now you have to run MySQL on the master computer, configure it and create the
Enomalism database on it. First run mysqld by running:
# /etc/init.d/mysqld start
Then provide a password to the root user of MySql by running the following
command. Let's assume, we give a password “pass@word”:
# mysqladmin password pass@word
Now run the following command to make sure MySql starts automatically
whenever the machine boots:
# chkconfig mysqld on
Now you have to create the database in MySql for enomalism. To do so go to
/opt/enomalism2/scripts and run:
#./init-db.sh pass@ord enomalism2 pass@word
This command will create at database named enomalism2 and a MySql user called
enomalism2, give the user a password which is again pass@word. It will create
the required tables and fill values to it.
Downloading appliances To create a virtual machine on top of your Enomalism cloud, the easiest thing which you can do is just download a virtual appliance from enomalism repository and use it to create virtual machines. To do so, go to “Repository ” tab, then click on the “Remote Appliances”. It will list all the appliances available in Enomalism's repo. Select the appliance and click on the 'Add' button to start the download. Provisioning a new VM Now select any physical machine on which you want to create a virtual Bug Fix |
Step 3: Configuring Enomalism
This is the time to configure and run Enomalism on the master computer. To do so
first create the enomalism configuration file by copying the sample default.cfg
file from /opt/enomalism2 to /opt/enomalism2/config by running the following
command:
#cp /opt/enomalism2/default.cfg /opt/enomalism2/config/$HOSTNAME.cfg
This will copy the default file with the same name as that of your hostname
to the config folder. Now open the file by using your favourite text editor and
change the following lines:
sqlobject.dburi="mysql://enomalism2:pass@word@localhost/enomalism2"
Here you are actually providing the Enomalism mysql user name and its
password to your FQDN or IP address/ the name of the Enomalism database.
enomalism2.baseurl=http://127.0.0.1:8080/rest/
enomalism2.ip_addr="192.168.3.82"
Here you are providing the land IP of Enomalism server.
Now go to a terminal and run the following command:
#uuidgen
You will get a 32 character value, like
“5fe6f05e-7ee0-11dc-ba7c-0011d88b8e81.” Copy this line and paste it to
enomalism2.self line in the config file. The line would look like this:
enomalism2.self="5fe6f05e-7ee0-11dc-ba7c-0011d88b8e81"
Now open /etc/xen/xend-config.sxp and add a line which says
(vnc-listen '0.0.0.0')
And your master node setup is done.
Step 4: Configuring the client nodes
To configure the client machines, you have to follow Step 1 exactly as you did
it for the Master Node. Once you are done with it, the extra thing which you
have to do here is to configure the enomalism configuration file in a bit
different way. To do so, copy the default.cfg file from /opt/enomalism2 to /opt/
enomalism/config by running the same command as we did earlier, like this:
#cp /opt/enomalism2/default.cfg /opt/enomalism2/config/ $HOSTNAME.cfg
Now open this file and do the following modifications.
enomalism2.ip_addr="192.168.3.82".
Here give the IP address of the client node on which you are working now:
sqlobject.dburi=”mysql: // enomalism2:pass@word @192. 168.3.82/enomalism2".
Here you will provide the MySQL username, IP address and database name which you
have configured in the master node:
Change enomalism2.baseurl="http://192.168.3.82:8080/rest/". Here also give
the IP address of the master node.
Now again run uuidgen command from the terminal and paste the value to the
line which starts with enomalism2.self. It should look something like this:
enomalism2.self="5fe6f05e-7ee0-11dc-ba7c-0011d88b8e81"
Just make sure, no two machines should have the same uuid.
Step 5: Granting MySQL
access
Now you have to configure MySQL running on the master node in such a way that it
can let the node access it remotely. For this, you have to grant the access from
the nodes to the MySQL server. To do so, run the following commands:
#mysql —p
GRANT ALL ON enomalism2.*
TO enomalism2@192.168.3.82 IDENTIFIED BY 'pass@word';
FLUSH PRIVILEGES;
Here change the IP address with the address of the client nodes one by one.
Once done, restart MySQL by running the following commands:
#/etc/inet.d/mysqld restart
Now the only thing which is left is mounting the repo directory of the Master
Node to all the client nodes over NFS. To do so, go to the master node and open
/etc/exports file and add “/opt/ enomalism2/repo local.nfs. ip.range/ 24 (rw,no_
root_ squash,no_all_squash)” line to it. Now save and exit the file and run the
following commands:
#service nfsd start
#export —r
Now, go to the client machines and add “master.nfs.ip.
address:/opt/enomalism2/repo /opt /enomalism2/repo nfs” to the /etc/fstab file.
Once done, reboot all the machines and run the following command to start
enomalism:
#/etc/init.d/enomalism2.sh start
Step 6: Accessing the web interface
Now, open a web browser and open http:// IPaddress:8080 /install address for all
the machines (both master and client nodes). So for instance, in our case the
Master Node was 192.168.3.82 and the client was 192.168.3.100. So we went to
http:// 192.168. 3.82:8080/install first and then to http:// 192.168
.3.100:8080/install.
This will add the node details to the SQL server. Once done, access the main
page by going to the IP address of the master node and port 8080. It will ask
you a username and password. Give 'admin' as user name and 'password' as
password. And you will be logged in to the web based interface.
The web based interface is pretty self explanatory, and you can easily
understand using it. Below are some tips on doing some basic operations.