Jump to: navigation, search

Difference between revisions of "Gyrex/Administrator Guide/Software Installation"

 
(3 intermediate revisions by the same user not shown)
Line 2: Line 2:
 
Gyrex supports installation of software into a running cluster. The implementation is based in [[Equinox/p2|p2]] - the standard for software installation of OSGi bundles at Eclipse. Please make yourself familiar with [[Equinox/p2/Concepts|p2 concepts]].
 
Gyrex supports installation of software into a running cluster. The implementation is based in [[Equinox/p2|p2]] - the standard for software installation of OSGi bundles at Eclipse. Please make yourself familiar with [[Equinox/p2/Concepts|p2 concepts]].
  
=== Repositories ===
+
In order to properly install software the following steps must be performed:
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.
+
# 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.
  
==== Adding and Removing Repositories using the Console ====
 
 
In the OSGi console a <code>sw</code> command is available which allows to perform a basic administration and handling of software installations.
 
In the OSGi console a <code>sw</code> command is available which allows to perform a basic administration and handling of software installations.
 
<pre>
 
<pre>
Line 11: Line 14:
 
---SoftwareConsoleCommands---
 
---SoftwareConsoleCommands---
 
   sw <cmd> [args]
 
   sw <cmd> [args]
     [...]
+
     addPkg <id> - adds a package
    ls repos|packages [filterString] - list repos or packages
+
    [...]
+
 
     addRepo <id> <uri> [filter] - adds a repository
 
     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
 
     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>  
 
osgi>  
 
</pre>
 
</pre>
  
The <code>addRepo</code> and <code>rmRepo</code> commands should be used to add or remove p2 repositories.
+
The examples below will use the OSGi commands in order to perform the tasks.
 +
 
 +
=== Add Repository Information ===
 +
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.
 +
 
 +
The <code>addRepo</code> and <code>rmRepo</code> commands should be used to add or remove p2 repositories.  
 +
 
 +
<small>The following command will add an Orbit p2 repository.</small>
 +
<pre>
 +
osgi> sw addRepo orbit-R20130118183705 "http://download.eclipse.org/tools/orbit/downloads/drops/R20130118183705/repository/"
 +
repository added
 +
osgi>
 +
</pre>
 +
 
 +
<small>The following commands will look for available artifacts in all configured repositories</small>
 +
<pre>
 +
osgi> sw ls artifacts
 +
Loading [...]
 +
Done loading. Searching...
 +
Found 392 artifacts:
 +
[...]
 +
osgi>
 +
</pre>
  
 
==== Repository Node Filters ====
 
==== Repository Node Filters ====
Line 26: Line 56:
  
 
Another usage scenario is staging/testing/production repositories. Special "testing" nodes might see a testing repository which may contain newer information.
 
Another usage scenario is staging/testing/production repositories. Special "testing" nodes might see a testing repository which may contain newer information.
 +
 +
=== Create Software Package ===
 +
Once repositories are available it's possible to define packages which can then be rolled out to nodes. After creating the package, artifacts must be added to it.
 +
 +
<small>The following commands will create package using the id "myapplication" add the bundle 'org.apache.commons.pool' to it.</small>
 +
<pre>
 +
osgi> sw addPkg myapplication
 +
Package added. You should now add installation artifacts to it.
 +
 +
osgi> sw addToPkg myapplication org.apache.commons.pool
 +
package updated
 +
 +
osgi>
 +
</pre>
 +
 +
=== Package Roll-Out ===
 +
When the package is configured properly with all available artifacts it can be rolled out. Only packages marked for "rollout" will be installed on nodes. Packages marked as "revoke" will be de-installed.
 +
 +
<small>The following command will roll-out the package "myapplication".</small>
 +
<pre>
 +
osgi> sw rollout myapplication
 +
package marked for rollout
 +
 +
osgi> sw ls package myapplication
 +
Package myapplication
 +
  Is rolled out.
 +
  Will be installed on all nodes.
 +
  Contains the following artifacts:
 +
    org.apache.commons.pool (no version constraint)
 +
osgi>
 +
</pre>

Latest revision as of 11:23, 7 February 2013

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:

  1. Create p2 repository with artifacts to install (eg., using Maven Tycho or PDE Build)
  2. Deploy repository to a webserver so that's accessible via an URL.
  3. Add repository information in Gyrex
  4. Create software package in Gyrex containing the artifacts to install.
  5. 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 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.

The addRepo and rmRepo commands should be used to add or remove p2 repositories.

The following command will add an Orbit p2 repository.

osgi> sw addRepo orbit-R20130118183705 "http://download.eclipse.org/tools/orbit/downloads/drops/R20130118183705/repository/"
repository added
osgi> 

The following commands will look for available artifacts in all configured repositories

osgi> sw ls artifacts
Loading [...]
Done loading. Searching...
Found 392 artifacts:
[...]
osgi> 

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.

Create Software Package

Once repositories are available it's possible to define packages which can then be rolled out to nodes. After creating the package, artifacts must be added to it.

The following commands will create package using the id "myapplication" add the bundle 'org.apache.commons.pool' to it.

osgi> sw addPkg myapplication
Package added. You should now add installation artifacts to it.

osgi> sw addToPkg myapplication org.apache.commons.pool
package updated

osgi> 

Package Roll-Out

When the package is configured properly with all available artifacts it can be rolled out. Only packages marked for "rollout" will be installed on nodes. Packages marked as "revoke" will be de-installed.

The following command will roll-out the package "myapplication".

osgi> sw rollout myapplication
package marked for rollout

osgi> sw ls package myapplication
Package myapplication
  Is rolled out.
  Will be installed on all nodes.
  Contains the following artifacts:
     org.apache.commons.pool (no version constraint)
osgi>