Apache Mesos

Apache Mesos is an open source cluster manager developed at UC Berkeley. It provides resource isolation and sharing across distributed applications.

Mesos consists of a master daemon that manages slave daemons running on each cluster node. Mesos frameworks are applications that run on Mesos and run tasks on these slaves. Slaves are either physical or virtual machines, typically from the same provider.

Mesos uses a two-level scheduling mechanism where resource offers are made to frameworks. The Mesos master node decides how many resources to offer each framework, while each framework determines the resources it accepts and what application to execute on those resources.

Mesos Architecture

img(°0°)

img(°0°)

Mesos Component and Process

  • Master daemon: runs on a master node and manages slave daemons
  • Slave daemon: runs on a master node and runs tasks that belong to frameworks
  • Framework: also known as a Mesos application, is composed of a scheduler, which registers with the master to receive resource offers, and one or more executors, which launches tasks on slaves. Examples of Mesos frameworks include Marathon, Chronos, and Hadoop
  • Offer: a list of a slave node’s available CPU and memory resources. All slave nodes send offers to the master, and the master provides offers to registered frameworks
  • Task: a unit of work that is scheduled by a framework, and is executed on a slave node. A task can be anything from a bash command or script, to an SQL query, to a Hadoop job
  • Apache ZooKeeper: software that is used to coordinate the master nodes

img(°0°)

refer

Mesos and Marathon
Marathon is a framework for Mesos that is designed to launch long-running applications, and, in Mesosphere, serves as a replacement for a traditional init system.

img(°0°)

img(°0°)

img(°0°)

Mesos Command
mesos endpoints

  • create app : curl -X POST http://marathon:8080/v2/apps -d @nginx.json -H “Content-type: application/json”