-
Language:
English
-
Language:
English
Red Hat Training
A Red Hat training course is available for Red Hat Fuse
Configuring and Running Red Hat JBoss Fuse
Managing the runtime container
Red Hat
Copyright © 2011-2014 Red Hat, Inc. and/or its affiliates.
Abstract
Chapter 1. Configuring the Initial Features in a Standalone Container
Abstract
Overview
etc/org.apache.karaf.features.cfg
file to discover the feature URLs (feature repository locations) and to determine which features it will load. By default, Red Hat JBoss Fuse loads a large number of features and you may not need all of them. You may also decide you need features that are not included in the default configuration.
etc/org.apache.karaf.features.cfg
are only used the first time the container is started. On subsequent start-ups, the container uses the contents of the InstallDir/data
directory to determine what to load. If you need to adjust the features loaded into a container, you can delete the data
directory, but this will also destroy any state or persistence information stored by the container.
Modifying the default installed features
Modifying the default set of feature URLs
Chapter 2. Installing Red Hat JBoss Fuse as a Service
Abstract
- Generate the service wrapper for your system.
- Configure the service wrapper for your system.
- Install the service wrapper as system service.
2.1. Generating the Service Wrapper
Abstract
Overview
wrapper
feature generates a wrapper around the JBoss Fuse runtime that allows you to install a message broker as a system service. The wrapper
feature does not come preinstalled in the console, so before you can generate the service wrapper you must install the wrapper
feature.
Procedure
- Start JBoss Fuse in console mode using the fuse command.
- Once the console is started and the command prompt appears, enter
features:install wrapper
.The features:install command will locate the required libraries to provision the wrapper feature and deploy it into the run time. - Generate the wrapper by entering
wrapper:install -n serviceName -d displayName -D description
.The wrapper:install command has the options described in Table 2.1, “Wrapper Install Options”.Table 2.1. Wrapper Install Options
Option Default Description -s
AUTO_START
Specifies the mode in which the service is installed. Valid values are AUTO_START
orDEMAND_START
.-n
karaf
Specifies the service name that will be used when installing the service. -d
Specifies the display name of the service. -D
Specifies the description of the service.
Generated files
etc\ServiceName-wrapper(.exe)
—the executable file for the wrapper.bin\ServiceName-service(.bat)
—the script used to install and remove the service.etc\ServiceName-wrapper.conf
—the wrapper's configuration file.- Three library files required by the service wrapper:
lib\libwrapper.so
lib\karaf-wrapper.jar
lib\karaf-wrapper-main.jar
2.2. Configuring the Wrapper
Abstract
ServiceName-wrapper.conf
file, which is located under the InstallDir/etc/
directory.
Overview
ServiceName-wrapper.conf
file, which is located under the InstallDir/etc/
directory.
- Environment variables
- Properties passed to the JVM
- Classpath
- JMX settings
- Logging settings
JAVA_HOME
environment variable.
Specifying the Red Hat JBoss Fuse's environment
JAVA_HOME
—the Java runtime install directory.KARAF_HOME
—the location of the Red Hat JBoss Fuse install directory.KARAF_BASE
—the root directory containing the configuration and OSGi data specific to the broker instance.The configuration for the broker instance is stored in theKARAF_BASE/conf
directory. Other data relating to the OSGi runtime is also stored beneath the base directory.KARAF_DATA
—the directory containing the logging and persistence data for the broker.
Example 2.1. Default Environment Settings
set.default.JAVA_HOME=JavaInstallDir set.default.KARAF_HOME=InstallDir set.default.KARAF_BASE=InstallDir set.default.KARAF_DATA=InstallDir\data
JAVA_HOME
either as a system variable in the registry (for example, through the system control panel) or in ServiceName-wrapper.conf
, as shown in the preceding example. Setting JAVA_HOME
as a regular environment variable, however, does not work.
Passing parameters to the JVM
wrapper.java.additional.<n>
. <n> is a sequence number that must be distinct for each parameter.
wrapper.java.additional.<n>=-DPropName=PropValue
.
Example 2.2. Default Java System Properties
# JVM # note that n is the parameter number starting from 1. wrapper.java.additional.1=-Dkaraf.home="%KARAF_HOME%" wrapper.java.additional.2=-Dkaraf.base="%KARAF_BASE%" wrapper.java.additional.3=-Dkaraf.data="%KARAF_DATA%" wrapper.java.additional.4=-Dcom.sun.managment.jmxremote wrapper.java.additional.5=-Dkaraf.startLocalConsole=false wrapper.java.additional.6=-Dkaraf.startRemoteShell=true wrapper.java.additional.7=-Djava.endorsed.dirs="%JAVA_HOME%/jre/lib/endorsed;%JAVA_HOME%/lib/endorsed;%KARAF_HOME%/lib/endorsed" wrapper.java.additional.8=-Djava.ext.dirs="%JAVA_HOME%/jre/lib/ext;%JAVA_HOME%/lib/ext;%KARAF_HOME%/lib/ext"
Adding classpath entries
wrapper.java.classpath.<n>
. <n> is a sequence number that must be distinct for each classpath entry.
Example 2.3. Default Wrapper Classpath
wrapper.java.classpath.1=%KARAF_BASE%/lib/karaf-wrapper.jar wrapper.java.classpath.2=%KARAF_HOME%/lib/karaf.jar wrapper.java.classpath.3=%KARAF_HOME%/lib/karaf-jaas-boot.jar wrapper.java.classpath.4=%KARAF_BASE%/lib/karaf-wrapper-main.jar
JMX configuration
- Locate the line
# Uncomment to enable jmx
.There are three properties, shown in Example 2.4, “Wrapper JMX Properties”, that are used to configure JMX.Example 2.4. Wrapper JMX Properties
# Uncomment to enable jmx #wrapper.java.additional.n=-Dcom.sun.management.jmxremote.port=1616 #wrapper.java.additional.n=-Dcom.sun.management.jmxremote.authenticate=false #wrapper.java.additional.n=-Dcom.sun.management.jmxremote.ssl=false
- Remove the
#
from in front of each of the properties. - Replace the
n
in each property to a number that fits into the sequence of addition properties established in the configuration.
Configuring logging
Table 2.2. Wrapper Logging Properties
Property | Description |
---|---|
wrapper.console.format |
Specifies how the logging information sent to the console is formated. The format consists of the following tokens:
|
wrapper.console.loglevel | Specifies the logging level displayed on the console. |
wrapper.logfile | Specifies the file used to store the log. |
wrapper.logfile.format | Specifies how the logging information sent to the log file is formated. |
wrapper.console.loglevel | Specifies the logging level sent to the log file. |
wrapper.console.maxsize | Specifies the maximum size, in bytes, that the log file can grow to before the log is archived. The default value of 0 disables log rolling. |
wrapper.console.maxfiles | Specifies the maximum number of archived log files which will be allowed before old files are deleted. The default value of 0 implies no limit. |
wrapper.syslog.loglevel | Specifies the logging level for the sys/event log output. |
2.3. Installing and Starting the Service
Overview
Windows
InstallDir\bin\ServiceName-service.bat install
. If you used the default start setting, the service will start when Windows is launched. If you specified DEMAND_START
, you will need to start the service manually.
net start "ServiceName"
. You can also use the Windows service UI.
net stop "ServiceName"
You can also use the Windows service UI.
InstallDir\bin\ServiceName-service.bat remove
.
Redhat Linux
#
ln -s InstallDir/bin/ServiceName-service /etc/init.d/
#
chkconfig ServiceName-service --add
#
chkconfig ServiceName-service on
service ServiceName-service start
.
service ServiceName-service stop
.
#
service ServiceName-service stop
#
chkconfig ServiceName-service --del
#
rm /etc/init.d/ServiceName-service
Ubuntu Linux
#
ln -s InstallDir/bin/ServiceName-service /etc/init.d/
#
update-rc.d ServiceName-service defaults
/etc/init.d/ServiceName-service start
.
/etc/init.d/ServiceName-service stop
.
#
/etc/init.d/ServiceName-service stop
#
rm /etc/init.d/ServiceName-service
Chapter 3. Basic Security
Abstract
3.1. Configuring Basic Security
Overview
Before you start the container
Create a secure JAAS user
InstallDir/etc/users.properties
file and add a new user field, as follows:
Username=Password,admin
Username
and Password
are the new user credentials. The admin
role gives this user the privileges to access all administration and management functions of the container. For more details about JAAS, see Chapter 14, Configuring JAAS Security.
Ports exposed by the Red Hat JBoss Fuse container
Figure 3.1. Ports Exposed by the Red Hat JBoss Fuse Container
- Console port—enables remote control of a container instance, through Apache Karaf shell commands. This port is enabled by default and is secured both by JAAS authentication and by SSH.
- JMX port—enables management of the container through the JMX protocol. This port is enabled by default and is secured by JAAS authentication.
- Web console port—provides access to an embedded Jetty container that can host Web console servlets. By default, the Fuse Management Console is installed in the Jetty container.
Enabling the remote console port
- JAAS is configured with at least one set of login credentials.
- The JBoss Fuse runtime has not been started in client mode (client mode disables the remote console port completely).
./client -u Username -p Password
Username
and Password
are the credentials of a JAAS user with admin
privileges. For more details, see Chapter 8, Using Remote Connections to Manage a Container.
Strengthening security on the remote console port
- Make sure that the JAAS user credentials have strong passwords.
- Customize the X.509 certificate (replace the Java keystore file,
InstallDir/etc/host.key
, with a custom key pair).
Enabling the JMX port
jconsole
) and connect to the following JMX URI:
service:jmx:rmi:///jndi/rmi://localhost:1099/karaf-root
/karaf-ContainerName
. If you change the container name from root
to some other name, you must modify the JMX URI accordingly.
Strengthening security on the Fuse Management Console port
3.2. Disabling Broker Security
Overview
Standalone server
InstallDir/etc/activemq.xml
file using a text editor and look for the following lines:
...
<plugins>
<jaasAuthenticationPlugin configuration="karaf" />
</plugins>
...
jaasAuthenticationPlugin
element. The next time you start up the Red Hat JBoss Fuse container (using the InstallDir/bin/fusemq
script), the broker will run with unsecured ports.
Chapter 4. Starting and Stopping Red Hat JBoss Fuse
Abstract
4.1. Starting Red Hat JBoss Fuse
Abstract
Overview
Setting up your environment
bin
directory of your JBoss Fuse installation to the PATH
environment variable, as follows:
set PATH
=%PATH
%;InstallDir\bin
export PATH
=$PATH
,InstallDir/bin
Launching the runtime
_ ____ ______ | | _ \ | ____| | | |_) | ___ ___ ___ | |__ _ _ ___ ___ _ | | _ / _ \/ __/ __| | __| | | / __|/ _ \ | |__| | |_) | (_) \__ \__ \ | | | |_| \__ \ __/ \____/|____/ \___/|___/___/ |_| \__,_|___/\___| JBoss Fuse (6.0.0.redhat-xxx) http://www.redhat.com/products/jbossenterprisemiddleware/fuse/ 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 JBoss Fuse. JBossFuse:karaf@root>
Launching the runtime in server mode
bin/fuse server
start
script in the InstallDir/bin
directory.
Launching the runtime in client mode
4.2. Stopping Red Hat JBoss Fuse
stop
script.
Stopping an instance from a local console
fuse
or fuse client
, you can stop it by doing one of the following at the karaf>
prompt:
- Type
shutdown -f
- Press Ctrl+D
Stopping an instance running in server mode
fuse server
or by running the start
script, you can stop it remotely, as described in Section 8.3, “Stopping a Remote Container”.
InstallDir/bin
directory:
./admin stop
instanceName./stop
etc/org.apache.karaf.shell.cfg
is set to the default value of 0.0.0.0, you can run the stop
script without any arguments. However, if you have configured a different hostname, you must run stop -h hostname
.
Chapter 5. Creating a New Fabric
Abstract
Static IP address required for Fabric Server
- For simple examples and tests (with a single Fabric Server) you can work around the static IP requirement by using the loopback address,
127.0.0.1
. - For distributed tests (multiple Fabric Servers) and production deployments, you must assign a static IP address to each of the Fabric Server hosts.
--resolver manualip --manual-ip StaticIPAddress
options to specify the static IP address explicitly, when creating a new Fabric Server.
Procedure
- (Optional) Customise the name of the root container by editing the
InstallDir/etc/system.properties
file and specifying a different name for this property:karaf.name=root
NoteFor the first container in your fabric, this step is optional. But at some later stage, if you want to join a root container to the fabric, you might need to customise the container's name to prevent it from clashing with any existing root containers in the fabric. - Any existing users in the
InstallDir/etc/users.properties
file are automatically used to initialize the fabric's user data, when you create the fabric. You can populate theusers.properties
file, by adding one or more lines of the following form:Username=Password[,RoleA][,RoleB]...
But there must not be any users in this file that have theadmin
role. If theInstallDir/etc/users.properties
already contains users with theadmin
role, you should delete those users before creating the fabric.WarningIf you leave some administrator credentials in theusers.properties
file, this represents a security risk because the file could potentially be accessed by other containers in the fabric.NoteThe initialization of user data fromusers.properties
happens only once, at the time the fabric is created. After the fabric has been created, any changes you make tousers.properties
will have no effect on the fabric's user data. - If you use a VPN (virtual private network) on your local machine, it is advisable to log off VPN before you create the fabric and to stay logged off while you are using the local container.NoteA local Fabric Server is permanently associated with a fixed IP address or hostname. If VPN is enabled when you create the fabric, the underlying Java runtime is liable to detect and use the VPN hostname instead of your permanent local hostname. This can also be an issue with multi-homed machines.
- Start up your local container.In JBoss Fuse, start the local container as follows:
cd InstallDir/bin ./fuse
NoteIf you want to create a fabric on a remote container, you can log into it using theInstallDir/bin/client
command-line utility. - Create a new fabric by entering the following command:
JBossFuse:karaf@root> fabric:create --new-user AdminUser --new-user-password AdminPass --zookeeper-password ZooPass --resolver manualip --manual-ip StaticIPAddress --wait-for-provisioning
The current container, namedroot
by default, becomes a Fabric Server with a registry service installed. Initially, this is the only container in the fabric. The--new-user
and--new-user-password
options specify the credentials for a new administrator user. The Zookeeper password is used to protect sensitive data in the Fabric registry service (all of the nodes under/fabric
). The--manual-ip
option specifies the Fabric Server's static IP addressStaticIPAddress
(see the section called “Static IP address required for Fabric Server”).For more details on fabric:create see section "Description" in "Console Reference"section "Description" in "Console Reference".
Fabric creation process
- The container installs the requisite OSGi bundles to become a Fabric Server.
- The Fabric Server starts a registry service, which listens on IP port 2181 (which makes fabric configuration data available to all of the containers in the fabric).
- The Fabric Server installs a new JAAS realm (based on the ZooKeeper login module), which overrides the default JAAS realm and stores its user data in the ZooKeeper registry.
- The new Fabric Ensemble consists of a single Fabric Server (the current container).
- A default set of profiles is imported from
InstallDir/fabric/import
(can optionally be overridden). - After the standalone container is converted into a Fabric Server, the previously installed OSGi bundles and Karaf features are completely cleared away and replaced by the default Fabric Server configuration. For example, some of the shell command sets that were available in the standalone container are no longer available in the Fabric Server.
Expanding a Fabric
- Child container, created on the local machine as a child process in its own JVM.Instructions on creating a child container are found in Child Containers.
- SSH container, created on any remote machine for which you have
ssh
access.Instructions on creating a SSH container are found in SSH Containers. - Cloud container, created on compute instance in the cloud.Instructions on creating a cloud container are found in Cloud Containers.
Chapter 6. Joining a Fabric
Overview
- A managed container is a full member of the fabric and is managed by a Fabric Agent. The agent configures the container based on information provided by the fabric's ensemble. The ensemble knows which profiles are associated with the container and the agent determines what to install based on the contents of the profiles.
- A non-managed container is not managed by a Fabric Agent. Its configuration remains intact after it joins the fabric and is controlled as if the container were a standalone container. Joining the fabric in this manner registers the container with the fabric's ensemble and allows clients to locate the services running in the container using the fabric's discovery mechanism.
Joining a fabric as a managed container
fabric
profile. If you want to preserve the previous configuration of the container, however, you must ensure that the fabric has an appropriately configured profile, which you can deploy into the container after it joins the fabric.
-p
option enables you to specify a profile to install into the container once the agent is installed.
Joining a fabric as an non-managed container
osgi:install
, features:install
, and hot deployment), because a Fabric Agent does not take control of its configuration. The agent only registers the container with the fabric's ensemble and keeps the registry entries for it up to date. This enables the newly joined container to discover services running in the container (through Fabric's discovery mechanisms) and to administer these services.
How to join a fabric
- Get the registry service URL for one of the Fabric Servers in the existing fabric. The registry service URL has the following format:
Hostname[:IPPort]
Normally, it is sufficient to specify just the hostname, Hostname, because the registry service uses the fixed port number, 2182, by default. In exceptional cases, you can discover the registry service port by following the instructions in the section called “How to discover the URL of a Fabric Server”. - Get the ZooKeeper password for the fabric. An administrator can access the fabric's ZooKeeper password at any time, by entering the following console command (while logged into one of the Fabric Containers):
JBossFuse:karaf@root> fabric:ensemble-password
- Connect to the standalone container's command console.
- Join a container in one of the following ways:
- Join as a managed container, with a default profile—uses the
fabric
profile.JBossFuse:karaf@root> fabric:join --zookeeper-password ZooPass URL ContainerName
- Join as a managed container, specifying a custom profile—uses a custom profile.
JBossFuse:karaf@root> fabric:join --zookeeper-password ZooPass -p Profile URL ContainerName
- Join as a non-managed container—preserves the existing container configuration.
JBossFuse:karaf@root> fabric:join -n --zookeeper-password ZooPass URL ContainerName
Where you can specify the following values:-
ZooPass
- The existing fabric's ZooKeeper password.
-
URL
- The URL for one of the fabric's registry services (usually just the hostname where a Fabric Server is running).
-
ContainerName
- The new name of the container when it registers itself with the fabric.WarningIf the container your're adding to the fabric has the same name as a container already registered with the fabric, both containers will be reset and will always share the same configuration.
-
Profile
- The name of the custom profile to install into the container after it joins the fabric (managed container only).
- If you joined the container as a managed container, you can subsequently deploy a different profile into the container using the
fabric:container-change-profile
console command.
How to discover the URL of a Fabric Server
- Connect to the command console of one of the containers in the fabric.
- Enter the following sequence of console commands:
JBossA-MQ:karaf@root>
config:edit io.fabric8.zookeeper
JBossA-MQ:karaf@root>
config:proplist
service.pid = io.fabric8.zookeeper zookeeper.url = myhostA:2181,myhostB:2181,myhostC:2181,myhostC:2182,myhostC:2183 fabric.zookeeper.pid = io.fabric8.zookeeperJBossA-MQ:karaf@root>
config:cancel
Thezookeeper.url
property holds a comma-separated list of Fabric Server URLs. You can use any one of these URLs to join the fabric.
Chapter 7. Shutting Down a Fabric
Overview
Shutting down a managed container
fabric:container-stop
command, specifying the name of the managed container—for example:
fabric:container-stop ManagedContainerName
fabric:container-stop
command looks up the container name in the registry and retrieves the data it needs to shut down that container. This approach works no matter where the container is deployed: whether on a remote host or in a cloud.
Shutting down a Fabric Server
registry1
, registry2
, and registry3
, you can shut down at most one of these Fabric Servers at a time using the fabric:container-stop
command—for example:
fabric:container-stop -f registry3
-f
flag is required when shutting down a container that belongs to the ensemble.
fabric:container-start registry3
Shutting down an entire fabric
- To take a concrete example, consider a fabric which consists of the following containers:
- Three Fabric Servers (ensemble servers):
registry1
,registry2
,registry3
. - Four managed containers:
managed1
,managed2
,managed3
,managed4
.
- Use the
client
console utility to log on to one of the containers in the fabric. Because this will be the last container to shut down, it is convenient to choose one of the Fabric Servers. For example, to log on to theregistry1
server, enter the following command:./client -u AdminUser -p AdminPass -h Registry1Host
WhereRegistry1Host
is the host whereregistry1
is running andAdminUser
andAdminPass
are the credentials of a user with administration privileges. It is assumed that theregistry1
server is listening for console connections on the default IP port (that is,8101
) - Shut down all of the managed containers in the fabric, using the
fabric:container-stop
command—for example:fabric:container-stop managed1 fabric:container-stop managed2 fabric:container-stop managed3 fabric:container-stop managed4
- Remove all but one of the Fabric Servers from the ensemble, using the
fabric:ensemble-remove
command. For example, given the ensemble consisting ofregistry1
,registry2
, andregistry3
(where you are logged on toregistry1
), removeregistry2
andregistry3
from the ensemble as follows:fabric:ensemble-remove registry2 registry3
- You can now shut down the
registry2
andregistry3
containers using thefabric:container-stop
command, as follows:fabric:container-stop registry2 fabric:container-stop registry3
- Assuming you are logged on to
registry1
(the sole remaining Fabric Server), shut it down as follows:shutdown -f
- Whenever you restart the fabric, you will have to remember to recreate the ensemble, so that it consists of three Fabric Servers again. For example, to recreate the ensemble consisting of
registry1
,registry2
, andregistry3
, you would restart the three servers, and then enter the following command:fabric:ensemble-add registry2 registry3
Note on shutting down the ensemble
fabric:container-stop registry1 fabric:container-stop registry2 fabric:container-stop registry3
fabric:container-stop
will fail and throw an error. This is because of the quorum-based voting system used by the ensemble (which is designed to protect against network splits). After the first two Fabric servers (registry1
and registry2
) are shut down, fewer than half of the ensemble servers are available. At this point, the registry shuts down and refuses to service any more requests, because there is no longer a quorum of ensemble servers available (that is, fewer than 50% of the ensemble servers are available). This causes a problem for the fabric:container-stop
command, which normally contacts the registry to retrieve details about the container it is trying to shut down.
fabric:ensemble-remove
, before attempting to shut down the ensemble servers.
Chapter 8. Using Remote Connections to Manage a Container
Abstract
8.1. Configuring a Container for Remote Access
Overview
Configuring a container for remote access
InstallDir/etc/org.apache.karaf.shell.cfg
configuration file. Example 8.1, “Changing the Port for Remote Access” shows a sample configuration that changes the port used to 8102.
Example 8.1. Changing the Port for Remote Access
sshPort=8102 sshHost=0.0.0.0
mac = <macName1>,<macName2>,<macNameN>
and cipher = <cipherName1>,<cipherName2>,<cipherNameN>
entries in the etc/org.apache.karaf.shell.cfg
file.
Table 8.1. Default options for mac and cipher properties
Property | Default |
---|---|
mac | hmac-sha1 |
cipher | aes256-ctr,aes192-ctr,aes128-ctr,arcfour256 |
etc/org.apache.karaf.shell.cfg
file override the default settings, so you need to specify all options you want to use. Table 8.2, “Supported options for mac and cipher properties” shows all of the supported mac and cipher options.
Table 8.2. Supported options for mac and cipher properties
Property | Options |
---|---|
mac | hmac-sha1 , hmac-sha1-96 , hmac-md5 , hmac-md5-96 |
cipher | aes128-ctr , aes192-ctr , aes256-ctr , aes128-cbc , aes192-cbc , aes256-cbc , arcfour128 , arcfour256 , blowfish-cbc , 3des-cbc |
8.2. Connecting and Disconnecting Remotely
Abstract
8.2.1. Connecting to a Container from a Remote Container
Overview
Using the ssh:ssh console command
Example 8.2. ssh:ssh Command Syntax
ssh:ssh
{
-l username
} {
-P password
} {
-p port
} {
hostname
}
-
-l username
- The username used to connect to the remote container. Use valid JAAS login credentials that have
admin
privileges (see Chapter 14, Configuring JAAS Security). -
-P password
- The password used to connect to the remote container.
-
-p port
- The SSH port used to access the desired container's remote console.By default this value is
8101
. See the section called “Configuring a container for remote access” for details on changing the port number. -
hostname
- The hostname of the machine that the remote container is running on. See the section called “Configuring a container for remote access” for details on changing the hostname.
etc/users.properties
file. See Chapter 14, Configuring JAAS Securityfor details.
Example 8.3. Connecting to a Remote Console
JBossFuse:karaf@root>ssh:ssh -l smx -P smx -p 8108 hostname
shell:info
at the prompt. Information about the currently connected instance is returned, as shown in Example 8.4, “Output of the shell:info Command”.
Example 8.4. Output of the shell:info Command
Karaf Karaf version 2.2.5.fuse-beta-7-052 Karaf home /Volumes/ESB/jboss-fuse-full-6.0.0.redhat-0XX Karaf base /Volumes/ESB/jboss-fuse-full-6.0.0.redhat-0XX/instances/child1 OSGi Framework org.apache.felix.framework - 4.0.3.fuse-beta-7-052 JVM Java Virtual Machine Java HotSpot(TM) 64-Bit Server VM version 20.6-b01-415 Version 1.6.0_31 Vendor Apple Inc. Uptime 6 minutes Total compile time 24.048 seconds Threads Live threads 62 Daemon threads 43 Peak 287 Total started 313 Memory Current heap size 78,981 kbytes Maximum heap size 466,048 kbytes Committed heap size 241,920 kbytes Pending objects 0 Garbage collector Name = 'PS Scavenge', Collections = 11, Time = 0.271 seconds Garbage collector Name = 'PS MarkSweep', Collections = 1, Time = 0.117 seconds Classes Current classes loaded 5,720 Total classes loaded 5,720 Total classes unloaded 0 Operating system Name Mac OS X version 10.7.3 Architecture x86_64 Processors 2
Disconnecting from a remote console
logout
or press Ctrl+D at the prompt.
8.2.2. Connecting to a Container Using the Client Command-Line Utility
Using the remote client
InstallDir/bin
directory), as follows:
client
client -a 8101 -h hostname -u username -p password shell:info
-p
option, you will be prompted to enter a password.
admin
privileges.
admin
and admin
.
client --help
Example 8.5. Karaf Client Help
Apache Felix Karaf client -a [port] specify the port to connect to -h [host] specify the host to connect to -u [user] specify the user name -p [password] specify the password --help shows this help message -v raise verbosity -r [attempts] retry connection establishment (up to attempts times) -d [delay] intra-retry delay (defaults to 2 seconds) [commands] commands to run If no commands are specified, the client will be put in an interactive mode
Disconnecting from a remote client console
8.2.3. Connecting to a Container Using the SSH Command-Line Utility
Overview
ssh
command-line utility (a standard utility on UNIX-like operating systems) to log in to the Red Hat JBoss Fuse container, where the authentication mechanism is based on public key encryption (the public key must first be installed in the container). For example, given that the container is configured to listen on IP port 8101, you could log in as follows:
ssh -p 8101 jdoe@localhost
Prerequisites
- The container must be standalone (Fabric is not supported) with the
PublickeyLoginModule
installed. - You must have created an SSH key pair (see the section called “Creating a new SSH key pair”).
- You must install the public key from the SSH key pair into the container (see the section called “Installing the SSH public key in the container”).
Default key location
ssh
command automatically looks for the private key in the default key location. It is recommended that you install your key in the default location, because it saves you the trouble of specifying the location explicitly.
~/.ssh/id_rsa ~/.ssh/id_rsa.pub
C:\Documents and Settings\Username\.ssh\id_rsa C:\Documents and Settings\Username\.ssh\id_rsa.pub
Creating a new SSH key pair
ssh-keygen
utility. Open a new command prompt and enter the following command:
ssh-keygen -t rsa -b 2048
Generating public/private rsa key pair. Enter file in which to save the key (/Users/Username/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Installing the SSH public key in the container
InstallDir/etc/keys.properties
file. Each user entry in this file appears on a single line, in the following format:
Username=PublicKey,Role1,Role2,...
~/.ssh/id_rsa.pub
, has the following contents:
ssh-rsa AAAAB3NzaC1kc3MAAACBAP1/U4EddRIpUt9KnC7s5Of2EbdSPO9EAMMeP4C2USZpRV1AIlH7WT2NWPq/xfW6MPbLm1Vs14E7 gB00b/JmYLdrmVClpJ+f6AR7ECLCT7up1/63xhv4O1fnfqimFQ8E+4P208UewwI1VBNaFpEy9nXzrith1yrv8iIDGZ3RSAHHAAAAFQCX YFCPFSMLzLKSuYKi64QL8Fgc9QAAAnEA9+GghdabPd7LvKtcNrhXuXmUr7v6OuqC+VdMCz0HgmdRWVeOutRZT+ZxBxCBgLRJFnEj6Ewo FhO3zwkyjMim4TwWeotifI0o4KOuHiuzpnWRbqN/C/ohNWLx+2J6ASQ7zKTxvqhRkImog9/hWuWfBpKLZl6Ae1UlZAFMO/7PSSoAAACB AKKSU2PFl/qOLxIwmBZPPIcJshVe7bVUpFvyl3BbJDow8rXfskl8wO63OzP/qLmcJM0+JbcRU/53Jj7uyk31drV2qxhIOsLDC9dGCWj4 7Y7TyhPdXh/0dthTRBy6bqGtRPxGa7gJov1xm/UuYYXPIUR/3x9MAZvZ5xvE0kYXO+rx jdoe@doemachine.local
jdoe
user with the admin
role by adding the following entry to the InstallDir/etc/keys.properties
file (on a single line):
jdoe=AAAAB3NzaC1kc3MAAACBAP1/U4EddRIpUt9KnC7s5Of2EbdSPO9EAMMeP4C2USZpRV1AIlH7WT2NWPq/xfW6MPbLm1Vs14E7 gB00b/JmYLdrmVClpJ+f6AR7ECLCT7up1/63xhv4O1fnfqimFQ8E+4P208UewwI1VBNaFpEy9nXzrith1yrv8iIDGZ3RSAHHAAAAFQCX YFCPFSMLzLKSuYKi64QL8Fgc9QAAAnEA9+GghdabPd7LvKtcNrhXuXmUr7v6OuqC+VdMCz0HgmdRWVeOutRZT+ZxBxCBgLRJFnEj6Ewo FhO3zwkyjMim4TwWeotifI0o4KOuHiuzpnWRbqN/C/ohNWLx+2J6ASQ7zKTxvqhRkImog9/hWuWfBpKLZl6Ae1UlZAFMO/7PSSoAAACB AKKSU2PFl/qOLxIwmBZPPIcJshVe7bVUpFvyl3BbJDow8rXfskl8wO63OzP/qLmcJM0+JbcRU/53Jj7uyk31drV2qxhIOsLDC9dGCWj4 7Y7TyhPdXh/0dthTRBy6bqGtRPxGa7gJov1xm/UuYYXPIUR/3x9MAZvZ5xvE0kYXO+rx,admin
id_rsa.pub
file here. Insert just the block of symbols which represents the public key itself.
Checking that public key authentication is supported
jaas:realms
console command, as follows:
Index Realm Module Class 1 karaf org.apache.karaf.jaas.modules.properties.PropertiesLoginModule 2 karaf org.apache.karaf.jaas.modules.publickey.PublickeyLoginModule
PublickeyLoginModule
is installed. With this configuration you can log in to the container using either username/password credentials or public key credentials.
Logging in using key-based SSH
$ ssh -p 8101 jdoe@localhost _ ____ ______ | | _ \ | ____| | | |_) | ___ ___ ___ | |__ _ _ ___ ___ _ | | _ < / _ \/ __/ __| | __| | | / __|/ _ \ | |__| | |_) | (_) \__ \__ \ | | | |_| \__ \ __/ \____/|____/ \___/|___/___/ |_| \__,_|___/\___| JBoss Fuse (6.0.0.redhat-xxx) http://www.redhat.com/products/jbossenterprisemiddleware/fuse/ 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 JBoss Fuse. JBossFuse:fbolton@root>
ssh
utility will prompt you to enter the pass phrase.
8.3. Stopping a Remote Container
Using the stop script
InstallDir/bin
directory.
Example 8.6. stop Script Syntax
stop
[
-a port
] {
-h hostname
} {
-u username
} {
-p password
}
-
-a port
- The SSH port of the remote instance. Defaults to 8101.
-
-h hostname
- The hostname of the machine that the remote instance is running on.
-
-u username
- The username used to connect to the remote instance. Use valid JAAS login credentials that have
admin
privileges -
-p password
- The password used to connect to the remote instance.
Using the remote console
Chapter 9. Managing Child Containers
Abstract
9.1. Standalone Child Containers
Using the admin console commands
Creating child containers
admin:create
in the JBoss Fuse console.
instances/containerName
directory. The new container is a direct copy of its parent. The only difference between parent and child is the port number they listen on. The child container is assigned an SSH port number based on an incremental count starting at 8101.
Example 9.1. Creating a Runtime Instance
FuseESB@root>
admin:create finn
Creating new instance on port 8106 at: /home/fuse/esb4/instances/finn Creating dir: /home/fuse/esb4/instances/finn/bin Creating dir: /home/fuse/esb4/instances/finn/etc Creating dir: /home/fuse/esb4/instances/finn/system Creating dir: /home/fuse/esb4/instances/finn/deploy Creating dir: /home/fuse/esb4/instances/finn/data Creating file: /home/fuse/esb4/instances/finn/etc/config.properties Creating file: /home/fuse/esb4/instances/finn/etc/java.util.logging.properties Creating file: /home/fuse/esb4/instances/finn/etc/org.apache.felix.fileinstall-deploy.cfg Creating file: /home/fuse/esb4/instances/finn/etc/org.apache.karaf.log.cfg Creating file: /home/fuse/esb4/instances/finn/etc/org.apache.karaf.features.cfg Creating file: /home/fuse/esb4/instances/finn/etc/org.apache.karaf.management.cfg Creating file: /home/fuse/esb4/instances/finn/etc/org.ops4j.pax.logging.cfg Creating file: /home/fuse/esb4/instances/finn/etc/org.ops4j.pax.url.mvn.cfg Creating file: /home/fuse/esb4/instances/finn/etc/startup.properties Creating file: /home/fuse/esb4/instances/finn/etc/system.properties Creating file: /home/fuse/esb4/instances/finn/etc/org.apache.karaf.shell.cfg Creating file: /home/fuse/esb4/instances/finn/bin/karaf Creating file: /home/fuse/esb4/instances/finn/bin/start Creating file: /home/fuse/esb4/instances/finn/bin/stop
Changing a child's SSH port
admin:change-port
{
containerName
} {
portNumber
}
Starting child containers
Listing all child containers
Example 9.2. Listing Instances
JBossFuse:karaf@root>
admin:list
Port State Pid Name [ 8107] [Started ] [10628] harry [ 8101] [Started ] [20076] root [ 8106] [Started ] [15924] dick [ 8105] [Started ] [18224] tom
Connecting to a child container
Example 9.3. Admin connect Command
admin:connect
{
containerName
} {
-u username
} {
-p password
}
- containerName
- The name of the child to which you want to connect.
-
-u
username - The username used to connect to the child's remote console. Use valid JAAS user credentials that have admin privileges (see Chapter 14, Configuring JAAS Security).
-
-p
password - This argument specifies the password used to connect to the child's remote console.
JBossFuse:karaf@harry>
Stopping a child container
osgi:shutdown
or simply shutdown
.
admin:stop containerName
.
Destroying a child container
Changing the JVM options on a child container
admin:change-opts
command. For example, you could change the amamount of memory allocated to the child container's JVM, as follows:
JBossFuse:karaf@harry>
admin:change-opts tom "-server -Xms128M -Xmx1345m -Dcom.sun.management.jmxremote"
Using the admin script
InstallDir/bin
directory provides the all of the admin console commands except for admin:connect.
Example 9.4. The admin Script
admin.bat: Ignoring predefined value for KARAF_HOME Available commands: change-port - Changes the port of an existing container instance. create - Creates a new container instance. destroy - Destroys an existing container instance. list - List all existing container instances. start - Starts an existing container instance. stop - Stops an existing container instance. Type 'command --help' for more help on the specified command.
admin.bat list
./admin list
9.2. Fabric Child Containers
Creating child containers
fabric:container-create-child
console command, which has the following syntax:
karaf@root> fabric:container-create-child parent child [number]
child1
, child2
, and so on.
karaf@root> fabric:container-create-child root child 2 The following containers have been created successfully: child1 child2
Listing all container instances
fabric:container-list
console command. For example:
JBossFuse: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
Assigning a profile to a child container
default
profile when it is created. To assign a new profile (or profiles) to a child container after it has been created, use the fabric:container-change-profile
console command.
default
to a newly created container by using the fabric:container-create-child command's --profile
argument.
example-camel
profile to the child1
container, enter the following console command:
JBossFuse:karaf@root> fabric:container-change-profile child1 example-camel
child1
and replaces them with the specified list of profiles (where in this case, there is just one profile in the list, example-camel
).
Connecting to a child container
fabric:container-connect
console command. For example, to connect to child1
, enter the following console command:
JBossFuse:karaf@root>
fabric:container-connect -u admin -p admin child1
Connecting to host YourHost on port 8102 Connected _ ____ ______ | | _ \ | ____| | | |_) | ___ ___ ___ | |__ _ _ ___ ___ _ | | _ < / _ \/ __/ __| | __| | | / __|/ _ \ | |__| | |_) | (_) \__ \__ \ | | | |_| \__ \ __/ \____/|____/ \___/|___/___/ |_| \__,_|___/\___| JBoss Fuse (6.0.0.redhat-xxx) http://www.redhat.com/products/jbossenterprisemiddleware/fuse/ 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 JBoss Fuse. JBossFuse:admin@child1>
Ctrl-D
.
Starting a child container
child1
:
JBossFuse:karaf@root>
fabric:container-start child1
Stopping a child container
child1
:
JBossFuse:karaf@root>
fabric:container-stop child1
child1
container.
Destroying a child container
child1
container instance, enter the following console command:
JBossFuse:karaf@root> fabric:container-delete child1
- stops the child's JVM process
- physically removes all files related to the child container
Chapter 10. Deploying a New Broker Instance
Abstract
Overview
Standalone containers
- Create a template Apache ActiveMQ XML configuration file in a location that is accessible to the container.
- In the JBoss Fuse command console, use the config:edit command to create a new OSGi configuration file.ImportantThe PID must start with
org.fusesource.mq.fabric.server-
. - Use the config:propset command to associate your template XML configuration with the broker OSGi configuration as shown in Example 10.1, “Specifying a Broker's Template XML Configuration”.
Example 10.1. Specifying a Broker's Template XML Configuration
JBossFuse:karaf@root>
config:propset config configFile
- Use the config:propset command to set the required properties.The properties that need to be set will depend on the properties you specified using property place holders in the template XML configuration and the broker's network settings.For information on using config:propset see section "Details" in "Console Reference".
- Save the new OSGi configuration using the config:update command.
${karaf.base}/etc/activemq.xml
. You will also need to provide values for the data property, the broker-name property, and the openwire-port property.
Fabric containers
- Create a template Apache ActiveMQ XML configuration file in a location that is accessible to the container.
- In the JBoss Fuse command console, use the fabric:import command to upload the your XML configuration template to the Fabric Ensemble as shown in Example 10.2, “Uploading a Template to a Fabric Ensemble”.
Example 10.2. Uploading a Template to a Fabric Ensemble
JBossFuse:karaf@root>
fabric:import -t /fabric/configs/versions/version/profiles/mq-base/configFile configFile
version must match the version of the new profile you will create for the new broker. - Use the fabric:mq-create command to create a profile for the new broker and assign it to a container.
- To deploy the new broker into an existing container use the command shown in Example 10.3, “Creating a New Broker in an Existing Container”
Example 10.3. Creating a New Broker in an Existing Container
JBossFuse:karaf@root>
fabric:mq-create --assign-container containerName --config configFile profileName
This will create a new broker profile that inherits from themq-base
profile, but uses your XML configuration template, and deploy it to the specified container. - To deploy the new broker into an new container use the command shown in Example 10.4, “Creating a New Broker in a New Container”
Example 10.4. Creating a New Broker in a New Container
JBossFuse:karaf@root>
fabric:mq-create --create-container containerName --config configFile profileName
This will create a new broker profile that inherits from themq-base
profile, but uses your XML configuration template, create a new container named containerName, and deploy the broker profile to it.NoteThe new container will be a child of the container from which you execute the fabric:mq-create command.
NoteYou can add network configuration settings to the profile as well. See section "Arguments" in "Console Reference". - Use the fabric:profile-edit command shown in Example 10.5, “Editing a Broker Profile” to set the required properties.
Example 10.5. Editing a Broker Profile
JBossFuse:karaf@root>
fabric:profile-edit --pid org.fusesource.mq.fabric.server-profileName/property=value profileName
The properties that need to be set will depend on the properties you specified using property place holders in the template XML configuration and the broker's network settings.For information on using fabric:profile-edit see section "Description" in "Console Reference".
Example
myBroker
that stores its data in InstallDir/data/myBroker
and opens a port at 61617, you would do the following:
- Open the JBoss Fuse command console.
- In the JBoss Fuse command console, use the config:edit command to create a new OSGi configuration file:
JBossFuse:karaf@root>
config:edit org.fusesource.mq.fabric.server-myBroker
- Use the config:propset command to associate your template XML configuration with the broker OSGi configuration:
JBossFuse:karaf@root>
config:propset config ${karaf.base}/etc/activemq.xml
- Use the config:propset command to specify the new broker's data directory:
JBossFuse:karaf@root>
config:propset data ${karaf.data}/myBroker
- Use the config:propset command to specify the new broker's name:
JBossFuse:karaf@root>
config:propset broker-name myBroker
- Use the config:propset command to specify the new broker's openwire port:
JBossFuse:karaf@root>
config:propset openwire-port 61617
- Save the new OSGi configuration using the config:update command.
Chapter 11. Configuring Red Hat JBoss Fuse
Abstract
11.1. Introducing Red Hat JBoss Fuse Configuration
OSGi configuration
.cfg
file in the InstallDir/etc
directory. The file is interpreted using the Java properties file format. The filename is mapped to the persistent identifier (PID) of the service that is to be configured. In OSGi, a PID is used to identify a service across restarts of the container.
Configuration files
Table 11.1. Red Hat JBoss Fuse Configuration Files
Filename | Description |
---|---|
activemq.xml | Configures the default Apache ActiveMQ broker in a Fabric (used in combination with the org.fusesource.mq.fabric.server-default.cfg file). |
config.properties | The main configuration file for the container See Section 11.2, “Setting OSGi Framework and Initial Container Properties” for details. |
keys.properties | Lists the users who can access the JBoss Fuse runtime using the SSH key-based protocol. The file's contents take the format username=publicKey,role |
org.apache.aries.transaction.cfg | Configures the transaction feature |
org.apache.felix.fileinstall-deploy.cfg | Configures a watched directory and polling interval for hot deployment. |
org.apache.karaf.features.cfg | Configures a list of feature repositories to be registered and a list of features to be installed when JBoss Fuse starts up for the first time. |
org.apache.karaf.features.obr.cfg | Configures the default values for the features OSGi Bundle Resolver (OBR). |
org.apache.karaf.jaas.cfg | Configures options for the Karaf JAAS login module. Mainly used for configuring encrypted passwords (disabled by default). |
org.apache.karaf.log.cfg | Configures the output of the log console commands. See Section 16.1, “Logging Configuration”. |
org.apache.karaf.management.cfg |
Configures the JMX system. See Chapter 13, Configuring JMX for details.
|
org.apache.karaf.shell.cfg |
Configures the properties of remote consoles. For more information see Section 8.1, “Configuring a Container for Remote Access”.
|
org.apache.servicemix.jbi.cfg |
Configures the shutdown timeout for the JBI container.
|
org.apache.servicemix.nmr.cfg |
Configures the default thread pool settings for JBI. See .
|
org.apache.servicemix.components.Name.cfg |
Configures the thread pool settings specifically for the Name JBI component. See .
|
org.fusesource.bai.agent.cfg | Configures the Fuse BAI (Business Activity Insight) feature, if it is installed. |
io.fabric8.fab.osgi.url.cfg | Configures the Maven repositories used by the Fuse Application Bundle (FAB) runtime when downloading artifacts. If the properties in this file are not set, FAB defaults to the values in org.ops4j.pax.url.mvn.cfg . |
io.fabric8.maven.cfg | Configures the Maven repositories used by the Fabric Maven Proxy when downloading artifacts, (The Fabric Maven Proxy is used for provisioning new containers on a remote host.) |
org.fusesource.mq.fabric.server-default.cfg | Configures the default Apache ActiveMQ broker in a Fabric (used in combination with the activemq.xml file). |
org.jclouds.shell.cfg | Configures options for formatting the output of jclouds:* console commands. |
org.ops4j.pax.logging.cfg |
Configures the logging system. For more, see Section 16.1, “Logging Configuration”.
|
org.ops4j.pax.url.mvn.cfg | Configures additional URL resolvers. |
org.ops4j.pax.web.cfg | Configures the default Jetty container (Web server). See Securing the Web Console. |
startup.properties
| Specifies which bundles are started in the container and their start-levels. Entries take the format bundle=start-level. |
system.properties |
Specifies Java system properties. Any properties set in this file are available at runtime using
System.getProperties() . See Setting System and Config Properties for more.
|
users.properties | Lists the users who can access the JBoss Fuse runtime either remotely or via the web console. The file's contents take the format username=password,role |
Configuration file naming convention
<PID>.cfg
<PID>
is the persistent ID of the OSGi Managed Service (as defined in the OSGi Configuration Admin specification). A persistent ID is normally dot-delimited—for example, org.ops4j.pax.web
.
<PID>-<InstanceID>.cfg
<PID>
is the persistent ID of the OSGi Managed Service Factory. In the case of a managed service factory's <PID>,
you can append a hyphen followed by an arbitrary instance ID, <InstanceID>
. The managed service factory then creates a unique service instance for each <InstanceID>
that it finds.
JBI component configuration
InstallDir/etc
folder may contain a number of configuration files for the JBI components that ship with Red Hat JBoss Fuse.
org.apache.servicemix.components.ComponentName.cfg
. For example, you would configure the JMS component using a file called org.apache.servicemix.components.jms.cfg
.
11.2. Setting OSGi Framework and Initial Container Properties
Overview
etc
folder:
config.properties
—specifies the bootstrap properties for the OSGi frameworksystem.properties
—specifies properties to configure container functions
OSGi framework properties
etc/config.properties
file contains the properties used to specify which OSGi framework implementation to load and properties for configuring the framework's behaviors. Table 11.2, “Properties for the OSGi Framework” describes the key properties to set.
Table 11.2. Properties for the OSGi Framework
Property | Description |
---|---|
karaf.framework | Specifies the OSGi framework that Red Hat JBoss Fuse uses. The default framework is Apache Felix which is specified using the value felix . |
karaf.framework.felix | Specifies the path to the Apache Felix JAR on the file system. |
Initial container properties
etc/system.properties
file contains properties that configure how various aspects of the container behave including:
- the container's name
- the default feature repository used by the container
- the default port used by the OSGi HTTP service
- the initial message broker configuration
Table 11.3. Container Properties
Property | Description |
---|---|
karaf.name | Specifies the name of this container. The default is root . |
karaf.default.repository | Specifies the location of the feature repository the container will use by default. The default setting is the local feature repository installed with JBoss Fuse. |
org.osgi.service.http.port | Specifies the default port for the OSGi HTTP Service. |
11.3. Configuring Standalone Containers Using the Command Console
Overview
Listing the current configuration
Example 11.1. Output of the config:list Command
...
---------------------------------------------------------------- Pid: org.ops4j.pax.logging BundleLocation: mvn:org.ops4j.pax.logging/pax-logging-service/1.4 Properties: log4j.appender.out.layout.ConversionPattern = %d{ABSOLUTE} | %-5.5p | %-16.16 t | %-32.32c{1} | %-32.32C %4L | %m%n felix.fileinstall.filename = org.ops4j.pax.logging.cfg service.pid = org.ops4j.pax.logging log4j.appender.stdout.layout.ConversionPattern = %d{ABSOLUTE} | %-5.5p | %-16 .16t | %-32.32c{1} | %-32.32C %4L | %m%n log4j.appender.out.layout = org.apache.log4j.PatternLayout log4j.rootLogger = INFO, out, osgi:VmLogAppender log4j.appender.stdout.layout = org.apache.log4j.PatternLayout log4j.appender.out.file = C:\apache\apache-servicemix-6.1.0.redhat-379/data/log/karaf.log log4j.appender.stdout = org.apache.log4j.ConsoleAppender log4j.appender.out.append = true log4j.appender.out = org.apache.log4j.FileAppender ---------------------------------------------------------------- Pid: org.ops4j.pax.web BundleLocation: mvn:org.ops4j.pax.web/pax-web-runtime/0.7.1 Properties: org.apache.karaf.features.configKey = org.ops4j.pax.web service.pid = org.ops4j.pax.web org.osgi.service.http.port = 8181 ----------------------------------------------------------------
...
Editing the configuration
- Start an editing session by typing
config:edit PID
.PID is the PID for the configuration you are editing. It must be entered exactly. If it does not match the desired PID, the container will create a new PID with the specified name. - Remind yourself of the available properties in a particular configuration by typing
config:proplist
. - Use one of the editing commands to change the properties in the configuration.The editing commands include:
- config:propappend—appends a new property to the configuration
- config:propset—set the value for a configuration property
- config:propdel—delete a property from the configuration
- Update the configuration in memory and save it to disk by typing
config:update
.
config:cancel
.
Example 11.2. Editing a Configuration
JBossFuse:karaf@root>
config:edit org.apache.karaf.log
JBossFuse:karaf@root>
config:proplist
service.pid = org.apache.karaf.log size = 500 felix.fileinstall.filename = org.apache.karaf.log.cfg pattern = %d{ABSOLUTE} | %-5.5p | %-16.16t | %-32.32c{1} | %-32.32C %4L | %m%n
JBossFuse:karaf@root>
config:propset size 300
JBossFuse:karaf@root>
config:update
11.4. Configuring Fabric Containers
Overview
Profiles
- the Apache Karaf features to be deployed
- OSGi bundles to be deployed
- the feature repositories to be scanned for features
- properties that configure the container's runtime behavior
Best practices
Making changes using the command console
- fabric:version-create—create a new version
- fabric:profile-create—create a new profile
- fabric:profile-edit—edit the properties in a profile
- fabric:container-change-profile—change the profiles assigned to a container
Example 11.3. Editing Fabric Profile
JBossFuse:karaf@root>
fabric:version-create
Created version: 1.1 as copy of: 1.0
JBossFuse:karaf@root>
fabric:profile-edit -p org.apache.karaf.log/size=300 NEBroker
Using the management console
Chapter 12. Configuring the Hot Deployment System
Abstract
Overview
org.apache.felix.fileinstall-deploy
PID.
Specifying the hot deployment folder
deploy
folder that is relative to the folder from which you launched the container. You change the folder the container monitors by setting the felix.fileinstall.dir property in the rg.apache.felix.fileinstall-deploy
PID. The value is the absolute path of the folder to monitor. If you set the value to /home/joe/deploy
, the container will monitor a folder in Joe's home directory.
Specifying the scan interval
org.apache.felix.fileinstall-deploy
PID. The value is specified in milliseconds.
Example
/home/smx/jbideploy
as the hot deployment folder and sets the scan interval to half a second.
Example 12.1. Configuring the Hot Deployment Folders
JBossFuse:karaf@root>
config:edit org.apache.felix.fileinstall-deploy
JBossFuse:karaf@root>
config:propset felix.fileinstall.dir /home/smx/jbideploy
JBossFuse:karaf@root>
config:propset felix.fileinstall.poll 500
JBossFuse:karaf@root>
config:update
Chapter 13. Configuring JMX
Abstract
Overview
org.apache.karaf.management
PID.
Changing the RMI port and JMX URL
Table 13.1. JMX Access Properties
Property | Description |
---|---|
rmiRegistryPort | Specifies the RMI registry port. The default value is 1099. |
serviceUrl | Specifies the the URL used to connect to the JMX server. The default URL is service:jmx:rmi:///jndi/rmi://localhost:1099/karaf-KarafName, where KarafName is the container's name (by default, root ). |
Setting the JMX username and password
admin
and the default password is admin
.
Troubleshooting on Linux platforms
- Check that the hostname resolves to the correct IP address. For example, if the
hostname -i
command returns 127.0.0.1, JConsole will not be able to connect to the JMX server. To fix this, edit the/etc/hosts
file so that the hostname resolves to the correct IP address. - Check whether the Linux machine is configured to accept packets from the host where JConsole is running (packet filtering is built in the Linux kernel). You can enter the command,
/sbin/iptables --list
, to determine whether an external client is allowed to connect to the JMX server.Use the following command to add a rule to allow an external client such as JConsole to connect:/usr/sbin/iptables -I INPUT -s JconsoleHost -p tcp --destination-port JMXRemotePort -j ACCEPT
Where JconsoleHost is either the hostname or the IP address of the host on which JConsole is running and JMXRemotePort is the IP port exposed by the JMX server.
Chapter 14. Configuring JAAS Security
14.1. Alternative JAAS Realms
Overview
Default realm
karaf
realm name. The standard administration services in JBoss Fuse (SSH remote console, JMX port, and so on) are all configured to use the karaf
realm by default.
Available realm implementations
Standalone JAAS realm
karaf
realm installs two JAAS login modules, which are used in parallel:
PropertiesLoginModule
- Authenticates username/password credentials and stores the secure user data in the
InstallDir/etc/users.properties
file. PublickeyLoginModule
- Authenticates SSH key-based credentials (consisting of a username and a public/private key pair). Secure user data is stored in the
InstallDir/etc/keys.properties
file.
Fabric JAAS realm
karaf
realm based on the ZookeeperLoginModule
login module is automatically installed in every container (the fabric-jaas
feature is included in the default profile) and is responsible for securing the SSH remote console and other administrative services. The Zookeeper login module stores the secure user data in the Fabric Registry.
karaf
realm with a higher rank.
LDAP JAAS realm
14.2. JAAS Console Commands
Editing user data from the console
jaas:*
console commands, which you can use to edit JAAS user data from the console.
jaas:*
console commands are not compatible with the LDAP JAAS module.
Standalone realm configuration
PropertiesLoginModule
and the PublickeyLoginModule
) maintains its own database of secure user data, independently of any other containers. To configure the user data for a standalone container, you must log into the specific container (see Connecting and Disconnecting Remotely) whose data you want to modify. Each standalone container must be configured separately.
jaas:realms
command, as follows:
JBossFuse:karaf@root> jaas:realms Index Realm Module Class 1 karaf org.apache.karaf.jaas.modules.properties.PropertiesLoginModule 2 karaf org.apache.karaf.jaas.modules.publickey.PublickeyLoginModule
karaf
JAAS realm. Enter the following console command to start editing the properties login module in the karaf
realm:
JBossFuse:karaf@root> jaas:manage --index 1
Fabric realm configuration
ZookeeperLoginModule
by default) shares its secure user data with all of the other containers in the fabric and the user data is stored in the Fabric Registry. To configure the user data for a fabric, you can log into any of the containers. Because the user data is shared in the registry, any modifications you make are instantly propagated to all of the containers in the fabric.
jaas:realms
console command, you might see a listing similar to this:
Index Realm Module Class 1 karaf io.fabric8.jaas.ZookeeperLoginModule 2 karaf org.apache.karaf.jaas.modules.properties.PropertiesLoginModule 3 karaf org.apache.karaf.jaas.modules.publickey.PublickeyLoginModule
ZookeeperLoginModule
login module has the highest priority and is used by the fabric (you cannot see this from the listing, but its realm is defined to have a higher rank than the other modules). In this example, the ZookeeperLoginModule
has the index 1
, but it might have a different index number in your container.
ZookeeperLoginModule
):
JBossFuse:karaf@root> jaas:manage --index 1
Adding a new user to the JAAS realm
jdoe
, to the JAAS realm.
- List the available realms and login modules by entering the following command:
JBossFuse:karaf@root> jaas:realms
- Choose the login module to edit by specifying its index, Index, using a command of the following form:
JBossFuse:karaf@root> jaas:manage --index Index
jdoe
, with password, secret
, by entering the following console command:
JBossFuse:karaf@root> jaas:useradd jdoe secret
admin
role to jdoe
, by entering the following console command:
JBossFuse:karaf@root> jaas:roleadd jdoe admin
jaas:pending
console command, as follows:
JBossFuse:karaf@root> jaas:pending Jaas Realm:karaf Jaas Module:org.apache.karaf.jaas.modules.properties.PropertiesLoginModule UserAddCommand{username='jdoe', password='secret'} RoleAddCommand{username='jdoe', role='admin'}
jaas:update
, as follows:
JBossFuse:karaf@root> jaas:update
etc/users.properties
file, in the case of a standalone container, or by storing the user data in the Fabric Registry, in the case of a fabric).
Canceling pending changes
jaas:update
command, you could abort the pending changes using the jaas:cancel
command, as follows:
JBossFuse:karaf@root> jaas:cancel
14.3. Standalone Realm Properties File
Overview
PropertiesLoginModule
JAAS module. This login module stores its user data in a Java properties file in the following location:
InstallDir/etc/users.properties
Format of users.properties entries
etc/users.properties
file has the following format (on its own line):
Username=Password,Role1,Role2,...
Changing the default username and password
etc/users.properties
file initially contains a commented out entry for a single user, smx, with password smx and role admin. It is strongly recommended that you create a new user entry that is different from the smx
user example.
Username=Password,admin
admin
role grants full administration privileges to this user.
Chapter 15. Securing Fabric Containers
Abstract
Default authentication system
io.fabric8.jaas.ZookeeperLoginModule
). This system allows you to define user accounts and assign passwords and roles to the users. Out of the box, the user credentials are stored in the Fabric registry, unencrypted.
Managing users
jaas:*
family of console commands. First of all you need to attach the jaas:*
commands to the ZookeeperLoginModule
login module, as follows:
JBossFuse:karaf@root> jaas:realms Index Realm Module Class 1 karaf org.apache.karaf.jaas.modules.properties.PropertiesLoginModule 2 karaf org.apache.karaf.jaas.modules.publickey.PublickeyLoginModule 3 karaf io.fabric8.jaas.ZookeeperLoginModule JBossFuse:karaf@root> jaas:manage --index 3
jaas:*
commands to the ZookeeperLoginModule
login module. You can then add users and roles, using the jaas:useradd
and jaas:roleadd
commands. Finally, when you are finished editing the user data, you must commit the changes by entering the jaas:update command, as follows:
JBossFuse:karaf@root> jaas:update
jaas:cancel
.
Obfuscating stored passwords
ZookeeperLoginModule
stores passwords in plain text. You can provide additional protection to passwords by storing them in an obfuscated format. This can be done by adding the appropriate configuration properties to the io.fabric8.jaas
PID and ensuring that they are applied to all of the containers in the fabric.
Enabling LDAP authentication
LDAPLoginModule
), which you can enable by adding the requisite configuration to the default profile.
Chapter 16. Logging
Abstract
- Apache Log4j
- Apache Commons Logging
- SLF4J
- Java Util Logging
16.1. Logging Configuration
Overview
etc/system.properties
—the configuration file that sets the logging level during the container’s boot process. The file contains a single property, org.ops4j.pax.logging.DefaultServiceLog.level, that is set toERROR
by default.org.ops4j.pax.logging
—the PID used to configure the logging back end service. It sets the logging levels for all of the defined loggers and defines the appenders used to generate log output. It uses standard Log4j configuration. By default, it sets the root logger's level toINFO
and defines two appenders: one for the console and one for the log file.NoteThe console's appender is disabled by default. To enable it, addlog4j.appender.stdout.append=true
to the configuration For example, to enable the console appender in a standalone container, you would use the following commands:JBossFuse:karaf@root>
config:edit org.ops4j.pax.logging
JBossFuse:karaf@root>
config:propappend log4j.appender.stdout.append true
JBossFuse:karaf@root>
config:update
org.apache.karaf.log.cfg
—configures the output of the log console commands.
Changing the log levels
org.ops4j.pax.logging
PID's log4j.rootLogger
property so that the logging level is one of the following:
TRACE
DEBUG
INFO
WARN
ERROR
FATAL
NONE
Example 16.1. Changing Logging Levels
JBossFuse:karaf@root>
config:edit org.ops4j.pax.logging
JBossFuse:karaf@root>
config:propset log4j.rootLogger "DEBUG, out, osgi:VmLogAppender"
JBossFuse:karaf@root>
config:update
Changing the appenders' thresholds
log4j.appender.appenderName.threshold
property that controls what level of messages are written to the appender. The appender threshold values are the same as the log level values.
DEBUG
but limiting the information displayed on the console to WARN
.
Example 16.2. Changing the Log Information Displayed on the Console
JBossFuse:karaf@root>
config:edit org.ops4j.pax.logging
JBossFuse:karaf@root>
config:propset log4j.rootLogger "DEBUG, out, osgi:VmLogAppender"
JBossFuse:karaf@root>
config:propappend log4j.appender.stdout.threshold WARN
JBossFuse:karaf@root>
config:update
Logging per bundle
sift
appender to the Log4j root logger as shown in Example 16.3, “Enabling Per Bundle Logging”.
Example 16.3. Enabling Per Bundle Logging
JBossFuse:karaf@root>
config:edit org.ops4j.pax.logging
JBossFuse:karaf@root>
config:propset log4j.rootLogger "INFO, out, sift, osgi:VmLogAppender"
JBossFuse:karaf@root>
config:update
data/log/BundleName.log
.
org.ops4j.pax.logging.cfg
.
16.2. Logging per Application
Overview
Application key
Enabling per application logging
- In each of your applications, edit the Java source code to define a unique application key.If you are using slf4j, add the following static method call to your application:
org.slf4j.MDC.put("app.name","MyFooApp");
If you are using log4j, add the following static method call to your application:org.apache.log4j.MDC.put("app.name","MyFooApp");
- Edit the
etc/org.ops4j.pax.logging
PID to customize the sift appender.- Set
log4j.appender.sift.key
toapp.name
. - Set
log4j.appender.sift.appender.file
to=${karaf.data}/log/$\\{app.name\\}.log
.
- Edit the
etc/org.ops4j.pax.logging
PID to add the sift appender to the root logger.JBossFuse:karaf@root>
config:edit org.ops4j.pax.logging
JBossFuse:karaf@root>
config:propset log4j.rootLogger "INFO, out, sift, osgi:VmLogAppender"
JBossFuse:karaf@root>
config:update
16.3. Log Commands
- log:display
- Displays the most recent log entries. By default, the number of entries returned and the pattern of the output depends on the size and pattern properties in the
org.apache.karaf.log.cfg
file. You can override these using the-p
and-d
arguments. - log:display-exception
- Displays the most recently logged exception.
- log:get
- Displays the current log level.
- log:set
- Sets the log level.
- log:tail
- Continuously display log entries .
- log:clear
- Clear log entries.
Chapter 17. Persistence
Abstract
Overview
data
folder in the directory from which you launch the container. This folder is populated by folders storing information about the message broker used by the container, the OSGi framework, and the JBI container.
The data folder
data
folder is used by the JBoss Fuse runtime to store persistent state information. It contains the following folders:
activemq
- Contains persistent data needed by any Apache ActiveMQ brokers that are started by the container.
cache
- The OSGi bundle cache. The cache contains a directory for each bundle, where the directory name corresponds to the bundle identifier number.
generated-bundles
- Contains bundles that are generated by the container. Typically these are to support deployed JBI artifacts.
jbi
- Contains a subdirectory for each JBI artifact deployed to the JBoss Fuse runtime. For JBI components the folder's name is generated by the component's name. For JBI service assemblies, the folder's name is the identifier of the bundle generated to support the service assembly.
log
- Contains the log files.
maven
- A temporary directory used by the Fabric Maven Proxy when uploading files.
txlog
- Contains the log files used by the transaction management system. You can set the location of this directory in the
org.apache.aries.transaction.cfg
file
Changing the bundle cache location
InstallDir/data/cache
.
config.properties
.
Flushing the bundle cache
config.properties
. This property is set to none by default.
Changing the generated-bundle cache location
org.apache.felix.fileinstall-deploy.cfg
file.
Adjusting the bundle cache buffer
config.properties
configuration file. The value is specified in bytes.
Chapter 18. Failover Deployments
Abstract
18.1. Using a Simple Lock File System
Overview
Configuring a lock file system
etc/system.properties
file on both the master and the slave installation to include the properties in Example 18.1, “Lock File Failover Configuration”.
Example 18.1. Lock File Failover Configuration
karaf.lock=true karaf.lock.class=org.apache.karaf.main.SimpleFileLock karaf.lock.dir=PathToLockFileDirectory karaf.lock.delay=10000
- karaf.lock—specifies whether the lock file is written.
- karaf.lock.class—specifies the Java class implementing the lock. For a simple file lock it should always be
org.apache.karaf.main.SimpleFileLock
. - karaf.lock.dir—specifies the directory into which the lock file is written. This must be the same for both the master and the slave installation.
- karaf.lock.delay—specifies, in milliseconds, the delay between attempts to reaquire the lock.
18.2. Using a JDBC Lock System
Overview
Adding the JDBC driver to the classpath
- Copy the JDBC driver JAR file to the
ESBInstallDir/lib
directory for each Red Hat JBoss Fuse instance. - Modify the
bin/karaf
start script so that it includes the JDBC driver JAR in itsCLASSPATH
variable.For example, given the JDBC JAR file,JDBCJarFile.jar
, you could modify the start script as follows (on a *NIX operating system):... # Add the jars in the lib dir for file in "$KARAF_HOME"/lib/karaf*.jar do if [ -z "$CLASSPATH" ]; then CLASSPATH="$file" else CLASSPATH="$CLASSPATH:$file" fi done CLASSPATH="$CLASSPATH:$KARAF_HOME/lib/JDBCJarFile.jar"
NoteIf you are adding a MySQL driver JAR or a PostgreSQL driver JAR, you must rename the driver JAR by prefixing it with thekaraf-
prefix. Otherwise, Apache Karaf will hang and the log will tell you that Apache Karaf was unable to find the driver.
Configuring a JDBC lock system
etc/system.properties
file for each instance in the master/slave deployment as shown
Example 18.2. JDBC Lock File Configuration
karaf.lock=true karaf.lock.class=org.apache.karaf.main.DefaultJDBCLock karaf.lock.level=50 karaf.lock.delay=10000 karaf.lock.jdbc.url=jdbc:derby://dbserver:1527/sample karaf.lock.jdbc.driver=org.apache.derby.jdbc.ClientDriver karaf.lock.jdbc.user=user karaf.lock.jdbc.password=password karaf.lock.jdbc.table=KARAF_LOCK karaf.lock.jdbc.clustername=karaf karaf.lock.jdbc.timeout=30
Configuring JDBC locking on Oracle
etc/system.properties
file must point to org.apache.karaf.main.OracleJDBCLock.
system.properties
file as normal for your setup, as shown:
Example 18.3. JDBC Lock File Configuration for Oracle
karaf.lock=true karaf.lock.class=org.apache.karaf.main.OracleJDBCLock karaf.lock.jdbc.url=jdbc:oracle:thin:@hostname:1521:XE karaf.lock.jdbc.driver=oracle.jdbc.OracleDriver karaf.lock.jdbc.user=user karaf.lock.jdbc.password=password karaf.lock.jdbc.table=KARAF_LOCK karaf.lock.jdbc.clustername=karaf karaf.lock.jdbc.timeout=30
Configuring JDBC locking on Derby
etc/system.properties
file should point to org.apache.karaf.main.DerbyJDBCLock. For example, you could configure the system.properties
file as shown:
Example 18.4. JDBC Lock File Configuration for Derby
karaf.lock=true karaf.lock.class=org.apache.karaf.main.DerbyJDBCLock karaf.lock.jdbc.url=jdbc:derby://127.0.0.1:1527/dbname karaf.lock.jdbc.driver=org.apache.derby.jdbc.ClientDriver karaf.lock.jdbc.user=user karaf.lock.jdbc.password=password karaf.lock.jdbc.table=KARAF_LOCK karaf.lock.jdbc.clustername=karaf karaf.lock.jdbc.timeout=30
Configuring JDBC locking on MySQL
etc/system.properties
file must point to org.apache.karaf.main.MySQLJDBCLock. For example, you could configure the system.properties
file as shown:
Example 18.5. JDBC Lock File Configuration for MySQL
karaf.lock=true karaf.lock.class=org.apache.karaf.main.MySQLJDBCLock karaf.lock.jdbc.url=jdbc:mysql://127.0.0.1:3306/dbname karaf.lock.jdbc.driver=com.mysql.jdbc.Driver karaf.lock.jdbc.user=user karaf.lock.jdbc.password=password karaf.lock.jdbc.table=KARAF_LOCK karaf.lock.jdbc.clustername=karaf karaf.lock.jdbc.timeout=30
Configuring JDBC locking on PostgreSQL
etc/system.properties
file must point to org.apache.karaf.main.PostgreSQLJDBCLock. For example, you could configure the system.properties
file as shown:
Example 18.6. JDBC Lock File Configuration for PostgreSQL
karaf.lock=true karaf.lock.class=org.apache.karaf.main.PostgreSQLJDBCLock karaf.lock.jdbc.url=jdbc:postgresql://127.0.0.1:5432/dbname karaf.lock.jdbc.driver=org.postgresql.Driver karaf.lock.jdbc.user=user karaf.lock.jdbc.password=password karaf.lock.jdbc.table=KARAF_LOCK karaf.lock.jdbc.clustername=karaf karaf.lock.jdbc.timeout=0
JDBC lock classes
org.apache.karaf.main.DefaultJDBCLock org.apache.karaf.main.DerbyJDBCLock org.apache.karaf.main.MySQLJDBCLock org.apache.karaf.main.OracleJDBCLock org.apache.karaf.main.PostgreSQLJDBCLock
18.3. Container-level Locking
Overview
Configuring container-level locking
etc/system.properties
file on each system in the master/slave setup:
Example 18.7. Container-level Locking Configuration
karaf.lock=true karaf.lock.level=50 karaf.lock.delay=10000
etc/startup.properties
, in the format BundleName.jar=level. The core system bundles have levels below 50, where as user bundles have levels greater than 50.
Table 18.1. Bundle Start Levels
Start Level | Behavior |
---|---|
1 | A 'cold' standby instance. Core bundles are not loaded into container. Slaves will wait until lock acquired to start server. |
<50 | A 'hot' standby instance. Core bundles are loaded into the container. Slaves will wait until lock acquired to start user level bundles. The console will be accessible for each slave instance at this level. |
>50 | This setting is not recommended as user bundles will be started. |
Avoiding port conflicts
servicemix
start script (or the karaf
script on a child instance) to include the following:
DEFAULT_JAVA_OPTS="-server $DEFAULT_JAVA_OPTS -Dcom.sun.management.jmxremote.port=1100 -Dcom.sun.management.jmxremote.authenticate=false"
Chapter 19. Configuring JBI Component Thread Pools
Abstract
Overview
Component configuration PIDs
org.apache.servicemix.components.ComponentName
.
Thread pool properties
Table 19.1. Component Thread Pool Properties
Property | Default | Description |
---|---|---|
corePoolSize | 8 | Specifies the minimum number of threads in a thread pool. If the number of available threads drops below this limit, the runtime will always create a new thread to handle the job. |
maximumPoolSize | 32 | Specifies the maximum number of threads in a thread pool. Setting this property to -1 specifies that it is unbounded. |
queueSize | 256 | Specifies the number of jobs allowed in a component's job queue. |
Thread selection
- If the component's thread pool is smaller than the corePoolSize, a new thread is created to process the task.
- If less than queueSize jobs are in the component's job queue, the task is placed on the queue to wait for a free thread.
- If the component's job queue is full and the thread pool has less than maximumPoolSize threads instantiated, a new thread is created to process the task.
- The job is processed by the current thread.
Example
Example 19.1. Component Thread Pool Configuration
corePoolSize = 10 maximumPoolSize = 200 ...
Chapter 20. Applying Patches
Abstract
.patch
file that lists the contained artifacts. The artifacts are typically one or more bundles. They can, however, include configuration files and feature descriptors.
- Customer Support sends you a patch.
- Customer Support sends you a link to download a patch.
- Download a patch directly from the Red Hat customer portal.
- standalone—the container's command console's patch shell has commands for managing the patching process
- fabric—patching a fabric requires applying the patch to a profile and then applying the profile to a container. The management console is the recommended way to patch containers in a fabric. See Using the Management Consolefor more information.
20.1. Finding the Right Patches to Apply
Abstract
Locate the patches on the customer portal
- Login to the Red Hat Customer Portal using your customer account. This account must be associated with an appropriate Red Hat software subscription, otherwise you will not be able to see the patch downloads for JBoss Fuse.
- Navigate to the customer portal Software Downloads page.
- In the Product dropdown menu, select the appropriate product (for example, A-MQ or Fuse), and then select the version, 6.1.0, from the Version dropdown menu. A table of downloads now appears, which has three tabs: Releases, Patches, and Security Advisories.NoteMake sure you select the right GA version for your product. A micro version release (for example, 6.1.1) is not the same thing as a patched release.
- Click the Patches tab to view the regular patches (with no security-related fixes).
- Click the Security Advisories tab to view the patches with security-related fixes.
Types of patch
- Patches with GA baseline (for example, Patch 1, Patch 2, Patch 3, and so on)
- Rollup patches (for example, Rollup 1, Rollup 2, and so on)
- Patches with rollup baseline (for example, Rollup 1 Patch1, Rollup1 Patch2, and so on)
Patches with GA baseline
Rollup patches
Patches with rollup baseline
Which patches are needed to update the GA product to the latest patch level?
- If the only patches released so far are patches with GA baseline (Patch 1, Patch 2, and so on), apply the latest of these patches directly to the GA product.
- If a rollup patch has been released and no patches have been released after the latest rollup patch, simply apply the latest rollup patch to the GA product.
- If the latest patch is a patch with a rollup baseline, you must apply two patches to the GA product, as follows:
- Apply the latest rollup patch, and then
- Apply the latest patch with a rollup baseline.
Which patches to apply, if you only want to install regression-tested patches?
Example of identifying patches to apply
Patches available under the Patches tab
Figure 20.1. Patches Tab

