Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Mastering Mesos

You're reading from   Mastering Mesos The ultimate guide to managing, building, and deploying large-scale clusters with Apache Mesos

Arrow left icon
Product type Paperback
Published in May 2016
Publisher Packt
ISBN-13 9781785886249
Length 352 pages
Edition 1st Edition
Tools
Arrow right icon
Authors (2):
Arrow left icon
Akhil Das Akhil Das
Author Profile Icon Akhil Das
Akhil Das
Dipa Dubhashi Dipa Dubhashi
Author Profile Icon Dipa Dubhashi
Dipa Dubhashi
Arrow right icon
View More author details
Toc

Table of Contents (11) Chapters Close

Preface 1. Introducing Mesos 2. Mesos Internals FREE CHAPTER 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)
lock icon The rest of the chapter is locked
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 $19.99/month. Cancel anytime
Banner background image