Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.
Difference between revisions of "Karaf Remote Management with Eclipse"
Line 24: | Line 24: | ||
Hit '<ctrl-d>' or type 'system:shutdown' or 'logout' to shutdown Karaf. | Hit '<ctrl-d>' or type 'system:shutdown' or 'logout' to shutdown Karaf. | ||
− | # 1 | + | # 1. Add the ECF Karaf Remote Management Repo |
− | + | ||
− | + | ||
− | + | ||
karaf@root()> feature:repo-add http://download.eclipse.org/rt/ecf/karafmgr/karaf4-features.xml | 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 | Adding feature url http://download.eclipse.org/rt/ecf/karafmgr/karaf4-features.xml | ||
− | # | + | # 2. Install the Remote Management Feature |
karaf@root()> feature:install -v ecf-karaf-mgrs | karaf@root()> feature:install -v ecf-karaf-mgrs | ||
</pre> | </pre> | ||
Line 36: | Line 33: | ||
This should take a few moments but then print out the downloaded/installed bundles, and then print out the EndpointDescriptions of the remote services exported. | This should take a few moments but then print out the downloaded/installed bundles, and then print out the EndpointDescriptions of the remote services exported. | ||
− | The default is set to use the | + | # 3. 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: |
<pre> | <pre> | ||
Line 54: | Line 51: | ||
<pre> | <pre> | ||
− | Name: ECF 3.13.4 | + | Name: ECF 3.13.4 |
− | Location: http://download.eclipse.org/rt/ecf/ | + | Location: http://download.eclipse.org/rt/ecf/3.13.4/site.p2 |
</pre> | </pre> | ||
Revision as of 21:06, 13 January 2017
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
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. 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 # 2. Install the Remote Management 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 remote services exported.
- 3. 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:
karaf@root()> property -p service.exported.configs ecf.generic.server karaf@root()> property -p ecf.generic.server.id ecftcp://localhost:3289/server
After setting these properties, stop and restart Karaf (i.e. karaf@root()>shutdown and then restart).
When Karaf restarts, it should export the 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.4 Location: http://download.eclipse.org/rt/ecf/3.13.4/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
Click on the rightmost green plus sign in the Remote OSGi Bundles view to bring up the connect dialog
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.
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.