zoukankan      html  css  js  c++  java
  • 【原创】大叔经验分享(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

  • 相关阅读:
    JS动态添加事件
    Asp.Net验证控件浅析
    word 文档如何加密
    scp 自动带密码参数复制文件到主机
    Zabbix监控Dell服务器相关硬件资源
    Zabbix的history相关数据表数据太大,执行表分区操作过程
    mysql日常操作
    linux下利用tcpdump抓包工具排查nginx获取客户端真实IP实例
    解决ssh登录很慢的问题以及jumpserver登录主机出现:Authentication timeout
    keepalived启动后报错:(VI_1): received an invalid passwd!的解决办法
  • 原文地址:https://www.cnblogs.com/barneywill/p/11566599.html
Copyright © 2011-2022 走看看