LibraryPrintFeedback

Console Reference

7.1

December 2012
Trademark Disclaimer
Third Party Acknowledgements

Updated: 07 Jan 2014

Table of Contents

1. Using the Command Console
2. Shell Console Commands
shell:cat — displays the contents of a file or URL
shell:clear — clears the console buffer
shell:each — execute a closure on a list of arguments
shell:echo — prints arguments to the standard output
shell:exec — executes system processes
shell:grep — displays lines matching a regular expression
shell:head — displays the first lines of a file
shell:history — prints the command history
shell:if — executes an if/then/else block
shell:info — displays system information and statistics about the container
shell:java — execute a Java application
shell:logout — disconnects the shell from the current session
shell:more — displays output as pages of a specified length
shell:new — creates a new Java object of the specified class
shell:printf — formats and prints the specified output
shell:sleep — sleeps for a specified time, then wakes up
shell:sort — writes a sorted concatenation of the specified files to standard output
shell:source — run a shell script
shell:tac — captures the STDIN and returns it as a string and optionally writes the content to a file
shell:tail — displays the last lines of a file
shell:watch — watches and refreshes the output of a command
3. ActiveMQ Console Commands
activemq:browse — displays messages on a specified destination
activemq:bstat — summarizes the statistics for a broker
activemq:list — lists all available brokers in the specified JMX context
activemq:purge — purges messages from a destination
activemq:query — queries the for broker information on specific objects
4. Admin Console Commands
admin:change-opts — changes the Java options of an existing container
admin:change-rmi-registry-port — changes the RMI registry port used by the management layer of a container
admin:change-rmi-server-port — changes the RMI server port used by the management layer of a container
admin:change-ssh-port — changes the secure shell port of a container
admin:clone — clones an existing container instance
admin:connect — connects to an existing container
admin:create — creates a new child container
admin:destroy — destroys a child container
admin:list — list all of the child containers on the current host
admin:rename — renames a child container
admin:start — starts a child container
admin:stop — stops a child container
5. Config Console Commands
config:cancel — cancels the changes to the configuration being edited
config:delete — deletes a configuration from the container
config:edit — begins an editing session for a configuration. If the configuration does not exist a new configuration is created.
config:list — lists the existing configurations for the container
config:propappend — appends the given value to an existing property or creates the property with the specified name and value
config:propdel — deletes a property from the configuration being edited
config:proplist — lists the properties in the configuration being edited
config:propset — sets a property in the configuration being edited
config:update — saves the changes made to the configuration being edited and propagates then to the container
6. Dev Console Commands
dev:classloaders — displays a list of leaking bundle classloaders
dev:create-dump — creates a ZIP file containing diagnostic information
dev:dynamic-import — enables/disables dynamic imports for a bundle
dev:framework — enables/disables debugging for an OSGi framework
dev:print-stack-traces — enables/disables printing of full stack traces in the console when the execution of a command throws an exception
dev:restart — restart the container
dev:show-tree — shows the tree of bundles based on the wiring information
dev:threads — shows the threads in the JVM
dev:wait-for-service — wait for the specified OSGi service
dev:watch — watches and automatically updates bundles
7. Fuse Application Bundle(FAB) Console Commands
fab:headers — displays the headers of a FAB
fab:info — display information about a FAB, including the list of shared and unshared dependencies, and the list of features installed as part of the FAB resolution process
fab:start — starts the specified FAB
fab:stop — stops the specified FAB bundle together with its shared transitive dependencies, except for those dependencies that are being used by other bundles.
fab:tree — displays the dependency tree of a FAB
fab:uninstall — uninstall the specified FAB and all of its transitive dependencies, except for those dependencies that are being used by other bundles
8. Fabric Console Commands
fabric:cluster-list — lists the members of a Fuse MQ Enterprise cluster
fabric:cloud-firewall-edit — manage a cloud container's firewall
fabric:cloud-service-add — initialize a cloud provider (which can be used for provisioning containers in the cloud)
fabric:cloud-service-list — list the configured cloud providers
fabric:cloud-service-remove — removes the specified cloud provider
fabric:container-add-profile — Adds the specified list of profiles to a container
fabric:container-connect — connects to a remote Fabric Container and execute the specified command
fabric:container-create — creates one or more Fabric Containers
fabric:container-create-child — create one or more child containers
fabric:container-create-cloud — creates one or more new containers on the cloud
fabric:container-create-ssh — creates one or more new containers through SSH
fabric:container-delete — stops and deletes a Fuse Container
fabric:container-domains — lists a container's JMX domains
fabric:container-list — lists the containers in a fabric
fabric:container-remove-profile — removes the specified list of profiles from the container
fabric:container-resolver-list — show the resolver policies for the specified containers
fabric:container-resolver-set — specifies how the container reports its address to other containers
fabric:container-rollback — roll back the specified containers to an older version
fabric:container-start — start the specified container
fabric:container-stop — shuts down the specified container
fabric:container-upgrade — upgrade the specified containers to a new version
fabric:create — creates a new fabric and imports fabric profiles
fabric:ensemble-add — extend the current Fabric Ensemble by converting the specified containers into Fuse Servers
fabric:ensemble-list — lists the Fuse Servers in the current Fabric Ensemble
fabric:ensemble-password — display the ensemble password
fabric:ensemble-remove — remove the specified containers from the current ensemble
fabric:export — export the contents of the Fabric Registry to the specified directory in the filesystem
fabric:import — import data either from a filesystem or from a properties file into the Fabric Registry
fabric:join — join a container to an existing fabric
fabric:mq-create — create a new broker profile
fabric:profile-change-parents — replace the profile's parents with the specified list of parents (where the parents are specified as a space-separated list)
fabric:profile-create — create a new profile with the specified name and version
fabric:profile-delete — delete the specified version of the specified profile (where the version defaults to the current default version)
fabric:profile-display — displays information about the specified version of the specified profile (where the version defaults to the current default version)
fabric:profile-edit — edits the specified version of the specified profile (where the version defaults to the current default version)
fabric:profile-list — lists all profiles that belong to the specified version (where the version defaults to the current default version)
fabric:require-profile-delete — deletes requirements on the specified profile
fabric:require-profile-list — lists all profile requirements in the current fabric
fabric:require-profile-set — associates requirements with the specified profile
fabric:status — displays the current status of the fabric, based on the configured profile requirements
fabric:version-create — create a new version
fabric:version-delete — delete the specified version
fabric:version-list — lists the existing versions
fabric:version-set-default — set the new default version (must be one of the existing versions)
9. Features Console Commands
features:addurl — registers one or more URLs to feature repositories with the container
features:chooseurl — registers the feature repository URL for a well known project
features:info — show information about the specified feature with the optionally specified version
features:install — installs a feature
features:list — Lists all existing features available from the defined repositories
features:listurl — lists the features repository URLs
features:listVersions — lists all versions of a feature available from the current feature repositories
features:refreshUrl — reloads the list of available features from the repositories
features:removeUrl — removes the specified list of repository URLs from the features service
features:removeRepository — removes the specified repository from the features service
features:uninstall — uninstalls a feature with the specified name and version
10. JAAS Console Commands
jass:cancel — cancels a JAAS editing session without applying the pending changes
jaas:manage — opens a JAAS realm for editing
jaas:pending — lists the changes waiting to be applied to the realm being edited
jaas:realms — lists the JAAS realms know to the container
jaas:roleadd — adds a role to a user
jaas:roledel — deletes a role from a user
jaas:update — applies all pending changes to the JAAS realm and closes the editing session
jaas:useradd — adds a user to the JAAS realm being edited
jaas:userdel — deletes a user from the JAAS realm being edited
jaas:users — lists the users in the JAAS realm being edited
11. Log Console Commands
log:clear — clears the log
log:display — displays log entries
log:display-exception — displays the last thrown exception from the log
log:get — shows the log level
log:set — sets the log level
log:tail — continually displays log entries
12. OSGi Console Commands
osgi:bundle-level — gets or sets the start level of a given bundle
osgi:bundle-services — lists the OSGi services provided by a bundle
osgi:classes — lists all of the classes in the specified bundle or bundles
osgi:find-class — locates a specified class in any deployed bundle
osgi:headers — displays the headers of a specified OSGi bundle
osgi:info — displays detailed information about OSGi bundles
osgi:install — installs one or more OSGi bundles
osgi:list — lists the installed bundles whose start level equals or exceeds the specified threshold
osgi:ls — lists OSGi services
osgi:refresh — refreshes an OSGi bundle
osgi:resolve — resolves an OSGi bundle's dependencies
osgi:restart — stops and restarts an OSGi bundle
osgi:shutdown — stops the OSGi framework
osgi:start — starts an OSGi bundle
osgi:start-level — gets or sets the OSGi framework's active start level
osgi:stop — stops an OSGi bundle
osgi:uninstall — uninstalls an OSGi bundle
osgi:update — updates an OSGi bundle
13. Packages Console Commands
packages:exports — displays the packages exported OSGi bundles
packages:imports — displays the packages imported by OSGi bundles
14. Patch Console Commands
patch:add — download a patch file from a remote location and places the relevant JAR files in the container's system directory
patch:install — installs a patch that was previously downloaded
patch:list — lists all known patches, showing the patch name and status (installed or not)
patch:rollback — reverses a patch installation
patch:simulate — logs all of the actions that would be performed during a patch install, without actually performing the install
15. SSH Console Commands
ssh:ssh — connects to a remote SSH server
ssh:sshd — creates an SSH server
16. Web Console Commands
web:list — lists the WARs deployed in the container
17. ZooKeeper Console Commands
zk:create — create a znode
zk:delete — delete the specified znode
zk:get — get a znode's data
zk:list — list a znode's children
zk:set — set a znode's data
A. Command Aliases

