Fuse 6 is no longer supported
As of February 2025, Red Hat Fuse 6 is no longer supported. If you are using Fuse 6, please upgrade to Red Hat build of Apache Camel.此内容没有您所选择的语言版本。
Chapter 9. Managing Child Containers
Abstract
A child container is a container that shares a common Red Hat JBoss Fuse runtime with a parent container, but has its own configuration files, runtime information, logs and temporary files. The child container functions as an independent container into which you can deploy bundles.
9.1. Standalone Child Containers 复制链接链接已复制到粘贴板!
复制链接链接已复制到粘贴板!
Using the admin console commands 复制链接链接已复制到粘贴板!
复制链接链接已复制到粘贴板!
The admin console commands allow you to create and manage instances of the JBoss Fuse runtime on the same machine. Each new runtime is a child instance of the runtime that created it. You can easily manage the children using names instead of network addresses. For details on the admin commands, see chapter "Admin Console Commands" in "Console Reference".
Installing the admin console commands 复制链接链接已复制到粘贴板!
复制链接链接已复制到粘贴板!
The
admin
commands are not installed by default. To install the command set, install the admin
feature with the following command:
JBossFuse:karaf@root> features:install admin
JBossFuse:karaf@root> features:install admin
Cloning a container 复制链接链接已复制到粘贴板!
复制链接链接已复制到粘贴板!
When you clone a container using the admin:clone command, you create a new child container which is an exact copy of the parent container in its current state. For example, if you clone the root container, the child gets the same configuration as the root container. Note that the child container has the same port numbers as the parent by default. After cloning, therefore, it is a good idea to customize the child's port numbers, to avoid clashes.
In the case of the SSH port, it is possible to customize the port when you create the child, by specifying the
-s
option. For example, to create a new child with the SSH port number of 8102:
JBossFuse:karaf@root> admin:clone -s 8102 root cloned
JBossFuse:karaf@root> admin:clone -s 8102 root cloned
Creating a Karaf child container 复制链接链接已复制到粘贴板!
复制链接链接已复制到粘贴板!
The
admin:create
command creates a new Apache Karaf child container. That is, the new child container is not a full JBoss Fuse container, and is missing many of the standard bundles, features, and feature repositories that are normally available in a JBoss Fuse container. What you get is effectively a plain Apache Karaf container with JBoss Fuse branding. Additional feature repositories or features that you require will have to be added to the child manually.
As shown in Example 9.1, “Creating a Runtime Instance”, admin:create causes the container to create a new child container in the active container's
instances/containerName
directory. The child container is assigned an SSH port number based on an incremental count starting at 8101.
Example 9.1. Creating a Runtime Instance
JBossFuse:karaf@root> admin:create finn Creating new instance on SSH port 8102 and RMI ports 1100/44445 at: /home/jdoe/apps/fuse/jboss-fuse-6.2.1.redhat-084/instances/finn
JBossFuse:karaf@root> admin:create finn
Creating new instance on SSH port 8102 and RMI ports 1100/44445 at:
/home/jdoe/apps/fuse/jboss-fuse-6.2.1.redhat-084/instances/finn
Changing a child's SSH port 复制链接链接已复制到粘贴板!
复制链接链接已复制到粘贴板!
You can change the SSH port number assigned to a child container using the admin:change-port command. The syntax for the command is:
admin:change-port
{
containerName
} {
portNumber
}
Important
You can only use the admin:change-port command on stopped containers.
Starting child containers 复制链接链接已复制到粘贴板!
复制链接链接已复制到粘贴板!
New containers are created in the stopped state. To start a child container and make it ready to host applications, use the admin:start command. This command takes a single argument, containerName, that identifies the child you want started.
Listing all child containers 复制链接链接已复制到粘贴板!
复制链接链接已复制到粘贴板!
To see a list of all the JBoss Fuse containers running under a particular installation, use the admin:list command:
Example 9.2. Listing Instances
Connecting to a child container 复制链接链接已复制到粘贴板!
复制链接链接已复制到粘贴板!
You can connect to a started child container's remote console using the admin:connect command.As shown in Example 9.3, “Admin connect Command”, this command takes three arguments:
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.
Once you are connected to the child container., the prompt changes to display the name of the current instance, as shown:
JBossFuse:karaf@harry>
JBossFuse:karaf@harry>
Stopping a child container 复制链接链接已复制到粘贴板!
复制链接链接已复制到粘贴板!
To stop a child container, from within the container itself, type
osgi:shutdown
or simply shutdown
.
To stop a child container remotely—in other words, from a parent or sibling instance—type
admin:stop containerName
.
Destroying a child container 复制链接链接已复制到粘贴板!
复制链接链接已复制到粘贴板!
You can permanently delete a stopped child container using the admin:destroy containerName command.
Important
You can only remove stopped children.
Changing the JVM options on a child container 复制链接链接已复制到粘贴板!
复制链接链接已复制到粘贴板!
To change the Java options in a child instance, use the
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"
JBossFuse:karaf@harry> admin:change-opts tom "-server -Xms128M -Xmx1345m -Dcom.sun.management.jmxremote"
These changes will take effect when you restart the child container.
Using the admin script 复制链接链接已复制到粘贴板!
复制链接链接已复制到粘贴板!
You can also use manage a JBoss Fuse container running in server mode without starting a new instance of the runtime. The admin script in the
InstallDir/bin
directory provides the all of the admin console commands except for admin:connect.
Example 9.4. The admin Script
For example, to list all of the JBoss Fuse containers on your host machine, type:
Windows
admin.bat list
admin.bat list
Linux or UNIX
./admin list
./admin list