5. 5
FOUNDED 2012 by Mitchell Hashimoto and Armon Dadgar
MISSION We enable organizations to provision, secure, and run any infrastructure for any application
INVESTORS Mayfield Fund, GGV Capital, Redpoint and True Ventures
KEY PRODUCTS Vagrant, Packer, Terraform, Vault, Nomad, Consul
COMPANY OVERVIEW
13. 13
SCHEDULERS IN THE WILD
13
Type Work Resources
CPU Scheduler Threads Physical Cores
EC2 / Nova Virtual Machines Hypervisors
Hadoop YARN MapReduce Jobs Client Nodes
Cluster Scheduler Applications Machines
21. 21
NOMAD DESIGN PRINCIPLES
21HashiCorp confidential do not distribute
Integrated scheduler and cluster manager
Distributed, shared state, optimistically concurrent
Agent-based, client/server
No dependencies
22. 22
NOMAD CHARACTERISTICS
22HashiCorp confidential do not distribute
Multi-datacenter and multi-region
Highly performant and highly available
Hybrid workloads with multiple schedulers and drivers
Seamlessly integrates with HashiCorp ecosystem
24. 24
SINGLE REGION DEPLOYMENT
24
SERVER SERVER SERVER
CLIENT CLIENT CLIENTDC1 DC2 DC3
FOLLOWER LEADER FOLLOWER
REPLICATION
FORWARDING
REPLICATION
FORWARDING
RPC RPC RPC
25. 25
MULTI REGION DEPLOYMENT
25
SERVER SERVER SERVER
FOLLOWER LEADER FOLLOWER
REPLICATION
FORWARDING
REPLICATION
REGION B GOSSIP
REPLICATION REPLICATION
FORWARDING
REGION FORWARDING
REGION A
SERVER
FOLLOWER
SERVER SERVER
LEADER FOLLOWER
38. 38
redis.nomad
JOB FILE: PARAMETERIZED
job "encode" {
type = "batch"
parameterized {
payload = "required"
meta_required = ["s3-input", "s3-output", ...]
}
# ...
task "ffmpeg" {
driver = "exec"
config {
command = "ffmpeg"
# When dispatched, the payload is written to a file that is then
# read by the created task upon startup
args = ["-config=${NOMAD_TASK_DIR}/config.json"]
# ...
}
41. Why Multi-Cloud?
• High Availability
• Redundancy
• Burstable Workload
• Cloud Migration
• Because we can
42. 42
CONSUL
NOMAD
SERVER
LEADER
SERVER
FOLLOWER
SERVER
LEADER
SERVER
FOLLOWER
SERVER
FOLLOWER
SERVER
FOLLOWER
NODE A NODE B
GOOGLE CLOUD
NATS CLOUD
MESSAGING
REPLICATION
FORWARDING
REPLICATION
FORWARDING
REPLICATION
FORWARDING
REPLICATION
FORWARDING
LOAD BALANCER
LOAD BALANCER
CONSUL
NOMAD
SERVER
LEADER
SERVER
FOLLOWER
SERVER
LEADER
SERVER
FOLLOWER
SERVER
FOLLOWER
SERVER
FOLLOWER
NODE A NODE B
AWS
REPLICATION
FORWARDING
REPLICATION
FORWARDING
REPLICATION
FORWARDING
REPLICATION
FORWARDING
LOAD BALANCER
REGION FORWARDING (VPN)
REGION FORWARDING (VPN)
44. 44
SCHEDULING
44
Schedulers process evaluations and generate allocation plans.
Placement is determined using the relevant scheduler.
Scheduling involves feasibility checking and ranking.
Feasibility filters out nodes missing necessary drivers and those failing
the specified constraints.
Ranking score feasible nodes to find the best fit (bin packing).
45. 45
SCHEDULER TYPES
45HashiCorp confidential do not distribute
Service
Long-running applications and services
Batch
Short-lived data processing jobs (benefit from fast placement)
System
Lower level jobs that run on all clients (logging, monitoring)
46. 46
$ nomad plan example.nomad
+ Job: "example"
+ Task Group: "cache" (1 create)
+ Task: "redis" (forces create)
Scheduler dry-run:
- All tasks successfully allocated.
$
Text
SCHEDULING: PLAN
47. 47
$ nomad plan example.nomad.java
+ Job: "example"
+ Task Group: "web" (1 create)
+ Task: "tomcat" (forces create)
Scheduler dry-run:
- WARNING: Failed to place all allocations.
Task Group "web" (failed to place 1 allocation):
* Constraint "missing drivers" filtered 2 nodes
$
Text
SCHEDULING: PLAN
48. 48
$ nomad run example.nomad
==> Monitoring evaluation "4b8b7779"
Evaluation triggered by job "example"
Allocation "38720b8e" created: node "ec2f0830", group "cache"
Evaluation status changed: "pending" -> "complete"
==> Evaluation "4b8b7779" finished with status "complete"
$
Text
SCHEDULING: RUN
49. 49
$ nomad run -region=gcp events.nomad
==> Monitoring evaluation "e2a8dfe6"
!On branch master
Evaluation triggered by job "events"
!Your branch is up-to-date with 'origin/master'.
Allocation "6615b39f" modified: node "0d6a6103", group "pubsub"
!nothing to commit, working tree clean
Evaluation status changed: "pending" -> "complete"
!
==> Evaluation "e2a8dfe6" finished with status "complete"
$
Text
SCHEDULING: RUN DIFFERENT REGION
50. 50
$ nomad status example
ID = example
Name = example
Type = service
Priority = 50
Datacenters = us-west-1
Status = running
Summary
Task Group Queued Starting Running Failed Complete Lost
cache 0 0 1 0 0 0
Allocations
ID Eval ID Node ID Task Group Desired Status Created At
38720b8e 4b8b7779 ec2f0830 cache run running 04/26/17 ...
$
Text
SCHEDULING: STATUS