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"
(→Install of Karaf Remote Management Services Host) |
(→Install of Karaf Remote Management Services Host) |
||
Line 3: | Line 3: | ||
[[File:Eclipserm1.png]] | [[File:Eclipserm1.png]] | ||
− | == | + | ==Installing Karaf Remote Management Services== |
Follow these instructions to install the ECF Remote Management Services. | Follow these instructions to install the ECF Remote Management Services. | ||
Line 45: | Line 45: | ||
After setting these properties, stop and restart Karaf (i.e. karaf@root()>shutdown and then restart). | After setting these properties, stop and restart Karaf (i.e. karaf@root()>shutdown and then restart). | ||
− | When Karaf restarts, it should export the [https://github.com/ECF/OSGIRemoteManagement/blob/master/bundles/org.eclipse.ecf.mgmt.framework/src/org/eclipse/ecf/mgmt/framework/IBundleManager.java IBundleManager], [https://github.com/ECF/OSGIRemoteManagement/blob/master/bundles/org.eclipse.ecf.mgmt.framework/src/org/eclipse/ecf/mgmt/framework/IServiceManager.java IServiceManager], and [https://github.com/ECF/OSGIRemoteManagement/blob/master/bundles/org.eclipse.ecf.mgmt.karaf.features/src/org/eclipse/ecf/mgmt/karaf/features/FeatureInstallManager.java FeatureInstallManager] remote management services. | + | When Karaf restarts, it should export the [https://github.com/ECF/OSGIRemoteManagement/blob/master/bundles/org.eclipse.ecf.mgmt.framework/src/org/eclipse/ecf/mgmt/framework/IBundleManager.java IBundleManager], [https://github.com/ECF/OSGIRemoteManagement/blob/master/bundles/org.eclipse.ecf.mgmt.framework/src/org/eclipse/ecf/mgmt/framework/IServiceManager.java IServiceManager], and [https://github.com/ECF/OSGIRemoteManagement/blob/master/bundles/org.eclipse.ecf.mgmt.karaf.features/src/org/eclipse/ecf/mgmt/karaf/features/FeatureInstallManager.java 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 | ||
+ | |||
+ | <pre> | ||
+ | Name: ECF 3.13.4 snapshot | ||
+ | Location: http://download.eclipse.org/rt/ecf/snapshot/site.p2 | ||
+ | </pre> | ||
+ | |||
+ | 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 | ||
+ | <pre> | ||
+ | Name: ECF Karaf Remote Management | ||
+ | Location: http://download.eclipse.ort/rt/ecf/karafmgr/eclipse | ||
+ | </pre> | ||
+ | |||
+ | <b>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 | ||
+ | |||
+ | [[File:Eclipserm2a.png]] | ||
+ | |||
+ | Click on the rightmost green plus sign in the Remote OSGi Bundles view to bring up the connect dialog | ||
+ | |||
+ | [[File:Eclipserm3.png]] | ||
+ | |||
+ | If for the Karaf host you used: | ||
+ | |||
+ | <pre> | ||
+ | karaf@root()> property -p ecf.generic.server.id ecftcp://localhost:3289/server | ||
+ | </pre> | ||
+ | |||
+ | 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. | ||
+ | |||
+ | [[File: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. | ||
+ | |||
+ | |||
+ | |||
+ | and follow the install through until installed. After Eclipse restart, go back to |
Revision as of 21:40, 2 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. Install the Service Component Runtime and Webconsole karaf@root()> feature:install scr karaf@root()> feature:install webconsole # 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 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.
The default is set to use the XMPP remote services provider. 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 snapshot Location: http://download.eclipse.org/rt/ecf/snapshot/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.
and follow the install through until installed. After Eclipse restart, go back to