4.2. SSH Containers
Abstract
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.
Overview
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.
Prerequisites
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-ssh
console 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
If the
myuser
user on myhost
has 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_rsa
for authentication. If you need to use a different key, you can specify the key location explicitly with the --private-key
option:
fabric:container-create-ssh --host myhost --user myuser --private-key ~/.ssh/fabric_pk myremotecontainername
The last command also supports the
--pass-phrase
option, in case your key requires a pass phrase.
Update SSH Credentials for Remote SSH Containers
You may need to change the credentials held in ZooKeeper for a remote SSH container. To do so, use the following command:
fabric:container-update-ssh-credentials [options] container
container is the name of the container for which you want to change the credentials.
The arguments are:
--user
the username of the user performing the action
--password
the password of the user performing the action
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
fabric:container-create-ssh
supports the --ensemble-server
option, which can be invoked to create a container which is a Fabric server. For example, the following container-create-ssh
command creates a new fabric consisting of one Fabric server on the myhost
host:
fabric:container-create-ssh --host myhost --user myuser --ensemble-server myremotecontainername
Note
The
--ensemble-server
option has been deprecated as of version 6.3. The recommended way to create a fabric on a remote host is to manually install JBoss Fuse on the remote host, then create the fabric there as you normally wouuld.
References
Note
The commands for creating and updating SSH containers are available for containers created as part of an existing fabric and are provisioned with the
fabric
profile.
For more details about the SSH container console commands, see the "Console Reference".