title: What does Apache Mesos actually do?
body: <p>I am trying to wrap my head around <a href="http://mesos.apache.org/">Apache Mesos</a> and need clarification on a few items.</p>
  
  <p>My <em>understanding</em> of Mesos is that it is an executable that gets installed on every physical/VM server ("<em>node</em>") in a cluster, and then provides a Java API (somehow) that treats each individual node as a collective pool of computing resources (CPU/RAM/etc.). Hence, to programs coding against the Java API, they only see 1 single set of resources, and don't have to worry about how/where the code is deployed.</p>
  
  <p>So for one, I could be fundamentally wrong in my understanding here (in which case, please correct me!). But if I'm on target, then how does the Java API (provided by Mesos) allow Java clients to tap into these resources?!? Can someone give a concrete example of Mesos in action?</p>
  
  <hr>
  
  <h2>Update</h2>
  
  <p>Take a look at my awful drawing below. If I understand the Mesos architecture correctly, we have a cluster of 3 physical servers (<code>phys01</code>, <code>phys02</code> and <code>phys03</code>). Each of these physicals is running an Ubuntu host (or whatever). Through a hypervisor, say, Xen, we can run 1+ VMs.</p>
  
  <p>I am interested in Docker &amp; CoreOS, so I'll use those in this example, but I'm guessing the same could apply to other non-container setups.</p>
  
  <p>So on each VM we have CoreOS. Running on each CoreOS instance is a Mesos executable/server. All Mesos nodes in a cluster see everything underneath them as a single pool of resources, and artifacts can be arbitrarily deployed to the Mesos cluster and Mesos will figure out which CoreOS instance to actually deploy them to.</p>
  
  <p>Running on top of Mesos is a "Mesos framework" such as Marathon or Kubernetes. Running inside Kubernetes are various Docker containers (<code>C1</code> - <code>C4</code>).</p>
  
  <p><img src="https://i.stack.imgur.com/QWoJD.png" alt="enter image description here"></p>
  
  <p>Is this understanding of Mesos more or less correct?</p>