简体   繁体   English

自动化 Docker Swarm 的工具

[英]Tool to automate Docker Swarm

I have followed the Docker Docs about setting up Swarm on Virtualbox.我遵循了有关在 Virtualbox 上设置 Swarm 的 Docker 文档。 I suppose it is the same procedure to set it up on AWS, Azure or DigitalOcean.我想在 AWS、Azure 或 DigitalOcean 上设置它是相同的过程。 It is a lot to do manually every time .每次都需要手动完成很多工作。

Is there a tool to automate this?有没有工具可以自动执行此操作?

I would like to use something to set up and scale Swarm like Compose does for Docker .我想使用一些东西来设置和扩展 Swarm,就像 Compose 为 Docker 所做的那样。

Maybe I would start with one AWS instance and 2-3 containers and then scale them up to 100 containers and the instances to scale accordingly.也许我会从一个 AWS 实例和 2-3 个容器开始,然后将它们扩展到 100 个容器,然后相应地扩展实例。 Then I would want to scale down to 2 instances and the rest would shut down.然后我想缩小到 2 个实例,其余的将关闭。

Does something like this exist ?这样的东西存在吗?

If you want to avoid manual configurations but still get the required high availability and cost efficiency, try to run Docker Swarm template pre-packaged by Jelastic:如果您想避免手动配置,但仍然获得所需的高可用性和成本效率,请尝试运行 Jelastic 预先打包的 Docker Swarm 模板:

  • it has built-in automatic clustering and scaling它具有内置的自动集群和缩放功能
  • the installation is performed automatically and you'll get full access to the cluster via intuitive UI安装会自动执行,您将通过直观的 UI 获得对集群的完全访问权限
  • containers are running directly on bare metal, so no need to reserve full VMs for each service (and you can choose the datacenter you want to run your project on)容器直接在裸机上运行,​​因此无需为每个服务保留完整的 VM(您可以选择要在其上运行项目的数据中心)
  • the payment is done based on actual consumption of RAM and CPU支付是根据RAM和CPU的实际消耗完成的
  • containers are automatically distributed across different hardware servers that increases high availability容器自动分布在不同的硬件服务器上,从而提高了高可用性

The details about the package and installation steps are in this article .有关打包和安装步骤的详细信息,请参阅本文

You can use Docker Machine for provisioning hosts and configuring swarm easily ( example ).您可以使用Docker Machine轻松配置主机和配置 swarm(示例)。

The Docker Ecosystem includes also managed solutions like Tutum or Docker Cloud to achieve easily what you want. Docker 生态系统还包括TutumDocker Cloud等托管解决方案,可轻松实现您想要的。

You can use Ansible for configuring the Swarm master, Swarm nodes, and all the required cluster discovery.您可以使用Ansible来配置 Swarm 主控、Swarm 节点和所有必需的集群发现。 Ansible is a general IT automation tool, but it comes with a very powerful Docker module that allows to set up Docker Swarm easily. Ansible 是一个通用的 IT 自动化工具,但它带有一个非常强大的Docker 模块,可以轻松设置 Docker Swarm。

This GitHub repository shows a good example how to set up Swarm with Ansible.这个 GitHub 存储库展示了如何使用 Ansible 设置 Swarm 的一个很好的例子。

查看devopsbyte.com博客,其中介绍了如何使用ansible设置docker swarm 集群

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM