2018
The SMACK Stack
- n Mesosphere DC/OS
Using Cloud Infrastructure
#OSCON
The SMACK Stack on Mesosphere DC/OS Using Cloud Infrastructure - - PowerPoint PPT Presentation
The SMACK Stack on Mesosphere DC/OS Using Cloud Infrastructure #OSCON 2018 OSCON - Portland, Oregon 2018 2 Kaitlin Carter Instructor & Content Developer at Mesosphere Develop Technical Trainings Instructional Designer OSCON
2018
Using Cloud Infrastructure
#OSCON
2
➔ Instructor & Content Developer at Mesosphere ➔ Develop Technical Trainings ➔ Instructional Designer
OSCON - Portland, Oregon 2018
3
➔ Solution Architect at Mesosphere ➔ 10+ years in Digital Transformation Technologies ➔ 20+ years in Linux systems architecture
OSCON - Portland, Oregon 2018
Agenda
1. Course Goals and Lab Environment 2. Intro to SMACK Stack 3. Intro to DC/OS 4. Lab 1 5. SMACK Stack Technologies on DC/OS 6. Lab 2 7. Case Study & Demo 8. Lab 3 9. Next Steps
4
Workshop Goals
Learn and understand:
technologies on DC/OS.
Gain hands on experience:
5
Lab Environment
Your lab environment consists of 7 nodes:
services will run. Lab Instructions:
6
Raffle!
To participate:
education@mesosphere.com Raffle Rules:
session - must be present.
7
8
OSCON - Portland, Oregon 2018 Kafka
1st Prize:
2nd Prize:
10
OSCON - Portland, Oregon 2018 Intro to SMACK
Batch Event Processing Micro-Batch
Days Hours Minutes Seconds Microseconds
Solves problems using predictive and prescriptive analytics Reports what has happened using descriptive analytics
Predictive User Interface Real-time Pricing and Routing Real-time Advertising Billing, Chargeback
Product recommendations
11
OSCON - Portland, Oregon 2018 Intro to SMACK
12
OSCON - Portland, Oregon 2018 Intro to SMACK
intention of its usage, intrinsic value for trends, and in some cases its presence is only a status symbol with no corporate value.
de-normalized – think about it…
most case if lost or deleted there is little consequence – perhaps with the exception of compliance retention
the rate of change, nor the patterns of change
13
OSCON - Portland, Oregon 2018 Intro to SMACK
1. Job Submitted 2. Job queries HDFS Name-Node(s) to find data 3. Job Tracker creates execution plan and submits to Task Trackers 4. Task trackers perform task and report status to Job Tracker 5. Job Tracker manages task phases 6. Job Tracker finished task and updates status
14
OSCON - Portland, Oregon 2018 Intro to SMACK
many cases
Slow and Fast data exist
Stack used to implement system
15
OSCON - Portland, Oregon 2018 Intro to SMACK
Data Ingestion Request/Response Devices Client Sensors Message Queue/Bus Microservices Distributed Storage Analytics (Streaming) Use Cases:
16
OSCON - Portland, Oregon 2018 Intro to SMACK
17
architectures
industry verticals
Product (MVP)
applications
cluster management for a diversity of workloads
OSCON - Portland, Oregon 2018 Intro to DC/OS
18
Cloud Native
OSCON - Portland, Oregon 2018 Intro to DC/OS
19
OSCON - Portland, Oregon 2018 Mesos
EVENTS
Ubiquitous data streams from connected devices
INGEST Apache Kafka STORE Apache Spark ANALYZE Apache Cassandra ACT Akka
Ingest millions of events per second Distributed & highly scalable database Real-time and batch process data Visualize data and build data driven applications
Mesos/ DC/OS
Sensors Devices Clients
○ Containers & Container Orchestration ○ Interacting with DC/OS & the DC/OS Catalog ○ Mesos
21
OSCON - Portland, Oregon 2018 Intro to DC/OS
Typical Datacenter siloed, over-provisioned servers, low utilization Apache Mesos automated schedulers, workload multiplexing onto the same machines
mySQL microservice Cassandra Spark/Hadoop Kafka
22
+ A big, diverse community
+ Roadmap and designs + Documentation and tutorials
+ Networking, Security, CLI, UI, Service Discovery, Load Balancing, Packages, ...
OSCON - Portland, Oregon 2018 Intro to DC/OS
23
Is the mesos component in DC/OS also the foundational technology in the SMACK stack?
OSCON - Portland, Oregon 2018 Intro to DC/OS
24
OSCON - Portland, Oregon 2018 Intro to DC/OS
25
OSCON - Portland, Oregon 2018 Intro to DC/OS
26
OSCON - Portland, Oregon 2018 Intro to DC/OS
27
OSCON - Portland, Oregon 2018 Intro to DC/OS
28
Docker Engine
nodes.
OSCON - Portland, Oregon 2018 Intro to DC/OS
UCR
29
frameworks. ○ Starts and keeps applications running. ○ Similar to a distributed init system.
scheduler.
OSCON - Portland, Oregon 2018 Intro to DC/OS
30
OSCON - Portland, Oregon 2018 Intro to DC/OS
31
OSCON - Portland, Oregon 2018 Intro to DC/OS
32
OSCON - Portland, Oregon 2018 Intro to DC/OS
33
DC/OS CLI for Node & Cluster Management.
OSCON - Portland, Oregon 2018 Intro to DC/OS
DC/OS CLI for App Management.
34
{ "service": { "name": "kafka", "user": "nobody", "virtual_network_enabled": false, "virtual_network_name": "dcos", "virtual_network_plugin_labels": "", "placement_constraint": "[[\"hostname\", \"MAX_PER\", \"1\"]]", "deploy_strategy": "serial" }
OSCON - Portland, Oregon 2018 Intro to DC/OS
35
○ Nodes page ○ Dashboard ○ Catalog: smack packages and k8s package. ○ Services page: marathon apps ○ Jobs page: metronome
OSCON - Portland, Oregon 2018 Intro to DC/OS
36
○ IP Detect ○ Config file
OSCON - Portland, Oregon 2018 Intro to DC/OS
$ sudo bash dcos_install.sh master
37
Server Assignments:
In this lab you will:
OSCON - Portland, Oregon 2018 Intro to DC/OS
38
OSCON - Portland, Oregon 2018 Intro to DC/OS
40
OSCON - Portland, Oregon 2018 Mesos
EVENTS
Ubiquitous data streams from connected devices
INGEST Apache Kafka STORE Apache Spark ANALYZE Apache Cassandra ACT Akka
Ingest millions of events per second Distributed & highly scalable database Real-time and batch process data Visualize data and build data driven applications
Mesos/ DC/OS
Sensors Devices Clients
41
OSCON - Portland, Oregon 2018 Mesos
42
servers to create “one giant computer”.
agent tasks.
resources.
OSCON - Portland, Oregon 2018 Mesos
43
44
Two-level Scheduling
Master
Framework
resources
OSCON - Portland, Oregon 2018 Mesos
Mesos Master Mesos Master Mesos Master Mesos Agent Mesos Agent Service
Cassandra Executor Cassandra Task
Cassandra Scheduler Container Scheduler Spark Scheduler
Spark Executor Spark Task
Mesos Agent Mesos Agent Service
Docker Executor Docker Task Spark Executor Spark Task
45
Marathon Scheduler Mesos Master Metronome Scheduler Other Schedulers Mesos Master Mesos Master
Zookeeper Ensemble
Leader
Mesos Private Agent
Docker executor
nginx
Mesos executor
./myapp
Mesos Public Agent
Docker executor
nginx
Mesos executor
./python main.py
OSCON - Portland, Oregon 2018
Mesos
46
Marathon Scheduler Mesos Master Mesos Private Agent Hey Master, I have 4 CPUs, 4 GB of RAM, and 100 GB of disk space available Great, I’ll make a note of it!
OSCON - Portland, Oregon 2018
Mesos
47
Marathon Scheduler Mesos Master Mesos Private Agent Hey Marathon, I need an nginx container that needs 1 CPU and 1 GB of RAM Great, I’ll ask the Master
OSCON - Portland, Oregon 2018
Mesos
48
Marathon Scheduler Mesos Master Mesos Private Agent Sounds good, here are agents that are capable of fulfilling those requirements Hey Mesos Master, I need an agent that has 1 available CPU and 1 GB of RAM available
OSCON - Portland, Oregon 2018
Mesos
49
Marathon Scheduler Mesos Master Mesos Private Agent Great, I’m on it! Agent, you’ve been selected to spawn an nginx container that is allocated 1 CPU and 1 GB of RAM - here’s all the information I received from the scheduler needed to launch this application
OSCON - Portland, Oregon 2018
Mesos
50
Marathon Scheduler Mesos Master Mesos Private Agent Hey Master, I got that container you were asking for up and running OK great, I will let the end users know OK great, I will let the scheduler know Hey Marathon, that nginx container you asked for is up and running Docker Executor nginx
OSCON - Portland, Oregon 2018
Mesos
51
How many leading Mesos masters can you have in a DC/OS cluster?
OSCON - Portland, Oregon 2018 Intro to DC/OS
53
OSCON - Portland, Oregon 2018 Spark
EVENTS
Ubiquitous data streams from connected devices
INGEST Apache Kafka STORE Apache Spark ANALYZE Apache Cassandra ACT Akka
Ingest millions of events per second Distributed & highly scalable database Real-time and batch process data Visualize data and build data driven applications
Mesos/ DC/OS
Sensors Devices Clients
54
Micro-batching
Native Streaming
OSCON - Portland, Oregon 2018 Spark
55
OSCON - Portland, Oregon 2018 Spark
Typical Use: distributed, large-scale data processing; micro-batching Why Spark Streaming?
latency, which can be faster
with other pieces of the pipeline
56
OSCON - Portland, Oregon 2018 Spark
57
OSCON - Portland, Oregon 2018 Spark
58
OSCON - Portland, Oregon 2018 Spark
Service
usage. HDFS
Security
59
OSCON - Portland, Oregon 2018 Spark
Service
HDFS
Security
60
Spark UI
DC/OS CLI Subcommands
DC/OS CLI
Connection Information from UI
OSCON - Portland, Oregon 2018 Spark
62
OSCON - Portland, Oregon 2018 Spark
EVENTS
Ubiquitous data streams from connected devices
INGEST Apache Kafka STORE Apache Spark ANALYZE Apache Cassandra ACT Akka
Ingest millions of events per second Distributed & highly scalable database Real-time and batch process data Visualize data and build data driven applications
Mesos/ DC/OS
Sensors Devices Clients
63
Akka is a toolkit for building highly concurrent, distributed, and resilient message-driven applications for Java and Scala.
OSCON - Portland, Oregon 2018 Akka
65
OSCON - Portland, Oregon 2018 Cassandra
EVENTS
Ubiquitous data streams from connected devices
INGEST Apache Kafka STORE Apache Spark ANALYZE Apache Cassandra ACT Akka
Ingest millions of events per second Distributed & highly scalable database Real-time and batch process data Visualize data and build data driven applications
Mesos/ DC/OS
Sensors Devices Clients
66
NoSQL
OSCON - Portland, Oregon 2018 Cassandra
Filesystems
Time-Series Datastores
SQL
67
Typical Use: No-dependency, time series database Why Cassandra?
built on Amazon’s Dynamo and Google’s BigTable
performance, operational simplicity and easy data distribution
OSCON - Portland, Oregon 2018 Cassandra
68
OSCON - Portland, Oregon 2018 Cassandra
consistent
read/write consistency ○ Write Strategies: ■ Any, One, Quorum, All, .. ○ Read Strategies: ■ One, Quorum, ALL
69
OSCON - Portland, Oregon 2018 Cassandra
70
Service
Nodes
OSCON - Portland, Oregon 2018 Cassandra
Cassandra:
71
OSCON - Portland, Oregon 2018 Cassandra
Node
node per DC/OS private agent.
Cassandra
72
OSCON - Portland, Oregon 2018 Cassandra
Connection information from UI or CLI
DC/OS CLI: dcos task exec
Cqlsh
Backup & Restore with DC/OS CLI
API
74
OSCON - Portland, Oregon 2018 Spark
EVENTS
Ubiquitous data streams from connected devices
INGEST Apache Kafka STORE Apache Spark ANALYZE Apache Cassandra ACT Akka
Ingest millions of events per second Distributed & highly scalable database Real-time and batch process data Visualize data and build data driven applications
Mesos/ DC/OS
Sensors Devices Clients
75
Message Brokers
Log-based Queues
see also queues.io
OSCON - Portland, Oregon 2018 Kafka
76
Typical Use: A reliable buffer for stream processing Why Kafka?
persistent publish-subscribe messaging system
production by 100+ web-scale companies [1]
OSCON - Portland, Oregon 2018 Kafka
77
be lost but are never re-delivered
never lost but may be redelivered (Kafka)
delivered once and only once (this is what everyone actually wants, but it’s tricky)
OSCON - Portland, Oregon 2018 Kafka
Murphy’s Law of Distributed Systems:
Anything that can go wrong, will go wrong … partially!
78
OSCON - Portland, Oregon 2018 Kafka
79
Sevice
Brokers
OSCON - Portland, Oregon 2018 Spark
Kafka
80
OSCON - Portland, Oregon 2018 Spark
Sevice
per DC/OS private agent.
Brokers
Kafka
81
OSCON - Portland, Oregon 2018 Kafka
Connection information from UI or CLI
DC/OS CLI: dcos task exec
Kafka API
DC/OS CLI Subcommands
82
In this lab you will use a script to install:
OSCON - Portland, Oregon 2018 Kafka
84
Available for you to try at: https://github.com/mesosphere/oscon-smack-stack
OSCON - Portland, Oregon 2018 Case Study & Demo
85
86
In this lab you will:
OSCON - Portland, Oregon 2018 Kafka
88
Get Help
OSCON - Portland, Oregon 2018 Next Steps
Join the Community: dcos.io/community Get Involved
Get Updates
89
DC/OS Documentation: https://docs.mesosphere.com
Service Docs: https://docs.mesosphere.com/service-docs/
OSCON - Portland, Oregon 2018 Next Steps
Raffle!
90
Questions?
91
@dcos users@dcos.io /dcos /dcos/examples /dcos/demos chat.dcos.io