7.1
Copyright © 2012 Red Hat, Inc. and/or its affiliates.
Updated: 07 Jan 2014
Table of Contents
system directoryList of Tables
List of Examples
The Fuse MQ Enterprise command console is a tool for both managing the Fuse MQ Enterprise environment and interacting with a fabric. When you start Fuse MQ Enterprise you can launch into a mode that displays the command console. You can also use a remote command console to connect to a broker.
The console provides commands that you can use to perform basic management of your Fuse MQ Enterprise environment, including managing destinations, connections and other administrative objects in the broker.
The console uses prefixes to group commands relating to the same functionality. For example commands related to configuration are prefixed config:, and logging-related commands are prefixed log:.
To start Fuse MQ Enterprise open a console at the installation directory and enter:
| Windows | bin\fusemq.bat |
| *NIX | bin/fusemq.sh |
Fuse MQ Enterprise starts and the console is ready. You should see the prompt shown in Example 1.1.
Example 1.1. The Fuse MQ Enterprise Console
______ ___ ___ _____
| ___| | \/ || _ |
| |_ _ _ ___ ___ | . . || | | |
| _|| | | |/ __| / _ \ | |\/| || | | |
| | | |_| |\__ \| __/ | | | |\ \/' /
\_| \__,_||___/ \___| \_| |_/ \_/\_\
Fuse MQ (7.0.0.fuse-036)
http://fusesource.org/mq/
Hit '<tab>' for a list of available commands
and '[cmd] --help' for help on a specific command.
Hit '<ctrl-d>' or 'osgi:shutdown' to shutdown Fuse MQ.
FuseMQ:karaf@root>The console provides two levels of help:
console help—list all of the commands along with a brief summary of the commands function
command help—a detailed description of a command and its arguments
To access the console help you use the help command from the console prompt (or the equivalent man command alias). It will display a grouped list of all the commands available in the console. Each command in the list will be followed by a description of the command as shown in Example 1.2.
Example 1.2. Console Help
FuseMQ:karaf@root>helpCOMMANDS activemq:browse activemq:bstat activemq:list activemq:purge activemq:query admin:change-opts Changes the Java options of an existing container instance. admin:change-rmi-registry-port Changes the RMI registry port (used by management layer) of an existing container instance....FuseMQ:karaf@root>
The help for each command includes the definition, the syntax, and the arguments and
any options. To display the help for a command, type the command with the
--help option. As shown in Example 1.3, entering
admin:start --help displays the help for that command.
Example 1.3. Help for a Command
FuseMQ:karaf@root>admin:start --helpDESCRIPTION admin:start Starts an existing container instance. SYNTAX admin:start [options] name ARGUMENTS name The name of the container instance OPTIONS --help Display this help message -o, --java-opts Java options when launching the instanceFuseMQ:karaf@root>
Pressing Tab at anytime will provide you with a list of commands that can
complete what you have already entered at the prompt. For example if you entered
active followed by Tab a list similar to
Example 1.4 will be shown.
Example 1.4. Console Commands
activemq:browse
activemq:bstat activemq:list
activemq:purge activemq:query
FuseMQ:karaf@root>If you press Tab without entering anything at the prompt, the console will list all of the possible commands.
Commands are grouped under prefixes according to functionality. Table 1.1 summarizes the command groups available in the console. Click on a command group name for more information.
Table 1.1. Fuse MQ Enterprise Command Groups
| Command Group | Description |
|---|---|
| activemq | Views and manages brokers and messages. |
| admin | Creates, manages, and destroys containers. |
| config | Manages configuration. |
| dev | Utilities that are useful for a developer while testing bundles in the container. |
| fab | Manages the dependency resolution mechanism used by Fuse Application Bundles. |
| fabric | Performs provisioning and configuration using Fuse Fabric. |
| features | Performs provisioning based on Apache Karaf feature specs. |
| jaas | Manages the console's security settings. |
| log | Displays and configures logging. |
| osgi | Manages the OSGi bundle repository. |
| patch | Manages patches. |
| packages | Lists imported and exported packages. |
| shell | Performs basic console functions |
| ssh | Creates and connects to a remote SSH server |
| web | Lists the WARs deployed in the container. |
| zk | ??? |
Many of the console commands allow you to omit the group prefix.
If the command is only in one command groups, you can omit the group prefix. For example, you can enter bstat in place of activemq:bstat because it only exists in the activemq command group.
If the command exists in multiple command groups, you can still drop the prefix and the console will default to using the version of the command from one of the following command groups:
shell
osgi
admin
For example, info is equivalent to shell:info. If you wanted to use osgi:info, you need to enter the full command.
The console allows you to define custom properties, which can be useful when writing shell
scripts for the console. Define properties using a simple assignment expression,
,
and access the property value with the syntax
PropertyName = Value$ or
PropertyName${. and For example, to define the
PropertyName}foo property:
FuseMQ:karaf@root>foo = fooValue fooValueFuseMQ:karaf@root>echo $foo fooValue
You can also use this syntax to access JVM System Properties. For example:
FuseMQ:karaf@root> echo ${karaf.name}
rootThe 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.
shell:cat, cat — displays the contents of a file or URL
shell:cat [-n] [--help] {[path] | [URL]}
Table 2.1 describes the arguments for this command.
Table 2.1. shell:cat Arguments
| Argument | Interpretation |
|---|---|
-n
| Display line numbers. |
--help
| Displays the online help for this command |
| The path(s) of the file to display, separated by whitespace (separated by
- for STDIN) |
| The URL(s) to display, separated by whitespace (separated by - for
STDIN) |
shell:clear, clear — clears the console buffer
shell:clear [--help]
Table 2.2 describes the command's arguments.
Table 2.2. shell:clear Arguments
| Argument | Interpretation |
|---|---|
--help
| Displays the online help for this command |
shell:each, each — execute a closure on a list of arguments
shell:each [--help] {values} {function}
Table 2.3 describes the command's arguments.
Table 2.3. shell:each Arguments
| Argument | Interpretation |
|---|---|
--help
| Displays the online help for this command |
| The collection of arguments to iterate over. |
| The function to execute. |
shell:echo, echo — prints arguments to the standard output
shell:echo [--help] [-n] {argument...}
Table 2.4 describes the command's arguments.
Table 2.4. shell:echo Arguments
| Argument | Interpretation |
|---|---|
--help
| Displays the online help for this command. |
-n
| Do not print the trailing newline character. |
| Specifies a space delimited list of arguments to print. |
shell:exec, exec — executes system processes
shell:exec [--help] {command}
Table 2.5 describes the command's arguments.
Table 2.5. shell:exec Arguments
| Argument | Interpretation |
|---|---|
--help
| Displays the online help for this command |
command | Specifies the command, with arguments, to execute. |
shell:grep, grep — displays lines matching a regular expression
shell:grep [--help] [[-i] | [--ignore-case]] [[-w] | [--word-regexp]] [[-n] | [--line-number]] [[-x] | [--line-regexp]] [[-v] | [--invert-match]] {regex}
Table 2.6 describes the command's arguments.
Table 2.6. shell:grep Arguments
| Argument | Interpretation |
|---|---|
--help
| Displays the online help for this command. |
-i, --ignore-case
| Ignore case distinctions in both the regex and the
input files. |
-w, --word-regexp
|
Select only lines containing matches that form whole words. A match qualifies if it meets one of the following conditions:
|
-n, --line-number | Display the line number of the match within its input file. |
-x, --line-regexp
| Selects only those matches that exactly match the whole line. |
-v, --invert-match
| Select non-matching lines. |
| Specifies the regular expression to match. |
shell:head, head — displays the first lines of a file
shell:head [--help] [-n numLines] {[path] | [URL]}
Table 2.7 describes the command's arguments.
Table 2.7. shell:head Arguments
| Argument | Interpretation |
|---|---|
--help
| Displays the online help for this command. |
-n
| Specifies the number of lines to display. Default is 1. |
| The path(s) of the file to display, separated by whitespace (separated by
- for STDIN) |
| Specifies the URL(s) to display, separated by whitespace (separated by - for
STDIN) |
shell:history, history — prints the command history
shell:history [--help]
Table 2.8 describes the arguments for this command.
Table 2.8. shell:history Arguments
| Argument | Interpretation |
|---|---|
--help
| Displays the online help for this command |
shell:if, if — executes an if/then/else block
shell:if [--help] {condition} {ifTrue} [ifFalse]
Table 2.9 describes the command's arguments.
Table 2.9. shell:if Arguments
| Argument | Interpretation |
|---|---|
--help
| Displays the online help for this command |
condition | Boolean condition. |
ifTrue | Function to evaluate, if condition is true. |
ifFalse | Function to evaluate, if condition is false. |
shell:info, info — displays system information and statistics about the container
shell:info [--help]
Table 2.10 describes the command's arguments.
Table 2.10. shell:info Arguments
| Argument | Interpretation |
|---|---|
--help
| Displays the online help for this utility |
shell:java, java — execute a Java application
shell:java [--help] [[-m] | [--method] ] {methodNameclassName} [arguments]
Table 2.11 describes the command's arguments.
Table 2.11. shell:java Arguments
| Argument | Interpretation |
|---|---|
--help
| Displays the online help for this command |
-m, --method | Specifies the name of a method to invoke. The default is
main(). |
| Specifies the name of the class to invoke. |
| Specifies the arguments to pass to the method of the given
className. |
shell:logout, logout — disconnects the shell from the current session
shell:logout [--help]
Table 2.12 describes the command's arguments.
Table 2.12. shell:logout Arguments
| Argument | Interpretation |
|---|---|
--help
| Displays the online help for this command |
shell:more, more — displays output as pages of a specified length
shell:more [--help] [--lines numLines]
Table 2.13 describes the command's arguments.
Table 2.13. shell:more Arguments
| Argument | Interpretation |
|---|---|
--help
| Displays the online help for this command |
--lines
| Specifies the number of lines to display before pausing. |
shell:new, new — creates a new Java object of the specified class
shell:new [--help] {class} [arg...]
Table 2.14 describes the command's arguments.
Table 2.14. shell:new Arguments
| Argument | Interpretation |
|---|---|
--help
| Displays the online help for this command |
class | The class of the object to create. |
args | The constructor arguments. |
shell:printf, printf — formats and prints the specified output
shell:printf [--help] {format} {arguments}
Table 2.15 describes the command's arguments.
Table 2.15. shell:printf Arguments
| Argument | Interpretation |
|---|---|
--help
| Displays the online help for this command |
| The output format pattern to use |
| The arguments for the given format pattern |
shell:sleep, sleep — sleeps for a specified time, then wakes up
shell:sleep [--help] [[-s] | [--second]] {duration}
Table 2.16 describes the command's arguments.
Table 2.16. shell:sleep Arguments
| Argument | Interpretation |
|---|---|
--help
| Displays the online help for this command |
-s, --second
| Specify the duration in seconds (instead of milliseconds). |
| The time to sleep in milliseconds (default) or in seconds (with the
-s option). |
shell:sort, sort — writes a sorted concatenation of the specified files to standard output
shell:sort [--help] [[-t] | [--field-separator] ] [[-b] | [--ignore-leading-blanks]] [[-f] | [--ignore-case]] [[-r] | [--reverse]] [[-k] | [--key]sep ] [[-n] | [--numeric-sort]] [[-u] | [--unique]] {keysfile...}
Table 2.17 describes the command's arguments.
Table 2.17. shell:sort Arguments
| Argument | Interpretation |
|---|---|
--help
| Displays the online help for this command |
-t, --field-separator
| Specifies a character to use as a field separator. The default is whitespace. |
-b, --igonore-leading-blanks
| Igonores leading blanks. |
-f, --ignore-case
| Ignores case when sorting. |
-r, --reverse
| Reverses the result of the sort. |
-k, --key
| Specifies a space delimited list of fields to use for sorting. |
-n, --numeric-set
| Compares according to string numerical value. |
-u, --unique
| Outputs only the first of an equal run. |
| Specifies a space delimited list of files to sort. |
shell:source, source — run a shell script
shell:source [--help] {script} [arguments]
Table 2.18 describes the command's arguments.
Table 2.18. shell:source Arguments
| Argument | Interpretation |
|---|---|
--help
| Displays the online help for this command |
| A URI pointing to the script |
| Arguments to pass to the script |
shell:tac, tac — captures the STDIN and returns it as a string and optionally writes the content to a file
shell:tac [--help] [-f fileName]
Table 2.19 describes the command's arguments.
Table 2.19. shell:tac Arguments
| Option | Interpretation |
|---|---|
--help
| Displays the online help for this command |
-f
| Specifies the name of the file into which the output is written. |
shell:tail, tail — displays the last lines of a file
shell:head [--help] [-n lineNum] [-s seconds] [-f] {[path] | [URL]...}
Table 2.20 describes the command's arguments.
Table 2.20. shell:tail Arguments
| Argument | Interpretation |
|---|---|
--help
| Displays the online help for this command. |
-n
| Specifies the number of lines to display. The default is 1. |
-s
| Specifies the interval, in seconds, to sleep before checking for changes to display. |
-f
| Follow file changes. |
| A space delimited list of file paths to display. |
| A space delimited list of file URLs to display. |
shell:watch, watch — watches and refreshes the output of a command
shell:watch [--help] [[-n] | [--interval]
] {secondscommand}
Table 2.21 describes the command's arguments.
Table 2.21. shell:watch Arguments
| Argument | Interpretation |
|---|---|
--help
| Displays the online help for this command |
-n,--interval | Specifies the interval, in seconds, between executions of the command. The default is 1. |
| Specifies the command to watch and refresh. |
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.
activemq:browse, browse — displays messages on a specified destination
activemq:browse {--amqurl brokerURL} [--msgsel {msgsel...}] [--factory className] [--passwordFactory className] [--user username] [--password password] [--view {attr...}] [[-Vheader] | [-Vcustom] | [-Vbody]] [--version] [[--help] | [-h] | [-?]] destName
Table 3.1 describes the command's arguments.
Table 3.1. activemq:browse Arguments
| Argument | Interpretation |
|---|---|
--amqurl
| Specifies the URL of the broker to which you are connecting. |
--msgsel | Displays messages matched by the message selector. |
--factory | Load className as the javax.jms.ConnectionFactory to use for creating connections. |
--passwordFactory | Load className as the org.apache.activemq.console.command.PasswordFactory
for retrieving the password from a keystore. |
--user | Username to use for JMS connections. |
--password | Password to use for JMS connections. |
-Vheader
| Shows all the standard JMS message headers. |
-Vcustom | Shows all the custom fields added to each JMS message. |
-Vbody | Shows the body of the message. |
--view
| Selects the specific attribute of the message to view. |
--version | Displays the version information. |
-h, -?, --help | Displays the online help for this command. |
Message filters specified using the --msgsel option take the form
.
Table 3.2 lists the headers you can use to filter
messages.header=value
Table 3.2. Message Headers for Filtering
| Name | Type |
|---|---|
JMSCorrelationID | String |
JMSDeliveryMode | 1-Non-Persistent, 2-Persistent |
JMSDestination | javax.jms.Destination |
JMSExpiration | long |
JMSMessageID | String |
JMSPriority | int |
JMSRedelivered
| boolean |
JMSReplyTo | javax.jms.Destination |
JMSTimestamp | long |
JMSType | String |
The following command prints the JMS message header, custom message header, and message body of all the
messages in the queue TEST.FOO on a broker:
FuseMQ:karaf@root>activemq:browse --amqurl tcp://localhost:61616 TEST.FOO
The following command displays the attributes from the body of the messages in the TEST.FOO queue:
FuseMQ:karaf@root>activemq:browse --amqurl tcp://localhost:61616 -Vbody TEST.FOO
The following command displays any messages with an ID ending in 10:
FuseMQ:karaf@root>activemq:browse --amqurl tcp://localhost:61616 --msgsel JMSMessaageID='*:10' TEST.FOO
The following command displays messages with a priority of 3, enter:
FuseMQ:karaf@root>activemq:browse --amqurl tcp://localhost:61616 --msgsel JMSPriority=3 TEST.FOO
The message selectors from the preceding two examples can be combined as follows:
FuseMQ:karaf@root>activemq:browse --amqurl tcp://localhost:61616 --msgsel JMSMessaageID='*:10',JMSPriority=3 TEST.FOO
activemq:bstat, bstat — summarizes the statistics for a broker
activemq:bstat [--jmxurl JMXUrl] [--pid PID] [-jmxuser userName] [-jmxpassword password] [-jmxlocal] [--version] [[--help] | [-h] | [-?]] {brokerName}
Table 3.3 describes the command's arguments.
Table 3.3. activemq:bstat Arguments
| Argument | Description |
|---|---|
--jmxurl
| Sets the JMX URL used to locate brokers. |
--pid
| Set the pid to connect to (only on Sun JVM). |
--jmxuser
| Sets the JMX user, used for authentication. |
--jmxpassword
| Sets the JMX password, used for authentication. |
--jmxlocal
| Use the local JMX server instead of a remote server. |
--version
| Displays the version information. |
-h, -?, --help
| Displays the online help for this command. |
brokerName | The name of the broker |
activemq:list — lists all available brokers in the specified JMX context
activemq:list [--jmxurl JMXUrl] [--pid PID] [-jmxuser userName] [-jmxpassword password] [-jmxlocal] [--version] [[--help] | [-h] | [-?]]
Table 3.4 describes the command's arguments.
Table 3.4. activemq:list Arguments
| Argument | Interpretation |
|---|---|
--jmxurl
| Sets the JMX URL to connect to |
--pid
| Set the pid to connect to (only on Sun JVM). |
--jmxuser
| Sets the JMX user, used for authentication |
--jmxpassword
| Sets the JMX password, used for authentication |
--jmxlocal
| Specifies to use the local JMX server instead of a remote server |
--version
| Displays the version information |
-h, -?, --help
| Displays the online help for this command |
activemq:purge, purge — purges messages from a destination
activemq:purge [--msgsel {msgsel...}] [--pid PID] [--jmxurl JMXUrl] [-jmxuser userName] [-jmxpassword password] [-jmxlocal] [--version] [[--help] | [-h] | [-?]] {destName}
Table 3.5 describes the command's arguments.
Table 3.5. activemq:purge Arguments
| Option | Interpretation |
|---|---|
--msgsel | Purges messages matched by the message selector. See Message filters. |
--jmxurl
| Sets the JMX URL used to locate the broker. |
--pid
| Set the pid to connect to (only on Sun JVM). |
--jmxuser
| Sets the JMX user, used for authentication. |
--jmxpassword
| Sets the JMX password, used for authentication. |
--jmxlocal
| Specifies to use the local JMX server instead of a remote server |
--version
| Displays the version information |
-h, -?, --help
| Displays the online help for this command |
| The specified message destination(s) |
The following command purges all the messages in the queue TEST.FOO on a broker:
FuseMQ:karaf@root>activemq:purge TEST.FOO
The following command purges any messages with an ID ending in 10:
FuseMQ:karaf@root>activemq:purge --msgsel JMSMessaageID='*:10' TEST.FOO
The following command purges messages with a priority of 3, enter:
FuseMQ:karaf@root>activemq:purge --msgsel JMSPriority=3 TEST.FOO
The message selectors from the preceding two examples can be combined as follows:
FuseMQ:karaf@root>activemq:purge --msgsel JMSMessaageID='*:10',JMSPriority=3 TEST.FOO
activemq:query, query — queries the for broker information on specific objects
activemq:query [-QMBeanType=name] [-xQMBeanType=name] [--objname query] [--xobjname query] [--view {attr...}] [--jmxurl JMXUrl] [--pid PID] [-jmxuser userName] [-jmxpassword password] [-jmxlocal] [--version] [[--help] | [-h] | [-?]]
Table 3.6 describes the command's arguments.
Table 3.6. activemq:query Arguments
| Argument | Interpretation |
|---|---|
-Q | Adds to the search list the specific object type matched by the defined object identifier. |
-xQ | Removes from the search list the specific object type matched by the object identifier. |
--objname | Adds to the search list objects matched by the query similar. |
--xobjname | Removes from the search list objects matched by the query. |
--view | Selects the specific attribute of the object to view. By default, all attributes are displayed. |
--jmxurl | Sets the JMX URL to connect to. |
--pid
| Set the pid to connect to (only on Sun JVM). |
--jmxuser
| Sets the JMX user, used for authentication |
--jmxpassword
| Sets the JMX password, used for authentication |
--jmxlocal
| Specifies to use the local JMX server instead of a remote server |
--version
| Displays the version information |
-h, -?, --help
| Displays the online help for this command |
The following command displays all attributes and object name information for all registered MBeans in the default JMX context:
FuseMQ:karaf@root>activemq:query
The following command displays all attributes and object name information of the
destination topic TEST.FOO:
FuseMQ:karaf@root>activemq:query -QTopic=TEST.FOO
The following command displays all the brokers in a context whose name ends in
host:
FuseMQ:karaf@root>activemq:query -QBroker=*host
the Following command displays all attributes and object name information for all registered queues:
FuseMQ:karaf@root>activemq:query -QQueue=*
The following command displays all attributes and object name information for all
topics ending with .FOO except those that also begin with
ActiveMQ.Advisory.:
FuseMQ:karaf@root>activemq:query -QTopic=*.FOO -xQTopic=ActiveMQ.Advisory.*
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.
admin:change-opts, change-opts — changes the Java options of an existing container
admin:change-opts [--help] {name} {opts}
Table 4.1 describes the command's arguments.
Table 4.1. admin:change-opts Arguments
| Argument | Interpretation |
|---|---|
--help
| Displays the online help for this command |
| The name of the container for which you want to change the Java options |
| The Java options to change |
admin:change-rmi-registry-port, change-rmi-registry-port — changes the RMI registry port used by the management layer of a container
admin:change-rmi-registry-port [--help] {name} {port}
Table 4.2 describes the command's arguments.
Table 4.2. admin:change-rmi-registry-port Arguments
| Argument | Interpretation |
|---|---|
--help
| Displays the online help for this command |
| The name of the container instance for which you want to change the port |
| The new RMI registry port |
admin:change-rmi-server-port, change-rmi-server-port — changes the RMI server port used by the management layer of a container
admin:change-rmi-server-port [--help] {name} {port}
Table 4.3 describes the command's arguments.
Table 4.3. admin:change-rmi-server-port Arguments
| Argument | Interpretation |
|---|---|
--help
| Displays the online help for this command |
| The name of the container instance for which you want to change the port |
| The new RMI server port |
admin:change-ssh-port, changessh-port — changes the secure shell port of a container
admin:change-ssh-port [--help] {name} {port}
Table 4.4 describes the command's arguments.
Table 4.4. admin:change-ssh-port Arguments
| Argument | Interpretation |
|---|---|
--help
| Displays the online help for this command |
| The name of the container instance for which you want to change the port |
| The new secure shell port |
admin:clone, clone — clones an existing container instance
admin:clone [--help] [[-l] | [--location]] [[-o] | [--java-opts]fileName] [[-s] | [--ssh-port]JVMOpts] [[-rs] | [--rmi-server-port]port] [[-r] | [-rr] | [--rmi-port] | [--rmi-registry-port]port] [[-v] | [--verbose]] {portname} {cloneName}
Table 4.5 describes the command's arguments.
Table 4.5. admin:clone Arguments
| Argument | Interpretation |
|---|---|
--help
| Displays the online help for this command |
-l, --location
| Location of the cloned container instance in the file system. |
-o, --java-opts
| JVM options to use when launching the cloned instance. |
-s, --ssh-port
| Port number for remote secure shell connection. |
-rs, --rmi-server-port
| Port number for RMI server connection. |
-r, -rr, --rmi-port, --rmi-registry-port
| Port number for RMI registry connection. |
-v, --verbose
| Display actions performed by the command (disabled by default). |
| Name of the original container instance. |
| Name of the cloned container instance. |
admin:connect, connect — connects to an existing container
admin:connect [--help] [[-u] | [--username] ] [[-p] | [--password]userName ] {passwordcontainer} [command]
Table 4.6 describes the command's arguments.
Table 4.6. admin:connect Arguments
| Argument | Interpretation |
|---|---|
--help
| Displays the online help for this command |
-u, --username
| The remote user name; the default is karaf |
-p, --password
| The remote user password; the default is karaf |
| The container to connect to |
| Command to execute on connecting |
admin:create, create — creates a new child container
admin:create [--help] [[-l] | [--location] ] [[-furl] | [--featureURL]filePath ...] [[-f] | [--feature]URL ...] [[-s] | [--ssh-port]feature ] [[-rs] | [--rmi-server-port]SSHPort ] [[-r] | [-rr] | [--rmi-registry-port] | [--rmi-port]RMIServPort ] [[-o] | [--java-opts]RMIRegPort ] {javaOptsname}
Table 4.7 describes the command's arguments.
Table 4.7. admin:create Arguments
| Argument | Interpretation |
|---|---|
--help
| Displays the online help for this command |
-l, --location
| The location of the child's data folders on the file system. By default, the
child's data is added to the
directory |
-furl, --featureURL | Registers additional feature URLs with the child. |
-f, --feature | Specifies additional features loaded by the child. |
-s, --ssh-port
| The port number for remote secure shell connection |
-rs, --rmi-server-port
| The port number for RMI server connection |
-r, -rr, --rmi-registry-port, --rmi-port
| The port number for RMI registry connection |
-o, --java-opts | JVM options to use when launching the child |
| The name of the child |
admin:destroy, destroy — destroys a child container
admin:destroy [--help] {name}
Table 4.8 describes the command's arguments.
Table 4.8. admin:destroy Arguments
| Argument | Interpretation |
|---|---|
--help
| Displays the online help for this command |
| The name of the container to destroy |
admin:list — list all of the child containers on the current host
admin:list [--help] [[-l] | [--location] ] [[-o] | [--java-opts]filePath ]javaOpts
Table 4.9 describes the command's arguments.
Table 4.9. admin:list Arguments
| Argument | Interpretation |
|---|---|
--help
| Displays the online help for this command |
-l, --location
| Displays the location of the container instances |
-o, --java-opts
| Displays the options used when launching the container's JVM |
admin:rename, rename — renames a child container
admin:rename [--help] {name} {new-name}
Table 4.10 describes the command's arguments.
Table 4.10. admin:rename Arguments
| Argument | Interpretation |
|---|---|
--help
| Displays the online help for this command |
| Current name of the container |
| The new name for the container |
admin:start — starts a child container
admin:start [--help] [[-o] | [--java-opts] ] {javaOptsname}
Table 4.11 describes the command's arguments.
Table 4.11. admin:start Arguments
| Argument | Interpretation |
|---|---|
--help
| Displays the online help for this command |
-o, --java-opts
| The Java options used when launching the container |
| The name of the container to start |
admin:stop — stops a child container
admin:stop [--help] {name}
Table 4.12 describes the command's arguments.
Table 4.12. admin:stop Arguments
| Argument | Interpretation |
|---|---|
--help
| Displays the online help for this command |
| The name of the container to start |
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:
Start the editing session for the specified configuration.
config:edit
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.
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.
config:cancel — cancels the changes to the configuration being edited
config:cancel [--help]
When editing a configuration, the changes are buffered until the editing session is closed. The config:cancel command clears the buffer without saving the changes and closes the editing session.
You can see a list of the buffered changes using the jaas:pending command.
Table 5.1 describes the command's arguments.
Table 5.1. config:cancel Arguments
| Option | Interpretation |
|---|---|
--help
| Displays the online help for this command |
config:delete, delete — deletes a configuration from the container
config:delte [--help] [[-f] | [--use-file]] [--no-delete-cfg-file] {pid}
When you delete a configuration, the change is made directly on the running container. Any properties set in the configuration are reverted to their default values and the behavior of the container will be immediate.
If you use the --no-delete-cfg-file argument, the original settings
can be reloaded from the configuration file.
Table 5.2 describes the command's arguments.
Table 5.2. config:delete Arguments
| Option | Interpretation |
|---|---|
--help
| Displays the online help for this command. |
-f, --use-file | Use a filename instead of the PID to locate the configuration. |
--no-delete-cfg-file | Does not delete the associated configuration file from the container's
etc folder. |
| Specifies the configuration's persistent identifier. |
config:edit, edit — begins an editing session for a configuration. If the configuration does not exist a new configuration is created.
config:edit [--help] [--force] [[-f] | [--use-file]] {pid}
The config:edit command is the first step in editing a container configuration. It opens the configuration so that calls to the config:* editing commands will update the selected configuration. The edits made by the config:* editing commands are placed in a buffer associated with the selected configuration and not propagated to the container, or the file system, until the editing session is ended by the config:update command.
If you use the config:edit command before saving the changes to a configuration that is open for editing, the changes to the previously open configuration are abandoned. The pending edits cleared without being saved.
Table 5.3 describes the command's arguments.
Table 5.3. config:edit Arguments
| Option | Interpretation |
|---|---|
--help
| Displays the online help for this command |
--force
| Forces the editing of this configuration, even if another configuration was being edited |
-f, --use-file | Use a filename instead of the PID to locate the configuration |
| The persistent identifier of the configuration |
config:list — lists the existing configurations for the container
config:list [--help] [query]
Table 5.4 describes the command's arguments.
Table 5.4. config:list Arguments
| Argument | Interpretation |
|---|---|
--help
| Displays the online help for this command |
| An LDAP query |
config:propappend, propappend — appends the given value to an existing property or creates the property with the specified name and value
config:propappend [--help] [[-b] | [--bypass-storage]] [[-p PID] | [--pid PID]] {name} {value}
When you append a value to a property using the config:propappend command, the change is stored in the buffer and not propagated to the container until the editing session is closed.
If you use the -p argument to specify a PID, however, the change is made
immediately.
Table 5.5 describes the command's arguments.
Table 5.5. config:propappend Arguments
| Argument | Interpretation |
|---|---|
--help
| Displays the online help for this command. |
-b, --bypass-storage | Doe not write the change to the local file. |
-p, --pid | Specifies the PID of the configuration in which to make the change. The default is to change the configuration currently open for editing. |
| Specifies the name of the property to change. |
| Specifies the value to append to the property. |
config:propdel, propdel — deletes a property from the configuration being edited
config:propdel [--help] [[-b] | [--bypass-storage]] [[-p PID] | [--pid PID]] {name}
When you delete a property using the config:propdel command, the change is stored in the buffer and not propagated to the container until the editing session is closed.
If you use the -p argument to specify a PID, however, the change is made
immediately.
Table 5.6 describes the command's arguments.
Table 5.6. config:propdel Arguments
| Argument | Interpretation |
|---|---|
--help
| Displays the online help for this command. |
-b, --bypass-storage | Does not write the change to the local file. |
-p, --pid | Specifies the PID of the configuration in which to make the change. The default is to change the configuration currently open for editing. |
| Specifies the name of the property to delete. |
config:proplist, proplist — lists the properties in the configuration being edited
config:proplist [--help] [[-p PID] | [--pid PID]]
Table 5.7 describes the command's arguments.
Table 5.7. config:proplist Arguments
| Argument | Interpretation |
|---|---|
--help
| Displays the online help for this command |
-p, --pid | The PID of the configuration in which to make the change |
config:propset, propset — sets a property in the configuration being edited
config:propset [--help] [[-b] | [--bypass-storage]] [[-p PID] | [--pid PID]] {name} {value}
When you set a property using the config:propset command, the change is stored in the buffer and not propagated to the container until the editing session is closed.
If you use the -p argument to specify a PID, however, the change is made
immediately.
Table 5.8 describes the command's arguments.
Table 5.8. config:propset Arguments
| Argument | Interpretation |
|---|---|
--help | Displays the online help for this command. |
-b, --bypass-storage | Does not write the change to the local file. |
-p, --pid | Specifies the PID of the configuration in which to make the change. The default is to change the configuration currently open for editing. |
| Specifies the name of the property to set. |
| Specifies the value to set for the property. |
config:update — saves the changes made to the configuration being edited and propagates then to the container
config:propset [--help] [[-b] | [--bypass-storage]]
Table 5.9 describes the command's arguments.
Table 5.9. config:update Arguments
| Argument | Interpretation |
|---|---|
--help
| Displays the online help for this command |
-b, --bypass-storage | Do not update the copy of the configuration on the file system |
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.
dev:classloaders, classloaders — displays a list of leaking bundle classloaders
dev:classloaders [--help]
Table 6.1 describes the commands arguments.
Table 6.1. dev:classloader Arguments
| Argument | Interpretation |
|---|---|
--help
| Displays the online help for this command |
dev:create-dump, create-dump — creates a ZIP file containing diagnostic information
dev:create-dump [--help] [[-d dumpFolder] | [--directory dumpFolder]] {dumpName}
Table 6.2 describes the commands arguments.
Table 6.2. dev:create-dump Arguments
| Argument | Interpretation |
|---|---|
--help | Displays the online help for this command |
-d, --directory | Specifies the folder into which to store the dump |
dumpName | Specifies the name for the dump file |
dev:dynamic-import, dynamic-import — enables/disables dynamic imports for a bundle
dev:dynamic-import [--help] {bundleID}
Table 6.3 describes the commands arguments.
Table 6.3. dev:dynamic-import Arguments
| Argument | Interpretation |
|---|---|
--help
| Displays the online help for this command |
bundleID | A bundle ID. |
dev:framework, framework — enables/disables debugging for an OSGi framework
dev:framework [--help] {[[-debug] | [--enable-debug]] [[-nodebug] | [--disable-debug]]} {framework}
Table 6.4 describes the commands arguments.
Table 6.4. dev:framework Arguments
| Argument | Interpretation |
|---|---|
--help | Displays the online help for this command |
-nodebug, --disable-debug | Disable debugging for the OSGi framework. |
-debug, --enable-debug | Enable debugging for the OSGi framework. |
framework
| Name of the OSGi framework |
dev:print-stack-traces, print-stack-traces — enables/disables printing of full stack traces in the console when the execution of a command throws an exception
dev:print-stack-traces [--help] [false]
Table 6.5 describes the commands arguments.
Table 6.5. dev:print-stack-traces Arguments
| Argument | Interpretation |
|---|---|
--help
| Displays the online help for this command |
false | Disables stack traces |
dev:restart — restart the container
dev:restart [--help] [[-c] | [--clean]]
Table 6.6 describes the commands arguments.
Table 6.6. dev:restart Arguments
| Argument | Interpretation |
|---|---|
--help
| Displays the online help for this command |
-c, --clean | Force a clean (cold) restart by deleting the container's
data directory. |
dev:show-tree, show-tree — shows the tree of bundles based on the wiring information
dev:show-tree [--help] {bundleID}
Table 6.7 describes the commands arguments.
Table 6.7. dev:show-tree Arguments
| Argument | Interpretation |
|---|---|
--help | Displays the online help for this command |
bundleID | A bundle ID. |
dev:threads, threads — shows the threads in the JVM
dev:threads [--help] [[-f] | [--flat]]
Table 6.8 describes the commands arguments.
Table 6.8. dev:threads Arguments
| Argument | Interpretation |
|---|---|
--help | Displays the online help for this command |
-f, --flat | Do not show the threads in a tree |
dev:wait-for-service, wait-for-service — wait for the specified OSGi service
dev:wait-for-service [--help] [[-t] | [--timeout]] [[-e] | [--exception]] {timeoutserviceClassOrFilter}
This command is useful when you are developing a console script and you want to wait for a specific OSGi service to start up, before proceeding with the execution of the script.
For example, the various command sets installed in the console (shell:*,
admin:*, features:*, and so on) are represented by OSGi services
of type, org.apache.karaf.shell.console.SubShell. If you want to check that a
sub-shell service is available, you could enter the following console command:
karaf@root> dev:wait-for-service -t 1000 org.apache.karaf.shell.console.SubShell true
This form of the command is not very useful in this case, because there are many different
instances of the SubShell service installed in the container. To be more
specific, you can define an LDAP filter, which specifies one or more service property values.
For example, you can wait specifically for the osgi sub-shell service by entering
a command like the following:
karaf@root> dev:wait-for-service -t 1000 &(objectClass=org.apache.karaf.shell.console.SubShell)(name=osgi) true
Table 6.9 describes the commands arguments.
Table 6.9. dev:wait-for-service Arguments
| Argument | Interpretation |
|---|---|
--help | Displays the online help for this command |
-t, --timeout | Timeout (specified in milliseconds: negative to not wait at all, zero to wait forever). Default is forever. |
-e, --exception | Throw an exception if the wait command times out (the service is not found). Default is false. |
| Specifies the OSGi service either by the service's class name or by an LDAP-style filter (which is applied to the OSGi service's properties). |
dev:watch, watch — watches and automatically updates bundles
dev:watch [--help] [[--start] | [--stop]] [-i interval] [--list] [--remove] {bundles...}
Table 6.10 describes the commands arguments.
Table 6.10. dev:watch Arguments
| Argument | Interpretation |
|---|---|
--help | Displays the online help for this command |
--stop | Stop watching the specified bundles |
--start | Start watching the specified bundles |
-i | Specifies the interval, in milliseconds, to check the bundles. |
--list | List the bundles being watched. |
--remove | Remove the specified bundles from the watch list. |
| Specifies a whitespace delimited list of bundle URLs or bundle IDs. |
![]() | Caution |
|---|---|
Only Maven URLs and Maven snapshots will be updated automatically. So, if you run
You are monitor all bundles that have a location matching |
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
fab:headers — displays the headers of a FAB
fab:headers [--help] [--indent style] {URL}
Displays the header entries from the META-INF/MANIFEST.MF file embedded in
the FAB JAR file. This is not the same thing as the bundle headers
returned by the osgi:headers command, because the osgi:headers
command shows the effective headers after the FAB is converted into an
OSGi bundle.
For example, a typical FAB might have headers like the following:
FuseESB:karaf@root> fab:headers mvn:org.fusesource.examples/cbr/7.0.0.fuse-beta-042 Manifest-Version = 1.0 Archiver-Version = Plexus Archiver Built-By = username Build-Jdk = 1.6.0_29 Created-By = Apache Maven
After the FAB is deployed, the corresponding OSGi bundle could have headers like the following (given that the bundle ID of the deployed FAB is 228):
FuseESB:karaf@root> osgi:headers 228 org.fusesource.examples.cbr (228) --------------------------------- Manifest-Version = 1 Bnd-LastModified = 1334306872960 Archiver-Version = Plexus Archiver Tool = Bnd-1.43.0 Originally-Created-By = Apache Maven FAB-URL = mvn:org.fusesource.examples/cbr/7.0.0.fuse-beta-042 Generated-By-FAB-From = mvn:org.fusesource.examples/cbr/7.0.0.fuse-beta-042 Built-By = username FAB-Id = org.fusesource.examples:cbr:7.0.0.fuse-beta-042:jar Build-Jdk = 1.6.0_29 Created-By = 1.6.0_29 (Apple Inc.) Bundle-Name = org.fusesource.examples.cbr Bundle-SymbolicName = org.fusesource.examples.cbr Bundle-Version = 7.0.0.fuse-beta-042 Bundle-ManifestVersion = 2 Export-Package = OSGI-INF.blueprint, OSGI-INF
Table 7.1 describes the commands arguments.
Table 7.1. fab:headers Arguments
| Argument | Interpretation |
|---|---|
--help | Displays the online help for this command |
--indent | Specify the indent style. Valid values are 1, 2,
or 3. The default is -1. |
URL | The URL of the 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:info [--help] {bundleID}
Table 7.2 describes the commands arguments.
Table 7.2. fab:info Arguments
| Argument | Interpretation |
|---|---|
--help | Displays the online help for this command |
| The bundle ID of the FAB (for deployed FABs) or the URL location of the FAB (for FABs that are not yet deployed). |
fab:start — starts the specified FAB
fab:start [--help] [--timeout millis] {bundleID}
Depending on how a FAB is configured, it can be associated with multiple dependent bundles.
When a FAB is initially installed in the container, the transitive dependencies of the FAB
are determined by scanning the embedded POM file,
META-INF/maven/.
Any transitive dependencies that are shared (for example, by being marked as provided or
because the dependency is already packaged as an OSGi bundle), are deployed as separate OSGi
bundles in the container.GroupID/ArtifactID/pom.xml
When you start the FAB using fab:start, the runtime attempts to start
all of the corresponding bundles, starting with the leaves of the
dependency tree and working its way up the tree to the FAB's bundle. In particular, this
implies that any OSGi services, blueprint XML files, and Spring XML files in the dependent
OSGi bundles are activated in the appropriate order.
Table 7.3 describes the commands arguments.
Table 7.3. fab:start Arguments
| Argument | Interpretation |
|---|---|
--help | Displays the online help for this command |
--timeout | Specifies, in milliseconds, how long to wait for the FAB bundle to start up.
Default is 30000. |
| The bundle ID of the 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:stop [--help] {bundleID}
Table 7.4 describes the commands arguments.
Table 7.4. fab:stop Arguments
| Argument | Interpretation |
|---|---|
--help | Displays the online help for this command |
| The bundle ID of the FAB. |
fab:tree, tree — displays the dependency tree of a FAB
fab:tree [--help] {bundleID}
Table 7.5 describes the commands arguments.
Table 7.5. fab:tree Arguments
| Argument | Interpretation |
|---|---|
--help | Displays the online help for this command |
| Specifies the bundle ID, URL, or filename of the FAB. |
fab:uninstall — uninstall the specified FAB and all of its transitive dependencies, except for those dependencies that are being used by other bundles
fab:uninstall [--help] {bundleID}
Depending on how a FAB is configured, it can be associated with multiple dependent bundles.
When a FAB is initially installed in the container, the transitive dependencies of the FAB
are determined by scanning the embedded POM file,
META-INF/maven/.
Any transitive dependencies that are shared (for example, by being marked as provided or
because the dependency is already packaged as an OSGi bundle), are deployed as separate OSGi
bundles in the container.GroupID/ArtifactID/pom.xml
When you uninstall the FAB using fab:uninstall, the runtime attempts to
uninstall all of the corresponding OSGi bundles, except for any bundles
that are still being used by other applications in the container.
Table 7.6 describes the commands arguments.
Table 7.6. fab:uninstall Arguments
| Argument | Interpretation |
|---|---|
--help | Displays the online help for this command |
| The bundle ID of the FAB. |
This chapter describes fabric console commands.
fabric:cluster-list, cluster-list — lists the members of a Fuse MQ Enterprise cluster
fabric:cluster-list [--help] [Path]
This command lists all message brokers in the fabric. It allows you to see which brokers are grouped into clusters. The resulting list will enable you to see which brokers are participating in a particular cluster.
Table 8.1 describes the command's arguments.
Table 8.1. fabric:cluster-list Arguments
| Argument | Interpretation |
|---|---|
--help | Displays the online help for this command |
| Specifies the path of the registry node to list. If not specified, all clusters will be listed. |
fabric:cloud-firewall-edit — manage a cloud container's firewall
fabric:cloud-firewall-edit [--help] [--owner owner] [--option
key=value]
Table 8.2 describes the command's arguments.
Table 8.2. fabric:cloud-firewall-edit Arguments
| Argument | Interpretation |
|---|---|
--port
| The target IP port. |
--flush | Flush all rules. |
--revoke
| Revoke the rule for the specified port. This blocks access to the specified IP port. |
--target-container | The target container name. |
--source-container | The source container, which has access granted or revoked. |
--target-node-id | The target node ID. |
--source-cidr | The source CIDR, which has access granted or revoked. |
--provider | The cloud provider name. |
--help
| Displays the online help for this command. |
fabric:cloud-service-add — initialize a cloud provider (which can be used for provisioning containers in the cloud)
fabric:cloud-service-add [--help] [--provider providerName] [--name name] [--api APIName] [--endpoint URL] [--identity accessKeyID] [--credential secretAccessKey] [--owner owner] [--option
key=value] [--async-registration]
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-) and
encapsulate such details as the endpoint URI, cloud API, and so on.ProviderName
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):
Install the basic set of fabric cloud commands:
karaf@root> features:install fabric-jclouds
Install the JClouds module specifically for AWS EC2:
karaf@root> features:install jclouds-aws-ec2
Add the AWS EC2 provider, specifying the login credentials for your EC2 account:
karaf@root> fabric:cloud-service-add --provider aws-ec2 --identityAccessKeyID--credentialSecretAccessKey
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):
Install the basic set of fabric cloud commands:
karaf@root> features:install fabric-jclouds
Install the JClouds module for the openstack-nova API:
karaf@root> features:install jclouds-api-openstack-nova
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/ --identityAccessKeyID--credentialSecretAccessKey
![]() | Note |
|---|---|
You can provide additional customisation of the connection by setting options
through the |
You are now ready to start creating compute instances on the
myOpenStack cloud service, using the
fabric:container-create-cloud command.
To access this command from a fabric container, you must have installed the
fabric-jclouds feature. To install the fabric-jclouds feature,
deploy the cloud profile into the current container, using the
fabric:container-change-profile command.
For example, if the console is currently logged on to the root container of
the Fabric, you could add the cloud profile as follows:
FuseESB:karaf@root> fabric:container-list [id] [version] [alive] [profiles] [provision status] root* 1.0 true fabric, fabric-ensemble-0000-1 success FuseESB:karaf@root> fabric:container-change-profile root fabric fabric-ensemble-0000-1 cloud FuseESB:karaf@root> fabric:container-list [id] [version] [alive] [profiles] [provision status] root* 1.0 true fabric, fabric-ensemble-0000-1, cloud success
Table 8.3 describes the command's arguments.
Table 8.3. fabric:cloud-service-add Arguments
| Argument | Interpretation |
|---|---|
--help
| Displays the online help for this command. |
--provider
| The name of a commercial cloud provider (for example, aws-ec2 or
rackspace). |
--name | The JClouds service context name, which identifies the cloud service uniquely.
Defaults to the provider name (as specified by the --provider
option). |
--api | Specifies the cloud API (for example, ec2,
openstack-nova, or cloudstack). |
--endpoint | Specifies the cloud service's endpoint URL. |
--identity | The identity used to access the cloud service. |
--credential | The credential used to access the cloud service. |
--owner
| Specifies the EC2 AMI owner, which enables you to use private images (AWS EC2 only). |
--option | Provider-specific properties. For example: --option
jclouds.regions=us-east-1. If you want to specify more than one option,
specify this option multiple times. |
--async-registration
| Do not wait for the provider registration (that is, complete the registration in a background thread). |
fabric:cloud-service-list — list the configured cloud providers
fabric:cloud-service-list [--help]
For each configured cloud provider, displays the provider name, type (compute
or blobstore), and registration (local, for a standalone container,
or fabric, for a Fabric Container).
To access this command, the current container must belong to a Fabric and you must have
installed the fabric-jclouds feature. To install the fabric-jclouds
feature, deploy the cloud profile into the current container, using the
fabric:container-change-profile command.
For example, if the console is currently logged on to the root container of
the Fabric, you could add the cloud profile as follows:
FuseESB:karaf@root> fabric:container-list [id] [version] [alive] [profiles] [provision status] root* 1.0 true fabric, fabric-ensemble-0000-1 success FuseESB:karaf@root> fabric:container-change-profile root fabric fabric-ensemble-0000-1 cloud FuseESB:karaf@root> fabric:container-list [id] [version] [alive] [profiles] [provision status] root* 1.0 true fabric, fabric-ensemble-0000-1, cloud success
Table 8.4 describes the command's arguments.
Table 8.4. fabric:cloud-service-list Arguments
| Argument | Interpretation |
|---|---|
--help
| Displays the online help for this command. |
fabric:cloud-service-remove — removes the specified cloud provider
fabric:cloud-service-remove [--help] {Name}
To access this command, the current container must belong to a Fabric and you must have
installed the fabric-jclouds feature. To install the fabric-jclouds
feature, deploy the cloud profile into the current container, using the
fabric:container-change-profile command.
For example, if the console is currently logged on to the root container of
the Fabric, you could add the cloud profile as follows:
FuseESB:karaf@root> fabric:container-list [id] [version] [alive] [profiles] [provision status] root* 1.0 true fabric, fabric-ensemble-0000-1 success FuseESB:karaf@root> fabric:container-change-profile root fabric fabric-ensemble-0000-1 cloud FuseESB:karaf@root> fabric:container-list [id] [version] [alive] [profiles] [provision status] root* 1.0 true fabric, fabric-ensemble-0000-1, cloud success
Table 8.5 describes the command's arguments.
Table 8.5. fabric:cloud-service-remove Arguments
| Argument | Interpretation |
|---|---|
--help
| Displays the online help for this command. |
| The JClouds service context name, which represents the cloud provider. |
fabric:container-add-profile, container-add-profile — Adds the specified list of profiles to a container
fabric:container-add-profile [--help] {Name} {Profiles}
Table 8.6 describes the command's arguments.
Table 8.6. fabric:container-add-profile Arguments
| Argument | Interpretation |
|---|---|
--help | Displays the online help for this command |
| Specifies the name of the container. |
| Specifies the list of profiles to add to the container. |
fabric:container-connect, container-connect — connects to a remote Fabric Container and execute the specified command
fabric:container-connect [--help] [[-u] | [--username]] [[-p] | [--password]User] {PasswordContainerName} [Command]
This command allows you to connect to any container in the current fabric and execute a
command. For example, to execute the osgi:list command on the
root2 container, you could enter a console command like
Example 8.1.
Example 8.1. Executing a Command in a Remote Container
FuseMQ:karaf@root>fabric:container-connect -u YourName -p YourPass root2 osgi:list
This command uses fabric JAAS security to log into the container, so the username and password are managed by the container's JAAS realm.
Table 8.7 describes the command's arguments.
Table 8.7. fabric:container-connect Arguments
| Argument | Interpretation |
|---|---|
--help | Displays the online help for this command |
-u, --username | Specifies the username for logging on to the remote container. The default is
admin. |
-p, --password | SPecifies the password for logging on to the remote container. The default is
admin. |
| Specifies the name of the remote container. |
| Specifies the console command to execute on the remote container. |
fabric:container-create, container-create — creates one or more Fabric Containers
fabric:container-create [--help] {[--parent ParentID] | [--url URL]} [--proxy-uri ProxyURI] [--ensemble-server] [--profile ProfileID] [--resolver policy] [--version Version] [--jvm-opts JvmOpts] {Name} [Number]
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.
To create a child container, specify a URL in the following format:
child://ParentNameWhere ParentName is the name of the child's parent
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.
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.
Table 8.8 describes the command's arguments.
Table 8.8. fabric:container-create Arguments
| Argument | Interpretation |
|---|---|
--help | Displays the online help for this command |
--parent | Specifies the parent container's ID. |
--url | Specifies the URL of the new container. |
--proxy-uri | Specifies the Maven proxy URI to use. |
--ensemble-server | Specifies if the new container should be a Fabric Server. |
--profile | Specifies a list of profiles to deploy into the new container. |
--resolver | Specifies 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. |
--version | Specifies the version of the profiles used by the new container. Defaults to the current default version. |
--jvm-opts | Specifies options to pass to the container's JVM. |
| Specifies the name of the new container. When creating multiple containers, the name serves as a prefix. |
| Specifies the number of containers that should be created. |
fabric:container-create-child — create one or more child containers
fabric:container-create-child [--help] [--ensemble-server] [--profile ] [--version profileID] [--jvm-opts version] [--resolver jvmOpts] {policyparent} {name} [number]
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
directory. The ESBInstallDir/instances/ChildName
directory is shared with the root container.ESBInstallDir/system
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.
After you create new child containers, the children run as separate processes,
independently of the parent. Consequently, when you shut down the parent container,
the child processes continue to run in the background. If you
want to shut down the children, you must explicitly invoke the
fabric:container-stop command. For example, if a root container has
three children—child1, child2, and
child3—you can issue the following commands in the root container
console to shut down all of the containers:
karaf@root> fabric:container-stop child1 karaf@root> fabric:container-stop child2 karaf@root> fabric:container-stop child3 karaf@root> shutdown -f
Table 8.9 describes the command's arguments.
Table 8.9. fabric:container-create-child Arguments
| Argument | Interpretation |
|---|---|
--help
| Displays the online help for this command |
--ensemble-server | Whether the new container should be a Fabric Server. |
--profile | A profile ID to associate with the new container. To associate
multiple profiles with the container, specify this flag multiple times
on the command line—for example, --profile foo --profile
bar. If no profile is specified, the container is associated
with the default profile. |
--version | Specifies 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-opts | Specify options to pass to the container's JVM. |
--resolver | Specifies 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. |
| (Required) The parent container ID. |
| (Required) The name of the container to create. When creating multiple containers, it serves as a prefix |
| The number of containers that should be created. |
For more details about resolver policies, see:
| fabric:container-resolver-list |
| fabric:container-resolver-set |
| fabric:create |
fabric:container-create-cloud — creates one or more new containers on the cloud
fabric:container-create-cloud [--help] [--name ] [--provider contextName] [--api cloudProvider] [--identity cloudAPI] [--credential cloudIdentity] [--imageId loginCredential] [--os-family imageID] [--os-version osFamily] [--hardwareId osVersion] [--instanceType hardwareID] [--locationId instanceType] [--user location] [--password userAcc] [--public-key-file userPass] [--owner file] [--group owner] [--proxy-uri group] [--ensemble-server] [--new-user URI] [--new-user-password jaasUser] [--new-user-role jaasUserPass] [--zookeeper-password jaasUserRole] [--resolver zooPass] [--min-port policy] [--max-port minPort] [--profile maxPort] [--version profileID] [--jvm-opts version] [--add-option
jvmOpts] [--no-admin-access] {key=valueName} [Number]
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:
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.
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 |
|---|---|
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. |
Starts up the newly installed container (or containers) and installs the specified fabric profile (or profiles).
When creating multiple containers using this command (by adding the
argument), multiple nodes
will be created and a root container will be installed on each node.Number
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).
Table 8.10 describes the command's arguments.
Table 8.10. fabric:container-create-cloud Arguments
| Argument | Interpretation |
|---|---|
--help
| Displays the online help for this command |
--name
| (Required) JClouds service context name. |
--provider
| JClouds provider name. |
--api | The 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-family | Specify 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-version | Specifies 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. |
--hardwareId | Kind 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. |
--password | Specifies the password associated with the O/S user account defined
by the --user option. |
--public-key-file | An 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-server | Whether the new container should be a Fabric Server (effectively creates a new fabric). |
--new-user
|
Used in combination with the When using this option, you must also specify
a password using the |
--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 If you subsequently try to join the current container to the
newly-created Fabric Server (ensemble server) using the
|
--resolver | Specifies 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. |
--profile | A list of profile IDs to associate with the new container. |
--version | Specifies 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-opts | Specify options to pass to the container's JVM. |
--add-option | Specifies 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= 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-access | Disables admin access, as it might not be feasible on all images. |
| (Required) The name of the container to create. When creating multiple containers, it serves as a prefix. |
| The number of containers that should be created. |
fabric:container-create-ssh — creates one or more new containers through SSH
fabric:container-create-ssh [--help] [--host ] [--path host] [--user path] [--password user] [--private-key password] [--port keyPath] [--ssh-retries port] [--proxy-uri retries] [--ensemble-server] [--profile URI] [--version profileID] [--jvm-optsversion] [--resolver jvmOpts] {policyName} [Number]
Specifically, this command provisions the container as follows:
Logs into the specified SSH host, using either the provided username and password or using the provided username and private key.
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 |
|---|---|
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. |
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).
Table 8.11 describes the command's arguments.
Table 8.11. fabric:container-create-ssh Arguments
| Argument | Interpretation |
|---|---|
--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\ 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-server | Whether the new container should be a Fabric Server. |
--profile | A list of profile IDs to associate with the new container. |
--version | Specifies 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-opts | Specify options to pass to the container's JVM. |
--resolver | Specifies 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. |
| (Required) The name of the container to create. When creating multiple containers, it serves as a prefix. |
| The number of containers that should be created. |
For more details about resolver policies, see:
| fabric:container-resolver-list |
| fabric:container-resolver-set |
| fabric:create |
fabric:container-delete, container-delete — stops and deletes a Fuse Container
fabric:container-delete [--help] [[-r] | [--recursive]] {Name}
Deleting a Fuse Container deletes all of the files associated with the container from the host.
If the container has children, the default behavior of the command is to leave the
children in place. You can force the deletion of the children using the -r
option.
![]() | Note |
|---|---|
If the container to be deleted is a Fabric Server, you must first
remove it from the ensemble using |
Table 8.12 describes the command's arguments.
Table 8.12. fabric:container-delete Arguments
| Argument | Interpretation |
|---|---|
--help
| Displays the online help for this command. |
-r, --recursive
| Recursively stops and deletes all child containers. |
| Specifies the name of the container to delete. |
fabric:container-domains, container-domains — lists a container's JMX domains
fabric:container-domains [--help] {Name}
Table 8.13 describes the command's arguments.
Table 8.13. fabric:container-domains Arguments
| Argument | Interpretation |
|---|---|
--help | Displays the online help for this command. |
| Specifies the name of the container. |
fabric:container-list, container-list — lists the containers in a fabric
fabric:container-list [--help] [--version Version] [[-v] | [--verbose]] [[ID] | [profile]]
Table 8.14 describes the command's arguments.
Table 8.14. fabric:container-list Arguments
| Argument | Interpretation |
|---|---|
--help
| Displays the online help for this command |
--version
| Specifies a profile version to use as filter. |
-v, --verbose
| Display verbose output. |
| Specifies a container ID to use in filtering the output. |
| Specifies a profile to use in filtering the output. When a profile is specified only the containers with the profile are listed. |
fabric:container-remove-profile, container-remove-profile — removes the specified list of profiles from the container
fabric:container-remove-profile [--help] {Name} {Profiles}
fabric:container-remove-profile, describes the command's arguments.
Table 8.15. fabric:container-remove-profile Arguments
| Argument | Interpretation |
|---|---|
--help | Displays the online help for this command |
| Specifies the name of the container. |
| Specifies the list of profiles to remove from the container. |
fabric:container-resolver-list — show the resolver policies for the specified containers
fabric:container-resolver-list [--help] [containers]
For all containers in the fabric, list the resolver policy and the following variants of the host address: local IP address, local hostname, public IP address, public hostname, and manually specified IP address.
The host addresses are found by looking them up in the Fabric Registry for each container. This information is stored in the Fabric Registry at the time when the container is created. In most cases, only the local IP address and the local hostname are known. The public IP address and public hostname are generally available only for cloud containers.
Table 8.16 describes the command's arguments.
Table 8.16. fabric:container-resolver-list Arguments
| Argument | Interpretation |
|---|---|
--help
| Displays the online help for this command |
| List of containers for which the resolver policy is displayed. Shows all containers by default. |
fabric:container-resolver-set — specifies how the container reports its address to other containers
fabric:container-resolver-set [--help] [--container ] [--all] {nameResolver}
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 |
|---|---|
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 |
The manualip resolver policy is a special case. If none of the standard
resolver policies are suitable for your network set-up, you can manually specify a
container's host address by setting the following key in the Fabric Registry:
/fabric/registry/containers/config/ContainerName/manualipTable 8.17 describes the command's arguments.
Table 8.17. fabric:container-resolver-set Arguments
| Argument | Interpretation |
|---|---|
--help
| Displays the online help for this command |
--container
| Apply the resolver policy to the specified container. |
--all
| Apply the resolver policy to all containers in the fabric. |
| (Required) The resolver policy to set on the
specified container(s). Possible values are: localip,
localhostname, publicip,
publichostname, manualip. |
fabric:container-rollback — roll back the specified containers to an older version
fabric:container-rollback [--help] [--all] {Version} [ContainerList]
Table 8.18 describes the command's arguments.
Table 8.18. fabric:container-rollback Arguments
| Argument | Interpretation |
|---|---|
--help
| Displays the online help for this command |
--all
| Roll back all containers. |
| (Required) The version to roll back to. |
| The list of containers to roll back. An empty list implies the current container. |
fabric:container-start, container-start — start the specified container
fabric:container-start [--help] {name}
Table 8.19 describes the command's arguments.
Table 8.19. fabric:container-start Arguments
| Argument | Interpretation |
|---|---|
--help
| Displays the online help for this command |
| Specifies the name of the container. |
fabric:container-stop, container-stop — shuts down the specified container
fabric:container-stop [--help] {Name}
Table 8.20 describes the command's arguments.
Table 8.20. fabric:container-stop Arguments
| Argument | Interpretation |
|---|---|
--help
| Displays the online help for this command |
| (Required) The name of the container. |
fabric:container-upgrade — upgrade the specified containers to a new version
fabric:container-upgrade [--help] [--all] {Version} [ContainerList]
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:
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
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 |
|---|---|
Instead of adding the option |
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
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
Table 8.21 describes the command's arguments.
Table 8.21. fabric:container-upgrade Arguments
| Argument | Interpretation |
|---|---|
--help
| Displays the online help for this command |
--all
| Upgrade all containers. |
| (Required) The version to upgrade to. |
| The list of containers to upgrade. An empty list implies the current container. |
fabric:create — creates a new fabric and imports fabric profiles
fabric:create [--help] [--clean] [--no-import] [--import-dir ] [[-v] | [--verbose]] [[-t] | [--time]dir] [[-n] | [--non-managed]] [[-p] | [--profile]millis] [--new-user profile] [--new-user-password
username] [--new-user-role password] [--zookeeper-password
role] [--generate-zookeeper-password] [[-g] | [--global-resolver]zooPassword] [[-r] | [--resolver]policy] [[-m] | [--manual-ip]policy] [--min-port ipAddress] [--max-port port] [portContainerList]
This command is used to create a new fabric. It can also be used to change the Fabric Servers in an existing fabric. Converting the current container into a fabric has two important side effects:
The contents of a container should now be managed using fabric profiles. Do not try to deploy bundles and features directly in a fabric container.
The default JAAS realm is superseded by the Zookeeper login module, which
stores user data in the Zookeeper registry. As the fabric is created it
initializes the user data by importing all of the user data that it finds in the
etc/users.properties file. If the users.properties
file is empty, you can specify a new user explicitly using the
--new-user and --new-user-password options (at
least one user must be defined).
If you want to create your own import directory with custom profile data, it is recommended that you proceed as follows:
Create a fabric that imports the sample profiles (for example, using
fabric:create).
Modify the sample profiles using the fabric:profile-create,
fabric:profile-delete, and fabric:edit
commands.
Export the modified profiles using the fabric:export
command.
Table 8.22 describes the command's arguments.
Table 8.22. fabric:create Arguments
| Argument | Interpretation |
|---|---|
--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-managed | Specifies 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
When using this option, you must also specify
a password using the |
--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 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 |
--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. |
| The list of containers to include in the ensemble. An empty list implies the current container. |
Create a fabric and import sample profiles from the directory, as
follows:ESBInstallDir/fabric/import
fabric:create --clean
Create a fabric without imported profiles, as follows:
fabric:create --clean --no-import
Create a fabric and import profiles from the custom import directory,
CustomImportDir, as follows:
fabric:create --clean --import-dir CustomImportDirRe-create a fabric such that the containers, reg1, reg2, and
reg3, are now included in the registry ensemble (an ensemble must
consist of an odd number of containers):
fabric:create reg1 reg2 reg3
In this case, the contents of the Zookeeper registry are preserved and the ensemble is expanded to include the specified containers.
fabric:ensemble-add — extend the current Fabric Ensemble by converting the specified containers into Fuse Servers
fabric:ensemble-add [--help] {ContainerList}
Because the total number of containers in an ensemble must always be odd, you should add an even number of containers.
For example, consider a fabric consisting of three
containers—root1, root2, and
root3—where root1 is an Fuse Server and
root2 and root3 are ordinary Fabric Containers. You can
now add root2 and root3 to the current ensemble by entering
the following console command:
fabric:ensemble-add root2 root3
Normally, it makes sense to have at most one Fabric Server running on each host, so that the specified containers are actually running on remote hosts (hence, it usually does not make sense to add child containers to an ensemble). You do not need to provide any information about where the containers are running, however, because fabric already knows the location of the containers in the fabric.
![]() | Note |
|---|---|
Because the Fabric Ensemble is the key component of Fuse Fabric, changing the ensemble is a critical operation. All data will be preserved and copied to the new Fuse Servers before switching. |
Table 8.23 describes the command's arguments.
Table 8.23. fabric:ensemble-add Arguments
| Argument | Interpretation |
|---|---|
--help
| Displays the online help for this command |
| The list of containers to add. |
fabric:ensemble-list — lists the Fuse Servers in the current Fabric Ensemble
fabric:ensemble-list [--help]
For a complete listing of all the containers in the fabric, use
fabric:container-list instead.
Table 8.24 describes the command's arguments.
Table 8.24. fabric:ensemble-list Arguments
| Argument | Interpretation |
|---|---|
--help
| Displays the online help for this command |
fabric:ensemble-password — display the ensemble password
fabric:ensemble-password [--help]
The ensemble password protects access to the Zookeeper nodes under the
/fabric/ path, which contains critical configuration data for the
fabric. To ensure integrity of the fabric configuration data, you should modify the
fabric configuration exclusively using the fabric:* console commands.
Table 8.25 describes the command's arguments.
Table 8.25. fabric:ensemble-password Arguments
| Argument | Interpretation |
|---|---|
--help
| Displays the online help for this command |
fabric:ensemble-remove — remove the specified containers from the current ensemble
fabric:ensemble-remove [--help] {ContainerList}
Re-create the current ensemble, excluding the specified containers from the ensemble. All containers are switched to this new ensemble.
![]() | Note |
|---|---|
Because the Fabric Ensemble is the key component of Fuse Fabric, changing the ensemble is a critical operation. All data will be preserved and copied to the new ensemble before switching. |
Table 8.26 describes the command's arguments.
Table 8.26. fabric:ensemble-remove Arguments
| Argument | Interpretation |
|---|---|
--help
| Displays the online help for this command |
| The list of containers to remove. Must be an even number of containers. |
fabric:export — export the contents of the Fabric Registry to the specified directory in the filesystem
fabric:export [--help] [-d|--delete] [-p|--path path] [-f|--regex regex] [-rf|--reverse-regex regex] [-t|--trim] [--dry-run] {target}
The output of this command is compatible with the import options of the other
fabric commands.
The regular expression options, -f and -rf, provide you with
considerable flexibility at specifying which parts of the Fabric Registry to export. For
example, to export every version of the default profile's data, you could use a
command like the following:
fabric:export -f /fabric/configs/versions/[0-9\\.]*/profiles/default/.*
Where a double-backslash, \\, is required to escape the period,
., so that the period gets interpreted as a character literal.
Table 8.27 describes the commands arguments.
Table 8.27. fabric:export Arguments
| Argument | Interpretation |
|---|---|
--help | Displays the online help for this command |
-d,--delete | Delete the existing contents of the target directory before exporting. Caution: Performs a recursive delete! |
-p,--path | Top-level znode to export. Default is /. |
-f,--regex | Specifies a regular expression that matches the znode paths you want to
include in the export. For multiple include expressions,
specify this option multiple times. The regular expression syntax is defined by the
java.util.regex package. |
-rf,--reverse-regex | Specifies a regular expression that matches the znode paths you want to
exclude from the export. For multiple exclude expressions,
specify this option multiple times. The regular expression syntax is defined by the
java.util.regex package. |
-t,--trim | Trims the first timestamp comment line in properties files starting with the
# character. |
--dry-run | Log the actions that would be performed during an export, but do not actually perform the export. |
| Path of the directory to export to. Default is ./export. |
fabric:import — import data either from a filesystem or from a properties file into the Fabric Registry
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}
Table 8.28 describes the commands arguments.
Table 8.28. fab:start Arguments
| Argument | Interpretation |
|---|---|
--help | Displays the online help for this command |
-fs,--filesystem | Indicates that the source argument is a directory on
the filesystem. Defaults to true. |
-props,--properties | Indicates that the source argument is a properties
file. Defaults to false. |
-t,--target | Path of the znode that the data is imported into. Default is
/. |
-d,--delete | Delete any paths that are not in the tree being imported. Ignored when importing a properties file. Caution: Using this option could permanently delete all or part of the Fabric Registry. |
-f,--regex | Specifies a regular expression that matches the znode paths you want to
include in the import. For multiple include expressions,
specify this option multiple times. The regular expression syntax is defined by the
java.util.regex package. |
-rf,--reverse-regex | Specifies a regular expression that matches the znode paths you want to
exclude from the import. For multiple exclude expressions,
specify this option multiple times. The regular expression syntax is defined by the
java.util.regex package. |
-v,--verbose | Verbose log of files being imported. |
--dry-run | Log the actions that would be performed during an import, but do not actually perform the import. |
| Location of a filesystem (if --filesystem is specified) or a
properties file (if --properties is specified). Defaults to
./import. |
fabric:join — join a container to an existing fabric
fabric:join [--help] [[-f] | [--force]] [[-p] | [--profile]] [[-n] | [--non-managed]] [--zookeeper-password ProfilezooPassword] [[-r] | [--resolver]] [[-m] | [--manual-ip]policy] [--min-port ipAddressport] [--max-port port] URL [ContainerName]
The fabric:join command can be used in either of the following
scenarios:
You have an existing fabric, A, and you want to join a standalone container to fabric A.
You have two separate fabrics, A and B, and you want to transfer a container from fabric B to fabric A.
Table 8.29 describes the command's arguments.
Table 8.29. fabric:join Arguments
| Argument | Interpretation |
|---|---|
--help
| Displays the online help for this command. |
-f, --force | Forces the provided container name to be used. |
-p, --profile | Specifies 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-managed | Registers 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. |
| Specifies the URL of one of the Fabric Servers, specified in the format
.
The value defaults to
2181. |
| Specifies 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. |
The following command will add a standalone container to a fabric as a managed container:
fabric:join myhostA ishmael
Where myhostA is the hostname of a Fabric Server (you must connect to a
Fabric Server, not an ordinary fabric container) and the container is assigned the name
ishmael. You will be prompted to enter the fabric's Zookeeper password.
![]() | Important |
|---|---|
If the container being added to a fabric is assigned the same name as a container that is already a part of the fabric, the original container will be reset to have the same settings as the new container. |
![]() | Warning |
|---|---|
If no container name is specified as part of the command, the command will use the
value of the |
To make sure that the container starts up with a specific profile, you use the
-p argument as follows:
fabric:join -p whaler myhostA ishmael
The container ishmael is assigned the profile, whaler, when it
joins the fabric.
If you want to be able to configure the container manually, but take advantage of the fabric's discovery features, you can add the container as a non-managed container using the following command:
fabric:join -n myhostA ishmael
fabric:mq-create — create a new broker profile
fabric:mq-create [--help] [--group groupName] [--networks brokerGroup,... ] [--create-container containerID,... ] [--assign-container containerID,... ] [--config configFile] [--data dataDir] [--version version] {name}
Table 8.30 describes the command's arguments.
Table 8.30. fabric:mq-create Arguments
| Argument | Description |
|---|---|
--help | Displays the online help for this command. |
--group | Specifies the name of the group to which brokers using this profile are
assigned. By default brokers are assigned to the default group. |
--networks | Specifies a comma separated list of broker groups to which brokers using this profile will establish network connections to form a network of brokers. See Using Networks of Brokers for more information. |
--create-container | Specifies a comma separated list of child containers to create using the new profile. The new containers will be children of the container from which the command is executed. |
--assign-container | Specifies a comma separated list of containers to which the new profile will be deployed. |
--config | Specifies the ensemble path of the XML configuration template used by the
profile. The path will have the syntax
/fabric/configs/versions/. |
--data | Specifies the path, relative to the container, for storing the persistence data for a broker using the profile. |
--version | Specifies the version into which the profile is stored. Defaults to the current default version. |
| Specifies the name of the new broker profile. |
To create a new broker profile with the name myBrokerProfile that uses the
XML template file myConfigTemplate.xml use the command:
fabric:mq-create --config /fabric/configs/versions/1.0/profiles/mq-base/myConfigTemplate.xml myBrokerProfile
To create a new broker profile and create a new container using the new profile use the command:
fabric:mq-create --config /fabric/configs/versions/1.0/profiles/mq-base/myConfigTemplate.xml --create-container broker1 myBrokerProfile
To create a new broker profile and associate it with an existing container use the command:
fabric:mq-create --config /fabric/configs/versions/1.0/profiles/mq-base/myConfigTemplate.xml --assign-container container1 myBrokerProfile
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-change-parents [--help] [--version ] {versionName} {ParentList}
Table 8.31 describes the command's arguments.
Table 8.31. fabric:profile-change-parents Arguments
| Argument | Interpretation |
|---|---|
--help
| Displays the online help for this command |
--version
| The profile version. Defaults to the current default version (use
version-list to find the current default). |
| (Required) Name of the profile. |
| (Required) The list of new parent profiles. |
fabric:profile-create — create a new profile with the specified name and version
fabric:profile-create [--help] [--version ] [--parents version] {parentListName}
The new profile is created only for the version you specify (or
the current default version). If you want to create a profile for every version, you
must invoke fabric:profile-create separately for each version (use
fabric:version-list to list all versions).
The newly created profile is initially empty, apart from the settings inherited from
the parent profiles. To add settings to the new profile, use the
fabric:profile-edit command.
For example, to add the new profile, test, which has the current default
version and inherits from the parent profiles, mq and camel,
enter the following console command:
fabric:profile-create --parents mq --parents camel test
Table 8.32 describes the command's arguments.
Table 8.32. fabric:profile-create Arguments
| Argument | Interpretation |
|---|---|
--help
| Displays the online help for this command |
--version
| The profile version. Defaults to the current default version (use
version-list to find the current default). |
--parents
| Optionally specifies one or multiple parent profiles. To specify
multiple parent profiles, specify this flag multiple times on the
command line—for example, --parents foo --parents
bar. |
| (Required) Name of the new profile. |
fabric:profile-delete — delete the specified version of the specified profile (where the version defaults to the current default version)
fabric:profile-delete [--help] [--version ] {versionProfile}
Table 8.33 describes the command's arguments.
Table 8.33. fabric:profile-delete Arguments
| Argument | Interpretation |
|---|---|
--help
| Displays the online help for this command |
--version
| The profile version to delete. Defaults to the current default
version (use version-list to find the current
default). |
| (Required) Name of the profile to delete. |
fabric:profile-display — displays information about the specified version of the specified profile (where the version defaults to the current default version)
fabric:profile-display [--help] [--version ] [[-o] | [--overlay]version] {Profile}
Table 8.34 describes the command's arguments.
Table 8.34. fabric:profile-display Arguments
| Argument | Interpretation |
|---|---|
--help
| Displays the online help for this command |
--version
| Select a specific profile version. Defaults to the current default
version (use version-list to find the current
default). |
-o, --overlay
| Enable overlay. Shows the effective profile settings, taking into account the settings inherited from parent profiles. |
| (Required) The name of the profile. |
fabric:profile-edit — edits the specified version of the specified profile (where the version defaults to the current default version)
fabric:profile-edit [--help] [[-p] | [--pid]] [[-r] | [--repositories] | [-f] | [--features] | [-b] | [--bundles] | [-c] | [--config] | [-s] | [--system]] [[--set] | [--delete]] [--import-pid] {PIDProfile} [Version]
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 --repositoriesRepoListProfile[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/featuresProfile[Version]
To delete repositories, enter a command of the following form:
fabric:profile-edit --delete --repositoriesRepoListProfile[Version]
Features to install—to add features to the profile, enter a command in the following format:
fabric:profile-edit --featuresFeatureListProfile[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 --featuresFeatureListProfile[Version]
Bundles to install—to add bundles to the profile, enter a command in the following format:
fabric:profile-edit --bundlesBundleListProfile[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 --bundlesBundleListProfile[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 --pidPID/Property=ValueProfile[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 --pidPID/PropertyProfile[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 --configProperty=ValueProfile[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=80Profile[Version]
To delete a Java system property from config.properties, enter a
command of the following form:
fabric:profile-edit --delete --configPropertyProfile[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 --systemProperty=ValueProfile[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=8181Profile[Version]
To delete a Java system property from system.properties, enter a
command of the following form:
fabric:profile-edit --delete --systemPropertyProfile[Version]
![]() | Important |
|---|---|
Any modifications you make to a profile using |
REVISIT - Need proper explanation of --import-pid option.
Table 8.35 describes the command's arguments.
Table 8.35. fabric:profile-edit Arguments
| Argument | Interpretation |
|---|---|
--help
| Displays the online help for this command |
-p, --pid | Edit an OSGi configuration property, specified in the format
PID/Property. |
-r, --repositories | Edit the list of feature repositories. |
-f, --features | Edit features, specifying a comma-separated list of features to add (or delete). |
-b, --bundles | Edit bundles, specifying a comma-separated list of bundles to add (or delete). |
-c, --config | Edit the Java system properties that affect the Apache Karaf container
(analogous to editing etc/config.properties in a root
container). |
-s, --system | Edit the Java system properties that affect installed bundles
(analogous to editing etc/system.properties in a root
container). |
--set | Set or create values (selected by default). |
--delete | Delete values. |
--import-pid | Imports the PIDs that are edited, from local OSGi Config Admin. |
| (Required) Name of the profile to edit. |
| Version of the profile to edit. Defaults to the current default
version (use version-list to find the current
default). |
fabric:profile-list — lists all profiles that belong to the specified version (where the version defaults to the current default version)
fabric:profile-list [--help] [--version ]version
Table 8.36 describes the command's arguments.
Table 8.36. fabric:profile-list Arguments
| Argument | Interpretation |
|---|---|
--help
| Displays the online help for this command |
--version
| Specifies the version of the profiles to list. Defaults to the
current default version (use version-list to find the
current default). |
fabric:require-profile-delete — deletes requirements on the specified profile
fabric:require-profile-delete [--help] {Profile}
Table 8.37 describes the command's arguments.
Table 8.37. fabric:require-profile-delete Arguments
| Argument | Interpretation |
|---|---|
--help
| Displays the online help for this command |
| A profile ID. |
fabric:require-profile-list — lists all profile requirements in the current fabric
fabric:require-profile-list [--help]
For example, if both the example-camel profile and the
example-cxf profile have requirements set, you could see output like
the following:
karaf@root> fabric:require-profile-list [profile] [# minimum] [# maximum] [depends on] example-camel 2 4 example-cxf 2 4
Table 8.38 describes the command's arguments.
Table 8.38. fabric:require-profile-list Arguments
| Argument | Interpretation |
|---|---|
--help
| Displays the online help for this command |
fabric:require-profile-set — associates requirements with the specified profile
fabric:require-profile-set [--help] [--minimum
] [--maximum
MinInstance] [--dependsOn
MaxInstance] {DependencyProfile}
Requirements associated with a profile are used to assess the health of the current fabric. Profile requirements are entirely passive. For example, if the number of running instances of a profile is less than the minimum or greater than the maximum, monitoring tools can be configured to indicate a problem or to trigger an alert. Otherwise, the requirements have no effect on the fabric.
In Fuse IDE a green/red bar indicates what proportion of the required profile instances are currently running in the fabric.
For example, to require a range of 2 to 4 running instances of the
example-camel profile, you would enter the following command:
karaf@root> require-profile-set --minimum 2 --maximum 4 example-camel
Table 8.39 describes the command's arguments.
Table 8.39. fabric:require-profile-set Arguments
| Argument | Interpretation |
|---|---|
--help
| Displays the online help for this command |
--minimum
| The minimum number of instances of this profile expected to be running in the fabric. |
--maximum
| The maximum number of instances of this profile expected to be running in the fabric. |
--dependsOn
| The profile IDs that must be provisioned before this profile. |
| A profile ID. |
fabric:status — displays the current status of the fabric, based on the configured profile requirements
fabric:status [--help]
This command summarizes the health of the fabric, based on requirements previously
configured by the fabric:require-profile-set command. For example, if you
configured the example-camel profile to require a minimum of two instances
and a maximum of four instances, and there is currently only one instance running, the
example-camel profile would get a health rating of 50%.
The fabric:status command produces output like the following:
karaf@root> fabric:status [profile] [instances] [health] cloud 1 100% example-camel 0 0% example-cxf 0 0% fabric 1 100% fabric-ensemble-0000-1 1 100%
Table 8.40 describes the command's arguments.
Table 8.40. fabric:status Arguments
| Argument | Interpretation |
|---|---|
--help
| Displays the online help for this command |
fabric:version-create — create a new version
fabric:version-create [--help] [--parent
] {parentVersionVersion}
Create a new version, by default copying all of the profiles from the
current latest version into the new version. You can specify which
version to copy the profiles from using the --parent option. If no version
is specified, the command creates a new minor version by default. For example:
karaf@root> fabric:version-list
[version] [default] [# containers]
1.0 true 1
karaf@root> fabric:version-create
Created version: 1.1 as copy of: 1.0
karaf@root> fabric:version-list
[version] [default] [# containers]
1.0 true 1
1.1 false 0 Table 8.41 describes the command's arguments.
Table 8.41. fabric:version-create Arguments
| Argument | Interpretation |
|---|---|
--help
| Displays the online help for this command |
--default
| Set the created version to be the new default version. |
--parent
| The parent version. By default, use the latest version as the parent. |
| The new version to create. If not specified, defaults to the next minor version. |
fabric:version-delete — delete the specified version
fabric:version-delete [--help] {Version}
Delete the specified version.
![]() | Warning |
|---|---|
This command also deletes all of the profile data associated with the deleted version. |
Table 8.42 describes the command's arguments.
Table 8.42. fabric:version-delete Arguments
| Argument | Interpretation |
|---|---|
--help
| Displays the online help for this command |
| (Required) The version to delete. |
fabric:version-list — lists the existing versions
fabric:version-list [--help]
For example:
karaf@root> fabric:version-list [version] [default] [# containers] 1.0 true 1 1.1 false 0
Table 8.43 describes the command's arguments.
Table 8.43. fabric:version-list Arguments
| Argument | Interpretation |
|---|---|
--help
| Displays the online help for this command |
fabric:version-set-default — set the new default version (must be one of the existing versions)
fabric:version-set-default [--help] {Version}
Many of the fabric console commands work with a default version. For example, when you
create a new profile with fabric:profile-create, the new profile is created
in the default version by default. The fabric:version-set-default changes
the default version that is used by these commands.
Table 8.44 describes the command's arguments.
Table 8.44. fabric:version-set-default Arguments
| Argument | Interpretation |
|---|---|
--help
| Displays the online help for this command |
| (Required) Version number to use as the new default 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.
features:addurl, addurl — registers one or more URLs to feature repositories with the container
features:addurl [--help] [[-i] | [--install-all]] {urls}
Each feature repository defines one or more features, and each feature is made up of a collection of bundles that work together to provide some functionality. When a feature is loaded, the container loads any required bundles that are not already present into the container and activates them.
Table 9.1 describes the command's arguments.
Table 9.1. features:addurl Arguments
| Argument | Interpretation |
|---|---|
--help
| Displays the online help for this command |
-i, --install-all
| Install all of the features in the specified feature repository URLs. |
| One or more repository URLs separated by whitespaces. |
features:chooseurl, chooseurl — registers the feature repository URL for a well known project
features:chooseurl [--help] {project} {version}
Fuse ESB Enterprise uses a number of features implemented by well-known projects. To simplify the process of adding their feature repositories, the chooseurl command allows you to add a feature repository without knowing its Maven URL. The list of projects supported by chooseurl is configured by the org.apache.karaf.features.repos PID.
Table 9.2 describes the command's arguments.
Table 9.2. features:chooseurl Arguments
| Argument | Interpretation |
|---|---|
--help
| Displays the online help for this command |
| Specifies the project name for the feature repository to add. |
| Specifies the version of the project's feature repository to add. |
features:info — show information about the specified feature with the optionally specified version
features:info [--help] [[-c] | [--configuration]] [[-b] | [--bundle]] [[-t] | [--tree]] [[-d] | [--dependency]] {featureName} {version}
Table 9.3 describes the command's arguments.
Table 9.3. features:info Arguments
| Argument | Interpretation |
|---|---|
--help
| Displays the online help for this command |
-c, --configuration
| Display configuration information. |
-b, --bundle | Display bundle information. |
-t, --tree | Display feature tree. |
-d, --dependency | Display dependency information. |
|
features:install — installs a feature
features:install [--help] {name} [version]
Table 9.4 describes the command's arguments.
Table 9.4. features:install Arguments
| Argument | Interpretation |
|---|---|
--help
| Displays the online help for this command |
| The name of the feature to install |
| The version of the feature |
features:list — Lists all existing features available from the defined repositories
features:list [--help] [[-i] | [--installed]]
Table 9.5 describes the command's arguments.
Table 9.5. features:list Arguments
| Argument | Interpretation |
|---|---|
--help
| Displays the online help for this command |
-i, --installed
| Displays the list of all installed features |
features:listurl — lists the features repository URLs
features:listurl [--help] [[-v] | [--validate]] [[-vo] | [--verbose]]
Table 9.6 describes the command's arguments.
Table 9.6. features:listurl Arguments
| Argument | Interpretation |
|---|---|
--help
| Displays the online help for this command |
-v,--validate | Validate current version of descriptors. |
-vo,--verbose | Shows validation output. |
features:listVersions, listVersions — lists all versions of a feature available from the current feature repositories
features:listVersions [--help] {feature}
Table 9.7 describes the command's arguments.
Table 9.7. features:listVersions Arguments
| Argument | Interpretation |
|---|---|
--help
| Displays the online help for this command |
| Name of a feature. |
features:refreshUrl — reloads the list of available features from the repositories
features:refreshUrl [--help] {urls}
Table 9.8 describes the command's arguments.
Table 9.8. features:refreshUrl Arguments
| Argument | Interpretation |
|---|---|
--help
| Displays the online help for this command |
| The repository URLs to reload (leave empty for all). |
features:removeUrl — removes the specified list of repository URLs from the features service
features:removeUrl [--help] {urls}
Table 9.9 describes the command's arguments.
Table 9.9. features:removeUrl Arguments
| Argument | Interpretation |
|---|---|
--help
| Displays the online help for this command |
-n,--interval | |
| One or more repository URLs separated by whitespace. |
features:removeRepository — removes the specified repository from the features service
features:removeRepository [--help] {repository}
Table 9.10 describes the command's arguments.
Table 9.10. features:removeRepository Arguments
| Argument | Interpretation |
|---|---|
--help
| Displays the online help for this command |
| The name of a features repository. |
features:uninstall — uninstalls a feature with the specified name and version
features:uninstall [--help] {features}
Table 9.11 describes the command's arguments.
Table 9.11. features:uninstall Arguments
| Argument | Interpretation |
|---|---|
--help
| Displays the online help for this command |
| A space-separated list of features to uninstall, where each feature is specified
in the format
(that is, the version is optional). |
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:
Start the editing session.
jaas:manage
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.
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.
jass:cancel, cancel — cancels a JAAS editing session without applying the pending changes
jaas:cancel [--help]
When editing a JAAS realm, the changes are buffered until the editing session is closed. The jaas:cancel command clears the buffer without saving the changes and closes the editing session.
You can see a list of the buffered changes using the jaas:pending command.
Table 10.1 describes the command's arguments.
Table 10.1. jaas:cancel Arguments
| Argument | Interpretation |
|---|---|
--help
| Displays the online help for this command |
jaas:manage, manage — opens a JAAS realm for editing
jaas:manage [--help] {[--realm realm] | [--index index]} [--module module] [--force]
The jaas:manage command is the first step in editing a JAAS realm. It opens the realm so that calls to the jaas:* editing commands will update the selected realm. The edits made by the jaas:* editing commands are placed in a buffer associated with the selected realm and not written to the realm until the editing session is ended by the jaas:update command.
If you use the jaas:manage command before saving the changes to a realm that is open for editing, the changes to the previously open realm are abandoned. The pending edits for the previous realm are cleared without being saved.
While editing a realm you can get a list of the pending changes using the jaas:pending command.
Table 10.2 describes the command's arguments.
Table 10.2. jaas:manage Arguments
| Argument | Interpretation |
|---|---|
--help | Displays the online help for this command. |
--realm | Select the realm to edit by specifying its realm name. |
--index | Select the realm to edit by specifying its index. |
--module | Specify which of the realm's login modules are to be edited. |
--force | Force the switch to the specified realm. If a different realm was already opened for editing its changes are abandoned without being applied. |
You can select the realm to manage either by specifying its realm name or by specifying its index.
If the installed realm names are all distinct (which you can check using
jaas:realms), you can identify the realm to manage by specifying the
--realm option. For example, if the container is a standalone instance (no
fabric installed), you can start to edit the karaf realm as follows:
jaas:manage --realm karafIf the container belongs to a fabric, however, the fabric-jaas feature
automatically installs another realm named karaf at a higher priority, so that it
overrides the default karaf realm. For example, in a fabric, the
jaas:realms command returns a list similar to the following:
Index Realm Module Class
1 karaf org.apache.karaf.jaas.modules.properties.PropertiesLoginModule
2 karaf org.fusesource.fabric.jaas.ZookeeperLoginModuleIn this case, you must identify the realm to manage using the --index option,
specifying one of the index values from the list. The current active karaf realm
is the ZookeeperLoginModule, which is selected by the index value,
2, as follows:
jaas:manage --index 2jaas:pending, pending — lists the changes waiting to be applied to the realm being edited
jaas:pending [--help]
When editing a JAAS realm, the changes are stored in a buffer until the editing session is closed. The jaas:pending command shows a list of the changes buffered during the currently open editing session.
The jaas:update command saves the changes and closes the editing session.
The jaas:cancel command clears the buffer without saving the changes and closes the editing session.
Table 10.3 describes the command's arguments.
Table 10.3. jaas:pending Arguments
| Argument | Interpretation |
|---|---|
--help | Displays the online help for this command. |
jaas:realms, realms — lists the JAAS realms know to the container
jaas:realms [--help]
Table 10.4 describes the command's arguments.
Table 10.4. jaas:realms Arguments
| Argument | Interpretation |
|---|---|
--help | Displays the online help for this command. |
jaas:roleadd, roleadd — adds a role to a user
jaas:roleadd [--help] {username} {role}
When editing a JAAS realm, the changes are buffered until the editing session is closed. When you add a new role using the jaas:roleadd command, the change is stored in the buffer and does not take effect until the editing session is closed.
The jaas:update command saves the changes and closes the editing session.
The jaas:cancel command clears the buffer without saving the changes and closes the editing session.
Table 10.5 describes the command's arguments.
Table 10.5. jaas:roleadd Arguments
| Argument | Interpretation |
|---|---|
--help
| Displays the online help for this command. |
username | Specifies the name of the user to modify. |
role | Specifies the role which is appended to the user data. |
jaas:roledel, roledel — deletes a role from a user
jaas:roledel [--help] {username} {role}
When editing a JAAS realm, the changes are buffered until the editing session is closed. When you delete a role using the jaas:roledel command, the change is stored in the buffer and does not take effect until the editing session is closed.
The jaas:update command saves the changes and closes the editing session.
The jaas:cancel command clears the buffer without saving the changes and closes the editing session.
Table 10.6 describes the command's arguments.
Table 10.6. jaas:roledel Arguments
| Argument | Interpretation |
|---|---|
--help | Displays the online help for this command. |
username | Specifies the name of the user to modify. |
role | Specifies the role which is removed from the user data. |
jaas:update — applies all pending changes to the JAAS realm and closes the editing session
jaas:update [--help]
When editing a JAAS realm, the changes are buffered until the editing session is closed. The jaas:update command saves the buffered changes to the realm and closes the editing session.
You can see a list of the buffered changes using the jaas:pending command.
Table 10.7 describes the command's arguments.
Table 10.7. jaas:update Arguments
| Argument | Interpretation |
|---|---|
--help | Displays the online help for this command. |
jaas:useradd, useradd — adds a user to the JAAS realm being edited
jaas:useradd [--help] {username} {password}
When editing a JAAS realm, the changes are buffered until the editing session is closed. When you add a new user using the jaas:useradd command, the change is stored in the buffer and does not take effect until the editing session is closed.
The jaas:update command saves the changes and closes the editing session.
The jaas:cancel command clears the buffer without saving the changes and closes the editing session.
Table 10.8 describes the command's arguments.
Table 10.8. jaas:useradd Arguments
| Argument | Interpretation |
|---|---|
--help | Displays the online help for this command. |
username | Specifies the name of the user to add. |
password | Specifies the password used to authenticate the user. |
jaas:userdel, userdel — deletes a user from the JAAS realm being edited
jaas:userdel [--help] {username}
When editing a JAAS realm, the changes are buffered until the editing session is closed. When you delete a user using the jaas:useradd command, the change is stored in the buffer and does not take effect until the editing session is closed.
The jaas:update command saves the changes and closes the editing session.
The jaas:cancel command clears the buffer without saving the changes and closes the editing session.
Table 10.9 describes the command's arguments.
Table 10.9. jaas:userdel Arguments
| Argument | Interpretation |
|---|---|
--help | Displays the online help for this command. |
username | Specifies the name of the user to add. |
jaas:users, users — lists the users in the JAAS realm being edited
jaas:users [--help]
Table 10.10 describes the command's arguments.
Table 10.10. jaas:users Arguments
| Argument | Interpretation |
|---|---|
--help | Displays the online help for this command. |
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.
log:clear — clears the log
log:clear [--help]
Table 11.1 describes the command's arguments.
Table 11.1. log:clear Arguments
| Argument | Interpretation |
|---|---|
--help
| Displays the online help for this command |
log:display, display, ld — displays log entries
log:display [--help] [-p pattern] [-n numLines] [--no-color]
Table 11.2 describes the command's arguments.
Table 11.2. log:display Arguments
| Argument | Interpretation |
|---|---|
--help
| Displays the online help for this command |
-p
| The pattern for formatting the output |
-n
| The number of entries to display |
--no-color
| Do not use syntax highlighting when displaying the log. |
log:display-exception, display-exception, lde — displays the last thrown exception from the log
log:display-exception [--help]
Table 11.3 describes the command's arguments.
Table 11.3. log:display-exception Arguments
| Argument | Interpretation |
|---|---|
--help
| Displays the online help for this command |
log:get, get — shows the log level
log:get [--help] {logger}
Table 11.4 describes the command's arguments.
Table 11.4. log:get Arguments
| Argument | Interpretation |
|---|---|
--help
| Displays the online help for this command |
| Specifies the logger name, ALL, or
ROOT. The default is ROOT. |
log:set, set — sets the log level
log:set [--help] {[DEFAULT] | [TRACE] | [DEBUG] | [INFO] | [WARN] | [ERROR]} {logger}
Table 11.5 describes the command's arguments.
Table 11.5. log:set Arguments
| Argument | Interpretation |
|---|---|
--help
| Displays the online help for this command |
level
| Specifies the logging level. |
| Specifies the logger name. The default is ROOT. |
log:tail — continually displays log entries
log:tail [--help] [-p pattern] [-n numLines] [--no-color]
Table 11.6 describes the command's arguments.
Table 11.6. log:tail Arguments
| Argument | Interpretation |
|---|---|
--help
| Displays the online help for this command |
-p
| The pattern for formatting the output |
-n
| The number of entries to display |
--no-color
| Do not use syntax highlighting when displaying the log. |
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.
osgi:bundle-level, bundle-level — gets or sets the start level of a given bundle
osgi:bundle-level [--help] [--force] {id} [startLevel]
Table 12.1 describes the command's arguments.
Table 12.1. osgi:bundle-level Arguments
| Argument | Interpretation |
|---|---|
--help
| Displays the online help for this command. |
--force
| Forces the command to execute. |
| Specifies the id for the bundle. |
| Specifies the new start level for the bundle. |
osgi:bundle-services, bundle-services — lists the OSGi services provided by a bundle
osgi:bundle-level [-u] [-p] [-a] [--help] [--force] {id}
Table 12.2 describes the command's arguments.
Table 12.2. osgi:bundle-services Arguments
| Argument | Interpretation |
|---|---|
-u
| Displays the services used by the bundle. |
-p
| Displays the properties for each service. |
-a
| Displays all of the services provided by the bundle including the Apache Karaf commands which are hidden by default. |
--help
| Displays the online help for this command. |
--force
| Forces the command to execute. |
| Specifies the id for the bundle. |
osgi:classes, classes — lists all of the classes in the specified bundle or bundles
osgi:classes [--help] [--force] [[-a] | [--display-all-files]] {ids}
Table 12.3 describes the command's arguments.
Table 12.3. osgi:classes Arguments
| Argument | Interpretation |
|---|---|
--help
| Displays the online help for this command. |
--force
| Forces the command to execute. |
-a, --display-all-files
| Also lists the files contained in the bundles. |
| Space-separated list of bundle IDs. |
osgi:find-class, find-class — locates a specified class in any deployed bundle
osgi:find-class [--help] {className}
Table 12.4 describes the command's arguments.
Table 12.4. osgi:find-class Arguments
| Argument | Interpretation |
|---|---|
--help
| Displays the online help for this command. |
| Class name or partial class name to find. |
osgi:headers, headers — displays the headers of a specified OSGi bundle
osgi:headers [--help] {id...}
Table 12.5 describes the command's arguments.
Table 12.5. osgi:headers Arguments
| Argument | Interpretation |
|---|---|
--help
| Displays the online help for this command |
| Specifies a space delimited list of bundle IDs. |
osgi:info — displays detailed information about OSGi bundles
osgi:info [--help] {id...}
Table 12.6 describes the command's arguments.
Table 12.6. osgi:info Arguments
| Argument | Interpretation |
|---|---|
--help
| Displays the online help for this command |
| Specifies a space delimited list of bundle IDs. |
osgi:install, install — installs one or more OSGi bundles
osgi:install [--help] [[-s] | [--start]] {url...}
Table 12.7 describes the command's arguments.
Table 12.7. osgi:install Arguments
| Argument | Interpretation |
|---|---|
--help
| Displays the online help for this command |
-s, --start
| Starts the bundles after installation |
| Specifies a space delimited list of bundle URLs. |
osgi:list, list — lists the installed bundles whose start level equals or exceeds the specified threshold
osgi:list [--help] [-u] [-t threshold] [-l] [-s]
Table 12.8 describes the command's arguments.
Table 12.8. osgi:list Arguments
| Argument | Interpretation |
|---|---|
--help
| Displays the online help for this command |
-u
| Shows the update locations |
-t | Specifies the start level threshold. The default is the value of the
karaf.systemBundlesStartLevel property whose default value is
50. |
-l
| Shows the locations of the bundles |
-s
| Shows the symbolic names of the bundles |
osgi:ls, ls — lists OSGi services
osgi:ls [--help] [-a] [-u] [--force] [id...]
Table 12.9 describes the command's arguments.
Table 12.9. osgi:ls Arguments
| Argument | Interpretation |
|---|---|
--help
| Displays the online help for this command |
-a
| Lists all services |
-u
| Lists the services in use |
--force
| Forces the command to execute |
| Specifies a space separated list of bundle IDs. |
osgi:refresh, refresh — refreshes an OSGi bundle
osgi:refresh [--help] [--force] {id...}
Table 12.10 describes the command's arguments.
Table 12.10. osgi:refresh Arguments
| Argument | Interpretation |
|---|---|
--help
| Displays the online help for this command. |
--force
| Forces the command to execute. |
| Specifies a space delimited list of bundle IDs. |
osgi:resolve, resolve — resolves an OSGi bundle's dependencies
osgi:resolve [--help] [--force] {id...}
Table 12.11 describes the command's arguments.
Table 12.11. osgi:resolve Arguments
| Argument | Interpretation |
|---|---|
--help
| Displays the online help for this command. |
--force
| Forces the command to execute. |
| Specifies a space delimited list of bundle IDs. |
osgi:restart, restart — stops and restarts an OSGi bundle
osgi:restart [--help] [--force] {id...}
Table 12.12 describes the command's arguments.
Table 12.12. osgi:restart Arguments
| Argument | Interpretation |
|---|---|
--help
| Displays the online help for this command. |
--force
| Forces the command to execute. |
| Specifies a space delimited list of bundle IDs. |
osgi:shutdown, shutdown — stops the OSGi framework
osgi:shutdown [--help] [[-f] | [--force]] [[hh:mm] | [+m]]
Table 12.13 describes the command's arguments.
Table 12.13. osgi:shutdown Arguments
| Argument | Interpretation |
|---|---|
--help
| Displays the online help for this command. |
-f, --force | Forces the command to execute. |
hh:mm | Specifies the time to shut down the broker in hours and minutes. The time
is specified in 24 hour time. For example, 13:30 specifies that the
container will shutdown at 1:30pm. |
+
| Specifies the time, in minutes, to pause before shutting down the OSGi
framework. For example, +30 specifies that the container will wait
thirty minutes before shutting down the OSGi framework. |
osgi:start, start — starts an OSGi bundle
osgi:start [--help] [--force] {id...}
Table 12.14 describes the command's arguments.
Table 12.14. osgi:start Arguments
| Argument | Interpretation |
|---|---|
--help
| Displays the online help for this command. |
--force
| Forces the command to execute. |
| Specifies a space delimited list of bundle IDs. |
osgi:start-level, start-level — gets or sets the OSGi framework's active start level
osgi:start [--help] [level]
Table 12.15 describes the command's arguments.
Table 12.15. osgi:start-level Arguments
| Argument | Interpretation |
|---|---|
--help
| Displays the online help for this command. |
| Specifies the new start level to set. |
osgi:stop, stop — stops an OSGi bundle
osgi:stop [--help] [--force] {id...}
Table 12.16 describes the command's arguments.
Table 12.16. osgi:stop Arguments
| Argument | Interpretation |
|---|---|
--help
| Displays the online help for this command. |
--force
| Forces the command to execute. |
| Specifies a space delimited list of bundle IDs. |
osgi:uninstall, uninstall — uninstalls an OSGi bundle
osgi:uninstall [--help] [--force] {id...}
Table 12.17 describes the command's arguments.
Table 12.17. osgi:uninstall Arguments
| Argument | Interpretation |
|---|---|
--help
| Displays the online help for this command. |
--force
| Forces the command to execute. |
| Specifies a space delimited list of bundle IDs. |
osgi:update, update — updates an OSGi bundle
osgi:update [--help] [--force] {id} [location]
Table 12.18 describes the command's arguments.
Table 12.18. osgi:update Arguments
| Argument | Interpretation |
|---|---|
--help
| Displays the online help for this command. |
--force
| Forces the command to execute. |
| Specifies ID of the bundle. |
| Specifies the location from which the update is loaded. If no location is specified the container will use either the bundle's Bundle-UpdateLocation property or the bundle's original location. |
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.
packages:exports, exports — displays the packages exported OSGi bundles
packages:export [--help] [[-d] | [--details]] [-s] [[-i] | [--imports]] [id...]
Table 13.1 describes the commands arguments.
Table 13.1. package:exports Arguments
| Argument | Interpretation |
|---|---|
--help
| Displays the online help for this command |
-d, --details | Reformat the output in master/detail layout, which makes it easier to see how related details are grouped together. |
-s | Show the Symbolic name column, which shows the symbolic name of the
bundle to which the exported package belongs. |
-i, --imports
| Show the Imported by column, which lists all of the bundles that
import the exported package. |
| Specifies a whitespace separated list of bundle IDs to check. |
packages:imports, imports — displays the packages imported by OSGi bundles
packages:imports [--help] [[-i] | [--show-importer]] [id...]
Table 13.2 describes the commands arguments.
Table 13.2. package:imports Arguments
| Argument | Interpretation |
|---|---|
--help
| Displays the online help for this command |
-i, --show-importer
| Show the bundle(s) that import a package. |
| Specifies a whitespace separated list of bundle IDs to check. |
system directoryThe 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:
You receive a notice from customer support that a patch is available.
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.
You install the patch using the patch:install command.
If you notice that the patch is causing issues, you can remove it using the patch:rollback command.
![]() | 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.
patch:add, download — download a patch file from a remote location and places the relevant JAR files
in the container's system directory
patch:add [--help] [--bundles] {URL}
Table 14.1 describes the command's arguments.
Table 14.1. patch:add Arguments
| Argument | Interpretation |
|---|---|
--help | Displays the online help for this command. |
--bundles | List the bundles included in the patch. |
URL | Specifies the URL from which the patch is downloaded. |
patch:install — installs a patch that was previously downloaded
patch:install [--help] {patch}
Table 14.2 describes the command's arguments.
Table 14.2. patch:install Arguments
| Argument | Interpretation |
|---|---|
--help | Displays the online help for this command. |
patch | Specifies the name of the patch to install. |
patch:list — lists all known patches, showing the patch name and status (installed or not)
patch:list [--help] [--bundles]
Table 14.3 describes the command's arguments.
Table 14.3. patch:list Arguments
| Argument | Interpretation |
|---|---|
--help | Displays the online help for this command. |
--bundles | List the bundles for each patch. |
patch:rollback — reverses a patch installation
patch:rollback [--help] {patch}
Table 14.4 describes the command's arguments.
Table 14.4. patch:rollback Arguments
| Argument | Interpretation |
|---|---|
--help | Displays the online help for this command. |
patch | Specifies the name of the patch to roll back. |
patch:simulate, simulate — logs all of the actions that would be performed during a patch install, without actually performing the install
patch:simulate [--help] {patch}
Table 14.5 describes the command's arguments.
Table 14.5. patch:simulate Arguments
| Argument | Interpretation |
|---|---|
--help | Displays the online help for this command. |
patch | Specifies the name of the patch to simulate installing. |
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.
ssh:ssh, ssh — connects to a remote SSH server
ssh:ssh [--help] [[-l username] | [--username username]] [[-P password] | [--password password]] [[-p port] | [--port port]] {hostname} [command]
Table 15.1 describes the commands arguments.
Table 15.1. ssh:ssh Arguments
| Argument | Interpretation |
|---|---|
--help
| Displays the online help for this command |
-l, --username
| The username for remote login |
-P, --password
| The password for remote login |
-p, --port
| The port to use for the SSH connection |
| The hostname to connect to via SSH |
| Specifies a command to execute upon connecting. |
ssh:sshd, sshd — creates an SSH server
ssh:sshd [--help] [[-b] | [--background]] [[-p port] | [--port port]]
Table 15.2 describes the commands arguments.
Table 15.2. ssh:sshd Arguments
| Argument | Interpretation |
|---|---|
--help | Displays the online help for this command |
-b, --background
| Specifies that the service will run in the background. |
-p, --port
| Specifies the port to setup for the SSH server. The default is
8101. |
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.
web:list — lists the WARs deployed in the container
web:list [--help]
Table 16.1 describes the command's arguments.
Table 16.1. web:list Arguments
| Argument | Interpretation |
|---|---|
--help
| Displays the online help for this command |
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
zk:create — create a znode
zk:create [--help] [-r|--recursive] [-i|--import] [-e|--ephemeral] [-s|--sequential] [-a|--acl ListOfACLs] [-o|--overwrite] {path} {data}
Using this command, you can create the following different types of znode:
The new znode is permanently stored in the ZooKeeper registry. This is the default.
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.
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.
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:anyoneThe permissions apply to all users.
auth:The permissions apply to all authenticated users, irrespective of their identity
(the field is left empty).ID
digest:MD5HashThe permissions apply to the user whose username and password generate the specified
MD5 hash value, .MD5Hash
ip:IPAddressThe permissions apply to the ZooKeeper client with the specified IP address.
The string consists of one or more of
the following characters: Permissionsr (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 |
|---|---|
To avoid corruption of the fabric registry, you should not create
any znodes under the |
![]() | 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 |
Table 17.1 describes the commands arguments.
Table 17.1. zk:create Arguments
| Argument | Interpretation |
|---|---|
--help | Displays the online help for this command |
-r,--recursive | Automatically create any missing parent nodes in the specified path. |
-i,--import | Interpret the data argument as a URL that locates a resource containing the initial data for the new znode. |
-e,--ephemeral | Make the new znode epehemeral, so that it is automatically deleted after the current ZooKeeper client session closes. |
-s,--sequential | Make the new znode sequential, which implies that a unique 10-digit suffix is appended to the znode name. |
-a,--acl | Specifies the znode's ACL as a comma-separated list, where each entry in the list
has the format,
.
The string consists of the
following characters, concatenated in any order: r (read), w
(write), c (create), d (delete), and a
(admin). |
-o,--overwrite | Overwrite the existing znode at this location, if there is one. |
| (Required) Path of the znode to create. |
| Initial data for the node or, if --import is specified, a URL
pointing at a location that contains the initial data. |
zk:delete — delete the specified znode
zk:delete [--help] [-v|--version version] [-r|--recursive] {path}
Table 17.2 describes the commands arguments.
Table 17.2. zk:delete Arguments
| Argument | Interpretation |
|---|---|
--help | Displays the online help for this command |
-v,--version | The ZooKeeper znode version to delete. Defaults to -1 (all versions). |
-r,--recursive | Recursively delete children. Defaults to false. |
| Path of the znode to delete. |
zk:get — get a znode's data
zk:get [--help] {path}
Table 17.3 describes the commands arguments.
Table 17.3. zk:get Arguments
| Argument | Interpretation |
|---|---|
--help | Displays the online help for this command |
| (Required) Path of the znode to get. |
zk:list — list a znode's children
zk:list [--help] [-r|--recursive] [-d|--display] {path}
Table 17.4 describes the commands arguments.
Table 17.4. zk:list Arguments
| Argument | Interpretation |
|---|---|
--help | Displays the online help for this command |
-r, --recursive | List children recursively. |
-d, --display | Display a znode's value, if set. |
| Path of the znode to list. Defaults to /. |
zk:set — set a znode's data
zk:set [--help] [-i|--import] {path} {data}
The data stored in a znode should not be too large. ZooKeeper imposes an absolute limit of 1 MB, but in practice a data item should normally be much smaller than that.
![]() | Important |
|---|---|
To avoid corruption of the Fabric Registry, you should not modify
any znodes under the |
Table 17.5 describes the commands arguments.
Table 17.5. zk:set Arguments
| Argument | Interpretation |
|---|---|
--help | Displays the online help for this command |
-i,--import | Import data from a URL. |
| (Required) Path of the znode to set. |
| (Required) The new data or URL to import. |
The command console shell uses a number of short cuts, or aliases for common commands. Table A.1 lists the command aliases available in the command console.
Table A.1. Console Command Aliases
| Alias | Command |
|---|---|
| ld | log:display |
| lde | log:display-exception |
| la | osgi:list -t 0 |
| cl | config:list "(service.pid=$args)" |
| man | help |