The task allocation process analysis of Apache Mesos, see the following figure:
Step 1 when one of the following events occurs, the resource allocation behavior is triggered: New framework registration, frame cancellation, additional nodes, idle resources, etc.
Step 2 Mesos The allocator module in master to assign resources to a framework and encapsulate resources into resourceoffersmessage (protocal Buffer message). Transmission through the network to the schedulerprocess;
Step 3 schedulerprocess invoke the Resourceoffers function in the user-written scheduler (no version may be changed), and a new resource is available;
Step 4 The user's scheduler calls the Launchtasks () function in Mesosschedulerdriver, telling the task to be started;
Step 5 schedulerprocess The task to be launched into the Launchtasksmessage (protocal Buffer message) and transmits it to Mesos Master via the network;
Step 6 Mesos Master to encapsulate the tasks to be launched into Runtaskmessage to send to each Mesos Slave;
Step 7 Mesos slave receive Runtaskmessage message, send it further to the corresponding executorprocess;
Step 8 executorprocess The resource after receiving the message, and prepares the task to run the environment, which ultimately invokes the Launchtask startup task in the user-written executor (if Executor has not started, start executor first).
On a mesos slave, a task startup process is shown in the following illustration:
You might also like: 1 Apache mesos Total Architecture 2 Apache Mesos Base Library 3 Apache Mesos module Communication Architecture 4 Apache Mesos dispatch mechanism 5 Apache Mesos task status update process Analysis 6 Uncover the distributed cloud computing framework you don't know