此内容没有您所选择的语言版本。
4.3. Fabric Containers on Windows
Abstract
Fabric supports the deployment of containers on Windows platforms. In this case, however, it is necessary to install the container manually on the target host.
Overview
Because Windows does not support the Secure Shell (SSH) protocol, it is not possible to install the container software remotely on to a Windows machine. The installation must be performed manually. But the remote deployment of applications (by assigning profiles to the container) is fully supported.
Creating a Fabric container on Windows
Perform the following steps to create a Fabric container on Windows (assuming the container is to join an existing fabric):
- Following the instructions in the JBoss Fuse Installation Guide, manually install the JBoss Fuse product on the Windows target host.
- Open a new command prompt and enter the following commands to start the container on the target host:
cd InstallDir\bin fuse.bat
- If the Fabric servers from the Fabric ensemble are not already running, start them now.
- Join the container to the existing fabric, by entering the following console command:
JBossFuse:karaf@root> fabric:join --zookeeper-password ZooPass ZooHost:ZooPort Name
WhereZooPass
is the ZooKeeper password for the Fabric ensemble (specified when you create the fabric withfabric:create
);ZooHost
is the hostname (or IP address) where the Fabric server is running andZooPort
is the ZooKeeper port (defaults to2181
). If necessary, you can discover the ZooKeeper host and port by logging into the Fabric server and entering the following console command:config:proplist --pid io.fabric8.zookeeper
TheName
argument (which is optional) specifies a new name for the container after it joins the fabric. It is good practice to provide this argument, because all freshly installed containers have the nameroot
by default. If you do not specify a new container name when you join the fabric, there are bound to be conflicts.NoteThe container where you run thefabric:join
command must be a standalone container. It is an error to invokefabric:join
in a container that is already part of a fabric.
After joining the fabric, the container becomes a managed Fabric container and initially has the
default
profile deployed on it.
Creating a Fabric server on Windows
If you don't have an existing fabric, you can create a new fabric on the Windows host. The starting point for any fabric is a Fabric server instance, which can act as a seed for the rest of the fabric. Perform the following steps to create a Fabric server on Windows:
- Following the instructions in the JBoss Fuse Installation Guide, manually install the JBoss Fuse product on the Windows target host.
- To start the container on the target host, open a new command prompt and enter the following commands:
cd InstallDir\bin fuse.bat
- To create a new fabric (thereby turning the current host into a Fabric server), enter the following console command:
JBossFuse:karaf@root> fabric:create --new-user AdminUser --new-user-password AdminPass --new-user-role Administrator --zookeeper-password ZooPass --resolver manualip --manual-ip StaticIPAddress --wait-for-provisioning
The current container, namedroot
by default, becomes a Fabric Server with a registry service installed. Initially, this is the only container in the fabric. The--new-user
,--new-user-password
, and--new-user-role
options specify the credentials for a newAdministrator
user. The Zookeeper password is used to protect sensitive data in the Fabric registry service (all of the nodes under/fabric
). The--manual-ip
option specifies the Fabric Server's static IP addressStaticIPAddress
(see the section called “Static IP address required for Fabric Server”).
Managing remote containers on Windows
Because a Fabric container on Windows is added to the fabric by joining (that is, using
fabric:join
), there are certain restrictions on which commands you can use to manage it. In particular, the following commands are not supported:
fabric:container-stop fabric:container-start fabric:container-delete
To stop and start a Fabric container running on Windows, you must log on to the Windows host and use the regular Windows system commands to manage the container process (in particular, you could potentially install the container as a Windows service and use the Windows service commands to manage the container lifecycle).