List of Tables

1.1. Fuse MQ Enterprise Command Groups
2.1. shell:cat Arguments
2.2. shell:clear Arguments
2.3. shell:each Arguments
2.4. shell:echo Arguments
2.5. shell:exec Arguments
2.6. shell:grep Arguments
2.7. shell:head Arguments
2.8. shell:history Arguments
2.9. shell:if Arguments
2.10. shell:info Arguments
2.11. shell:java Arguments
2.12. shell:logout Arguments
2.13. shell:more Arguments
2.14. shell:new Arguments
2.15. shell:printf Arguments
2.16. shell:sleep Arguments
2.17. shell:sort Arguments
2.18. shell:source Arguments
2.19. shell:tac Arguments
2.20. shell:tail Arguments
2.21. shell:watch Arguments
3.1. activemq:browse Arguments
3.2. Message Headers for Filtering
3.3. activemq:bstat Arguments
3.4. activemq:list Arguments
3.5. activemq:purge Arguments
3.6. activemq:query Arguments
4.1. admin:change-opts Arguments
4.2. admin:change-rmi-registry-port Arguments
4.3. admin:change-rmi-server-port Arguments
4.4. admin:change-ssh-port Arguments
4.5. admin:clone Arguments
4.6. admin:connect Arguments
4.7. admin:create Arguments
4.8. admin:destroy Arguments
4.9. admin:list Arguments
4.10. admin:rename Arguments
4.11. admin:start Arguments
4.12. admin:stop Arguments
5.1. config:cancel Arguments
5.2. config:delete Arguments
5.3. config:edit Arguments
5.4. config:list Arguments
5.5. config:propappend Arguments
5.6. config:propdel Arguments
5.7. config:proplist Arguments
5.8. config:propset Arguments
5.9. config:update Arguments
6.1. dev:classloader Arguments
6.2. dev:create-dump Arguments
6.3. dev:dynamic-import Arguments
6.4. dev:framework Arguments
6.5. dev:print-stack-traces Arguments
6.6. dev:restart Arguments
6.7. dev:show-tree Arguments
6.8. dev:threads Arguments
6.9. dev:wait-for-service Arguments
6.10. dev:watch Arguments
7.1. fab:headers Arguments
7.2. fab:info Arguments
7.3. fab:start Arguments
7.4. fab:stop Arguments
7.5. fab:tree Arguments
7.6. fab:uninstall Arguments
8.1. fabric:cluster-list Arguments
8.2. fabric:cloud-firewall-edit Arguments
8.3. fabric:cloud-service-add Arguments
8.4. fabric:cloud-service-list Arguments
8.5. fabric:cloud-service-remove Arguments
8.6. fabric:container-add-profile Arguments
8.7. fabric:container-connect Arguments
8.8. fabric:container-create Arguments
8.9. fabric:container-create-child Arguments
8.10. fabric:container-create-cloud Arguments
8.11. fabric:container-create-ssh Arguments
8.12. fabric:container-delete Arguments
8.13. fabric:container-domains Arguments
8.14. fabric:container-list Arguments
8.15. fabric:container-remove-profile Arguments
8.16. fabric:container-resolver-list Arguments
8.17. fabric:container-resolver-set Arguments
8.18. fabric:container-rollback Arguments
8.19. fabric:container-start Arguments
8.20. fabric:container-stop Arguments
8.21. fabric:container-upgrade Arguments
8.22. fabric:create Arguments
8.23. fabric:ensemble-add Arguments
8.24. fabric:ensemble-list Arguments
8.25. fabric:ensemble-password Arguments
8.26. fabric:ensemble-remove Arguments
8.27. fabric:export Arguments
8.28. fab:start Arguments
8.29. fabric:join Arguments
8.30. fabric:mq-create Arguments
8.31. fabric:profile-change-parents Arguments
8.32. fabric:profile-create Arguments
8.33. fabric:profile-delete Arguments
8.34. fabric:profile-display Arguments
8.35. fabric:profile-edit Arguments
8.36. fabric:profile-list Arguments
8.37. fabric:require-profile-delete Arguments
8.38. fabric:require-profile-list Arguments
8.39. fabric:require-profile-set Arguments
8.40. fabric:status Arguments
8.41. fabric:version-create Arguments
8.42. fabric:version-delete Arguments
8.43. fabric:version-list Arguments
8.44. fabric:version-set-default Arguments
9.1. features:addurl Arguments
9.2. features:chooseurl Arguments
9.3. features:info Arguments
9.4. features:install Arguments
9.5. features:list Arguments
9.6. features:listurl Arguments
9.7. features:listVersions Arguments
9.8. features:refreshUrl Arguments
9.9. features:removeUrl Arguments
9.10. features:removeRepository Arguments
9.11. features:uninstall Arguments
10.1. jaas:cancel Arguments
10.2. jaas:manage Arguments
10.3. jaas:pending Arguments
10.4. jaas:realms Arguments
10.5. jaas:roleadd Arguments
10.6. jaas:roledel Arguments
10.7. jaas:update Arguments
10.8. jaas:useradd Arguments
10.9. jaas:userdel Arguments
10.10. jaas:users Arguments
11.1. log:clear Arguments
11.2. log:display Arguments
11.3. log:display-exception Arguments
11.4. log:get Arguments
11.5. log:set Arguments
11.6. log:tail Arguments
12.1. osgi:bundle-level Arguments
12.2. osgi:bundle-services Arguments
12.3. osgi:classes Arguments
12.4. osgi:find-class Arguments
12.5. osgi:headers Arguments
12.6. osgi:info Arguments
12.7. osgi:install Arguments
12.8. osgi:list Arguments
12.9. osgi:ls Arguments
12.10. osgi:refresh Arguments
12.11. osgi:resolve Arguments
12.12. osgi:restart Arguments
12.13. osgi:shutdown Arguments
12.14. osgi:start Arguments
12.15. osgi:start-level Arguments
12.16. osgi:stop Arguments
12.17. osgi:uninstall Arguments
12.18. osgi:update Arguments
13.1. package:exports Arguments
13.2. package:imports Arguments
14.1. patch:add Arguments
14.2. patch:install Arguments
14.3. patch:list Arguments
14.4. patch:rollback Arguments
14.5. patch:simulate Arguments
15.1. ssh:ssh Arguments
15.2. ssh:sshd Arguments
16.1. web:list Arguments
17.1. zk:create Arguments
17.2. zk:delete Arguments
17.3. zk:get Arguments
17.4. zk:list Arguments
17.5. zk:set Arguments
A.1. Console Command Aliases

