Fabric8 allows you to install from scratch containers in the local network via ssh. Fabric will install the container from scratch and will configure the container to automatically join the fabric cluster.
The requirements for using this feature to create a container in a remote host are:
Fabric provides the fabric:container-create-ssh command, for creating ssh containers.
Assuming that we have a host with hostname myhost accessible from our local network, with a user account name myuser with password mypassword. We can create a container to myhost from the shell, using the following command:
fabric:container-create-ssh --host myhost --username myuser --password mypassword myremotecontainername
If user myuser on host myhost has configure public key authentication for the user on which we are currently logged we can skip the password option:
fabric:container-create-ssh --host myhost --username myuser myremotecontainername
This command will make use of the ~/.ssh/id_rsa key for authentication. In case that you want to use an other key, you can specify it using the --private-key option:
fabric:container-create-ssh --host myhost --username myuser --private-key ~/.ssh/fabric_pk myremotecontainername
The last command also supports the --pass-phrase option if your key is configured with a pass phrase.
There are cases, that you don't have an existing fabric and want to create one on a remote host. The obvious option is to do it manually, but fabric allows you to create a remote fabric registry server (ensemble-server) using the ensemble server option. This is extremely usefull as it can allow any devops guy setup the whole cluster, just using his local installation.
fabric:container-create-ssh --host myhost --username myuser --ensemble-server myremotecontainername fabric:join myhost:2181
The ssh container provider capabilities do not stop to the creation of the container. Fabric also allows you to stop, restart or delete (uninstall) a remote container.
To stop an (ssh) container:
To restart an (ssh) container:
To uninstall an (ssh) container:
Note that these commands are only available for containers that have been created using Fabric. This means that the are not usable on containers that have been installed and joined in the cluster manually.
Some organisations require firewalls between containers within a Fabric. If this is the case the following ports need to be opened for SSH containers to be created, provisioned, started and managed.
Note that if running more than one container on a server these port numbers will increase with each new container. Below are the defaults so opening a port range should be considered if scaling multiple containers on a single node.
For info, Zookeeper servers also use the following ports to communicate with each other.