A centralized service runs on one machine • A distributed service runs on two or more machines that are connected via a network • A stateless service persists (no significant) state • A stateful service persists state
a stateless, centralized service cat /dev/random # a stateless, distributed service (Marathon) http PUT http://1.2.3.4:8080/v2/apps < app.json # a stateful, centralized service (redirect to file) echo 'lolwut' > ./some.dat # a stateful, distributed service (HDFS) hadoop fs -put ./some.dat hdfs:///user/me/some.dat
• resource == anything a task/executor consumes in order to do their work • standard resources: cpu, mem, disk, ports • define your own, for example: --attributes='host_os:ubuntu;zone:us_east;rack:42'
SERVICES 15 Mesos data persistence → store in out-of-band location, e.g.: path.data: /var/crate/data # in crate.yml • no Mesos agent garbage collection • not accounted for by Mesos • setup ahead of time via local volume, NFS-mount of SAN/NAS or DFS such as HDFS, Ceph or Quobyte
Reservation See MESOS-2018 and docs/reservation • solves resource reservation issue • enables re-launch on same agent w/ guaranteed allocation • via framework or operator
Volumes See MESOS-1554 and docs/persistent-volume • solves data persistence issue • avoids garbage collection in the sandbox • can only exist on reserved resources (access/security)
DISTRIBUTED OPERATING SYSTEM 22 • kernel (Apache Mesos, written in C++) scales to 10,000 of nodes • fault-tolerant in all components, rolling upgrades throughout • containers first class citizens (LXC, Docker) • local OS per node (+container enabled) • scheduling (long-lived, batch) • service discovery, monitoring, logging, debugging
• Run stateless services such as Web servers, app servers (via Marathon) and stateful services like Crate, Kafka, HDFS, Cassandra, ArangoDB etc. together on one cluster • Dynamic partitioning of your cluster, depending on your needs (business requirements) • Increased utilization (10% → 80% an more)
28 • @mhausenblas • mhausenblas.info • @mesosphere • mesosphere.io/product Kudos for material in this talk go out to: David Greenberg and Joe Stein http://shop.oreilly.com/product/0636920039952.do https://manning.com/books/mesos-in-action