List of Examples

1.1. The Fuse MQ Enterprise Console
1.2. Console Help
1.3. Help for a Command
1.4. Console Commands
8.1. Executing a Command in a Remote Container
shell:cat — displays the contents of a file or URL
shell:clear — clears the console buffer
shell:each — execute a closure on a list of arguments
shell:echo — prints arguments to the standard output
shell:exec — executes system processes
shell:grep — displays lines matching a regular expression
shell:head — displays the first lines of a file
shell:history — prints the command history
shell:if — executes an if/then/else block
shell:info — displays system information and statistics about the container
shell:java — execute a Java application
shell:logout — disconnects the shell from the current session
shell:more — displays output as pages of a specified length
shell:new — creates a new Java object of the specified class
shell:printf — formats and prints the specified output
shell:sleep — sleeps for a specified time, then wakes up
shell:sort — writes a sorted concatenation of the specified files to standard output
shell:source — run a shell script
shell:tac — captures the STDIN and returns it as a string and optionally writes the content to a file
shell:tail — displays the last lines of a file
shell:watch — watches and refreshes the output of a command

The shell command group provides a number of commands that provide basic console functions such as displaying system information and showing the contents of files.

Type shell: then press Tab at the prompt to view the commands in this group.

activemq:browse — displays messages on a specified destination
activemq:bstat — summarizes the statistics for a broker
activemq:list — lists all available brokers in the specified JMX context
activemq:purge — purges messages from a destination
activemq:query — queries the for broker information on specific objects

The activemq commands allow you to view and manage the brokers and messages.

Type activemq: then press Tab at the prompt to view the available commands.

Name

activemq:browse, browse — displays messages on a specified destination

Synopsis

activemq:browse {--amqurl brokerURL} [--msgsel {msgsel...}] [--factory className] [--passwordFactory className] [--user username] [--password password] [--view {attr...}] [[-Vheader] | [-Vcustom] | [-Vbody]] [--version] [[--help] | [-h] | [-?]] destName

Name

activemq:query, query — queries the for broker information on specific objects

Synopsis

activemq:query [-QMBeanType=name] [-xQMBeanType=name] [--objname query] [--xobjname query] [--view {attr...}] [--jmxurl JMXUrl] [--pid PID] [-jmxuser userName] [-jmxpassword password] [-jmxlocal] [--version] [[--help] | [-h] | [-?]]

admin:change-opts — changes the Java options of an existing container
admin:change-rmi-registry-port — changes the RMI registry port used by the management layer of a container
admin:change-rmi-server-port — changes the RMI server port used by the management layer of a container
admin:change-ssh-port — changes the secure shell port of a container
admin:clone — clones an existing container instance
admin:connect — connects to an existing container
admin:create — creates a new child container
admin:destroy — destroys a child container
admin:list — list all of the child containers on the current host
admin:rename — renames a child container
admin:start — starts a child container
admin:stop — stops a child container

The admin commands allow you to create, manage and destroy container instances.

Type admin: then press Tab at the FuseMQkaraf:karaf@root> prompt to view the available commands.

config:cancel — cancels the changes to the configuration being edited
config:delete — deletes a configuration from the container
config:edit — begins an editing session for a configuration. If the configuration does not exist a new configuration is created.
config:list — lists the existing configurations for the container
config:propappend — appends the given value to an existing property or creates the property with the specified name and value
config:propdel — deletes a property from the configuration being edited
config:proplist — lists the properties in the configuration being edited
config:propset — sets a property in the configuration being edited
config:update — saves the changes made to the configuration being edited and propagates then to the container

The config commands are used for managing container configuration. The configuration data is edited in two stages. First the changes are queued until they are dynamically loaded into the container by executing the config:update command. A copy of the configuration is persisted to the file system in the container's etc folder.

When editing a configuration the commands are used as follows:

  1. Start the editing session for the specified configuration.

    config:edit

  2. Edits, or creates, a configuration.

    • config:proplist

      Lists the properties in the configuration.

    • config:propappend

      Append a new property to the configuration.

    • config:propset

      Sets the value for a configuration property.

    • config:propdel

      Deletes a property from the configuration.

  3. config:update

    Saves the changes and updates the containers using the configuration.

You can abandon an editing session using config:cancel.

Type config: then press Tab at the prompt to view the available commands.

dev:classloaders — displays a list of leaking bundle classloaders
dev:create-dump — creates a ZIP file containing diagnostic information
dev:dynamic-import — enables/disables dynamic imports for a bundle
dev:framework — enables/disables debugging for an OSGi framework
dev:print-stack-traces — enables/disables printing of full stack traces in the console when the execution of a command throws an exception
dev:restart — restart the container
dev:show-tree — shows the tree of bundles based on the wiring information
dev:threads — shows the threads in the JVM
dev:wait-for-service — wait for the specified OSGi service
dev:watch — watches and automatically updates bundles

The dev commands are a collection of utilities that are useful testing bundles in the container.

Type dev: then press Tab at the prompt to view the available commands.

Name

dev:wait-for-service, wait-for-service — wait for the specified OSGi service

Synopsis

dev:wait-for-service [--help] [[-t] | [--timeout]timeout] [[-e] | [--exception]] {serviceClassOrFilter}

fab:headers — displays the headers of a FAB
fab:info — display information about a FAB, including the list of shared and unshared dependencies, and the list of features installed as part of the FAB resolution process
fab:start — starts the specified FAB
fab:stop — stops the specified FAB bundle together with its shared transitive dependencies, except for those dependencies that are being used by other bundles.
fab:tree — displays the dependency tree of a FAB
fab:uninstall — uninstall the specified FAB and all of its transitive dependencies, except for those dependencies that are being used by other bundles

The fab commands are used for managing Fuse Application Bundle(FAB)s.

There is no dedicated install command for FABs. To install a FAB, use the osgi:install command combined with the fab: URL prefix. For example, to install the FAB mvn:org.fusesource.example/camel-example/1.0 use the following console command:

FuseMQ:karaf@root> osgi:install fab:mvn:org.fusesource.example/camel-example/1.0

Name

fab:headers — displays the headers of a FAB

Synopsis

fab:headers [--help] [--indent style] {URL}

