Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The remote console feature allows to connect to a running ServiceMix Karaf instance from a remote computer and perform all the operations that are usually accessible from the local console.

...

These options affect two system properties that can be set if you don't use the standard shell scripts:

  • servicemixkaraf.startLocalConsole
  • servicemixkaraf.startRemoteShell

Using the client jar

From Apache ServiceMix Kernel 1.1.0 and posterior versions, it is It is also possible to use a more lightweight way to connect to a ServiceMix Kernel Karaf instance using the following command line:

Code Block
java -jar lib/servicemixkaraf-client.jar

There are a few parameters that can be set on the command line to change the URL used to connect to the Kernel, the user or the password.
All these parameters are detailed in the help screen:

Panel
bgColor#000000

No Format
nopaneltrue
> java -jar lib/servicemix-client.jar --help
Apache ServiceMix Kernel client
  -a [SMX4KNL:address]  specify the URL to connect to
  -h [SMX4KNL:host]     specify the host to connect to
  -u [SMX4KNL:user]     specify the user name
  -p [SMX4KNL:password] specify the password
  --help        shows this help message
  [SMX4KNL:commands]    commands to run
If no commands are specified, the client will be put in an interactive mode

...

Warning
titleSending direct commands from the client

The client jar does not yet support passing command line arguments to the remote ServiceMix KernelKaraf.
In order to do so, you can create a text file containing the commands and use the system console to redirect this file to the input stream:

Code Block
> echo osgi/shutdown > command.txt
> java -jar lib/servicemix-client.jar < command.txt
>

4.2. Remote Console#top

Using an SSH client

You can use any standard SSH client to connect to a ServiceMix Kernel Karaf instance. The default port is 8101.

...

Warning
titleError messages when using some ssh clients

Some SSH clients will prompt some harmless warnings when connecting to ServiceMix Kernel.
In particular, openssh 5.1p1 will display the following output:

Code Block
channel_by_id: 1: bad id: channel free
channel_input_success_failure: 1: unknown
channel_by_id: 1: bad id: channel free
channel_input_success_failure: 1: unknown

4.2. Remote Console#top

Using another Kernel instance

First, open a terminal and launch a Kernel Karaf in server mode (you could use a Kernel Karaf instance in console mode too):

Code Block
bin/servicemixkaraf server

On another terminal, start a Kernel another Karaf instance in client mode:

Code Block
bin/servicemixkaraf client
Tip
titleUser another Kernel instance to start the client

At this point in time, you can not use the same Kernel Karaf installation to start both the server and the client, so you need to create a new instance using the 'admin create xxx' command and use that one to start the client. If you are on a different host or already use another copy of ServiceMix KernelKaraf, this requirement does not hold.

...

You can also do that in a single command line from the prompt by appending the previous ServiceMix command to the shell command:

Code Block
bin/servicemixkaraf client remote rsh tcp://localhost:8101/ -u smx -p smx 

...

The TCP port is configured at the following location:

Code Block
[SMX4KNL:KERNELKARAF]/etc/org.apache.felix.servicemixkaraf.shell.cfg

The defaut configuration is as below:

Code Block
startLocalConsole=${servicemixkaraf.startLocalConsole}
startRemoteShell=${servicemixkaraf.startRemoteShell}
sshPort=8101
sshRealm=servicemix
hostKey=${servicemixkaraf.base}/etc/host.key

The port used can easily be changed by changing the default port 8101 in the sshPort property.

The security realm used by the console when authenticating remote users is named servicemix, so you can override this realm as explained in the 4.5. Security framework. 4.2. Remote Console

#top

Wiki Markup
{scrollbar}