+ All Categories
Home > Technology > London HUG 14/4 - Deploying and Discovering at Scale with Consul and Nomad

London HUG 14/4 - Deploying and Discovering at Scale with Consul and Nomad

Date post: 21-Jan-2017
Category:
Upload: london-hashicorp-user-group
View: 249 times
Download: 1 times
Share this document with a friend
53
HASHICORP Deploying and Discovering at Scale with Consul & Nomad
Transcript
Page 1: London HUG 14/4 - Deploying and Discovering at Scale with Consul and Nomad

HASHICORP

Deploying and Discovering at Scale with Consul & Nomad

Page 2: London HUG 14/4 - Deploying and Discovering at Scale with Consul and Nomad

HASHICORP

Jon Benson @jm_benson

Page 3: London HUG 14/4 - Deploying and Discovering at Scale with Consul and Nomad

HASHICORP

Agenda

• Nomad Overview

• Nomad Architecture

Page 4: London HUG 14/4 - Deploying and Discovering at Scale with Consul and Nomad

HASHICORP

Agenda

• Consul Overview

• Consul Architecture

• Prepared Queries

Page 5: London HUG 14/4 - Deploying and Discovering at Scale with Consul and Nomad

HASHICORP

Agenda

• Demo

Page 6: London HUG 14/4 - Deploying and Discovering at Scale with Consul and Nomad

HASHICORP

Advantages of a Scheduler

Higher Resource Utilization

Decouple Work from Resources

Better Quality of Service

Page 7: London HUG 14/4 - Deploying and Discovering at Scale with Consul and Nomad

HASHICORP

Advantages of a Scheduler

Bin Packing

Over-Subscription

Job Queueing

Higher Resource Utilization

Decouple Work from Resources

Better Quality of Service

Page 8: London HUG 14/4 - Deploying and Discovering at Scale with Consul and Nomad

HASHICORP

Advantages of a Scheduler

Abstraction

API Contracts

Standardization

Higher Resource Utilization

Decouple Work from Resources

Better Quality of Service

Page 9: London HUG 14/4 - Deploying and Discovering at Scale with Consul and Nomad

HASHICORP

Advantages of a Scheduler

Priorities

Resource Isolation

Pre-emption

Higher Resource Utilization

Decouple Work from Resources

Better Quality of Service

Page 10: London HUG 14/4 - Deploying and Discovering at Scale with Consul and Nomad

HASHICORP

Page 11: London HUG 14/4 - Deploying and Discovering at Scale with Consul and Nomad

NomadHASHICORP

Cluster Scheduler

Easily Deploy Applications

Job Specification

Page 12: London HUG 14/4 - Deploying and Discovering at Scale with Consul and Nomad

HASHICORP

example.nomad

# Define our simple redis jobjob "redis" {

# Run only in us-east-1 datacenters = ["us-east-1"]

# Define the single redis task using Docker task "redis" { driver = "docker"

config { image = "redis:latest" }

