Chapter 9. Managing Child Containers
9.1. Standalone Child Containers
Using the admin console commands
Installing the admin console commands
admincommands are not installed by default. To install the command set, install the
adminfeature with the following command:
JBossFuse:karaf@root> features:install admin
Cloning a container
-soption. For example, to create a new child with the SSH port number of 8102:
JBossFuse:karaf@root> admin:clone -s 8102 root cloned
Creating a Karaf child container
admin:createcommand 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.
instances/containerNamedirectory. 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.0.redhat-133/instances/finn
Changing a child's SSH port
Starting child containers
Listing all child containers
Example 9.2. Listing Instances
JBossFuse:karaf@root> admin:list Port State Pid Name [ 8107] [Started ]  harry [ 8101] [Started ]  root [ 8106] [Started ]  dick [ 8105] [Started ]  tom
Connecting to a child container
Example 9.3. Admin connect Command
- The name of the child to which you want to connect.
- 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).
- This argument specifies the password used to connect to the child's remote console.
Stopping a child container
Destroying a child container
Changing the JVM options on a child container
admin:change-optscommand. 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/bindirectory 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.