Patches available under the Security Advisories tab
Figure 20.2. Security Advisories Tab

Complete list of available patches
- Red Hat JBoss Fuse 6.1.0 Patch 1
- Red Hat JBoss Fuse 6.1.0 Patch 2
- Red Hat JBoss Fuse/A-MQ 6.1 Rollup 1
- Red Hat JBoss Fuse/A-MQ 6.1 Rollup 1 Patch 1
- Red Hat JBoss Fuse/A-MQ 6.1 Rollup 1 Patch 2
Patches you would apply to update to the latest patch level
- Red Hat JBoss Fuse/A-MQ 6.1 Rollup 1
- Red Hat JBoss Fuse/A-MQ 6.1 Rollup 1 Patch 2
20.2. Patching a Standalone Container
Abstract
Overview
system
folder. When the patch is applied, the container's configuration is changed so that it points to the patched artifacts instead of the artifacts from the original installation. This makes it easy for the system to be restored to its original state or to selectively back out patches.
Applying a patch
- Add the patch to the container's environment using the patch:add command.Example 20.1, “Adding a Patch to a Broker's Environment” shows the command for adding the patch contained in the patch file
patch.zip
from the local file system.Example 20.1. Adding a Patch to a Broker's Environment
JBoss Fuse>
patch:add file://patch.zip
This command copies the specified patch file to the container'ssystem
folder and unpacks it. - Simulate installing the patch using the patch:simulate command.This will generate a log of the changes that will be made to the container when the patch is installed, but will not make any actual changes to the container.NoteThe patch:list command displays a list of all patches added to the container's
system
folder. - Review the simulation log to understand the changes that will be made to the container.
- Apply the patch to the container using the patch:install command.WarningRunning patch:install before the container is fully started and all of the bundles are active will cause the container to hang.NoteThe patch:list command displays a list of all patches added to the container's
system
folder. - Shut down the container that you just applied the patch to.
- The extracted patch archive contains the
manual_steps
directory. Copy the content of themanual_steps/
directory to the appropriate directory (xyz
bin
,etc
,lib
) in the JBoss Fuse 6.1 installation directory. Copy the content in themanual_steps/fabric-system-updates/system
directory to thesystem
directory in the JBoss Fuse installation directory. This is the system repository that contains some patched artifacts. - Start the container. If you are using a remote console, you will lose the connection to the container. If you are using the container's local console, it will automatically reconnect when the container restarts.
Rolling back a patch
Example 20.2. Rolling Back a Patch
JBoss Fuse> patch:rollback patch1
system
folder.
Adding features to a patched container
20.3. Patching a Container in a Fabric
Abstract
Overview
Procedure
- Getting a patch file.
- Customer Support sends you a patch.
- Customer Support sends you a link to download a patch.
- You, or your organization, generate a patch file for an internally created application.
- Uploading one or more patch files to the fabric's Maven repository.
- Applying the patch(es) to a profile version.This creates a new profile version that points to the new versions of the patched bundles and repositories.
- Migrate one or two containers to the patched profile version to ensure that the patch does not introduce any new issues.
- After you are certain that the patch works, migrate the remaining containers in the fabric to the patched version.
Using the management console
Using the command console
- Create a new version, using the
fabric:version-create
command:JBossFuse:karaf@root> fabric:version-create 1.1 Created version: 1.1 as copy of: 1.0
ImportantThe version name must be a pure numeric string, such as1.1
,1.2
,2.1
, or2.2
. You cannot incorporate alphabetic characters in the version name (such as1.0.patch
). - Apply the patch to the new version, using the
fabric:patch-apply
command. For example, to apply theactivemq.zip
patch file to version1.1
:JBossFuse:karaf@root> fabric:patch-apply --version 1.1 file:///patches/activemq.zip
- Upgrade the container using the
fabric:container-upgrade
command, specifying which container you want to upgrade. For example, to upgrade theroot
container, enter the following command:JBossFuse:karaf@root> fabric:container-upgrade 1.1 root Upgraded container root from version 1.0 to 1.1
- You can check that the new patch profile has been created using the
fabric:profile-list
command, as follows:BossFuse:karaf@root> fabric:profile-list --version 1.1 | grep patch default 0 patch-activemq-patch patch-activemq-patch
Where we presume that the patch was applied to profile version 1.1.TipIf you want to avoid specifying the profile version (with--version
) every time you invoke a profile command, you can change the default profile version using thefabric:version-set-default Version
command.You can also check whether specific JARs are included in the patch, for example:JBossFuse:karaf@root> list | grep -i activemq [ 131] [Active ] [Created ] [ ] [ 50] activemq-osgi (5.9.0.redhat-61037X) [ 139] [Active ] [Created ] [ ] [ 50] activemq-karaf (5.9.0.redhat-61037X) [ 207] [Active ] [ ] [ ] [ 60] activemq-camel (5.9.0.redhat-61037X)
Chapter 21. Configuring a Fabric's Maven Proxy
Abstract
Overview
Default repositories
- Maven Central (http://repo1.maven.org/maven2)
- Fuse Releases (http://repo.fusesource.com/nexus/content/repositories/releases)
- Fuse Early Access (http://repo.fusesource.com/nexus/content/groups/ea)
- SpringSource (http://repository.springsource.com/maven/bundles/release, http://repository.springsource.com/maven/bundles/external)
- Scala Tools (
http://scala-tools.org/repo-releases
) - User's Local (~/.m2/repository)
Changing the repositories
- Create a new profile version.From the command console this is done using the fabric:version-create command. See section "Description" in "Console Reference"section "Description" in "Console Reference" for more information.
- Change the
org.ops4j.pax.url.mvn.repositories
property in theio.fabric8.agent
PID of thedefault
profile. Example 21.1, “Configuring the Maven Proxy URL” shows the console command for editing this property.Example 21.1. Configuring the Maven Proxy URL
JBossFuse:karaf@root> fabric:profile-edit -p io.fabric8.agent/org.ops4j.pax.url.mvn.repositories= \ http://repo1.maven.org/maven2, \ http://repo.fusesource.com/nexus/content/repositories/releases, \ http://repo.fusesource.com/nexus/content/groups/ea, \ http://repository.springsource.com/maven/bundles/release, \ http://repository.springsource.com/maven/bundles/external, \ http://scala-tools.org/repo-releases default
NoteTheio.fabric8.agent
PID is refined in all of the fabric profiles. Setting the proxy URL, theorg.ops4j.pax.url.mvn.repositories
property, in thedefault
profile ensures that all of the other fabric profiles share the same Maven proxy setting.ImportantThefabric
profile'sio.fabric8.maven
PID, which ultimately controls the Maven proxy, imports its value from thedefault
profile'sio.fabric8.agent
PID. You should not change the settings of theio.fabric8.maven
PID. - Roll the changes out the fabric by upgrading the containers to the new profile version.ImportantYou cannot test this configuration change out on a few containers to validate it. The change must be made to the entire fabric or it will result in conflicts.
Index
A
- admin commands, Using the admin console commands
B
- broker
- deploying
- fabric container, Fabric containers
- standalone container, Standalone containers
- bundle cache, Changing the bundle cache location
C
- child containers, Managing Child Containers
- config shell, Standalone containers
- config.properties, OSGi framework properties, Overview
- config:list, Listing the current configuration
- configuration
F
- fabric shell, Fabric containers
- fabric:container-stop, Shutting Down a Fabric
- fabric:container-upgrade, Using the command console
- fabric:join, Joining a Fabric
- fabric:mq-create, Fabric containers
- failover, Failover Deployments
- featureRepositories, Modifying the default set of feature URLs
- featuresBoot, Modifying the default installed features
- felix.cache.bufsize, Adjusting the bundle cache buffer
- felix.fileinstall.dir, Specifying the hot deployment folder
- felix.fileinstall.poll, Specifying the scan interval
- felix.fileinstall.tmpdir, Changing the generated-bundle cache location
G
- generated bundle cache, Changing the generated-bundle cache location
H
- hot deployment
- folder, Specifying the hot deployment folder
- monitor interval, Specifying the scan interval
I
- io.fabric8.agent, Changing the repositories
- io.fabric8.maven, Changing the repositories
J
- JBI
- configuration, JBI component configuration
- JDBC lock, Using a JDBC Lock System
- JMX configuration
K
- karaf.default.repository, Initial container properties
- karaf.framework, OSGi framework properties
- karaf.framework.felix, OSGi framework properties
- karaf.name, Initial container properties
- KARAF_BASE, Specifying the Red Hat JBoss Fuse's environment
- KARAF_DATA, Specifying the Red Hat JBoss Fuse's environment
- KARAF_HOME, Specifying the Red Hat JBoss Fuse's environment
L
- launching
- client mode, Launching the runtime in client mode
- default mode, Launching the runtime
- server mode, Launching the runtime in server mode
- lock file, Using a Simple Lock File System
- logging
- commands, Log Commands
M
- mq-create, Fabric containers
O
- org.apache.felix.fileinstall-deploy, Overview
- org.apache.karaf.log, Overview
- org.ops4j.pax.logging, Overview
- org.ops4j.pax.logging.DefaultServiceLog.level, Overview
- org.ops4j.pax.url.mvn.repositories, Changing the repositories
- org.osgi.framework.storage, Changing the bundle cache location
- org.osgi.framework.storage.clean, Flushing the bundle cache
- org.osgi.service.http.port, Initial container properties
- OSGi
- configuration, Introducing Red Hat JBoss Fuse Configuration
- OSGi configuration
- creating, Standalone containers
- OSGi framework
- configuring, OSGi framework properties
P
- patch:add, Applying a patch
- patch:install, Applying a patch
- patch:list, Applying a patch, Rolling back a patch
- patch:rollback, Rolling back a patch
- patch:simulate, Applying a patch
- patching
- fabric
- command console, Using the command console
- management console, Using the management console
- standalone, Applying a patch
- rollback, Rolling back a patch
- profile
- creating, Fabric containers
R
- remote client, Using the remote client
- remote console
- remoteShellLocation, Configuring a container for remote access
- RMI port, Changing the RMI port and JMX URL
- RMI registry
- port number, Changing the RMI port and JMX URL
- rmiRegistryPort, Changing the RMI port and JMX URL
S
- security, Configuring JAAS Security
- service wrapper
- classpath, Adding classpath entries
- JMX configuration, JMX configuration
- JVM properties, Passing parameters to the JVM
- logging, Configuring logging
- serviceUrl, Changing the RMI port and JMX URL
- standalone
- initial features, Configuring the Initial Features in a Standalone Container
- starting, Starting Red Hat JBoss Fuse
- stopping, Stopping Red Hat JBoss Fuse
- remote container, Stopping a Remote Container
- system service
- Redhat, Redhat Linux
- Ubuntu, Ubuntu Linux
- Windows, Windows
- system.properties, Initial container properties
Legal Notice
Trademark Disclaimer
Legal Notice
Third Party Acknowledgements
- JLine (http://jline.sourceforge.net) jline:jline:jar:1.0License: BSD (LICENSE.txt) - Copyright (c) 2002-2006, Marc Prud'hommeaux
mwp1@cornell.edu
All rights reserved.Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
- Neither the name of JLine nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - Stax2 API (http://woodstox.codehaus.org/StAX2) org.codehaus.woodstox:stax2-api:jar:3.1.1License: The BSD License (http://www.opensource.org/licenses/bsd-license.php)Copyright (c) <YEAR>, <OWNER> All rights reserved.Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - jibx-run - JiBX runtime (http://www.jibx.org/main-reactor/jibx-run) org.jibx:jibx-run:bundle:1.2.3License: BSD (http://jibx.sourceforge.net/jibx-license.html) Copyright (c) 2003-2010, Dennis M. Sosnoski.All rights reserved.Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
- Neither the name of JiBX nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - JavaAssist (http://www.jboss.org/javassist) org.jboss.javassist:com.springsource.javassist:jar:3.9.0.GA:compileLicense: MPL (http://www.mozilla.org/MPL/MPL-1.1.html)
- HAPI-OSGI-Base Module (http://hl7api.sourceforge.net/hapi-osgi-base/) ca.uhn.hapi:hapi-osgi-base:bundle:1.2License: Mozilla Public License 1.1 (http://www.mozilla.org/MPL/MPL-1.1.txt)