SmartDomains tutorial

SmartDomains is a tool for automated deployment and management of distributed Xen virtual machines.
Project page
Project authors: Olivier Pernet and Xavier Grehant.
Developed as part of Grid IC projects of CERN openlab second phase.

This tutorial: Xavier Grehant (xagATcernDOTch)
In sync with revision 127 (release 0.9.08)

SmartDomains is a showcase of SmartFrog, a framework for distributed configuration and deployment developed at HP Labs.

Contents


Installation


Install Ant

You need Ant 6 or later. To check type on a prompt:

> ant -version

If you don't have Ant or you have a version older than v6, you can get it on http://ant.apache.org

Download SmartDomains

SmartDomain is available here. You only need one file:

Uncompress the file where you want it to be installed. For example:

> mkdir /opt/SmartDomains/ > tar -xzf SmartDomains-0.9.tgz -C /opt/SmartDomains/

Install SmartFrog

SmartFrog is available here. You may skip this and rely on SmartFrog binaries from your SmartDomains package but this would work only if you're using jdk1.4.2, and we tested it on Scientific Linux CERN only. If you're running something else we recommend you install SmartFrog independently before you carry on with the next steps. (Thanks Fermin for mentionning.)

You only need SmartFrog core from the SmartFrog distribution.

SFHOME environment variable

> echo $SFHOME

If SFHOME environment variable is defined, it probably means you already have SmartFrog installed. In this case you can skip this section and head directly to Class Loading.

If SmartFrog is installed but SFHOME is not defined, you have to define it now pointing to SmartFrog 'dist' directory: apply the following instructions by replacing '/opt/SmartDomains/' with the directory where SmartFrog is installed (e.g. 'opt/SmartFrog/').

Otherwise you're relying on the SmartFrog binaries carried by your SmartDomains package. SFHOME must be pointing to SmartDomains' dist directory:

> export SFHOME=/opt/SmartDomains/dist

to launch deployments from this computer, you also need to put SmartDomain's dist/bin directory (it doesn't exist yet but will be created) under the path, e.g:

> export PATH=${PATH}":"${SFHOME}/bin

To keep these variables for every shell, you can for instance create files in /etc/profile.d/

/etc/profile.d/smartdomains.sh:

export SFHOME=/opt/SmartDomains/dist if [ -z "$PATH" ]; then export PATH=${SFHOME}/bin else export PATH=${PATH}":"${SFHOME}/bin fi

/etc/profile.d/smartdomains.csh:

setenv SFHOME /opt/SmartDomains/dist if( $?PATH ) then setenv PATH ${PATH}":"${SFHOME}/bin else setenv PATH ${SFHOME}/bin endif

Class loading

For a standalone installation, you can skip and head directly to Run Ant Command.

Otherwise, if you want to keep SmartDomains up to date and frequently download new releases, you can put the jar on a http or ftp server instead of re-installing SmartDomains on every node every time. In this case your node will do remote class loading and you need to edit a couple of scripts for this:

in SmartDomains/bin/setSFProperties:

# Uncomment to enable Dynamic ClassLoading export SFDYNAMICCLASSLOADING_ON=ENABLED

in SmartDomains/bin/setSFDynamicClassLoadingProperties, give the proper path to you server. The one below is our latest build, that we use for our testbed.

export SERVER="http://smartfrog.web.cern.ch/smartfrog/download/xavier/" export CODEBASE="$SERVER/SmartDomains.jar"

Run Ant command

Ant will look for a build file. SmartDomains' build file is SmartDomains/build.xml. So you need to call ant on this directory

> cd /opt/SmartDomains

If you're not using remote class loading for this host (standalone installation):

> ant install

If, instead, you want this node to dynamically load SmartDomains classes from a server:

> ant node

If, instead, you're installing the server, then set the right property webserver.dir in file build.properties, for example:

webserver.dir=/afs/cern.ch/project/openlab/smartfrog/download/xavier/

and then launch:

> ant deploy