fabric:cluster-list — lists the members of a Fuse MQ Enterprise cluster
fabric:cloud-firewall-edit — manage a cloud container's firewall
fabric:cloud-service-add — initialize a cloud provider (which can be used for provisioning containers in the cloud)
fabric:cloud-service-list — list the configured cloud providers
fabric:cloud-service-remove — removes the specified cloud provider
fabric:container-add-profile — Adds the specified list of profiles to a container
fabric:container-connect — connects to a remote Fabric Container and execute the specified command
fabric:container-create — creates one or more Fabric Containers
fabric:container-create-child — create one or more child containers
fabric:container-create-cloud — creates one or more new containers on the cloud
fabric:container-create-ssh — creates one or more new containers through SSH
fabric:container-delete — stops and deletes a Fuse Container
fabric:container-domains — lists a container's JMX domains
fabric:container-list — lists the containers in a fabric
fabric:container-remove-profile — removes the specified list of profiles from the container
fabric:container-resolver-list — show the resolver policies for the specified containers
fabric:container-resolver-set — specifies how the container reports its address to other containers
fabric:container-rollback — roll back the specified containers to an older version
fabric:container-start — start the specified container
fabric:container-stop — shuts down the specified container
fabric:container-upgrade — upgrade the specified containers to a new version
fabric:create — creates a new fabric and imports fabric profiles
fabric:ensemble-add — extend the current Fabric Ensemble by converting the specified containers into Fuse Servers
fabric:ensemble-list — lists the Fuse Servers in the current Fabric Ensemble
fabric:ensemble-password — display the ensemble password
fabric:ensemble-remove — remove the specified containers from the current ensemble
fabric:export — export the contents of the Fabric Registry to the specified directory in the filesystem
fabric:import — import data either from a filesystem or from a properties file into the Fabric Registry
fabric:join — join a container to an existing fabric
fabric:mq-create — create a new broker profile
fabric:profile-change-parents — replace the profile's parents with the specified list of parents (where the parents are specified as a space-separated list)
fabric:profile-create — create a new profile with the specified name and version
fabric:profile-delete — delete the specified version of the specified profile (where the version defaults to the current default version)
fabric:profile-display — displays information about the specified version of the specified profile (where the version defaults to the current default version)
fabric:profile-edit — edits the specified version of the specified profile (where the version defaults to the current default version)
fabric:profile-list — lists all profiles that belong to the specified version (where the version defaults to the current default version)
fabric:require-profile-delete — deletes requirements on the specified profile
fabric:require-profile-list — lists all profile requirements in the current fabric
fabric:require-profile-set — associates requirements with the specified profile
fabric:status — displays the current status of the fabric, based on the configured profile requirements
fabric:version-create — create a new version
fabric:version-delete — delete the specified version
fabric:version-list — lists the existing versions
fabric:version-set-default — set the new default version (must be one of the existing versions)

This chapter describes fabric console commands.

Name

fabric:cloud-service-add — initialize a cloud provider (which can be used for provisioning containers in the cloud)

Synopsis

fabric:cloud-service-add [--help] [--provider providerName] [--name name] [--api APIName] [--endpoint URL] [--identity accessKeyID] [--credential secretAccessKey] [--owner owner] [--option key=value] [--async-registration]

Description

This command runs asynchronously. That is, although the command returns immediately, it runs a thread in the background, which completes the initialization of the cloud provider. You can use fabric:cloud-service-list to discover when the initialization has completed.

There are two different styles of usage for this command:

  • Commercial cloud provider—if you are using a commercial cloud provider, JClouds provides prepackaged modules that encapsulate the basic connection details for the provider. The prepackaged modules are available to install as Karaf features (named jclouds-ProviderName) and encapsulate such details as the endpoint URI, cloud API, and so on.

    For example, to install an Amazon Web Services (AWS) EC2 cloud provider, you can perform the following steps (assuming you are working in a standalone container):

    1. Install the basic set of fabric cloud commands:

      karaf@root> features:install fabric-jclouds
    2. Install the JClouds module specifically for AWS EC2:

      karaf@root> features:install jclouds-aws-ec2
    3. Add the AWS EC2 provider, specifying the login credentials for your EC2 account:

      karaf@root> fabric:cloud-service-add --provider aws-ec2 --identity AccessKeyID
      --credential SecretAccessKey
    4. You are now ready to start creating compute instances on the aws-ec2 cloud service, using the fabric:container-create-cloud command.

  • Private cloud service—if you are hosting your compute instances on a private cloud service, you must specify the connection details more explicitly, by supplying the --api and --endpoint options. In this case, you must also define a name for the cloud service, by supplying the --name option.

    For example, to define a connection to a private cloud service that uses the openstack-nova API through the endpoint, http://172.16.0.1:4000/v2.0/, you can perform the following steps (assuming you are working in a standalone container):

    1. Install the basic set of fabric cloud commands:

      karaf@root> features:install fabric-jclouds
    2. Install the JClouds module for the openstack-nova API:

      karaf@root> features:install jclouds-api-openstack-nova
    3. Add the private cloud service, specifying the login credentials, API, and endpoint URL:

      karaf@root> fabric:cloud-service-add --name myOpenStack --api openstack-nova
      --endpoint http://172.16.0.1:4000/v2.0/ --identity AccessKeyID --credential SecretAccessKey
      [Note]Note

      You can provide additional customisation of the connection by setting options through the --option flag (which can appear multiple times in the command).

    4. You are now ready to start creating compute instances on the myOpenStack cloud service, using the fabric:container-create-cloud command.

Name

fabric:container-create, container-create — creates one or more Fabric Containers

Synopsis

fabric:container-create [--help] {[--parent ParentID] | [--url URL]} [--proxy-uri ProxyURI] [--ensemble-server] [--profile ProfileID] [--resolver policy] [--version Version] [--jvm-opts JvmOpts] {Name} [Number]

Examples

This command is a generic container create command. It combines the functionality of the fabric:container-create-child, fabric:container-create-cloud, and fabric:container-create-ssh commands. The type of container that is created, depends on the specified URL.

Child container

To create a child container, specify a URL in the following format:

child://ParentName

Where ParentName is the name of the child's parent container.

Cloud container

To create a cloud container, specify a URL in the following format:

jclouds://ProviderId?imageId=ImageID&locationId=LocationID&group=Group&user=User

For a detailed explanation of the options appearing in this URL, see fabric:container-create-cloud.

SSH container

To create an SSH container with username and password credentials, specify a URL in the following format:

ssh://User:Password@Host:Port

Where User and Password are the credentials for logging in to the machine at Host:Port, through the SSH protocol.

To create an SSH container with username and private key credentials, specify a URL in the following format:

ssh://User@Host:Port?privateKeyFile=KeyPath

Where KeyPath is the pathname of the private key file on the local filesystem.

Name

fabric:container-create-child — create one or more child containers

Synopsis

fabric:container-create-child [--help] [--ensemble-server] [--profile profileID] [--version version] [--jvm-opts jvmOpts] [--resolver policy] {parent} {name} [number]

Description

Child containers have the following characteristics:

  • Each child container has a parent, so that the child containers form a hierarchy, with the root container as the ultimate ancestor.

  • The child starts in a new JVM instance (JVM options can be passed to the new JVM through the --jvm-opts command option).

  • A complete set of data directories are created for the child instance, under the ESBInstallDir/instances/ChildName directory. The ESBInstallDir/system directory is shared with the root container.

For example, if you have already created a new fabric (for example, by invoking fabric:create), you could add some child containers to the root container by entering the following command:

karaf@root> fabric:container-create-child root child 3

This command creates three new children under the root container. To check that the containers have been successfully created, invoke the fabric:container-list command, as follows:

karaf@root> fabric:container-list
[id]                           [version] [alive] [profiles]                     [provision status]
root                           1.0       true    fabric, fabric-ensemble-0000-1 
  child1                       1.0       true    default                        success
  child2                       1.0       true    default                        success
  child3                       1.0       true    default                        success

As you can see, the command creates three new child containers, child1, child2, and child3, with the default profile. This containers are ordinary (non-ensemble) containers, running fabric agents (ZooKeeper clients).

If you do not explicitly specify any profile (or profiles) for the new child containers, each of the child containers is created with the OSGi bundles required for a minimal Apache Karaf container and all of the profiles and bundles specified by the default profile. In particular, the newly created containers do not contain all of the features and bundles associated with a full Fuse ESB Enterprise container. If you want a child container to deploy all of the bundles associated with a full Fuse ESB Enterprise container, you can explicitly associate the child with the esb profile, as follows:

