1 / 22

Deployment with Karaf and ACE

Deployment with Karaf and ACE. Jean-Baptiste Onofré, Talend jbonofre@apache.org, 2011-11-11. Summary. Background Introduction to Karaf Introduction to ACE ACE and Karaf Use case 1: standalone ACE server and Karaf with ACE agent (demo) Use case 2: Karaf hosting ACE server Roadmap Q&A.

naomi
Download Presentation

Deployment with Karaf and ACE

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Deployment with Karaf and ACE Jean-Baptiste Onofré, Talendjbonofre@apache.org, 2011-11-11

  2. Summary • Background • Introduction to Karaf • Introduction to ACE • ACE and Karaf • Use case 1: standalone ACE server and Karaf with ACE agent (demo) • Use case 2: Karaf hosting ACE server • Roadmap • Q&A

  3. My Background • Jean-Baptiste Onofré • Software Architect at Talend • ASF Member • PMC for Karaf, ServiceMix • Committer for ACE, Camel, Kalumet

  4. Introduction to Karaf • Lightweight complete OSGi container, abstracting the OSGi framework (Felix or Equinox) • Comes from ServiceMix Kernel • High adoption (Geronimo, ServiceMix, …)

  5. Karaf overview Enterprise (JPA, JNDI, JTA) WebConsole WebContainer (Pax Web/Jetty) Instances Remote & Management ConfigAdmin Security/JAAS Shell Console Logging Deployers Features Aries Blueprint / Spring OSGi framework (Apache Felix / Eclipse Equinox) JVM

  6. Karaf directory structure • /bin: startup scripts • /etc: configuration files (ConfigAdmin) • /data: working directory • /data/cache: OSGi framework bundle cache • /data/generated-bundles: temporary folder used by the deployer • /data/log: log files • /deploy: hot deploy directory • /instances: directory containing child instances • /lib: contains the bootstrap libraries • /lib/ext: directory for JRE extensions • /lib/endorsed: directory for endorsed libraries • /system: OSGi bundles repository (OBR), laid out as a Maven 2 repository

  7. Karaf start/stop • Starting Karaf with the shell: > ./bin/karaf • Starting Karaf without shell: > ./bin/karaf server • Starting Karaf in background: > ./bin/start • Stopping Karaf: karaf@root> osgi:shutdown > ./bin/stop

  8. Karaf shell console • Complete Unix-like shell environment: completion, grep, more, find, etc • Remote using SSH (Karaf uses Mina SSHd) • Contextual help on commands: karaf@root> <tab>Display all 182 possibilities? (y or n) *:help addurl admin:change-opts admin:change-rmi-registry-port admin:change-ssh-port admin:connect admin:create admin:destroy admin:list admin:rename admin:start admin:stop bundle-level cancel cat … karaf@root> features:list --help

  9. Karaf Logging • Powerful logging system powered by OPS4J PAX Logging • Supports several logging API: Apache Commons Logging, SLF4J, Apache Log4j, Java Util Logging • Karaf provides commands: log:display, log:display-exception, log:set • Use of etc/org.ops4j.pax.logging.cfg by default (changes are dynamic)

  10. Karaf child instances • Karaf supports multiple child instances. • A child instance is a copy that you can launch separately and deploy applications into. An instance is not a full copy of Karaf, but only a copy of the configuration files and data folder which contains all the runtime information, logs and temporary files • Instances are managed by the « admin » commands: admin:list, admin:create, admin:start, ... • The bin/admin script allows you to manipulate child instances outside a Karaf shell environment • Karaf supports multiple child instances. • A child instance is a copy that you can launch separately and deploy applications into. An instance is not a full copy of Karaf, but only a copy of the configuration files and data folder which contains all the runtime information, logs and temporary files • Instances are managed by the « admin » commands: admin:list, admin:create, admin:start, ... • The bin/admin script allows you to manipulate child instances outside a Karaf shell environment

  11. Karaf configuration • Karaf combines ConfigAdmin and FileInstance to be able to propagate changes on the configuration files to the bundles • Files in /etc folder are used to set the startup configuration. • For dynamic configuration, Karaf provides commands to administer the OSGi configuration service: config:edit, config:proplist, etc • Support of commit and rollback: config:update, config:cancel • Provides an MBean dedicated for configuration.

  12. Karaf deployers • Karaf monitor the deploy folder by default (FileInstall) and delegates the polled files to the deployers • A deployer is simply a bundle, easy to create • Karaf provides several deployer: Spring, Feature, Kar, War, Wrap

  13. Karaf features • Karaf provisioning is made by Features • A Karaf feature is a collection of bundles, configuration, and others features forming an application • Features are described in a XML features descriptor <features xmlns='http://karaf.apache.org/xmlns/features/v1.0.0'> <feature name='my' version='1.0'> <feature>other</feature> <bundle>mvn:...bundleA</bundle> <bundle>http:...bundleB</bundle> <config></config> <configfile></configfile> </feature> </features>

  14. Introduction to ACE • Software distribution framework providing • Handle dependency management • Deployment management • Log reporting

  15. ACE topology • ACE server including repository, distribution, etc • A set of target system where the ACE agent is running • A client (browser or REST) to handle the ACE server console

  16. ACE logical grouping • ACE feature is like a Karaf feature but only handling bundles: it's a group of bundles • ACE distribution is a group of features • ACE target is where the ACE agent is running: it's where distributions will be deployed

  17. ACE and Karaf • ACE provides Karaf features • ACE agent easily deployable in Karaf using the ace-agent feature • ACE also provides all Karaf features to deploy the ACE server in Karaf

  18. Use case 1 • Standalone ACE server: unzip org.apache.ace.target.devserver*.zip cd ace-devserver ./run.sh • Install ACE agent in Karaf: karaf@root> admin:create testing karaf@root> admin:set-opts testing “-Didentification=testing” karaf@root> admin:connect testing karaf@testing> features:addurl mvn:org.apache.ace.karaf/apache-ace/0.8.1-incubator-SNAPSHOT/xml/features karaf@testing> features:install ace-agent Started management agent. Target ID : testing Server : http://localhost:8080 Sync interval: 2000 ms Unaffected bundles will not be stopped during deployment.

  19. Use case 2 • ACE server distribution powered by Karaf: root@karaf> features:addurl mvn:org.apache.ace.karaf/apache-ace/0.8.1-incubator-SNAPSHOT/xml/features root@karaf> features:install ace-server • Will be in the ACE provided distributions

  20. Roadmap • Extend/enhance ACE feature/distribution to be able to directly support Karaf features • Leverage Karaf sub-projects in ACE: Karaf Cellar clustering, Karaf Cave OBR • Embed ACE in Apache Kalumet to provide a complete deployment platform (OSGi, J2EE, OS, etc)

  21. Sources Links • http://karaf.apache.org • http://incubator.apache.org/ace • http://Incubator.apache.org/kalumet

  22. Contact • Jean-Baptiste (JB) Onofré • jbonofre@apache.org • jbonofre@talend.com • http://blog.nanthrax.net Q&A

More Related