359 lines (251 sloc) 11.9 KB
Building and Installing from Source
This is the Eucalyptus process for developers wishing to understand or
modify Eucalyptus source code. It allows them to obtain and build the
Eucalyptus source code into installable packages.
If you instead wish to evaluate Eucalyptus by deploying a small private
cloud on your own machine with a single command, see to download
and install the FastStart package.
If you instead wish to implement a Eucalyptus cloud on multiple systems with
full configurability, from pre-built component packages, refer to the
Eucalyptus documentation at to get
The process consists of:
1. Setting up your Linux environment,
2. Obtaining the source code and dependent github repositories,
3. Installing build dependencies,
4. Building the code from source into RPM packages,
5. Distributing the RPMs to other systems,
6. Installing the RPMs to the build system and other systems,
7. Configuring Eucalyptus, using the Eucalyptus Install Guide,
8. Rebuilding code as needed, and installing rebuilt artifacts.
***NOTE*** The following instructions are subject to change and
may be INCOMPLETE. Contributions encouraged! :)
Eucalyptus only supports 64-bit installations on CentOS/RHEL 7.
These instructions were tested on the "Minimal" distribution of CentOS 7.
We will use the Eucalyptus RPM build process to build the source code,
install it to a certain directory tree, and create the RPM packages. Those
packages will be installed on all systems that will be part of the
Eucalyptus cloud, which can include the build system.
1. Set up the environment
On each system (build or others), add the following environment variables to
your .bashrc, or another file you can source before executing the
commands that use them.
Pick any directories you wish. Just don't make any nested in any of the
# Get github repositories here
export EUCAGIT=~/euca/git
# Lay out the rpmbuild structure here, for sources, build outputs, and RPMs
export EUCARPM=~/euca/rpmbuild
# Distribute the rpmbuild outputs to other systems here
# Define this on the build system too
export EUCAPKGS=~/euca/pkgs
# Define the required JAVA environment variables
# As of Eucalyptus 4.3 Java 1.8 is required. If you need to use a
# different implementation of Java, set the JAVA_HOME so that it
# references that location.
export JAVA_HOME="/usr/lib/jvm/java-1.8.0/"
export JAVA="$JAVA_HOME/bin/java"
Log out and in again, or "source <this file>".
Create the directories if they don't already exist:
>>>>> Command 1a:
Install the following tools and repos needed for building:
>>>>> Command 1b:
# yum install git yum-utils wget \
Install the Eucalyptus repository that will allow yum to find the packages
needed for building Eucalyptus that are not in the other repos. Point your
Web browser to:
Drill down to find the latest version of the RPM for your desired Linux
platform, for "x86_64" (not "source"). As of this writing, the subdirs "7",
"7Server", and "7Workstation" all point to the same repositories. Look for
the latest version of:
>>>>> Command 1c:
# yum install <that URL>
Similarly, install the euca2ools repository from:
Drill down to find the latest:
>>>>> Command 1d:
# yum install <that URL>
If you are setting up a non-build system to install Eucalyptus on, skip the
next build-only steps and proceed to Step 6 (Install Eucalyptus).
2. Get the source code (build system only)
Get the Eucalyptus source code repository:
>>>>> Command 2a:
# git clone $EUCAGIT/eucalyptus
Get the repository containing the RPM build spec and a few other files
needed to build and install the source code:
>>>>> Command 2b:
# git clone $EUCAGIT/eucalyptus-rpmspec
Get the Eucalyptus-specific libraries needed to build and run:
>>>>> Command 2c:
# git clone $EUCAGIT/eucalyptus-cloud-libs
3. Install build dependencies (build system only)
Follow these instructions to install the required build dependencies.
Install the general software development build dependencies:
>>>>> Command 3a:
# yum groupinstall development
Install the Eucalyptus-specific build dependencies:
>>>>> Command 3b:
# yum-builddep --nogpgcheck eucalyptus
(The GPG keys are not kept up-to-date for nightly builds, hence the
Download the Apache Ivy 2.1.0 tarball and replace the Ivy jar installed by
the "apache-ivy" yum install.
>>>>> Commands 3c:
# cd /tmp && \
wget && \
tar -zxvf apache-ivy-2.1.0-bin.tar.gz && \
cp -p apache-ivy-2.1.0/ivy-2.1.0.jar /usr/share/java && \
ln -fs /usr/share/java/ivy-2.1.0.jar /usr/share/java/ivy.jar
>>>>> (end of commands)
4. Build Eucalyptus (build system only)
We run the rpmbuild command with the Eucalyptus build spec to build the
source code, install it into a destination file tree, and create binary RPMs
that can be installed on this system or any other system that has been
prepared using steps 1-3 above.
Remove any artifacts from the previous rpmbuild:
BE CAREFUL: Make sure $EUCARPM is defined!
>>>>> Command 4a:
# if [ -n "$EUCARPM" ]; then rm -Rf $EUCARPM/*/*; fi
Link to the RPM spec file:
>>>>> Command 4b:
# ln -fs $EUCAGIT/eucalyptus-rpmspec/eucalyptus.spec $EUCARPM/SPECS
Create the tarballs of eucalyptus and the eucalyptus-cloud-libs that
rpmbuild will un-tar and build:
>>>>> Commands 4c:
# cd $EUCAGIT && \
tar -cvJf $EUCARPM/SOURCES/eucalyptus.tar.xz --exclude .git --exclude eucalyptus/clc/lib --exclude eucalyptus
>>>>> (end of commands)
>>>>> Commands 4d:
# cd $EUCAGIT/eucalyptus-cloud-libs && \
tar -cvJf $EUCARPM/SOURCES/eucalyptus-cloud-libs.tar.xz *.jar licenses
>>>>> (end of commands)
Now rpmbuild will do all of the build and packaging, in one command:
>>>>> Command 4e:
# rpmbuild --define "_topdir $EUCARPM" --define 'tarball_basedir eucalyptus' --define 'cloud_lib_tarball eucalyptus-cloud-libs.tar.xz' -bb $EUCARPM/SPECS/eucalyptus.spec
5. Distribute the Build (build system only)
At this point, if you plan to use Eucalyptus on more than one system, you're
ready to push the software out to the other systems.
From the build system, copy the packages to the other systems' hostnames or
IP addresses:
>>>>> Commands 5a: #
# rsync -ar $EUCARPM/RPMS/ root@{host-2}:$EUCAPKGS
# rsync -ar $EUCARPM/RPMS/ root@{host-3}:$EUCAPKGS
>>>>> (end of commands)
6. Install Eucalyptus (on all systems)
You can now install the Eucalyptus RPMs onto each system.
Follow the instructions from the Installation Guide for all of the steps to
plan and configure your system's dependencies, before the steps describing
how to install Eucalyptus or nightly release packages. The Eucalyptus
documentation can be found here:
At this point, instead of installing the packages as described in the
Installation Guide, install the packages you have built. Install all of the
Eucalyptus RPMs even if all the components are not needed, to prevent
dependency problems with Eucalyptus packages that have the same names but
different version numbers in the eucalyptus-nightly repository. You can
still choose which components to configure and run on each system.
For the build system (if you're installing onto it):
>>>>> Command 6a:
# yum install $EUCARPM/RPMS/noarch/* $EUCARPM/RPMS/x86_64/*
For all other systems:
>>>>> Command 6a:
# yum install $EUCAPKGS/noarch/* $EUCAPKGS/x86_64/*
The yum command may install many other Linux packages on which the
Eucalyptus packages depend.
7. Configure Eucalyptus (on all systems)
From this point forward, follow the instructions from the Installation
Guide, starting at the "Install Eucalyptus Release Packages" section. The
Eucalyptus documentation can be found here:
Skip the "yum install" commands for the packages you have already installed,
NOTE: that there are other steps in the "Install Eucalyptus Release
Packages" sections that you still need to perform, besides installing
Eucalyptus packages, such as removing the default libvirt network (virsh
8. Rebuild Eucalyptus (build system only)
NOTE: Before replacing files on installed systems, stop any Eucalyptus
services or processes that may be using them. Then restart them after the
files have been replaced. If you are unclear what to stop and restart,
refer to the Installation Guide sections "Shutdown Services" and
"Restart Eucalyptus Services".
NOTE: The following steps require that the above rpmbuild process be
performed at least once, and the resulting RPMs be installed at least once
onto any system you intend to update with rebuilt artifacts (including the
build system).
To rebuild code after changing it, you can either:
1. Repeat step 4, using rpmbuild. Then, you can then either:
1a. Copy the RPM packages you've changed to the installed systems, and
re-install them.
1b. Or, copy individual jars or executables (or other built artifacts)
from the $EUCARPM/BUILD directory tree to the installed systems,
replacing those files.
2. Or, you can build the code using "make", without rpmbuild. Then, you can
copy individual jars or executables (or other built artifacts) built by
"make" to the installed systems, replacing those files.
Non-rpmbuild rebuilds (option 2)
If you choose this option, add the following environment variable to your
.bashrc, or another file you can source before executing the commands that
use them.
Do not use any other directory besides "/", or neither "make" nor "rpmbuild"
will work. Future "rpmbuild"s will continue to work as long as it's defined
this way.
Run the "configure" script to prepare the system to build:
>>>>> Command 8a:
# cd $EUCAGIT/eucalyptus
>>>>> Command 8b:
# ./configure --with-axis2==/usr/share/java/axis2 \
--with-axis2c=/usr/lib64/axis2c --prefix=$EUCALYPTUS \
--with-apache2-module-dir=/usr/lib64/httpd/modules \
Run the "make" commands below.
>>>>> Command 8b:
# make clean && make
The "make clean" deletes the artifacts from any previous build.
The "make" builds the artifacts, in the $EUCAGIT/eucalyptus tree.
>>>>> Command 8c: (optional)
# make install
The "make install" copies the built artifacts into their runtime destination
directories on this build system, overwriting any files already installed by
package-based installs.
If your build system is also an installed system as part of your running
cloud, this step will update all necessary files. If your build system is
not part of your cloud, this step is unnecessary.
If you only want to update a few artifact files (such as a .jar file) onto
your installed systems, you can skip this step, and copy those files from
the $EUCAGIT/eucalyptus tree where they were built by "make", to their
proper destination directories on the installed systems.
NOTE: If you do a non-rpmbuild (option 2), and later wish to do an rpmbuild
(option 1), remove all make artifacts from the non-rpmbuild before doing the
>>>>> Commands 8d:
# cd $EUCAGIT/eucalyptus
# make distclean
>>>>> (end of commands)