A child instance of Fuse ESB is a copy that you can launch separately and deploy applications into. An instance does not contain a full copy of Fuse ESB, but only a copy of the configuration files and data folder which contains all runtime information, logs and temporary files.
The admin console commands allow you to create and manage instances of the Fuse ESB 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 Admin Console Commands in Console Reference.
You create a new runtime instance by typing admin:create
in the
Fuse ESB console.
As shown in Example 2.7,
admin:create causes the runtime to create a new runtime installation in
the active runtime's instances/
directory. The new instance is a direct copy of its parent. The only difference between
parent and child is the port number they listen on. The child instance is assigned an SSH
port number based on an incremental count starting at 8101.instanceName
Example 2.7. Creating a Runtime Instance
karaf@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
karaf@root>
You can change the SSH port number assigned to a child instance using the admin:change-port command. The syntax for the command is:
admin:change-port
{instanceName
} {portNumber
}
![]() | Important |
---|---|
You can only use the admin:change-port command on stopped runtime instances. |
New instances are created in the 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, instanceName
, that identifies the child
you want started.
To see a list of all Fuse ESB instances running under a particular installation, use the admin:list command:
Example 2.8. Listing Instances
karaf@root>admin:list
Port State Pid Name
[ 8107] [Started ] [10628] harry
[ 8101] [Started ] [20076] root
[ 8106] [Started ] [15924] dick
[ 8105] [Started ] [18224] tom
karaf@root>
You can connect to a started child instance's remote console using the admin:connect command.As shown in Example 2.9, this command takes three arguments:
-
instanceName
The name of the child to which you want to connect.
-
-u
username
The username used to connect to the child's remote console. The default value is
smx
.-
-p
password
This argument specifies the password used to connect to the child's remote console. The default value is
smx
.
Once you are connected to the child instance., the karaf>
prompt changes to
display the name of the current instance, as shown:
karaf@harry>
To stop a child instance, from within the instance itself, type
osgi:shutdown
or simply shutdown
.
To stop a child instance remotely—in other words, from a parent or sibling
instance—type admin:stop
. instanceName
You can permanently delete a stopped child instance using the
admin:destroy
instanceName
command.
![]() | Important |
---|---|
You can only remove stopped children. |
You can also use manage an instance of Fuse ESB running in server mode without starting a
new instance of the runtime. The admin
script in the
directory provides the
same commands as the admin console commands, apart from
admin:connect.InstallDir
/bin
Example 2.10. 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.
For example, to list all the instances of Fuse ESB on your host machine, type:
Windows
admin.bat list
*NIX
./admin list