Docker Swarm 创建与应用指南
1. 提升节点可用性
在 node1 上,可以提升 node2 和 node3 的角色,使 Swarm 具备高可用性:
$ docker node promote node2 node3
输出结果如下:
Node node2 promoted to a manager in the swarm.
Node node3 promoted to a manager in the swarm.
这样,我们就创建了一个高可用的 Docker Swarm,包含三个形成 Raft 共识组的管理节点和两个工作节点。
2. 在云端创建 Docker Swarm
如果要创建一个可用于生产环境的 Swarm,可以在云端(如 AWS)创建。以下是手动通过 AWS 控制台创建 Swarm 的步骤:
1. 登录 AWS 账户,若没有则创建一个免费账户。
2. 创建 AWS 安全组(SG),命名为 aws-docker-demo-sg :
- 导航到默认 VPC。
- 选择左侧的“安全组”。
- 点击“创建安全组”按钮。
- 将 SG 命名为 aws-docker-demo-sg ,并添加描述,如 “A SG for our Docker demo”。
- 点击“创建安全组”按钮。
-
超级会员免费看
订阅专栏 解锁全文
1013

被折叠的 条评论
为什么被折叠?



