Skip to Content
Building Applications on Mesos
book

Building Applications on Mesos

by David Greenberg
December 2015
Intermediate to advanced content levelIntermediate to advanced
225 pages
4h 19m
English
O'Reilly Media, Inc.
Content preview from Building Applications on Mesos

Chapter 4. Creating a New Framework for Mesos

A Mesos framework is the conceptual aggregation of a distributed system. But what does that mean to us, as framework developers? How can we actually understand how the structure of the code we write maps onto the Mesos cluster? Let’s review the Mesos architecture, and learn some common patterns in framework design.

Instead of trying to understand everything about Mesos architecture all at once, we’ll look at the simplest case: a framework that only has a scheduler, and no custom executor. This type of framework could spin up workers to process requests coming in on a queue, or it could manage a pool of services.

The Scheduler

The scheduler is the component that interacts directly with the leading Mesos master. A scheduler has four responsibilities:

  1. Launch tasks on the received offers.

  2. Handle status updates from those tasks, particularly to respond to task failures and crashes.

  3. Persist state and manage failovers in order to be highly available.

  4. Interact with clients, users, or other systems (since no system runs in a vacuum!).

Some of these responsibilities are implemented purely by interacting with the Mesos API; others must be implemented using the language of choice’s platform. For instance, launching tasks and handling status updates are implemented entirely by Mesos callbacks and API requests. On the other hand, it’s up to you to start a web server (such as Jetty on Java or Flask on Python) to allow clients to interact ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Mastering Mesos

Mastering Mesos

Akhil Das, Dipa Dubhashi
Mesos in Action

Mesos in Action

Roger Ignazio

Publisher Resources

ISBN: 9781491926543Errata Page