Managing child instances

A child instance of Karaf is a copy that you can launch separately and deploy applications into. An instance does not contain the full copy of Karaf, but only a copy of the configuration files and data folder which contains all the runtime information, logs and temporary files.

Using the admin console commands

The admin console commands allow you to create and manage instances of Karaf 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 the admin commands.

Creating child instances

You create a new runtime instance by typing admin:create in the Karaf console.

As shown in the following example, admin:create causes the runtime to create a new runtime installation in the active runtime's instances/name directory. The new instance is a new Karaf instance and is assigned an SSH port number based on an incremental count starting at 8101 and a RMI registry port number based on an incremental count starting at 1099/44444.

Changing a child's ports

You can change the SSH port number assigned to a child instance using the admin:change-ssh-port command. The syntax for the command is:

admin:change-ssh-port instance port

Note that the child instance has to be stopped in order to run this command.

In the same way, you can change the RMI registry port number assigned to a child instance using the admin:change-rmi-registry-port command. The syntax for the command is:

admin:change-rmi-registry-port instance port

Note that the child instance has to be stopped in order to run this command.

Starting child instances

New instances are created in a stopped state. To start a child instance and make it ready to host applications, use the admin:start command. This command takes a single argument instance-name that identifies the child you want started.

Listing all container instances

To see a list of all Karaf instances running under a particular installation, use the admin:list command.