The Framework Of Mesos

Reading time ~1 minute

Note:This is a Beginning for Understanding the Framework of Mesos.

Mesos Frameworks

Frameworks

The Architecture of Mesos:
mesos-architecture.jpg
Apache Mesos is offen explained as being a kernel for data-centre, meaning that cluster resources (CPU, GPU, RAM, Disk…) are tracked ad offered to “user space” programs(i.e Frameworks) to do computations on the cluster. From the above figure , we have one elected master that track resources on slaves and offer these resources to frameworks. Frameworks can take the offers and use this to launch a task on the slaves. These tasks run on an executor usually the built-in. Command Executor, that manages the task for us on the machine. So the framwork itself is actually a type of scheduler.

Register The Framework

One of the first things that a Mesos Framework should do is to register itself with the elected Mesos master so that it can start receiving resource offers. These offers then need to end up in our scheduler implementation. In Java we can use the MesosSchdulerDriver to take care off this wiring for us. we set our new MesosSchedulerDriver up by passing in a reference to our scheduler and by telling it everything it needs to know to communicate and register with the Mesos master.

If we want wo develop our own Framework, the Library and the Interface below need to be included.
- The Scheduler Library Of Mesos
SchedulerLibraryOfMesos.png

- The Executor Library Of Mesos
ExecutorLibraryOfMesos.png

- The FrameworkScheduler Interface
SchedulerInterface.png

- The FrameworkExecutor Interface
ExecutorInterface.png

- Run FrameworkScheduler
runFramework.png

- Run FrameworkExecutor
runExecutor.png

The first thing a Framework insterting into Mesos is to prepare two stuffs:

- One is the Scheduler of Framework FrameworkScheduler, a core class to schedule the resources achieved from Mesos-Master and execute the tasks that match the resources. FrameworkScheduler insteract with Mesos-Master trough MesosSchedulerDriver.

- The other is the Executor of Framework Execute the tasks that Frameworks deploy on Mesos-Slave.

When we create a FrameworkScheduler instance, with the (FrameworkID, MasterID, FrameworkScheduler) create SchedulerDriver instance. The instance of SchedulerDriver use for two things:

- Manage the FrameworkScheduler all the life-cycle, include start, stop, wait…

Linux_generic_block_layer

## 块设备层分析 ##IO无论是经过EXT3文件系统还是块设备文件,最终都要通过writeback机制将数据刷新到磁盘,除非用户在对文件进行读写的时候采用了`Direct IO`的方式。为了提高性能,文件系统或者是裸设备都会采用Linux的cache机制对数据读写性能进行...… Continue reading

Linux_driver

Published on February 22, 2017

Linux Direct I/O

Published on January 12, 2017