DEPRECATED - REMOVE IT SmartGears gHN Installation
As described in detail in in the dedicated WIKI Page of the gCube Developer's Guide, SmartGears is a set of Java libraries that turn Servlet-based containers and applications into gCube resources, in a transparent way.
In this guide, we show how administrators and site-managers can install SmartGears and manage SmartGears installations.
The following are prerequisite for a SmartGears installation:
J2SE 1.6 update 4 SDKor greater. Oracle's reference implementation is recommended, but versions from IBM, HP, or BEA should work equally well.
GNU tarto install the SmartGears from archived distributions.
- An existing installation of one of the available Servlet Containers
The following are pre-requisites for the operation of a SmartGears-based hosting node in any infrastructure:
- A static IP address and preferably a DNS name.
The SmartGears distribution is available as a tarball from the gCube Nexus Maven repository, with the following coordinates:
<dependency> <groupId>org.gcube.distribution</groupId> <artifactId>smartgears-distribution</artifactId> <version>...</version> <type>tar.gz</type> </dependency>
Once downloaded, the tarball can be expanded in any location of the filesystem, henceforth referred to as the installation folder. The distribution contains all the relevant files, including the
install script which performs the real installation of SmartGears within the servlet container.
A new folder should be designated to contain the state of the SmartGears-enabled hosting node, and its absolute path configured as the value of the
GHN_HOME environment variable. If the folder, does not exist, the
install script will create it.
usage: install [-d <distro directory>] -s tomcat|<lib directory> -a [app directory] [-g gHN directory] [-x|-h] <distro directory> = the directory with the distribution of SmartGears XXX. By default, this is the parent directory of this script. <lib directory> = the directory with libraries shared by all applications in the target container. <app directory> = the directory with all the applications in the target container. <gHN directory> = the directory with logs and files related to the gCube Hosting Node. By default, this is value of the GHN_HOME env var. tomcat = Sets <lib directory> and <app directory> for a target Tomcat container. x = dry run. h = shows this help.
The following parameters must be provided to the script for each servlet container:
- -a <app directory> : is the folder where applications are stored in the container
- -s <lib directory> : is the folder where the shared libraries of the container are stored.
In the common case in which the servlet container is Tomcat, however, the single setting:
- -s tomcat
will suffice, provided the environment variable
CATALINA_HOME is correctly set.
Other optional parameters include:
- -s <distro directory>: specifies the folder where the Smargears distribution has been downloaded.
- -g <gHN directory> : specifies the gHN folder if not provided trough GHN_HOME var
- -x : perform a dry run : checks that the specified options are fine without performing a real installation
An existing SmartGears installation can be upgraded with the
download script, which contacts the gCube Nexus Repository. The script is available in
$GHN_HOME/scipts/download and it offers the following options:
usage: download [-v <version>] [-o <folder>] [-s|-h] <version> = the version to download. = By default, this is the latest known version. s = download a snapshot version. <folder> = download to specific folder. h = shows this help.
SmartGears stores on disk the information it publishes in the gCube Information System, including hosting node and endpoint profiles. In particular:
- the profile of the hosting node is stored in the file
- endpoint profiles are stored in files of the following form:
Scripts are available that clean the state of the installation (both node and all or individual endpoint profiles). These scripts can be used when reinstalling SmartGears or during development.
Clean Node State
$GHN_HOME/scripts/clean-container-state cleans the entire state of the installation:
usage: clean-container-state [-g <ghn_home>] [-h] <ghn_home> = the gHN directory. h = shows this help.
Clean Endpoint State
$GHN_HOME/scripts/clean-app-state cleans the state of a single endpoint:
usage: clean-app-state -a <app_name> [-g <ghn_home>] [-h] <app-name> = the application name whose state has to be cleaned <ghn_home> = the gHN directory. h = shows this help.
Configuring the Environment
The only environment-level configuration needed by SmartGears is the
GHN_HOME variable, as discussed above.
in the case of Tomcat installation some variables can be usefully added to the env. Assuming a bash shell:
export CATALINA_OPTS="-Xmx2000m -Xms2000m" export CATALINA_PID=~/pid.txt
In some cases it could be needed to increase the maximum permanent generation size, so that the VM can hold additional classes. Assuming a bash shell:
Configuring the Hosting Node
The runtime configuration of SmartGears is found in the file
The following configuration properties are available:
|| either |
||the hostname of the hosting node to be published on the infrastructure.|
||the port of the hosting node to be published on the infrastructure.|
|| the name of the infrastructure in which the hosting nodes operates. (e.g. |
||the VO[s] that the hosting nodes joins.|
||an alternative folder where the state of the hosting node and apps state are maintained.|
||an arbitrary property with name/value attributes|
||the two-character ISO code of the Country where the hosting node is located.|
||the name of the location.|
||the longitude of the hosting node.|
||the latitude of the hosting node.|
||how often the hosting node refreshes its profile on the IS (in seconds).|
an example of configuration file can be found at 
Please refer to the SmartGears development guide section on logging