Search icon
Subscription
0
Cart icon
Close icon
You have no products in your basket yet
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Mastering Mesos

You're reading from  Mastering Mesos

Product type Book
Published in May 2016
Publisher Packt
ISBN-13 9781785886249
Pages 352 pages
Edition 1st Edition
Languages
Authors (2):
Dipa Dubhashi Dipa Dubhashi
Profile icon Dipa Dubhashi
Akhil Das Akhil Das
Profile icon Akhil Das
View More author details

Table of Contents (16) Chapters

Mastering Mesos
Credits
About the Authors
About the Reviewer
www.PacktPub.com
Preface
1. Introducing Mesos 2. Mesos Internals 3. Getting Started with Mesos 4. Service Scheduling and Management Frameworks 5. Mesos Cluster Deployment 6. Mesos Frameworks 7. Mesos Containerizers 8. Mesos Big Data Frameworks 9. Mesos Big Data Frameworks 2 Index

The attributes and resources of Mesos


Mesos describes the slave nodes present in the cluster by the following two methods:

Attributes

Attributes are used to describe certain additional information regarding the slave node, such as its OS version, whether it has a particular type of hardware, and so on. They are expressed as key-value pairs with support for three different value types—scalar, range, and text—that are sent along with the offers to frameworks. Take a look at the following code:

attributes : attribute ( ";" attribute )*

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

Resources

Mesos can manage three different types of resources: scalars, ranges, and sets. These are used to represent the different resources that a Mesos slave has to offer. For example, a scalar resource type could be used to represent the amount of CPU on a slave. Each resource is identified by a key string, as follows:

resources : resource ( ";" resource )*

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

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

resourceRole : text | "*"

Predefined uses and conventions

The Mesos master predefines how it handles the following list of resources:

  • cpus

  • mem

  • disk

  • ports

In particular, a slave without the cpu and mem resources will never have its resources advertised to any frameworks. Also, the master's user interface interprets the scalars in mem and disk in terms of MB. For example, the value 15000 is displayed as 14.65GB.

Examples

Here are some examples of configuring the Mesos slaves:

  • 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]'

In this case, we have three different types of resources, scalars, a range, and a set. They are called cpus, mem, and disk, and the range type is ports.

  • A scalar called cpus with the value 24

  • A scalar called mem with the value 24576

  • A scalar called disk with the value 409600

  • A range called ports with values 21000 through 24000 (inclusive)

  • A set called bugs with the values a, b, and c

In the case of attributes, we will end up with three attributes:

  • A rack attribute with the text value abc

  • A zone attribute with the text value west

  • An os attribute with the text value centos5

  • A level attribute with the scalar value 10

  • A keys attribute with range values 1000 through 1500 (inclusive)

You have been reading a chapter from
Mastering Mesos
Published in: May 2016 Publisher: Packt ISBN-13: 9781785886249
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}