此内容没有您所选择的语言版本。

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):
  1. Following the instructions in the JBoss Fuse Installation Guide, manually install the JBoss Fuse product on the Windows target host.
  2. Open a new command prompt and enter the following commands to start the container on the target host:
    cd InstallDir\bin
    fuse.bat
  3. If the Fabric servers from the Fabric ensemble are not already running, start them now.
  4. Join the container to the existing fabric, by entering the following console command:
    JBossFuse:karaf@root> fabric:join --zookeeper-password ZooPass ZooHost:ZooPort Name
    Where ZooPass is the ZooKeeper password for the Fabric ensemble (specified when you create the fabric with fabric:create); ZooHost is the hostname (or IP address) where the Fabric server is running and ZooPort is the ZooKeeper port (defaults to 2181). 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
    The Name 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 name root by default. If you do not specify a new container name when you join the fabric, there are bound to be conflicts.
    Note
    The container where you run the fabric:join command must be a standalone container. It is an error to invoke fabric: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:
  1. Following the instructions in the JBoss Fuse Installation Guide, manually install the JBoss Fuse product on the Windows target host.
  2. To start the container on the target host, open a new command prompt and enter the following commands:
    cd InstallDir\bin
    fuse.bat
  3. 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, named root 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 new Administrator 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 address StaticIPAddress (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).
Red Hat logoGithubRedditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

© 2024 Red Hat, Inc.