fabric:container-create-child --profile esb root childESB

To associate multiple profiles with a new child container, you can specify the --profile option multiple times. For example, if you want to deploy your own application profile, myApp, together with the esb profile, you would use a command like the following:

fabric:container-create-child --profile esb --profile myApp root childMyApp

REVISIT - Does it make sense to use the --ensemble-server option with child containers?. Await feedback from Ioannis and Guillaume.

Name

fabric:container-create-cloud — creates one or more new containers on the cloud

Synopsis

fabric:container-create-cloud [--help] [--name contextName] [--provider cloudProvider] [--api cloudAPI] [--identity cloudIdentity] [--credential loginCredential] [--imageId imageID] [--os-family osFamily] [--os-version osVersion] [--hardwareId hardwareID] [--instanceType instanceType] [--locationId location] [--user userAcc] [--password userPass] [--public-key-file file] [--owner owner] [--group group] [--proxy-uri URI] [--ensemble-server] [--new-user jaasUser] [--new-user-password jaasUserPass] [--new-user-role jaasUserRole] [--zookeeper-password zooPass] [--resolver policy] [--min-port minPort] [--max-port maxPort] [--profile profileID] [--version version] [--jvm-opts jvmOpts] [--add-option key=value] [--no-admin-access] {Name} [Number]

Description

To access this command, you must have installed the fabric-jclouds feature. To install the fabric-jclouds feature, enter the following console command:

features:install fabric-jclouds

The fabric:container-create-cloud command provisions the container as follows:

  1. Creates a new node on the cloud provider. The node is created using a JClouds compute service: either by lookup in the service registry (using the provider ID as a property) or by instantiating a new node, by specifying the identity and credential of the provider.

  2. Connects to the created node, using the authentication metadata returned upon the node creation (this is usually a username and private key, where the username can be overridden by the --user option). After it connects to the node, it executes a script, which downloads the fabric distribution from the Maven proxy and untars the distribution.

    By default, the script uses the oldest Maven proxy server in the current ensemble (every ensemble server has a Maven proxy server deployed in it). You can optionally override the default Maven proxy by specifying the --proxy-uri option. The script would then use the specified Maven proxy server to download the container runtime.

    [Note]Note

    The ability to override the Maven proxy is important in certain cases (for example, in a cloud deployment) where the remote host might not be able to access the default Maven proxy server.

  3. Starts up the newly installed container (or containers) and installs the specified fabric profile (or profiles).

  4. When creating multiple containers using this command (by adding the Number argument), multiple nodes will be created and a root container will be installed on each node.

By default, the newly created cloud containers belong to the current fabric (that is, the same fabric as the container from which you invoked the command). It is possible, however, to create a container on the compute instance that acts as the seed for a completely new fabric, separate from the current one. To create a new fabric on the compute instance, invoke the fabric:container-create-cloud command with the --ensemble-server flag, which makes the newly created container (or containers) an ensemble server, with its own fabric registry agent. The newly created ensemble server on the cloud does not join the current ensemble: it belongs to an independent ensemble (a new fabric).

Arguments

Table 8.10 describes the command's arguments.

Table 8.10. fabric:container-create-cloud Arguments

ArgumentInterpretation
--help Displays the online help for this command
--name (Required) JClouds service context name.
--provider JClouds provider name.
--apiThe cloud API name.
--identity The identity used to access the cloud service.
--credential The credential used to access the cloud service.
--imageId The image ID to use for the new node(s). Alternatively, the image can be specified indirectly using the --os-family and --os-version options. Defaults to an instance of the latest version of Ubuntu.
--os-familySpecify the image by requesting a particular kind of operating system—for example, ubuntu or redhat. To see which O/S families are available, type Tab while entering this option. Defaults to ubuntu.
--os-versionSpecifies the version of the O/S family. The version number need not be exact (it will be rounded up to the latest available patch version). Defaults to the latest version available.
--hardwareIdKind of hardware to use.
--instanceType Type of instance required.
--locationId The location used to create the new node(s).
--user Specifies the O/S user account to run on the new nodes. If the user account does not already exist on the new nodes, it will automatically be created. Defaults to the username that matches the current user.
--passwordSpecifies the password associated with the O/S user account defined by the --user option.
--public-key-fileAn option to specify a public key file to copy to the created node. Copying a public key file to a node can be used for SSH access using public key authentication. If no key file is specified, Fabric attempts to auto-detect the user's public key and, if found, this key will be used by default.
--owner Optional owner of images; only really used for EC2, and will be deprecated in future.
--group Group tag to use on the new node(s). Defaults to fabric.
--proxy-uri URL of the Maven proxy server used to download the container runtime.
--ensemble-serverWhether the new container should be a Fabric Server (effectively creates a new fabric).
--new-user

Used in combination with the --ensemble-server option to ensure that at least one user exists in the JAAS realm of the Zookeeper login module for the new fabric (otherwise it would be impossible to connect to the newly created Fabric Server).

When using this option, you must also specify a password using the --new-user-password option.

--new-user-password Used in combination with the --new-user option and the --ensemble-server option to specify the new user's password. No default value.
--new-user-role Used in combination with the --new-user option and the --ensemble-server to specify the new user's role. Default is admin.
--zookeeper-password

Used in combination with the --ensemble-server option. Specifies the Zookeeper password, which is used to access the Zookeeper nodes under the /fabric/ path. Defaults to the password of the current session user.

If you subsequently try to join the current container to the newly-created Fabric Server (ensemble server) using the fabric:join command, you will be prompted to enter the Zookeeper password.

--resolverSpecifies how the container will report its address to other containers. Valid values are localip, localhostname, publicip, publichostname, manualip. For more information see fabric:container-resolver-set.
--min-port Specifies the minimum port number of the allowed IP port range. Default is 0.
--max-port Specifies the maximum port number of the allowed IP port range. Default is 65535.
--profileA list of profile IDs to associate with the new container.
--versionSpecifies the version of the new container (the version must be created in advance using fabric:version-create). Defaults to the current default version (use version-list to find the current default).
--jvm-optsSpecify options to pass to the container's JVM.
--add-optionSpecifies generic JCloud properties or provider-specify properties. For example, when using Amazon with Amazon VPC to create a container inside a VPN, you can specify --option subnetId=yoursubnetId to define the VPC subnet where you want the node to be created. If you want to specify more than one option, specify this option multiple times.
--no-admin-accessDisables admin access, as it might not be feasible on all images.
Name(Required) The name of the container to create. When creating multiple containers, it serves as a prefix.
NumberThe number of containers that should be created.

Name

fabric:container-create-ssh — creates one or more new containers through SSH

Synopsis

fabric:container-create-ssh [--help] [--host host] [--path path] [--user user] [--password password] [--private-key keyPath] [--port port] [--ssh-retries retries] [--proxy-uri URI] [--ensemble-server] [--profile profileID] [--version version] [--jvm-optsjvmOpts] [--resolver policy] {Name} [Number]

Description

Specifically, this command provisions the container as follows:

  1. Logs into the specified SSH host, using either the provided username and password or using the provided username and private key.

  2. Runs a script on the remote host that that downloads the container runtime to the remote host. The runtime files are downloaded through a Maven proxy server. By default, the script uses the oldest Maven proxy server in the current ensemble (every Fabric Server has a Maven proxy server deployed in it). You can optionally override the default Maven proxy by specifying the --proxy-uri option. The script would then use the specified Maven proxy server to download the container runtime.

    [Note]Note

    The ability to override the Maven proxy is important in certain cases (for example, in a cloud deployment) where the remote host might not be able to access the default Maven proxy server.

  3. Starts up the newly installed container (or containers) and installs the specified fabric profile (or profiles).