resources { cpu = 500 # Mhz memory = 256 # MB network { mbits = 10 dynamic_ports = ["redis"] } } }}

Page 13: London HUG 14/4 - Deploying and Discovering at Scale with Consul and Nomad

HASHICORP

Job Specification

Declares what to run

Page 14: London HUG 14/4 - Deploying and Discovering at Scale with Consul and Nomad

HASHICORP

Job Specification

Nomad determines where and manages how to run

Page 15: London HUG 14/4 - Deploying and Discovering at Scale with Consul and Nomad

HASHICORP

Job Specification

Abstract work from resources

Page 16: London HUG 14/4 - Deploying and Discovering at Scale with Consul and Nomad

NomadHASHICORP

Multi-Datacenter

Multi-Region

Flexible Workloads

Job Priorities

Bin Packing

Large Scale

Operationally Simple

Page 17: London HUG 14/4 - Deploying and Discovering at Scale with Consul and Nomad

HASHICORP

Thousands of regions

Tens of thousands of clients per region

Thousands of jobs per region

Page 18: London HUG 14/4 - Deploying and Discovering at Scale with Consul and Nomad

HASHICORP

Built on Experience

gossip consensus

Page 19: London HUG 14/4 - Deploying and Discovering at Scale with Consul and Nomad

HASHICORP

• Cluster Management

• Gossip Based (P2P)

• Membership

• Failure Detection

• Event System

Page 20: London HUG 14/4 - Deploying and Discovering at Scale with Consul and Nomad

HASHICORP

• Gossip Protocol

• Large Scale

• Production Hardened

• Operationally Simple

Page 21: London HUG 14/4 - Deploying and Discovering at Scale with Consul and Nomad

HASHICORP

• Service configuration and discovery

• Monitoring at scale

• High-availability

Page 22: London HUG 14/4 - Deploying and Discovering at Scale with Consul and Nomad

HASHICORP

• Service configuration and discovery

• Monitoring at scale

• High-availability

Page 23: London HUG 14/4 - Deploying and Discovering at Scale with Consul and Nomad

HASHICORP

• Service configuration and discovery

• Monitoring at scale

• High-availability

Page 24: London HUG 14/4 - Deploying and Discovering at Scale with Consul and Nomad

HASHICORP

• Service configuration and discovery

• Monitoring at scale

• High-availability

Page 25: London HUG 14/4 - Deploying and Discovering at Scale with Consul and Nomad

HASHICORP

Page 26: London HUG 14/4 - Deploying and Discovering at Scale with Consul and Nomad

HASHICORP

• Multi-Datacenter

• Raft Consensus

• Large Scale

• Production Hardened

• Coordination (Locking)

• Central Servers + Distributed Clients

• Network Tomography

• Prepared Queries

Page 27: London HUG 14/4 - Deploying and Discovering at Scale with Consul and Nomad

HASHICORP

Prepared Queries

• Multiple instances of a given service exist in multiple datacenters

• Clients can talk to any of them, and always prefer the instances with

lowest latency

• Policies can change, desire to not have the clients know the details

of how to locate a healthy service

Page 28: London HUG 14/4 - Deploying and Discovering at Scale with Consul and Nomad

HASHICORP

Prepared Queries

• New query namespace, similar to services

• Register queries to answer for parts of this namespace

• Clients use APIs, or “.query.consul” DNS lookups to run

queries

Page 29: London HUG 14/4 - Deploying and Discovering at Scale with Consul and Nomad

HASHICORP

gossip consensus

Mature Libraries

Design Patterns

No Scheduling Logic

Page 30: London HUG 14/4 - Deploying and Discovering at Scale with Consul and Nomad

HASHICORP

Built on Research

gossip consensus

Page 31: London HUG 14/4 - Deploying and Discovering at Scale with Consul and Nomad

NomadHASHICORP

Inspired by Google Omega

Optimistic Concurrency

Internal State and Coordination

Service and Batch workloads

Pluggable Architecture

Page 32: London HUG 14/4 - Deploying and Discovering at Scale with Consul and Nomad

HASHICORP

Single Region Architecture

SERVER SERVER SERVER

CLIENT CLIENT CLIENTDC1 DC2 DC3

FOLLOWER LEADER FOLLOWER

REPLICATIONFORWARDING

REPLICATIONFORWARDING

RPC RPC RPC

Page 33: London HUG 14/4 - Deploying and Discovering at Scale with Consul and Nomad

HASHICORP

Multi Region Architecture

SERVER SERVER SERVERFOLLOWER LEADER FOLLOWER

REPLICATIONFORWARDING

REPLICATION

REGION B GOSSIP

REPLICATION REPLICATIONFORWARDING

REGION FORWARDING

REGION A

SERVERFOLLOWER

SERVER SERVERLEADER FOLLOWER

Page 34: London HUG 14/4 - Deploying and Discovering at Scale with Consul and Nomad

NomadHASHICORP

Region is Isolation Domain

1-N Datacenters Per Region

Flexibility to do 1:1 (Consul)

Scheduling Boundary

Page 35: London HUG 14/4 - Deploying and Discovering at Scale with Consul and Nomad

HASHICORP

Data Model

Page 36: London HUG 14/4 - Deploying and Discovering at Scale with Consul and Nomad

HASHICORP

Evaluations ~= State Change Event

Page 37: London HUG 14/4 - Deploying and Discovering at Scale with Consul and Nomad

HASHICORP

Create / Update / Delete JobNode Up / Node Down

Allocation Failed

Page 38: London HUG 14/4 - Deploying and Discovering at Scale with Consul and Nomad

HASHICORP

External Event

Evalua?on Crea?on

Evalua?on Queuing

Evalua?on Processing

Op?mis?c Coordina?on

State Updates

Page 39: London HUG 14/4 - Deploying and Discovering at Scale with Consul and Nomad

HASHICORP

Server Architecture

Omega Class Scheduler

Pluggable Logic

Internal Coordination and State

Multi-Region / Multi-Datacenter

Page 40: London HUG 14/4 - Deploying and Discovering at Scale with Consul and Nomad

HASHICORP

Client Architecture

Broad OS Support

Host Fingerprinting

Pluggable Drivers

Page 41: London HUG 14/4 - Deploying and Discovering at Scale with Consul and Nomad

HASHICORP

Fingerprinting

Operating System

Hardware

Applications

Environment

Type Examples

Kernel, OS, Versions

CPU, Memory, Disk

Java, Docker, Consul

AWS, GCE

Page 42: London HUG 14/4 - Deploying and Discovering at Scale with Consul and Nomad

HASHICORP

Fingerprinting

Constrain Placement and Bin Pack

Page 43: London HUG 14/4 - Deploying and Discovering at Scale with Consul and Nomad

HASHICORP

Fingerprinting

“Task Requires Linux, Docker, and PCI-Compliant Hardware” expressed as Constraints

Page 44: London HUG 14/4 - Deploying and Discovering at Scale with Consul and Nomad

HASHICORP

Fingerprinting

“Task needs 512MB RAM and 1 Core” expressed as Resource Ask

Page 45: London HUG 14/4 - Deploying and Discovering at Scale with Consul and Nomad

HASHICORP

Drivers

Execute Tasks Provide Resource Isolation

Page 46: London HUG 14/4 - Deploying and Discovering at Scale with Consul and Nomad

HASHICORP

Containerized

Virtualized

Standalone

Docker

Qemu / KVM

Java Jar

Static Binaries

Rocket

Page 47: London HUG 14/4 - Deploying and Discovering at Scale with Consul and Nomad

HASHICORP

Containerized

Virtualized

Standalone

Docker

Rocket

Windows Server Containers

Qemu / KVM

Hyper-V

Xen

Java Jar

Static Binaries

C#

Page 48: London HUG 14/4 - Deploying and Discovering at Scale with Consul and Nomad

NomadHASHICORP

Workload Flexibility:

Schedulers

Fingerprints

Drivers

Job Specification

Page 49: London HUG 14/4 - Deploying and Discovering at Scale with Consul and Nomad

NomadHASHICORP

Operational Simplicity:

Single Binary

No Dependencies

Highly Available

Page 50: London HUG 14/4 - Deploying and Discovering at Scale with Consul and Nomad

NomadHASHICORP

Cluster Scheduler

Easily Deploy Applications

Job Specification

Page 51: London HUG 14/4 - Deploying and Discovering at Scale with Consul and Nomad

NomadHASHICORP

Higher Resource Utilization

Decouple Work from Resources

Better Quality of Service

Page 52: London HUG 14/4 - Deploying and Discovering at Scale with Consul and Nomad

NomadHASHICORP

• Million Container Challenge

• hashicorp.com/c1m.html

• github.com/hashicorp/c1m

Page 53: London HUG 14/4 - Deploying and Discovering at Scale with Consul and Nomad

HASHICORP

Thanks!We’ll do a quick demo then answer questions…

Jon Benson @jm_benson


Recommended