4.2. SSH Containers
Fabric allows you to install containers in a local network using SSH. Fabric installs the container from scratch and configures the container to join the Fabric cluster automatically.
An SSH container is just a Fabric container that is running on a remote host on your local network, where that host is accessible through the SSH protocol. This section describes some basic administration tasks for these SSH containers.
The requirements for creating an SSH container on a remote host are:
- Linux or UNIX operating system,
- SSHD running on the target host and:
- A valid account credentials, or
- Configured public key authentication
- Java is installed (for supported versions, see Red Hat JBoss A-MQ Supported Configurations).
- Curl installed.
- GNU tar installed.
- Telnet installed.
Creating an SSH container
Fabric provides the
fabric:container-create-sshconsole command, for creating SSH containers.
Given the host,
myhost(accessible from the local network) with the SSH user account,
myuser, and the password,
mypassword, your could create an SSH container on
myhost, using the following console command:
fabric:container-create-ssh --host myhost --user myuser --password mypassword myremotecontainername
myhosthas configured public key authentication for SSH, you can skip the password option:
fabric:container-create-ssh --host myhost --user myuser myremotecontainername
Where the preceding command uses the key located in
~/.ssh/id_rsafor authentication. If you need to use a different key, you can specify the key location explicitly with the
fabric:container-create-ssh --host myhost --user myuser --private-key ~/.ssh/fabric_pk myremotecontainername
The last command also supports the
--pass-phraseoption, in case your key requires a pass phrase.
Creating a Fabric server using SSH
Sometimes you do not have an existing fabric and you want to create one on a remote host. The starting point for any fabric is a Fabric server instance, which can act as a seed for the rest of the fabric. So, to enable you to create a new fabric on a remote host, the
--ensemble-serveroption, which can be invoked to create a container which is a Fabric server. For example, the following
container-create-sshcommand creates a new fabric consisting of one Fabric server on the
fabric:container-create-ssh --host myhost --user myuser --ensemble-server myremotecontainername
Managing remote SSH containers
Using JBoss Fuse console commands, you can stop, restart or delete (that is, uninstall) a remote container, as follows:
To stop an SSH container:
To restart an SSH container:
To uninstall an SSH container:
Note that these commands are available only for containers created directly using the current fabric. They are not available for containers that were joined to the cluster manually.
For more details about the SSH container console commands, see the JBoss Fuse Console Reference.