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.
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)
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.
To create the gs-cxf-base profile, follow these steps:
Create the
gs-cxf-baseprofile by entering this console command:karaf@root> fabric:profile-create --parents cxf gs-cxf-base
Add the
get-startedfeatures repository (see Define a Feature for the Application) to thegs-cxf-baseprofile by entering this console command:karaf@root> profile-edit -r mvn:org.fusesource.example/get-started/1.0-SNAPSHOT/xml/features gs-cxf-base
Now add the get-started-cxf feature (which provides the Web service example server) to the
gs-cxf-baseprofile. Enter the following console command:karaf@root> profile-edit --features get-started-cxf gs-cxf-base
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:
Create the
gs-cxf-01profile—which derives fromgs-cxf-base—by entering this console command:karaf@root> profile-create --parents gs-cxf-base gs-cxf-01
Create the
gs-cxf-02profile—which derives fromgs-cxf-base—by entering this console command:karaf@root> profile-create --parents gs-cxf-base gs-cxf-02
In the
gs-cxf-01profile, set theportNumberconfiguration property to 8185, by entering this console command:karaf@root> profile-edit -p org.fusesource.example.get.started/portNumber=8185 gs-cxf-01
In the
gs-cxf-02profile, set theportNumberconfiguration property to 8186, by entering this console command:karaf@root> profile-edit -p org.fusesource.example.get.started/portNumber=8186 gs-cxf-02