By default, the newly created containers belong to the current fabric (that is, the same fabric as the container from which you invoked the command). It is possible, however, to create a container on the remote host that acts as the seed for a completely new fabric, separate from the current one. To create a new fabric on the remote host, invoke the fabric:container-create-ssh command with the --ensemble-server flag, which makes the newly created container (or containers) a Fuse Server. The newly created Fuse Server on the remote host does not join the current ensemble: it belongs to an independent ensemble (a new fabric).

Arguments

Table 8.11 describes the command's arguments.

Table 8.11. fabric:container-create-ssh Arguments

ArgumentInterpretation
--help Displays the online help for this command
--host (Required) Host name to SSH into.
--path Path on the remote filesystem where the container is to be installed.
--user (Required) User name for login.
--password Password for login. If the password is omitted, private key authentication is used instead.
--private-key Specifies the path to the private key on the local file system. The default is ~/.ssh/id_rsa on *NIX platforms or C:\Documents and Settings\UserName\.ssh\id_rsa on Windows.
--port The IP port number for the SSH connection.
--ssh-retries Maximum number or times to retry SSH connection.
--proxy-uri URL of the Maven proxy server used to download the container runtime.
--ensemble-serverWhether the new container should be a Fabric Server.
--profileA list of profile IDs to associate with the new container.
--versionSpecifies the version of the new container (the version must be created in advance using fabric:version-create). Defaults to the current default version (use version-list to find the current default).
--jvm-optsSpecify options to pass to the container's JVM.
--resolverSpecifies how the container will report its address to other containers. Valid values are localip, localhostname, publicip, publichostname, manualip. For more information see fabric:container-resolver-set.
Name(Required) The name of the container to create. When creating multiple containers, it serves as a prefix.
NumberThe number of containers that should be created.

Name

fabric:container-resolver-set — specifies how the container reports its address to other containers

Synopsis

fabric:container-resolver-set [--help] [--container name] [--all] {Resolver}

Description

Apply the specified resolver policy to the specified container or containers, where the resolver policy can take one of the following values:

localip
localhostname
publicip
publichostname
manualip

The localip and localhostname resolver policies are suitable for accessing a container in a LAN. The publicip and publichostname resolver policies are suitable for accessing a container in a WAN (Internet), but they are typically only available for cloud containers. In the case of a the cloud, localip and localhostname can be used for container-to-container connections within the cloud, but for container-to-container connections from outside the cloud, you must use publicip or publichostname.

Fabric manages host addresses as follows:

  • When you create a new container, fabric tries to discover as much as it can about the container's host address and stores this information in the following fields in the fabric registry: localip (local IP address); localhostname (local hostname); publicip (public IP address); publichostname (public hostname).

    For example, if you create a new container using the fabric:container-create-ssh command and specify the local IP address to the --host option, fabric attempts to perform a reverse lookup to obtain the corresponding local hostname and then stores both the local IP address and the local hostname in the Fabric Registry.

    If you create a new container in the cloud, the metadata sent by the cloud provider typically includes a complete set of host addresses: localip, localhostname, publicip, and publichostname.

  • Every container in the fabric has its own resolver policy, which determines what kind of host address is returned to another container that wants to connect to it. The container's resolver policy is set in one of the following ways:

    • (Default) By inheriting the resolver policy from the global resolver policy (specified at the time the fabric is created)

    • By specifying the resolver policy explicitly at the time the container is created (through the --resolver option).

    • By invoking the fabric:container-resolver-set command.

  • The container's resolver policy is applied whenever fabric looks up the container's host address, irrespective of what protocol is involved. In particular, the resolver policy determines the form of the host address used in the following URLs:

    • Fabric Ensemble URL,

    • SSH URL (console client port),

    • Maven proxy URL,

    • JMX URL.

For example, if your fabric includes a container called SSH1 (originally created using the fabric:container-create-ssh command) and the SSH1 container is configured with the localip resolver policy, any container that tries to connect to SSH1 will automatically receive the local IP address of SSH1 when it looks up the Fabric Registry.

[Note]Note

A container's resolver policy only affects the host address returned when other containers want to connect to it. The container's own policy has no effect on how the container resolves the host addresses of the other containers. In other words, if containers X, Y, and Z want to connect to container SSH1, the form of host address they get is determined by SSH1's resolver policy. But if SSH1 wants to connect to container X, it is container X's resolver policy that is used.

Name

fabric:container-upgrade — upgrade the specified containers to a new version

Synopsis

fabric:container-upgrade [--help] [--all] {Version} [ContainerList]

Description

This command is typically used in combination with the fabric:profile-edit command to guarantee atomicity of profile modifications. That is, if multiple edits need to be made to a profile, you can use fabric:container-upgrade to roll out all of the changes in one step.

For example, consider the container, child1, which is currently assigned to version 1.0 and has the sample profile deployed inside it. If you need to make multiple changes to the sample profile, you can roll out these changes atomically, as follows:

  1. Create a new version, 1.1, to hold the pending changes, as follows:

    karaf@root> fabric:version-create
    Created version: 1.1 as copy of: 1.0
  2. Now start editing the new version of the sample profile, remembering to specify 1.1, so that the modifications are applied to version 1.1 of sample. For example, to add the camel-quartz feature to the sample profile, enter the following command:

    fabric:profile-edit --features camel-quartz sample 1.1
    [Note]Note

    Instead of adding the option 1.1 to every edit command, you could change the default version to 1.1 by entering the command, fabric:version-set-default 1.1.

  3. When you have finished editing the sample profile and you are ready to let the changes take effect on the container, child1, you can roll out the changes by upgrading the child1 container to version 1.1, as follows:

    fabric:container-upgrade 1.1 child1
  4. If you are not happy with the changes you made, you can easily roll back to the old version of the sample profile, using the fabric:container-rollback command, as follows:

    fabric:container-rollback 1.0 child1

Name

fabric:create — creates a new fabric and imports fabric profiles

Synopsis

fabric:create [--help] [--clean] [--no-import] [--import-dir dir] [[-v] | [--verbose]] [[-t] | [--time]millis] [[-n] | [--non-managed]] [[-p] | [--profile]profile] [--new-user username] [--new-user-password password] [--new-user-role role] [--zookeeper-password zooPassword] [--generate-zookeeper-password] [[-g] | [--global-resolver]policy] [[-r] | [--resolver]policy] [[-m] | [--manual-ip]ipAddress] [--min-port port] [--max-port port] [ContainerList]

Arguments

Table 8.22 describes the command's arguments.

Table 8.22. fabric:create Arguments

ArgumentInterpretation
--help Displays the online help for this command
--clean Clean local zookeeper cluster and configurations.
--no-import Disable the import of the sample registry data.
--import-dir Directory of files to import into the newly created ensemble.
-v, --verbose Flag to enable verbose output of files being imported.
-t, --time How long to wait (milliseconds) for the ensemble to start up, before trying to import the default data.
-n, --non-managedSpecifies that the container remains unmanaged.
-p, --profile Specifies the profile to use for the ensemble containers in the new fabric.
--new-user

Create a new user in the new fabric's JAAS realm. Because the fabric:create command automatically imports user data from the etc/users.properties file, you would only need to specify this option, if the etc/users.properties file contains no valid user entries.

When using this option, you must also specify a password using the --new-user-password option.

--new-user-password Used in combination with the --new-user option to specify the new user's password. No default value.
--new-user-role Used in combination with the --new-user option to specify the new user's role. Default is admin.
--zookeeper-password

Specifies the Zookeeper password, which is used to access the Zookeeper nodes under the /fabric/ path. Defaults to the password of the current session user.

Subsequently, because the Zookeeper password is cached in the current session, you normally do not need to provide it when executing fabric commands. You can display the Zookeeper password at any time using the fabric:ensemble-password command.

