DC/OS: The Architecture #1

Mentioned in a paper called “Datacenter needs an Operating System” published at the University Of California. The expectations in the paper were roughly rounded up to the following points:

  1. Sharing of Data & Resources.
  2. Programming Abstractions.
  3. Debugging & Monitoring.

Mesosphere DC/OS, as a datacenter os, does the following above things for the user. The actual feeling you get when you use DC/OS is similar to an Operating System like Linux or Windows you use at least that’s what it expects to.

Introduction

We’re going to talk about DC/OS and how it does what it does. The basic functionalities offered by DC/OS can be tailored down to the following:

  1. Distributed Systems – DC/OS includes a group of nodes they are coordinated by Master nodes.
  2. Cluster Management – management of resources used by tasks.
  3. Container Platform – For containerized tasks multiple container platforms are supported.
  4. Operating System – to abstract hardware and software underlying and also to provide basic services the apps running. Also, there is a separation between User and Kernel Space.

We’re gonna explore some of the layers, nodes, tasks, & how the system starts up.

Node Types

Nodes are the physical/ virtual machines glued together with the help of network to form a cluster. Each node in the cluster has IP – to – IP connectivity with every other node for better communication. Each node in the cluster is required to have DC/OS.

There are 3 types of nodes:

  1. Master Node.
  2. Private Agent Node.
  3. Public Agent Node.

It is required to have each category of the node to put in a particular firewall group to have protected access.

Master Node

Working with other master nodes in the cluster and manages the cluster. Master Node contains the bulk of DC/OS components including the Mesos master process. Master nodes are placed in Protected Zone. Master nodes can be publicly accessible or in a network zone that restricts access to improve security. Using VPN or by restricting a particular range of IPs we can achieve that.

Agent Nodes

User tasks which are supplied either through the DC/OS GUI or CLI run at these nodes include a Mesos Agent process. The agent nodes also contain certain DC/OS components like Master Node. Agent nodes can be further sub-divided into two categories based on which firewall group belongs to.

Private Agent Node: They are not accessed from outside the cluster. These nodes are configured to allow undifferentiated access to resources by tasks.  These tasks are not accessible from outside the cluster. They are put in the Private Zone.

Public Agent Node: Allows ingress from outside the cluster through the cluster infrastructure network. Resources are differentiated depending on the task demands. These nodes are put in the Public Zone.

High Availability & Reliability

For availability DC/OS allows multiple master nodes to communicate. Leader Election is one such feature that allows traffic to be routed to the current leader. DC/OS allows the Quorum principle to be followed for example: If there are 3 master nodes it allows 1 one of the master node to go off.

Task Type

DC/OS runs many different workloads, which are composed of tasks. These tasks are scheduled by a built-in scheduler or by a scheduler service running on DC/OS.  These tasks are then put on the Mesos engine for execution and they are called Mesos Tasks.

Now we will discuss the two main constituents of the Mesos Framework.

Mesos Framework = Scheduler + Mesos Engine

Schedulers

Mesos tasks are, prior to being supplied with resources, put into the queue waiting to be executed at the Mesos Engine. Also, it allows for task abstraction so that users need not create them or interact with them.

Built-In Schedulers

There are 2 type of scheduler available

  1. Marathon Scheduler: provides services (Apps and Pods), which run continuously and in parallel.
  2. Metronome Scheduler: provides jobs, which run immediately or on a defined schedule.

User- Space Schedulers

These schedulers can be installed as scheduler services on Marathon via Mesosphere universe or directly via Marathon.

example: Kafka Scheduler provides Kafka broker, which run as lifecycle managed Kafka Nodes.

Executors

Executors are what get your work done on the Mesos Engine.

Built-In Executors – Mesos built-in executors are available to all schedulers, but schedulers can also use their own executors.

Types:

  • Command Executor – execute shell commands or Docker containers
  • Default Executor (Mesos 1.1) – execute a group of shell commands or Docker containers
The architecture of DC/OS

Distribution Process Management

In this section, we are going to talk about how all the jargon we talked about interacts when a task comes up. We, as DC/OS users, have the ability to specify the job through the DC/OS GUI or CLI. Let’s see what happens through the help of an interaction diagram:

At a high level, this interaction takes place between the DC/OS components when a user launches a process. Communication occurs between the different layers, such as the user interacting with the scheduler, and within a layer, for example, a master communicating with agents.

Let’s see how it is done step by step:

  1. the Client needs to know how to connect to the Scheduler to launch a process, for example via Mesos-DNS or DC/OS CLI.
  2. Mesos master sends resources to offer to Scheduler: the resource offers are based on cluster resources managed through agents and the DRF algorithm in Mesos master.
  3. Scheduler declines resource offers because no process requests from Clients are pending. As long as no clients have initiated a process, the scheduler will reject offers from the master.
  4. The client initiates process launch.
  5. Mesos master sends the resource offers.
  6. If resource offer matches the requirements the Scheduler has for the process, it accepts the offer and sends a launchTask request to Mesos master.
  7. Mesos master directs Mesos agents to launch tasks.
  8. Mesos agent launches tasks via Executor.
  9. Executor reports task status to Mesos agent.
  10. Mesos agent reports task status to Mesos master.
  11. Mesos master reports task status to the scheduler.
  12. Scheduler reports process status to the client.

That’s it, for now, folks, We’re gonna look under the hood and explore the various components in the next part.

knoldus-advt-sticker

 

Written by 

Vinay is a software consultant having more than 0.5 years of experience. He likes to keep up with the trending technologies. Vinay is familiar with languages such as C++, Java, Scala and is currently working on DevOps technologies /tools like DC/OS, Jenkins, Ansible, Docker. His hobbies includes writing, gaming, and sketching.

2 thoughts on “DC/OS: The Architecture #1

Leave a Reply

%d bloggers like this: