第 2 章 Red Hat Ansible Automation Platform 中的横向扩展
您可以为 Ansible Automation Platform 间的组件设置多节点部署。无论您需要为 Automation Execution、Automation Decisions 或自动化网格进行横向扩展,您可以根据机构的需要扩展部署。
2.1. Event-Driven Ansible 控制器中的水平扩展
使用 Event-Driven Ansible 控制器,您可以为事件自动化设置水平扩展。这个多节点部署可让您在安装过程中定义您首选的节点。您还可以随时根据您的机构需求增加或减少节点数。
此部署中使用以下节点类型:
- API 节点类型
- 响应 Event-Driven Ansible 控制器的 HTTP REST API。
- Worker 节点类型
- 运行 Event-Driven Ansible worker,它是 Event-Driven Ansible 组件,它不仅管理项目和激活,还执行激活本身。
- 混合节点类型
- 是 API 节点和 worker 节点的组合。
以下示例演示了如何使用主机组名称 [automationeda]
和节点类型变量 eda_type
来设置清单文件,以便在 Red Hat Enterprise Linux 虚拟机上水平扩展 Event-Driven Ansible 控制器:
[automationeda] 3.88.116.111 routable_hostname=automationeda-api.example.com eda_type=api # worker node 3.88.116.112 routable_hostname=automationeda-api.example.com eda_type=worker
[automationeda]
3.88.116.111 routable_hostname=automationeda-api.example.com eda_type=api
# worker node
3.88.116.112 routable_hostname=automationeda-api.example.com eda_type=worker
2.1.1. 大小和扩展指南
API 节点处理用户请求(使用 UI 或 API,worker 节点处理激活和其他后台任务),使 Event-Driven Ansible 正常工作。与应用程序所需用户关联的 API 节点数量,worker 节点数量与您要运行的激活数量相关联。
由于激活是变量并由 worker 节点控制,支持的扩展方法是使用单独的 API 和 worker 节点,而不是混合节点,因为 worker 节点分配硬件资源的有效分配。通过分离节点,您可以根据特定的需求独立扩展每种类型,从而提高了资源利用率和成本效率。
例如,您可能会考虑扩展节点部署的一个示例是,您希望为将运行大量激活的小型用户部署 Event-Driven Ansible 部署。在这种情况下,一个 API 节点足够了,但如果您需要更多,您可以扩展到三个额外的 worker 节点。
要设置多节点部署,请按照 为 Event-Driven Ansible 控制器设置水平扩展 的步骤进行操作。
2.1.2. 为 Event-Driven Ansible 控制器设置水平扩展
要扩展(添加更多节点)或缩减(删除节点),您必须更新清单文件的内容以添加或删除节点,并重新运行安装程序。
流程
更新清单,以添加两个以上的 worker 节点:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow [automationeda] 3.88.116.111 routable_hostname=automationeda-api.example.com eda_type=api 3.88.116.112 routable_hostname=automationeda-api.example.com eda_type=worker # two more worker nodes 3.88.116.113 routable_hostname=automationeda-api.example.com eda_type=worker 3.88.116.114 routable_hostname=automationeda-api.example.com eda_type=worker
[automationeda] 3.88.116.111 routable_hostname=automationeda-api.example.com eda_type=api 3.88.116.112 routable_hostname=automationeda-api.example.com eda_type=worker # two more worker nodes 3.88.116.113 routable_hostname=automationeda-api.example.com eda_type=worker 3.88.116.114 routable_hostname=automationeda-api.example.com eda_type=worker
- 重新运行安装程序。