--generate-zookeeper-password Directs Fabric to generate a random Zookeeper password. Subsequently, you can display the Zookeeper password using the fabric:ensemble-password command.
-g, --global-resolver Specifies the global resolver policy, which becomes the default resolver policy applied to all new containers created in this fabric. Possible values are: localip, localhostname, publicip, publichostname, manualip. The default is localhostname.
-r, --resolver Specifies the local resolver policy. Possible values are: localip, localhostname, publicip, publichostname, manualip. The default is localhostname.
-m, --manual-ip If you select the manualip resolver policy (using either the --resolver or --global-resolver options), specifies the IP address to use for the resolver.
--min-port Specifies the minimum port number of the allowed IP port range. Default is 0.
--max-port Specifies the maximum port number of the allowed IP port range. Default is 65535.
ContainerList The list of containers to include in the ensemble. An empty list implies the current container.

Name

fabric:export — export the contents of the Fabric Registry to the specified directory in the filesystem

Synopsis

fabric:export [--help] [-d|--delete] [-p|--path path] [-f|--regex regex] [-rf|--reverse-regex regex] [-t|--trim] [--dry-run] {target}

Name

fabric:import — import data either from a filesystem or from a properties file into the Fabric Registry

Synopsis

fabric:import [--help] [-fs|--filesystem] [-props|--properties URL] [-t|--target path] [-d|--delete] [-f|--regex regex] [-rf|--reverse-regex regex] [-v|--verbose] [--dry-run] {source}

Name

fabric:join — join a container to an existing fabric

Synopsis

fabric:join [--help] [[-f] | [--force]] [[-p] | [--profile]Profile] [[-n] | [--non-managed]] [--zookeeper-password zooPassword] [[-r] | [--resolver]policy] [[-m] | [--manual-ip]ipAddress] [--min-port port] [--max-port port] URL [ContainerName]

Arguments

Table 8.29 describes the command's arguments.

Table 8.29. fabric:join Arguments

ArgumentInterpretation
--help Displays the online help for this command.
-f, --forceForces the provided container name to be used.
-p, --profileSpecifies the profile to associate with the container after it joins the fabric. The fabric profile, which installs the Fabric Agent, is automatically assigned to all managed containers.
-n, --non-managedRegisters the container with the fabric's ensemble, but does not install a Fabric Agent into the container. The container's configuration is not managed by the fabric and continues to behave like a standalone container except that it can be discovered through the fabric's ensemble.
--zookeeper-password The ensemble password for the fabric that you are trying to join. If you do not specify this option, you will be prompted to enter the password.
-r, --resolver Specifies the local resolver policy. Possible values are: localip, localhostname, publicip, publichostname, manualip. The default is localhostname.
-m, --manual-ip If you select the manualip resolver policy (using the --resolver option), specifies the IP address to use for the resolver.
--min-port Specifies the minimum port number of the allowed IP port range. Default is 0.
--max-port Specifies the maximum port number of the allowed IP port range. Default is 65535.
URL Specifies the URL of one of the Fabric Servers, specified in the format Host[:Port]. The Port value defaults to 2181.
ContainerNameSpecifies a unique name for the container to use when joining the fabric. By default, the value of the karaf.name property from the etc/system.properties file is used.

Name

fabric:mq-create — create a new broker profile

Synopsis

fabric:mq-create [--help] [--group groupName] [--networks brokerGroup,... ] [--create-container containerID,... ] [--assign-container containerID,... ] [--config configFile] [--data dataDir] [--version version] {name}

Name

fabric:profile-edit — edits the specified version of the specified profile (where the version defaults to the current default version)

Synopsis

fabric:profile-edit [--help] [[-p] | [--pid]PID] [[-r] | [--repositories] | [-f] | [--features] | [-b] | [--bundles] | [-c] | [--config] | [-s] | [--system]] [[--set] | [--delete]] [--import-pid] {Profile} [Version]

Description

In the specified profile, you can edit different kinds of settings, as follows:

  • Feature repository locations—to add a feature repository to the profile, enter a command in the following format:

    fabric:profile-edit --repositories RepoList Profile [Version]

    For example, to add the fuse-fabric feature repository to the profile, enter a command like the following:

    fabric:profile-edit --repositories mvn:org.fusesource.fabric/fuse-fabric/7.1.0.fuse-047/xml/features Profile [Version]

    To delete repositories, enter a command of the following form:

    fabric:profile-edit --delete --repositories RepoList Profile [Version]
  • Features to install—to add features to the profile, enter a command in the following format:

    fabric:profile-edit --features FeatureList Profile [Version]

    Where FeatureList is a comma-separated list of features. For example, to add the camel-jetty and the camel-quartz features to the default version of the sample profile, enter a command like the following:

    fabric:profile-edit --features camel-jetty,camel-quartz sample

    To delete features, enter a command of the following form:

    fabric:profile-edit --delete --features FeatureList Profile [Version]
  • Bundles to install—to add bundles to the profile, enter a command in the following format:

    fabric:profile-edit --bundles BundleList Profile [Version]

    For example, to add camel-quartz bundle to the sample profile, enter a command like the following:

    fabric:profile-edit --bundles mvn:org.apache.camel/camel-quartz/ sample

    To delete bundles, enter a command of the following form:

    fabric:profile-edit --delete --bundles BundleList Profile [Version]
  • Configuration settings for the OSGi Config Admin service—to modify or create a configuration setting from the OSGi Config Admin service, enter a command in the following format:

    fabric:profile-edit --pid PID/Property=Value Profile [Version]

    Where PID is a persistent ID, which is used in the context of the OSGi Config Admin service to identify a collection of related properties. For example, to change the value of the secure HTTPS port used by the Jetty server in the sample profile, you could edit the org.osgi.service.http.port.secure property from the org.ops4j.pax.web PID using a command like the following:

    fabric:profile-edit --pid org.ops4j.pax.web/org.osgi.service.http.port.secure=8553 sample

    To delete a property, enter a command of the following form:

    fabric:profile-edit --delete --pid PID/Property Profile [Version]
  • Property settings from etc/config.properties—to modify or create a Java system property in the container's etc/config.properties file (which affects the Apache Karaf container), enter a command in the following format:

    fabric:profile-edit --config Property=Value Profile [Version]

    For example, to change the value of the karaf.startlevel.bundle Java system property in config.properties, you would enter a command like the following:

    fabric:profile-edit --config karaf.startlevel.bundle=80 Profile [Version]

    To delete a Java system property from config.properties, enter a command of the following form:

    fabric:profile-edit --delete --config Property Profile [Version]
  • Property settings from etc/system.properties—to modify or create a Java system property in the container's etc/system.properties file (which affects bundles deployed in the container), enter a command in the following format:

    fabric:profile-edit --system Property=Value Profile [Version]

    For example, to change the default port for the OSGi HTTP service, you would enter a command like the following:

    fabric:profile-edit --system org.osgi.service.http.port=8181 Profile [Version]

    To delete a Java system property from system.properties, enter a command of the following form:

    fabric:profile-edit --delete --system Property Profile [Version]
[Important]Important

Any modifications you make to a profile using fabric:profile-edit are immediately propagated to the containers that use that profile. This is not the recommended way to edit profiles, however: if you change multiple settings in the profile, you could potentially put the affected containers into an inconsistent state. To guarantee atomicity, it is better to use the fabric:profile-edit command in combination with the fabric:container-upgrade command—see fabric:container-upgrade.

REVISIT - Need proper explanation of --import-pid option.

features:addurl — registers one or more URLs to feature repositories with the container
features:chooseurl — registers the feature repository URL for a well known project
features:info — show information about the specified feature with the optionally specified version
features:install — installs a feature
features:list — Lists all existing features available from the defined repositories
features:listurl — lists the features repository URLs
features:listVersions — lists all versions of a feature available from the current feature repositories
features:refreshUrl — reloads the list of available features from the repositories
features:removeUrl — removes the specified list of repository URLs from the features service
features:removeRepository — removes the specified repository from the features service
features:uninstall — uninstalls a feature with the specified name and version

