发布于 2015-12-05 11:12:26 | 544 次阅读 | 评论: 0 | 来源: 网络整理

Mesos system 系统有两个基本的方法来描述集群的子集,一个是用 Mesos 主控来管理,另一个是用集群传送框架。

类型

那些由 Mesos 中属性和资源支持的数值的类型包括 scalar、Range、Set 和 Text 以下是这类类型的定义:

 
scalar : floatValue

floatValue : ( intValue ( "." intValue )? ) | ...

intValue : [0-9]+

range : "[" rangeValue ( "," rangeValue )* "]"

rangeValue : scalar "-" scalar

set : "{" text ( "," text )* "}"

text : [a-zA-Z0-9_/.-]

属性

属性是 Mesos 发送给框架的 key-value 对(其中 value 是可选的)。一个属性的 value 支持三个不同种类的类型:scalar、range、text

 
attributes : attribute ( ";" attribute )*

attribute : text ":" ( scalar | range | text )

资源

Mesos 系统可以管理三种不同的资源:scalar、range、set。这些被用于代表 Mesos 从属所提供的不同的资源。例如,一个 scalar 资源类型可以代表一个从属的内存。每个从属都由一个 key string 标识。

 
resources : resource ( ";" resource )*

resource : key ":" ( scalar | range | set )

key : text ( "(" resourceRole ")" )?

resourceRole : text | "*"

预定义的用途和约定

Mesos master 有一些可以用来处理预定义的资源。目前,这个列表包括:

  • cpus
  • mem
  • disk
  • ports

当一个从属没有 cpus 和 mem 时,它就没有可以发送给框架的资源。

实例

以下是配置 Mesos 从属的几个例子:

 
--resources='cpus:24;mem:24576;disk:409600;ports:[21000-24000];bugs:{a,b,c}'
--attributes='rack:abc;zone:west;os:centos5;level:10;keys:[1000-1500]'

在这个例子中,我们有不同类型的资源,它们将 cpus, mem, disk, 和 ranges 称作 ports:

scalar called cpus, with the value 24
scalar called mem, with the value 24576
scalar called disk, with the value 409600
range called ports, with values 21000 through 24000 (inclusive)
set called bugs, with the values a, b and c

在 attributes 的例子中,我们最终会有三个属性: rack with text value abc zone with text value west os with text value centos5 level with scalar value 10 keys with range value 1000 through 1500 (inclusive)

最新网友评论  共有(0)条评论 发布评论 返回顶部

Copyright © 2007-2017 PHPERZ.COM All Rights Reserved   冀ICP备14009818号  版权声明  广告服务