Thursday, January 19, 2012

Building Eucalyptus 3-devel

As some readers may already be aware, Eucalyptus has started publishing code from the Eucalyptus 3 development branch on launchpad.   The build process has a fairly sizable set of dependencies, so I'd like to give a quick example of how I built and installed this code on a Fedora 16 system.  I started with a minimal x86_64 install.

1) Add Eucalyptus' yum repository which contains dependencies for the source build: 

[euca-deps] 
name=euca-deps
baseurl=http://downloads.eucalyptus.com/devel/packages/3-devel/fedora/16/x86_64/
gpgcheck=1
enabled=1


2) Download the GPG key for verifying packages, and add it to your rpm database:

rpm --import http://downloads.eucalyptus.com/devel/gpg-keys/9d7b073c-eucalyptus-nightly-release-key.pub

3) Install dependencies.  For simplicity, this list includes build and runtime deps for all components:

yum install axis2c rampartc axis2c-devel rampartc-devel python-boto \
euca2ools libvirt-devel openssl-devel gcc java-1.6.0-openjdk-devel ant \
curl-devel libxslt-devel apache-commons-logging xalan-j2-xsltc wsdl4j \
backport-util-concurrent httpd postgresql-server libvirt PyGreSQL make \
openssh-clients scsi-target-utils qemu-kvm axis2-codegen axis2-adb-codegen

4) Install grub 1.   UPDATE: This is no longer required in 3.1.

This package is obsoleted by grub2, so it cannot be installed by yum, but it has no conflicting files, so installing it outside of the rpm database is safe:

yum install yum-utils
yumdownloader grub
cd /; rpm2cpio /root/grub-0.97-*.rpm | cpio -id
cp /usr/share/grub/x86_64-redhat/* /boot/grub/

5) Create a user named eucalyptus on your system.

useradd -G kvm eucalyptus
passwd eucalyptus

6) Disable iptables (eucalyptus must be allowed to control iptables for dynamic routing).

systemctl disable iptables.service
systemctl stop iptables.service

7) Increase shmmax on the system: 

SHMMAX=$(( 48 * 1024 * 1024 ))
echo $SHMMAX > /proc/sys/kernel/shmmax
echo "kernel.shmmax = $SHMMAX" > /etc/sysctl.d/euca_shmmax

8) Modify  /usr/lib64/axis2c/bin/tools/wsdl2c/WSDL2C.sh -- erase the existing lines and add these:

java -classpath $(build-classpath axis2/codegen axis2/kernel axis2/adb \
 axis2/adb-codegen wsdl4j commons-logging xalan-j2 xsltc \
 backport-util-concurrent ws-commons-XmlSchema ws-commons-neethi \
 ws-commons-axiom annogen ) org.apache.axis2.wsdl.WSDL2C $*

9)   Log in as the eucalyptus user to checkout and build the code

10) Check out the code from bzr:   bzr branch lp:eucalyptus && cd eucalyptus
UPDATE: Check out the code from GitHub: git clone https://github.com/eucalyptus/eucalyptus.git

11) Configure eucalyptus.  I recommend running "./configure --help"  and reading over the options, but this configuration should work:

./configure --with-axis2c=/usr/lib64/axis2c/ \
            --with-apache2-module-dir=/usr/lib64/httpd/modules/

12) Modify ./clc/modules/postgresql/conf/scripts/setup_db.groovy :

Change PG_BIN on line 97 to "/usr/bin/pg_ctl"
Change PG_INITDB on line 103 to "/usr/bin/initdb"

13) Run make

Then as root, do the following:

14) Run make install

NOTE: there's an issue here which causes some files in the source tree to be root-owned after this step, so you may want to run "find . | xargs chown eucalyptus" to fix this.  Otherwise, you may see "permission denied" errors the next time you run "make" or "make distclean".

15) Copy PolicyKit configuration for libvirt into place:

mkdir -p /var/lib/polkit-1/localauthority/10-vendor.d
cp -p tools/eucalyptus-nc-libvirt.pkla \
  /var/lib/polkit-1/localauthority/10-vendor.d/eucalyptus-nc-libvirt.pkla

16) Restart libvirtd:  systemctl restart libvirtd.service

I'll write up another post detailing configuration and initialization steps.  For those of you who have used eucalyptus before, you will find that the eucalyptus.conf file is mostly unchanged from 2.0.x.  The database initialization and component registration steps differ slightly, though.   Stay tuned.

4 comments:

  1. Sir would you please publish article regarding How to install Eucalyptus 3.2.0 from source on Ubuntu 10.04 that will be great helpful to me ??

    Thanks.

    ReplyDelete
    Replies
    1. A good starting point is here:
      https://github.com/eucalyptus/eucalyptus/wiki/Source-build-on-Ubuntu

      It was not written with 10.04 in mind, though. 10.04 is too old to be interesting to me at this point; technologies such as kvm, libvirt, etc. are still moving fast enough that using the latest stable releases possible are usually worth the effort..

      Delete
  2. Hey Andy,
    while performing the installation of axis2-codegen. Am getting the following dependencies trouble. that is in your step 3. and also with axis2-adb-codegen.
    Error: Package: 1:mysql-connector-java-5.1.17-6.el6.noarch (@anaconda-CentOS-201207061011.x86_64/6.3)
    Requires: jta >= 1.0
    Removing: geronimo-specs-compat1.0-3.5.M2.el6.noarch (@base)
    jta = 1.0.1
    Obsoleted By: geronimo-jms-1.1-api-1.2-13.jpp5.noarch (euca-3-deps)
    Not found
    Error: Package: jetty-eclipse-6.1.24-2.el6.noarch (@anaconda-CentOS-201207061011.x86_64/6.3)
    Requires: jta
    Removing: geronimo-specs-compat-1.0-3.5.M2.el6.noarch (@base)
    jta = 1.0.1
    Obsoleted By: geronimo-jms-1.1-api-1.2-13.jpp5.noarch (euca-3-deps)
    Not found

    ReplyDelete
    Replies
    1. Hi, Ankit. This post is now nearly two years old, and the Eucalyptus codebase and build process has changed significantly. I think the best source of information now is in the Eucalyptus source tree:

      https://github.com/eucalyptus/eucalyptus/blob/master/INSTALL

      Delete