Developing Frameworks for Apache Mesos

38
Developing Frameworks for Apache Mesos

Transcript of Developing Frameworks for Apache Mesos

Page 1: Developing Frameworks  for Apache Mesos

Developing Frameworks for Apache Mesos

Page 2: Developing Frameworks  for Apache Mesos

Joe Stein

CEO of Elodina http://www.elodina.net/ a big data as a service platform built on top open source software. The Elodina platform enables customers to analyze data streams and programmatically react to the results in real-time. We solve today’s data analytics needs by providing the tools and support necessary to utilize open source technologies.

As users, contributors and committers, Elodina also provides support for frameworks that run on Mesos including Apache Kafka, Exhibitor (Zookeeper), Apache Storm, Apache Cassandra and a whole lot more!

LinkedIn: http://linkedin.com/in/charmalloc Twitter : @allthingshadoop

Page 3: Developing Frameworks  for Apache Mesos

◉What goes on Mesos?◉Framework = (Scheduler +

Executor)◉What does it look like without a

scheduler?◉We can do better using a

scheduler!◉Schedulers working together.◉Framework API & Examples.

Overview

Page 4: Developing Frameworks  for Apache Mesos

What goes on Mesos?

Page 5: Developing Frameworks  for Apache Mesos
Page 6: Developing Frameworks  for Apache Mesos

Many, many things

Page 7: Developing Frameworks  for Apache Mesos

Anything can be run on Mesos with Marathon or Aurora

https://mesosphere.github.io/marathon/ http://aurora.apache.org/

Page 8: Developing Frameworks  for Apache Mesos

Framework = (Scheduler + Executor)

Page 9: Developing Frameworks  for Apache Mesos
Page 10: Developing Frameworks  for Apache Mesos

Scheduler

Page 11: Developing Frameworks  for Apache Mesos

Executors

Page 12: Developing Frameworks  for Apache Mesos

mesos/kafka

https://github.com/mesos/kafka

Page 13: Developing Frameworks  for Apache Mesos

Scheduler◉ Provides the operational automation for a Kafka

Cluster.◉ Manages the changes to the broker's

configuration. ◉ Exposes a REST API for the CLI to use or any other

client.◉ Runs on Marathon for high availability.◉ Broker Failure Management “stickiness”

Executor◉ The executor interacts with the kafka broker as an

intermediary to the scheduler

Scheduler & Executor

Page 14: Developing Frameworks  for Apache Mesos

CLI & REST API

◉ scheduler - starts the scheduler.◉ add - adds one more more brokers to the cluster.◉ update - changes resources, constraints or broker properties one or

more brokers.◉ remove - take a broker out of the cluster.◉ start - starts a broker up.◉ stop - this can either a graceful shutdown or will force kill it

(./kafka-mesos.sh help stop)◉ rebalance - allows you to rebalance a cluster either by selecting the

brokers or topics to rebalance. Manual assignment is still possible using the Apache Kafka project tools. Rebalance can also change the replication factor on a topic.

◉ help - ./kafka-mesos.sh help || ./kafka-mesos.sh help {command}

Page 15: Developing Frameworks  for Apache Mesos

Launch 20 brokers in seconds

./kafka-mesos.sh add 1000..1019 --cpus 0.01 --heap 128 --mem 256 --options num.io.threads=1./kafka-mesos.sh start 1000..1019

Page 16: Developing Frameworks  for Apache Mesos

What does it look like without a scheduler?

Page 17: Developing Frameworks  for Apache Mesos

without a scheduler

Page 18: Developing Frameworks  for Apache Mesos

without a scheduler

Page 19: Developing Frameworks  for Apache Mesos

without a scheduler

Page 20: Developing Frameworks  for Apache Mesos

without a scheduler

Page 21: Developing Frameworks  for Apache Mesos

without a scheduler

Page 22: Developing Frameworks  for Apache Mesos

We can do better using a scheduler

Page 23: Developing Frameworks  for Apache Mesos

with a scheduler

Page 24: Developing Frameworks  for Apache Mesos

with a scheduler

Page 25: Developing Frameworks  for Apache Mesos

with a scheduler

Page 26: Developing Frameworks  for Apache Mesos

with a scheduler

Page 27: Developing Frameworks  for Apache Mesos

with a scheduler

Page 28: Developing Frameworks  for Apache Mesos

Schedulers working together

Page 29: Developing Frameworks  for Apache Mesos
Page 30: Developing Frameworks  for Apache Mesos
Page 31: Developing Frameworks  for Apache Mesos
Page 32: Developing Frameworks  for Apache Mesos

Framework API & Examples

Page 33: Developing Frameworks  for Apache Mesos

Mesos Protos

https://github.com/apache/mesos/blob/master/include/mesos/mesos.proto

Everything is good to understand but here is a good place to start◉ FrameworkInfo◉ TaskInfo◉ TaskState◉ MasterInfo◉ SlaveInfo

Page 34: Developing Frameworks  for Apache Mesos

Mesos Framework Development Guide

http://mesos.apache.org/documentation/latest/app-framework-development-guide/

◉ Scheduler APIregistered, reregistered, disconnectedresourceOffers, offerRescinded, statusUpdate, frameworkMessageslaveLost, executorLost, error

◉ Executor APIregistered, reregistered, disconnectedlaunchTask, killTask, frameworkMessage

Page 35: Developing Frameworks  for Apache Mesos

Task Reconciliation

http://mesos.apache.org/documentation/latest/reconciliation/

It is the responsibility of Mesos (scheduler driver / Master) to ensure that the framework is notified when a disconnection, and subsequent (re-)registration occurs. At this point, the scheduler should perform task state reconciliation.

Page 36: Developing Frameworks  for Apache Mesos

Language Bindings◉ c++ →

https://github.com/apache/mesos/tree/master/src/examples◉ python →

https://github.com/apache/mesos/tree/master/src/examples/pythonhttps://github.com/wickman/pesos

◉ java → https://github.com/apache/mesos/tree/master/src/examples/javahttp://mesos.apache.org/api/latest/java/https://github.com/groupon/jesos

◉ go → https://github.com/mesos/mesos-go

◉ clojure → https://github.com/dgrnbrg/clj-mesoshttps://github.com/pyr/mesomatic

◉ scala → https://github.com/mesosphere/scala-sbt-mesos-framework.g8

Page 37: Developing Frameworks  for Apache Mesos

Rendler

A rendering web crawler for Apache Mesos.https://github.com/mesosphere/RENDLER

Page 38: Developing Frameworks  for Apache Mesos

Questions?

Joe Steinhttp://www.elodina.net