通过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

【原创】大叔经验分享(81)marathon上app无法重启的更多相关文章

  1. 【原创】经验分享:一个小小emoji尽然牵扯出来这么多东西?

    前言 之前也分享过很多工作中踩坑的经验: 一个线上问题的思考:Eureka注册中心集群如何实现客户端请求负载及故障转移? [原创]经验分享:一个Content-Length引发的血案(almost.. ...

  2. 【原创】大叔经验分享(70)marathon重启app后一直处于waiting状态

    marathon重启app后一直处于waiting状态,查看marathon日志 # journalctl -u marathon -f 有如下日志: Jun 14 12:58:38 DataOne- ...

  3. 【原创】大叔经验分享(12)如何程序化kill提交到spark thrift上的sql

    spark 2.1.1 hive正在执行中的sql可以很容易的中止,因为可以从console输出中拿到当前在yarn上的application id,然后就可以kill任务, WARNING: Hiv ...

  4. 【原创】大叔经验分享(6)Oozie如何查看提交到Yarn上的任务日志

    通过oozie job id可以查看流程详细信息,命令如下: oozie job -info 0012077-180830142722522-oozie-hado-W 流程详细信息如下: Job ID ...

  5. 【原创】大叔经验分享(2)为什么hive在大表上加条件后执行limit很慢

    问题重现 select id from big_table where name = 'sdlkfjalksdjfla' limit 100; 首先看执行计划: hive> explain se ...

  6. 【原创】大叔经验分享(1)在yarn上查看hive完整执行sql

    hive执行sql提交到yarn上的任务名字是被处理过的,通常只能显示sql的前边一段和最后几个字符,这样就会带来一些问题: 1)相近时间提交了几个相近的sql,相互之间无法区分: 2)一个任务有问题 ...

  7. 【原创】大叔经验分享(87)marathon重启应用过程服务不可用

    marathon提供多种健康检查方式 常用的有TCP和HTTP, TCP检查端口是否存在,存在则认为实例健康: HTTP检查指定URL的HTTP返回码,返回码正常(2xx.3xx)则认为实例健康: 这 ...

  8. 【原创】大叔经验分享(11)python引入模块报错ImportError: No module named pandas numpy

    python应用通常需要一些库,比如numpy.pandas等,安装也很简单,直接通过pip # pip install numpyRequirement already satisfied: num ...

  9. 【原创】大叔经验分享(7)创建hive表时格式如何选择

    常用格式 textfile 需要定义分隔符,占用空间大,读写效率最低,非常容易发生冲突(分隔符)的一种格式,基本上只有需要导入数据的时候才会使用,比如导入csv文件: ROW FORMAT DELIM ...

随机推荐

  1. Facebook币Libra学习-4.新的智能合约语言Move入门

    Move是一种新的编程语言,旨在为Libra Blockchain提供安全可编程的基础.Libra Blockchain中的帐户是任意数量的Move资源和Move模块的容器.提交给Libra Bloc ...

  2. JAVA通过FTP方式向远程服务器或者客户端上传、下载文件,以及删除FTP服务器上的文件

    1.在目标服务器上搭建FTP服务器 搭建方式有多种大家可以自行选择,例如使用Serv-U或者FTPServer.exe:这里我以FTPServer.exe为例搭建:在目标服务器(这里对应的IP是10. ...

  3. Windows 10 搭建Python3 安装使用 protobuf

    Protobuf对比XML.Json等其他序列化的优势 protobuf 不管是处理时间上,还是空间占用上都优于现有的其他序列化方式.内存暂用是java 序列化的1/9,时间也是差了一个数量级,一次操 ...

  4. nginx虚拟机无法访问解决

    .重要:修改配置文件使用虚拟机,否则怎么配置都不生效,添加如下用户 [root@host---- html]# ll /etc/nginx/nginx.conf -rw-r--r-- root roo ...

  5. iOS面试-堆和栈的区别

    堆和栈的区别: 一.堆栈空间分配区别: 1.栈(操作系统):由操作系统自动分配释放 ,存放函数的参数值,局部变量的值等.其操作方式类似于数据结构中的栈: 2.堆(操作系统): 一般由程序员分配释放, ...

  6. Response.setContentType()参数说明

    response.setContentType()的参数说明 <meta http-equiv="Content-Type" content="text/html; ...

  7. golang web框架设计3:controller设计

    继续学习golang web框架设计 controller作用 MVC设计模式里面的这个C,控制器. Model是后台返回的数据: View是渲染页面,通常是HTML的模板页面: Controller ...

  8. Django:(06)Django模版

    一.模版的使用 配置 如果是命令行创建的项目需要手动配置模版文件目录(如果是Pycharm创建的项目则无需配置) 在项目根目录下创建目录templates, 用来存放模版文件 在项目的配置文件夹set ...

  9. lnmp 命令 及其 TP5 部署遇到的一些问题

    1.添加站点域名命令: lnmp vhost add; 2.重置mysql密码: 第一种方法:用军哥的一键修改LNMP环境下MYSQL数据库密码脚本 一键脚本肯定是非常方便.具体执行以下命令: wge ...

  10. HTML5页面如何在手机端浏览器调用相机、相册功能

    最近在做一个公司的保险信息处理系统项目,开发微信端浏览器访问的HTML5的页面,页面中有一个<input id="input" type="file"/& ...