DCOS-Training

Notes for training on DC OS

View on GitHub

00 Breaking Ice

IT solutions constantly feel like: https://youtu.be/C2YZnTL596Q?t=46s

But ever so often, we do make a leap that allows us to deal with problems of a higher order.

From dedicated boxes and expensive data centers to virtualization and now to containers and container management. We constantly evolve new ways of doing our job better.

We are here to grok the basics of a bunch of overlapping technologies. This may be confusing to start with, so we’ll focus on a lot of hands on sessions.

This is in no way a comprehensive survey of the field, nor is it a extremely deep dive into the inner workings of distributed computing, datacenters etc. The goal is to familiarize you with these technologies and give you a solid grounding on Mesos and DC/OS.

Each new technology ‘trend’ must be taken with a grain of salt, a technology that worked well for one type of solution may not work for another. Our sessions here may give you some insights into how to make this decision as well.

01 Install Dependencies

02 Why Mesos, DC/OS?

We started with simple applications, monolithic in nature and from there graduated to:

But that is easier said than done. Let’s look at some of the areas one must attend to in today’s IT ecosystem.

Orchestration: [Service Managment, Scheduling, Resource Management]

Resource Management: [Memory, Disk, Processor, IP, Ports]

Scheduling: [Placement, Replication/Scaling, Resurrection, Rescheduling, Rolling Deployment, Upgrades, Downgrades, Collocation]

Service Management: [Groups, Namespaces, Dependencies, Load Balancing]

Debugging: [Log, Monitoring, Metrics, Shell based remediation]

Maintenance: [Upgrades, Capacity planning, Backups, Disaster Recovery]

… and on and on…

Wait, there’s the non-functional requirements too:

Usability, Scalability, Availability, Portability, Flexibility, Security, Agility

…and you can’t have them all.

So IT becomes a game of tradeoffs and strategies, and we need all the help we can get.

Mesos and DC/OS

03 Vagrant Up

Why?

…and What?

Aside: Vagrant and Docker

Vagrant vocabulary

How? - Hands On: Vagrant

Let’s try our hand at Vagrant so we build a fair level of comfort with the technology. In future, this will give us insights into DC/OS and will also give us a good grounding for installing a small DC/OS cluster on our local machines. Please follow along closely and ensure that you complete all the steps.

Basics

vagrant init
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
  config.vm.box = "hashicorp/precise32"
  end
vagrant up
vagrant suspend
vagrant resume
vagrant halt
vagrant destroy

Forwarded Ports

VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
  config.vm.box = "hashicorp/precise32"
  config.vm.network "forwarded_port", guest: 80, host: 8080
  end
vagrant up
sudo apt-get -y update
sudo apt-get -y install apache2
sudo su
vagrant halt

NB: Another approach to installing Apache2 using a shell script at startup is described here: https://www.vagrantup.com/intro/getting-started/provisioning.html

Multi-machine setup

There may be scenarios where you’d want to setup more than one VM at the same time. Some really good reasons listed on Vagrant’s site:

As I am sure you can see, there may be more.

Let’s see how simple it is to setup two machines at the same time.

VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
  config.vm.provision "shell", inline: "echo Hello"

  config.vm.define "web" do |web|
    web.vm.box = "apache"
  end

  config.vm.define "db" do |db|
    db.vm.box = "mysql"
  end
end

Exercise - ideally 30 minutes, not exceeding 45 minutes

04 Hands On: Setup a DC/OS cluster locally

We’ll use: https://github.com/dcos/dcos-vagrant/

vagrant halt

or

vagrant destroy
vagrant plugin install vagrant-hostmanager
git clone https://github.com/dcos/dcos-vagrant
cd dcos-vagrant
copy VagrantConfig-1m-1a-1p.yaml VagrantConfig.yaml
vagrant up
vagrant destroy -f

That is it for today! :)

05: Day 02

We’ll look at: