Jump to: navigation, search

Karaf Remote Management with Eclipse

It's now possible to use Eclipse view to remotely manage a Karaf instance. By 'remotely manage' what is currently possible is to monitor, start, and stop the bundles, monitor the OSGi services registered in the Karaf runtime, and remotely install, and uninstall Karaf features...all through an Eclipse-based user interface

Eclipserm1.png

Installing Karaf Remote Management Services

Follow these instructions to install the ECF Remote Management Services.

Install Karaf 4.0.8 using Java 8 vm.

Start Karaf

        __ __                  ____
       / //_/____ __________ _/ __/
      / ,<  / __ `/ ___/ __ `/ /_
     / /| |/ /_/ / /  / /_/ / __/
    /_/ |_|\__,_/_/   \__,_/_/

  Apache Karaf (4.0.8)

Hit '<tab>' for a list of available commands
and '[cmd] --help' for help on a specific command.
Hit '<ctrl-d>' or type 'system:shutdown' or 'logout' to shutdown Karaf.

# 1.  The default is set to use the MQTT remote services provider (based upon Paho 3.1).   To change to use the ECF generic provider, in the 
# Karaf console type the following.   To use the MQTT provider, skip the following two commands:
karaf@root()> property -p service.exported.configs ecf.generic.server
karaf@root()> property -p ecf.generic.server.id ecftcp://localhost:3289/server

# 2. Add the ECF Karaf Remote Management Repo
karaf@root()> feature:repo-add http://download.eclipse.org/rt/ecf/karafmgr/karaf4-features.xml
Adding feature url http://download.eclipse.org/rt/ecf/karafmgr/karaf4-features.xml
# 3. Install the Karaf Remote Managers Feature
karaf@root()> feature:install -v ecf-karaf-mgrs

This should take a few moments but then print out the downloaded/installed bundles, and then print out the EndpointDescriptions of the 3 exported remote services.

IBundleManager, IServiceManager, and FeatureInstallManager remote management services. Thesse remote services may now be accessed from an Eclipse user interface as described below

Installing Eclipse Karaf Remote Management UI

To access the Karaf Remote Management UI, install Eclipse Neon.2 with Java 8.

In Eclipse, go to the Help->Install New Software..., select the Add... button on the right and enter

Name:  ECF 3.13.5
Location:   http://download.eclipse.org/rt/ecf/3.13.5/site.p2

Select 'ECF Remote Services SDK' and 'ECF SDK for Eclipse' and follow through until installed.

After restart, go back to Help->Install New Software..., select the Add... button and enter

Name:  ECF Karaf Remote Management
Location:  http://download.eclipse.ort/rt/ecf/karafmgr/eclipse

Unselect the 'Group items by category' check box toward the bottom, select 'ECF Remote Management API Feature' and 'ECF Remote Management Eclipse Consumer Feature', and follow through to complete the installation.

After Eclipse restart, goto to the Remote Services perspective

Eclipserm2a.png

Click on the rightmost green plus sign in the Remote OSGi Bundles view to bring up the connect dialog

Eclipserm3.png

If for the Karaf host you used:

   karaf@root()> property -p ecf.generic.server.id ecftcp://localhost:3289/server

then the defaults of 'localhost' and 3289 can be used and selecting Ok will make the connection. If you used other values for hostname and port in the ecftcp://<hostname>:<port>/server, then those can be used to connect.

Then after a few seconds, the remote bundles and services should be listed.

Eclipserm1.png

In each of the views selecting one of the elements will show the properties in the properties view...e.g. for bundles the properties are the manifest entries for that bundle, for services the service property name/values, and for Karaf Features the repo or feature properties.

For the Karaf Features view and the Remote OSGi Bundles view the context menu will allow operations to be performed...e.g. in the Karaf Features view a repo may be added, and features installed or uninstalled. Be cautious, as uninstalling ECF or necessary features may make the remote management disconnect, or even make the Karaf instance unusable.

For the Remote OSGi Bundles view individual bundles may be stopped, started, or uninstalled.