Disclaimer: Installing this version of Eucalyptus from source is not a trivial matter. The combination of our limited resources and the unlimited variety of cluster configurations means that we may be incapable of assisting those who run into problems installing Eucalyptus from source code.
The following "cook book" illustrates how we build, deploy, and test Eucalyptus.
A Eucalyptus cloud setup consists of three types of components -- the cloud controller, the cluster controller(s), and the node controller(s). The cloud controller is a Java program that, in addition to high-level resource scheduling and system accounting, offers a Web services interface and a Web interface to the outside world. Cluster controller and node controller are written in C and deployed as Web services inside Apache.
Communication among these three types of components goes over SOAP with WS-security. There is one cluster controller per cluster, running on the head node; there is one node controller per each compute node, running as root in dom0. So, if you are installing Eucalyptus on one cluster, then one cloud and one cluster controller should be deployed on the head node and one node controller should be deployed on each compute node.
Download eucalyptus-1.1-src.tar.gz from http://eucalyptus.cs.ucsb.edu/downloads
$ tar zvxf eucalyptus-1.1-src.tar.gz $ cd eucalyptus-1.1-src $ export EUCALYPTUS_SRC=`pwd`
Pub the following variable definitions into file named Makedefs:
export EUCALYPTUS=${EUCALYPTUS_SRC}/deployed/eucalyptus-1.1
export AXIS2_HOME=${EUCALYPTUS_SRC}/deployed/packages/axis2-1.4
export AXIS2C_HOME=${EUCALYPTUS_SRC}/deployed/packages/axis2c-1.4.0
export LIBVIRT_HOME=${EUCALYPTUS_SRC}/deployed/packages/libvirt-0.4.2
export GWT_HOME=${EUCALYPTUS_SRC}/deployed/packages/gwt-1.4.62
We assume that you are using the "bash" shell, but these instructions should be altered to reflect the corresponding commands for your shell.
$ source Makedefs
Set NFS_SHARE environment variable to point the location of a NFS-shared directory that will be shared between nodes and the cluster controller. It should have ample space for VM images, which can be several GB in size each.
To install Eucalyptus, you need to build packages that Eucalyptus depends on. Source tarballs for these are provided on the Eucalyptus downloads page. Please untar/unzip these before proceeding. For the sake of this discussion, we are going to assume that all packages are installed in "$EUCALYPTUS_SRC/deployed/packages":
$ mkdir -p $EUCALYPTUS_SRC/deployed/packages
The dependencies can be built as follows:
$ cd $EUCALYPTUS_SRC/deployed/packages $ tar zvxf gwt-1.4.62.tar.gz
$ cd $EUCALYPTUS_SRC/deployed/packages $ unzip axis2-1.4-bin.zip
The Eucalyptus node and cloud controller depend on Apache 2. We rely on running apache as root, therefore we recommend that apache 2 be installed separately from the webserver that might be included as part of your distribution.
$ cd $EUCALYPTUS_SRC/deployed/packages $ tar zvxf httpd-2.2.8-src.tar.gz $ cd httpd-2.2.8 $ CFLAGS="-DBIG_SECURITY_HOLE" ./configure --prefix=$EUCALYPTUS_SRC/deployed/packages/httpd-2.2.8 $ make ; make install
$ cd $EUCALYPTUS_SRC/deployed/packages
$ tar zvxf axis2c-src-1.4.0.tar.gz
$ cd axis2c-src-1.4.0
$ ./configure --with-apache2=$EUCALYPTUS_SRC/deployed/packages/httpd-2.2.8/include --prefix=${AXIS2C_HOME}
$>make ; make install
$ cd $EUCALYPTUS_SRC/deployed/packages $ tar zvxf libvirt-0.4.2-src.tar.gz $ cd libvirt-0.4.2 $ ./configure --prefix=$EUCALYPTUS_SRC/deployed/packages/libvirt-0.4.2 $ make ; make install
$ cd $EUCALYPTUS_SRC/deployed/packages
$ tar zvxf rampartc-src-1.2.0.tar.gz
$ cd rampartc-src-1.2.0
$ export LD_LIBRARY_PATH=${AXIS2C_HOME}/lib:$LD_LIBRARY_PATH
$ ./configure --prefix=${AXIS2C_HOME} --enable-static=no --with-axis2=${AXIS2C_HOME}/include/axis2-1.4.0
$ make ; make install
$ cd $EUCALYPTUS_SRC/deployed/packages $ tar zvxf vde-2.2.0-pre3.tgz $ cd vde-2.2.0-pre3 $ ./configure --prefix=$EUCALYPTUS_SRC/deployed/packages/vde-2.2.0-pre3 --enable-cryptcab --enable-experimental $ make ; make install
The following dependencies need to be met:
The following commands MUST be run as the superuser (root). This will build the cloud controller.
# cd $EUCALYPTUS_SRC/clc # ant clean deps build jce setup
To build the node and the cluster controller, in the top level Eucalyptus source directory:
# cd $EUCALYPTUS_SRC # make build # make deploy
$ cd $EUCALYPTUS_SRC/deployed/packages/axis2c-1.4.0
Edit axis2.xml and search for "Security", changing
<!--phase name="Security"/-->
to
<phase name="Security"/>
Save the file.
Copy over axis2 apache module
$ cp $EUCALYPTUS_SRC/deployed/packages/axis2c-1.4.0/lib/libmod_axis2.so.0.4.0 $EUCALYPTUS_SRC/deployed/packages/httpd-2.2.8/modules/mod_axis2.so
Modify $EUCALYPTUS_SRC/deployed/packages/httpd-2.2.8/conf/httpd.conf, adding the following lines:
LoadModule axis2_module modules/mod_axis2.so
Axis2RepoPath <full path to eucalyptus top level source>/deployed/packages/axis2c-1.4.0
Axis2LogFile <full path to eucalyptus top level source>/deployed/packages/axis2c-1.4.0/logs/axis2.log
Axis2MaxLogFileSize 128
Axis2LogLevel trace
<Location /axis2>
SetHandler axis2_module
</Location>
Change the following lines:
Uncomment the following:
Include conf/extra/httpd-mpm.conf
Modify $EUCALYPTUS_SRC/deployed/packages/httpd-2.2.8/conf/extra/httpd-mpm.conf, changing:
<IfModule mpm_prefork_module>
StartServers 5
MinSpareServers 5
MaxSpareServers 10
MaxClients 150
MaxRequestsPerChild 0
</IfModule>
to:
<IfModule mpm_prefork_module>
StartServers 0
MinSpareServers 1
MaxSpareServers 0
MaxClients 1
MaxRequestsPerChild 0
</IfModule>
In the top level Eucalyptus source directory (cd $EUCALYPTUS_SRC), create the vde key:
$ ssh-keygen -t rsa1 -b 768 -f $EUCALYPTUS/var/eucalyptus/keys/vdekey -N ''
Copy the Eucalyptus configuration file
$ cp $EUCALYPTUS_SRC/tools/eucalyptus.conf $EUCALYPTUS/etc/eucalyptus/
and edit it ($EUCALYPTUS/etc/eucalyptus/eucalyptus.conf), as follows:
Create symlinks:
$ mkdir $EUCALYPTUS/bin $ mkdir $EUCALYPTUS/lib $ ln -s $EUCALYPTUS_SRC/deployed/packages/*/bin/* $EUCALYPTUS/bin $ ln -s $EUCALYPTUS_SRC/deployed/packages/*/lib/* $EUCALYPTUS/lib
Add $EUCALYPTUS/bin to your PATH and $EUCALYPTUS/lib to your LD_LIBRARY_PATH
$ cp $EUCALYPTUS_SRC/tools/add_key.sh $EUCALYPTUS/usr/share/eucalyptus
Mirror $EUCALYPTUS_SRC on all hosts. Preferably use the same path on all hosts. scp or rsync can be used to do this.
On each host, change to the top-level source directory
$ source Makedefs
Make sure that LD_LIBRARY_PATH and PATH are set up as previously described on all hosts.
Make sure that the $NFS_SHARE/templates, $NFS_SHARE/registered and INSTANCE_PATH directories are created on all hosts.
$ deployed/eucalyptus-1.1/bin/apachectl start
At this point, apache2 should be running. Verify this.
$ ps aux | grep httpd
Axis2 webservices should be enabled. To verify this, point your browser to hostname:9090/axis2/services
To test that node(s) are available, execute the following.
$ $EUCALYPTUS_SRC/node/NCclient NChostname:9090 describeResource
To test that the cluster controller is available, execute the following.
$ $EUCALYPTUS_SRC/cluster/CCclient_full CChostname:9090 describeResources
On the host that is designated to run the cloud controller, do:
$ cp $EUCALYPTUS_SRC/clc/cloud.xml $EUCALYPTUS/etc/eucalyptus/cloud-ant.xml
Add the cluster to the cloud controller configuration:
# ant -f $EUCALYPTUS/etc/eucalyptus/cloud-ant.xml cluster-add -Deuca.cluster.alias=<name of the cluster> -Deuca.cluster.host=<cluster controller hostname> -Deuca.cluster.port=9090
Start the Cloud Controller:
# ant -f $EUCALYPTUS/etc/eucalyptus/cloud-ant.xml run &
Download euca-ttylinux.tgz from the Eucalyptus website (or provide your own images)
$ cd $EUCALYPTUS_SRC $ tar zvxf euca-ttylinux.tgz $ cd $EUCALYPTUS_SRC/tools $ ./euca add_image --disk-image $EUCALYPTUS_SRC/ttylinux/ttylinux.img --kernel-image $EUCALYPTUS_SRC/ttylinux/vmlinuz-2.6.16.33-xen --image-name ttylinux
On the host with the certificates:
$ ec2-describe-instances $ ec2-describe-availability-zones $ ec2-describe-images
At this point you should be able to run instances.