Gyrex/Administrator Guide/Software Installation
Gyrex supports installation of software into a running cluster. The implementation is based in p2 - the standard for software installation of OSGi bundles at Eclipse. Please make yourself familiar with p2 concepts.
In order to properly install software the following steps must be performed:
- Create p2 repository with artifacts to install (eg., using Maven Tycho or PDE Build)
- Deploy repository to a webserver so that's accessible via an URL.
- Add repository information in Gyrex
- Create software package in Gyrex containing the artifacts to install.
- Roll-out the software package.
In the OSGi console a
sw command is available which allows to perform a basic administration and handling of software installations.
osgi> help sw ---SoftwareConsoleCommands--- sw <cmd> [args] addPkg <id> - adds a package addRepo <id> <uri> [filter] - adds a repository addToPkg <packageId> <installableUnitId> [<installUnitVersion>] - adds an installable unit to a package ls repos|packages [filterString] - list repos or packages revoke <ID> - revokes a package rmFromPkg <packageId> <installableUnitId> [<installUnitVersion>] - removes an installable unit from a package rmPkg <id> - removes a package rmRepo <id> - removes a repository rollout <ID> - marks a package for rollout status - prints status information about the sw process update - updates the local node osgi>
The examples below will use the OSGi commands in order to perform the tasks.
Add repository information in Gyrex
In order to install software, you need to produce a p2 repository containing the artifacts to install. Repositories are the source of installation. In Gyrex, everything is installed from a repository. However, Gyrex does not know about any repositories by default. Therefore you need to configure the list of available repositories.
rmRepo commands should be used to add or remove p2 repositories.
The following command will add a repository using the id "myrepo" and the URL "http://myserver/myrepo/"
osgi> sw addRepo myrepo "http://myserver/myrepo/" repository added
Repository Node Filters
When adding repositories it's possible to specify a node filter. Such a filter can be used to limit the visibility of repositories to certain nodes. This is interesting in a multiple data center scenario when nodes in a specific region should use the repository located within their data center.
Another usage scenario is staging/testing/production repositories. Special "testing" nodes might see a testing repository which may contain newer information.
Once repositories are available it's possible to define packages which can then be rolled out to nodes.