The features commands allow you to provision entire applications using the Fuse ESB Enterprise features facility. Features allow you to provision a collection of bundles using a single name.

Type features: then press Tab at the karaf> prompt to view the available commands.

jass:cancel — cancels a JAAS editing session without applying the pending changes
jaas:manage — opens a JAAS realm for editing
jaas:pending — lists the changes waiting to be applied to the realm being edited
jaas:realms — lists the JAAS realms know to the container
jaas:roleadd — adds a role to a user
jaas:roledel — deletes a role from a user
jaas:update — applies all pending changes to the JAAS realm and closes the editing session
jaas:useradd — adds a user to the JAAS realm being edited
jaas:userdel — deletes a user from the JAAS realm being edited
jaas:users — lists the users in the JAAS realm being edited

The jaas commands are used for editing JAAS realm and user data. Editing a JAAS realm is done in two stages. The changes are placed in a queue until they are applied by executing the jaas:update.

When editing JAAS settings the commands are used as follows:

  1. Start the editing session.

    jaas:manage

  2. Edit the realm's user data.

    • jass:users

      Lists all of the users.

    • jass:useradd

      Add a new user.

    • jass:userdel

      Delete a user.

    • jass:roleadd

      Add a new role to a user.

    • jass:roledel

      Delete a role from a user.

    • jass:pending

      Lists all of the pending changes that have been made to the realms, but have not been applied to the container.

  3. Apply the changes to the JAAS realm and ends the editing session.

    jaas:update

You can abandon an editing session using jaas:cancel before the changes applied to the JAAS settings.

Type jaas: then press Tab at the prompt to view the available commands.

Name

jaas:manage, manage — opens a JAAS realm for editing

Synopsis

jaas:manage [--help] {[--realm realm] | [--index index]} [--module module] [--force]

log:clear — clears the log
log:display — displays log entries
log:display-exception — displays the last thrown exception from the log
log:get — shows the log level
log:set — sets the log level
log:tail — continually displays log entries

The log commands allow you to display and change log levels. For information about logging, see Using Logging in Managing and Monitoring a Broker.

Type log: then press Tab at the prompt to view the available commands.

osgi:bundle-level — gets or sets the start level of a given bundle
osgi:bundle-services — lists the OSGi services provided by a bundle
osgi:classes — lists all of the classes in the specified bundle or bundles
osgi:find-class — locates a specified class in any deployed bundle
osgi:headers — displays the headers of a specified OSGi bundle
osgi:info — displays detailed information about OSGi bundles
osgi:install — installs one or more OSGi bundles
osgi:list — lists the installed bundles whose start level equals or exceeds the specified threshold
osgi:ls — lists OSGi services
osgi:refresh — refreshes an OSGi bundle
osgi:resolve — resolves an OSGi bundle's dependencies
osgi:restart — stops and restarts an OSGi bundle
osgi:shutdown — stops the OSGi framework
osgi:start — starts an OSGi bundle
osgi:start-level — gets or sets the OSGi framework's active start level
osgi:stop — stops an OSGi bundle
osgi:uninstall — uninstalls an OSGi bundle
osgi:update — updates an OSGi bundle

The osgi commands provide for managing the OSGi runtime. It includes commands for listing OSGi bundles and services and managing bundle lifecycles.

Type osgi: then press Tab at the prompt to view the available commands.

packages:exports — displays the packages exported OSGi bundles
packages:imports — displays the packages imported by OSGi bundles

The packages commands are used for showing all packages imported and exported by the OSGi bundles currently installed.

Type packages: then press Tab at the prompt to view the available commands.

patch:add — download a patch file from a remote location and places the relevant JAR files in the container's system directory
patch:install — installs a patch that was previously downloaded
patch:list — lists all known patches, showing the patch name and status (installed or not)
patch:rollback — reverses a patch installation
patch:simulate — logs all of the actions that would be performed during a patch install, without actually performing the install

The patch commands allow you to download, install, and manage patches.

Patches contain a discreet set of bundles intended to update a standalone container. Each patch includes the following metadata:

  • the patch name

  • a description of the patch

  • the list of bundles included in the patch

The basic procedure applying a patch is:

  1. You receive a notice from customer support that a patch is available.

  2. Using the URL provided by customer support, you download the patch using the patch:add command.

    This command downloads an archive file, unzips the archive, and puts the relevant JAR files under the container's system/ directory. The patch does not overwrite any of the existing JAR files and the patch is not actually installed until you run the patch:install command.

  3. You install the patch using the patch:install command.

  4. If you notice that the patch is causing issues, you can remove it using the patch:rollback command.

[Important]Important

These commands are not suitable for use with containers that are part of a fabric. They are only for use in applying patches to standalone containers.

Type patch: then press Tab at the prompt to view the available commands.

ssh:ssh — connects to a remote SSH server
ssh:sshd — creates an SSH server

The ssh commands allow you to connect to or create a secure shell (SSH) server.

Type ssh: then press Tab at the prompt to view the available commands.

web:list — lists the WARs deployed in the container

The web command group is used to get information about WARs deployed in the container.

Type web: then press Tab at the prompt to view the commands in this group.

zk:create — create a znode
zk:delete — delete the specified znode
zk:get — get a znode's data
zk:list — list a znode's children
zk:set — set a znode's data

By default, the ZooKeeper commands are not installed in a Fabric Container. To make the ZooKeeper commands available, install the fabric-zookeeper-commands feature, as follows:

features:install fabric-zookeeper-commands

Name

zk:create — create a znode

Synopsis

zk:create [--help] [-r|--recursive] [-i|--import] [-e|--ephemeral] [-s|--sequential] [-a|--acl ListOfACLs] [-o|--overwrite] {path} {data}

Description

Using this command, you can create the following different types of znode:

Persistent

The new znode is permanently stored in the ZooKeeper registry. This is the default.

Persistent sequential

The new znode is permanently stored in the ZooKeeper registry and a 10-digit sequence number is appended to the specified znode name. Selected by the --sequential option.

Ephemeral

The new znode exists only for the duration of the current client session. When the session is over, the znode is removed. Selected by the --ephemeral option.

Ephemeral sequential

The new znode exists only for the duration of the current client session and a 10-digit sequence number is appended to the specified znode name. When the session is over, the znode is removed. Selected by combining the --ephemeral option with the --sequential option.

You can optionally specify a list of ACLs to apply to the newly created znode. The ACL is specified as a comma-separated list, where each entry in the list has the following format:

Scheme:ID:Permissions

ZooKeeper supports the following built-in schemes:

world:anyone

The permissions apply to all users.

auth:

The permissions apply to all authenticated users, irrespective of their identity (the ID field is left empty).

digest:MD5Hash

The permissions apply to the user whose username and password generate the specified MD5 hash value, MD5Hash.

ip:IPAddress

The permissions apply to the ZooKeeper client with the specified IP address.

The Permissions string consists of one or more of the following characters: r (read), w (write), c (create), d (delete), and a (admin). For example, to create a new znode that explicitly grants all permissions to all users (which is, in fact, the default), you could use a command like the following:

karaf@root> zk:create --acl world:anyone:rwcda /path/to/the/new/znode
[Important]Important

To avoid corruption of the fabric registry, you should not create any znodes under the /fabric/ path using the zk:create command. These registry nodes should only be created through the fabric console commands—see Fabric Console Commands.

[Note]Note

Fuse Fabric does not use the ACL security features of ZooKeeper. Currently, all znodes in the fabric registry are created without any ACL restrictions (equivalent to the world:anyone:rwcda ACL setting).