LibraryToggle FramesPrintFeedback

Create Fabric Profiles

Overview

A profile is the basic unit of deployment in a fabric. You can deploy one or more profiles to a container, and the content of those deployed profiles determines what is installed in the container.

Contents of a profile

A profile encapsulates the following kinds of information:

  • The URL locations of features repositories

  • A list of features to install

  • A list of bundles to install (or, more generally, any suitable JAR package—including OSGi bundles, Fuse Application Bundles, and WAR files)

  • A collection of configuration settings for the OSGi Config Admin service

  • Java system properties that affect the Apache Karaf container (analogous to editing etc/config.properties)

  • Java system properties that affect installed bundles (analogous to editing etc/system.properties)

Base profile

Profiles support inheritance. This can be useful in cases where you want to deploy a cluster of similar servers—for example, where the servers differ only in the choice of IP port number. For this, you would typically define a base profile, which includes all of the deployment data that the servers have in common. Each individual server profile would inherit from the common base profile, but add configuration settings specific to its server instance.

Create a base profile

To create the gs-cxf-base profile, follow these steps:

  1. Create the gs-cxf-base profile by entering this console command:

    karaf@root> fabric:profile-create --parents cxf gs-cxf-base
  2. Add the get-started features repository (see Define a Feature for the Application) to the gs-cxf-base profile by entering this console command:

    karaf@root> profile-edit -r mvn:org.fusesource.example/get-started/1.0-SNAPSHOT/xml/features gs-cxf-base
  3. Now add the get-started-cxf feature (which provides the Web service example server) to the gs-cxf-base profile. Enter the following console command:

    karaf@root> profile-edit --features get-started-cxf gs-cxf-base

Create the derived profiles

You create two derived profiles, gs-cxf-01 and gs-cxf-02, which configure different IP ports for the Web service. To do so, follow these steps:

  1. Create the gs-cxf-01 profile—which derives from gs-cxf-base—by entering this console command:

    karaf@root> profile-create --parents gs-cxf-base gs-cxf-01
  2. Create the gs-cxf-02 profile—which derives from gs-cxf-base—by entering this console command:

    karaf@root> profile-create --parents gs-cxf-base gs-cxf-02
  3. In the gs-cxf-01 profile, set the portNumber configuration property to 8185, by entering this console command:

    karaf@root> profile-edit -p org.fusesource.example.get.started/portNumber=8185 gs-cxf-01
  4. In the gs-cxf-02 profile, set the portNumber configuration property to 8186, by entering this console command:

    karaf@root> profile-edit -p org.fusesource.example.get.started/portNumber=8186 gs-cxf-02
Comments powered by Disqus