【原创】大叔经验分享(81)marathon上app无法重启

通过api调用marathon重启app后出现deployment,但是app不会重启,配置如下:

  "constraints": [
    [
      "hostname",
      "UNIQUE"
    ],
    [
      "hostname",
      "LIKE",
      "HOST-00[12]"
    ]
  ]

指定app只能在2个服务器上启动,并且每个服务器只能启动1个instance,

解决方法如下:

  "upgradeStrategy": {
    "maximumOverCapacity": 1,
    "minimumHealthCapacity": 0.5
  }

官方解释如下:

Marathon allows you to perform rolling restarts to deploy new versions of applications. In general, there are two phases to deploying a new version of an application: starting a set of processes with the new version and stopping the set of processes with the old version.

In Marathon, you can perform a rolling restart by defining an upgrade strategy with a minimumHealthCapacity at the application level.

The minimumHealthCapacity is a percentage which, when applied to the instance count, defines the number of healthy instances that a certain version of the application must have at all times during update. Number of healthy instances is rounded up (ceil).

  • minimumHealthCapacity == 0 : All old instances can be killed before the new version is deployed.
  • minimumHealthCapacity == 1 : All instances of the new version are deployed side by side before the old version is stopped.
  • minimumHealthCapacity between 0 and 1 : Scale the old version to minimumHealthCapacity and start the new version to minimumHealthCapacity side by side. If this is completed successfully, the new version is scaled to 100% and the old version is stopped. Number of healthy instances is rounded up (ceil). E.g. 3 instances and minimumHealthCapacity 0.7 gives us ⌈3 × 0.7⌉ = ⌈2.1⌉ = 3 so all instances will remain.

问题原因:minimumHealthCapacity默认为1,即只有新实例启动之后才会停止老实例,这与hostname:UNIQUE冲突了;

 

参考:

marathon constraints

https://mesosphere.github.io/marathon/docs/constraints.html

 

marathon app deployment

http://mesosphere.github.io/marathon/docs/deployments.html

 

转载于:https://www.cnblogs.com/barneywill/p/11566599.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值