How to configure autoscaling on docker swarm? - Stack Overflow

标签: | 发表时间:2018-09-29 13:45 | 作者:
出处:https://stackoverflow.com

Short answer: There is no easy way to do this with Docker Swarm for now.

Docker Swarm (or Swarm mode) does not support auto-scalingmachines out of the box. You'd need to use another solution for that like docker-machineto create machines (with docker) on your infrastructure and link these to the existing Swarm cluster (with docker swarm join).

This will involve a lot of scripting but the idea is to monitor the cluster for CPU / Memory / Network usage (with topor monit) and once it goes beyond a threshold (say 70%of total cluster resources), you trigger a script calling docker-machineto scale up the cluster. Using the same idea you can also scale down by drainingand removingnodes (preferably Agentnodes) from the existing swarm cluster once your are below the lower threshold.

You need to make sure you are monitoring for sustained resource usage if you want to use this criteria or you will have your Infrastructure spawning and destroying nodes from the frequent and sudden changes in resource usage.

You can define a lower bound and an upper bound for machines in the cluster to keep things under control.

Note that Swarm requires at least 3 Managernodes (recommended 5) to maintain a quorum for the Distributed Consensus algorithm. So the minimum recommended lower bound is 5 nodes(which you can extend with Agentnodes as resources are incrementally being used by services).

To some extent, you can also take a look at Docker InfraKitor Terraformfor Infrastructure automationand Health monitoring.

Update: There is now a promising cross-platform autoscaler that supports Swarm Mode task auto-scaling: Orbiter. Although still nothing out-of-the-box yet for service/machine autoscaling.

相关 [how to configure] 推荐:

How to configure autoscaling on docker swarm? - Stack Overflow

- -
This will involve a lot of scripting but the idea is to monitor the cluster for CPU / Memory / Network usage (with.

读书笔记 - How Google Test Software

- - CSDN博客研发管理推荐文章
(《谷歌如何测试软件》)的确为神秘谷歌公司揭开一层面纱,讲到了谷歌的代码文化和测试文化,讲到了角色划分,职责划分,测试种类划分,讲到优秀的不同角色的人应该具有什么样子的,讲到测试的创新和工具,还有大量的人物访谈. 这里的笔记主要包含:个人感兴趣的,值得备忘的,需要后续关注的东西记录.

How To Be Successful (如何成功)- Sam Altman

- -
I’ve observed thousands of founders and thought a lot about what it takes to make a huge amount of money or to create something important. Everything here is easier to do once you’ve already reached a baseline degree of success (through privilege or effort) and want to put in the work to turn that into outlier success.

Facebook 如何发布代码 (How Facebook Ships Code 译文)

- Tim - DBA Notes
按:这篇 How Facebook Ships Code 提供了大量的细节信息,之前已经有朋友提供了一个翻译版本,阅读之后发现有些许错误,并且原文有更新,所以基于前面的翻译版本我重新翻译了一个(完整的)版本. 我对 Facebook 的运作方式着迷. 这是个非常独特的环境,很难被复制(这个方式并不适合所有的公司,即使有些公司尝试过这么做).

程序猿秘笈:How to scare a girl #随笔杂记#

- 宏劼 - 陈远 yuanc.42qu.com
在这个世界上,有一个特别的物种,他们的学名叫程序猿. 程序猿有一项特别的技能,就是能快速有效地引起异性的反感,仿佛在程序猿周身存在一个不可见的异性防御力场. 异性防御力场存在的结果往往是,即使一个程序猿非常喜欢某位女生,只要他用自己认为非常合理、非常正常的方式去与她沟通和交流就有很大机率把对方吓跑,这是一种天赋和职业素养.

How to lie with statistics――统计数据背后的真相

- - 互联网分析
在之前读过的《How to lie with statistics》一书中提到当我们接触一个统计资料时,提5个简单的问题可分辨大部分的统计资料,分别是:谁说的,他是如何知道的,遗漏了什么,是否有人偷换了概念以及这个资料有意义吗. 经常会遇到利用数据图表进行问题说明的情况,这时我们往往会关注于这些数据到底是什么意思而忽略这些数据的来源和它的时效性.

[How-To]初创公司如何有效利用社会化媒体?

- - SocialBeta
本文来自 @石蓉Kelly  的编译. 酷,现在正是好时候,人和人之间的联系较之以前紧密得多. 因此使用社会化渠道变得复杂了但是对公司却是更重要而有益的. 如果你打算为公司做推广,免费获得媒体关注机会,之后恰当时机地发布产品,使用社会化营销太合适了. 和你直接竞争的品牌可能已经在电视上 广告轮番播出,竞争是惨烈的.

如何向投资人展示——How to Present to Investors

- - CSDN博客互联网推荐文章
Y Combinator在孵化创业公司积累了大量的经验,尤其是在帮助创始人向投资人展示自己的创意或产品. Y Combinator会在正式的Demo Day之前组织一次演练,纠正创始人在展示阶段遇到的问题,尤其是年轻的技术人员更需要了解这些注意事项. 最核心的其实就两点:讲解自己做的什么东西;解释用户为什么会喜欢他.

【How-To】建立数字营销策略的4 个致胜关键

- - SocialBeta
  作者: @ 迎邦網誌. 如果数字行销的灵魂是“内容” 和“对话”,那么要制定一个成功的数字营销架构和策略,须要具备哪些条件呢. 让我们再看看 Minter Dial 提出的4 个基本原则:. 在一个被社会化媒体放大的环境里,品牌与客户可以直接对话,因此必须明确自己的定位和价值是什么.

how to write extension for firefox -- 如何给firefox编写插件

- - CSDN博客Web前端推荐文章
1.1 创建一个dev profile. 1.3 创建或者修改一些preference. 1.4 启动firefox. 使用-no-remoet可以使你同时用自己平时使用的profile浏览网页,和你开发的profile互补干扰. Note 1:当你修改install.rdf中有关firefox的compatile version时,有时会提示你版本不兼容当前的firefox,不要理会,.