SlideShare ist ein Scribd-Unternehmen logo
1 von 37
Joe Stein
• Developer, Architect & Technologist
• Founder & Principal Consultant => Big Data Open Source Security LLC - http://stealth.ly
Big Data Open Source Security LLC provides professional services and product solutions for the collection,
storage, transfer, real-time analytics, batch processing and reporting for complex data streams, data sets and
distributed systems. BDOSS is all about the "glue" and helping companies to not only figure out what Big Data
Infrastructure Components to use but also how to change their existing (or build new) systems to work with
them.
• Apache Kafka Committer & PMC member
• Blog & Podcast - http://allthingshadoop.com
• Twitter @allthingshadoop
Overview
● Quick Intro To Mesos
● Architecture
● Frameworks
● Roles, Resources, Attributes
● Marathon
● Constraints
● Creating your own “executor” for Marathon
● Persisting Data
● Kafka, HDFS, Accumulo, And More!!
Origins
Mesos: A Platform for Fine-Grained Resource Sharing in the Data Center
http://static.usenix.org/event/nsdi11/tech/full_papers/Hindman_new.pdf
Datacenter Management with Apache Mesos
https://www.youtube.com/watch?v=YB1VW0LKzJ4
Omega: flexible, scalable schedulers for large compute clusters
http://eurosys2013.tudos.org/wp-content/uploads/2013/paper/Schwarzkopf.pdf
2011 GAFS Omega John Wilkes
https://www.youtube.com/watch?v=0ZFMlO98Jkc&feature=youtu.be
Life without Apache Mesos
Static Partitioning
Static Partitioning IS Bad
hard to utilize machines
(i.e., X GB RAM and Y CPUs)
Static Partitioning does NOT scale
hard to scale elastically
(to take advantage of statistical multiplexing)
Failures === Downtime
hard to deal with failures
It doesn’t have to be that way
Operating System === Datacenter
Mesos => data center “kernel”
Apache Mesos
● Scalability to 10,000s of nodes
● Fault-tolerant replicated master and slaves using ZooKeeper
● Support for Docker containers
● Native isolation between tasks with Linux Containers
● Multi-resource scheduling (memory, CPU, disk, and ports)
● Java, Python and C++ APIs for developing new parallel applications
● Web UI for viewing cluster state
Sample Frameworks
C++ - https://github.com/apache/mesos/tree/master/src/examples
Java - https://github.com/apache/mesos/tree/master/src/examples/java
Python - https://github.com/apache/mesos/tree/master/src/examples/python
Scala - https://github.com/mesosphere/scala-sbt-mesos-framework.g8
Go - https://github.com/mesosphere/mesos-go
Resources & Attributes
The Mesos system has two basic methods to describe the
slaves that comprise a cluster. One of these is managed by the
Mesos master, the other is simply passed onwards to the
frameworks using the cluster.
Attributes
The attributes are simply key value string pairs that Mesos passes along when it sends offers to frameworks.
attributes : attribute ( ";" attribute )*
attribute : labelString ":" ( labelString | "," )+
Resources
The Mesos system can manage 3 different types of resources: scalars, ranges, and sets. These are used to represent
the different resources that a Mesos slave has to offer. For example, a scalar resource type could be used to represent
the amount of memory on a slave. Each resource is identified by a key string.
resources : resource ( ";" resource )*
resource : key ":" ( scalar | range | set )
key : labelString ( "(" resourceRole ")" )?
scalar : floatValue
range : "[" rangeValue ( "," rangeValue )* "]"
rangeValue : scalar "-" scalar
set : "{" labelString ( "," labelString )* "}"
resourceRole : labelString | "*"
labelString : [a-zA-Z0-9_/.-]
floatValue : ( intValue ( "." intValue )? ) | ...
intValue : [0-9]+
Predefined Uses & Conventions
The Mesos master has a few resources that it pre-defines in how it handles them. At the current time, this list consist of:
● cpu
● mem
● disk
● ports
In particular, a slave without cpu and mem resources will never have its resources advertised to any frameworks. Also, the Master’s
user interface interprets the scalars inmem and disk in terms of MB. IE: the value 15000 is displayed as 14.65GB.
Examples
Here are some examples for configuring the Mesos slaves.
--resources='cpu:24;mem:24576;disk:409600;ports:[21000-24000];bugs:{a,b,c}'
--attributes='rack:abc;zone:west;os:centos5,full'
In this case, we have three different types of resources, scalars, a range, and a set. They are called cpu, mem, disk, and the range
type is ports.
● scalar called cpu, with the value 24
● scalar called mem, with the value 24576
● scalar called disk, with the value 409600
● range called ports, with values 21000 through 24000 (inclusive)
● set called bugs, with the values a, b and c
In the case of attributes, we end up with three attributes:
● rack with value abc
Roles
Total consumable resources per slave, in the form 'name(role):value;name(role):value...'. This value can be set to
limit resources per role, or to overstate the number of resources that are available to the slave.
--resources="cpus(*):8; mem(*):15360; disk(*):710534; ports(*):[31000-32000]"
--resources="cpus(prod):8; cpus(stage):2 mem(*):15360; disk(*):710534; ports(*):[31000-32000]"
All * roles will be detected, so you can specify only the resources that are not all roles (*). --
resources="cpus(prod):8; cpus(stage)"
Frameworks bind a specific roles or any. A default roll (instead of *) can also be configured.
Roles can be used to isolate and segregate frameworks.
Marathon
https://github.com/mesosphere/marathon
Cluster-wide init and control system for
services in cgroups or docker based on
Apache Mesos
Constraints
Constraints control where apps run to allow optimizing for fault tolerance or locality. Constraints are made up of three parts: a field
name, an operator, and an optional parameter. The field can be the slave hostname or any Mesos slave attribute.
Fields
Hostname field
hostname field matches the slave hostnames, see UNIQUE operator for usage example.
hostname field supports all operators of Marathon.
Attribute field
If the field name is none of the above, it will be treated as a Mesos slave attribute. Mesos slave attribute is a way to tag a slave
node, see mesos-slave --help to learn how to set the attributes.
Unique
UNIQUE tells Marathon to enforce uniqueness of the attribute across all of an app's tasks. For example the following constraint
ensures that there is only one app task running on each host:
via the Marathon gem:
$ marathon start -i sleep -C 'sleep 60' -n 3 --constraint hostname:UNIQUE
via curl:
$ curl -X POST -H "Content-type: application/json" localhost:8080/v1/apps/start -d '{
"id": "sleep-unique",
"cmd": "sleep 60",
"instances": 3,
"constraints": [["hostname", "UNIQUE"]]
}'
CLUSTER allows you to run all of your app's tasks on slaves that share a certain attribute.
$ curl -X POST -H "Content-type: application/json" localhost:8080/v1/apps/start -d '{
"id": "sleep-cluster",
"cmd": "sleep 60",
"instances": 3,
"constraints": [["rack_id", "CLUSTER", "rack-1"]]
}'
You can also use this attribute to tie an application to a specific node by using the hostname property:
$ curl -X POST -H "Content-type: application/json" localhost:8080/v1/apps/start -d '{
"id": "sleep-cluster",
"cmd": "sleep 60",
"instances": 3,
"constraints": [["hostname", "CLUSTER", "a.specific.node.com"]]
}'
Cluster
Group By
GROUP_BY can be used to distribute tasks evenly across racks or datacenters for high availability.
via the Marathon gem:
$ marathon start -i sleep -C 'sleep 60' -n 3 --constraint rack_id:GROUP_BY
via curl:
$ curl -X POST -H "Content-type: application/json" localhost:8080/v1/apps/start -d '{
"id": "sleep-group-by",
"cmd": "sleep 60",
"instances": 3,
"constraints": [["rack_id", "GROUP_BY"]]
}'
Optionally, you can specify a minimum number of groups to try and achieve.
Like
LIKE accepts a regular expression as parameter, and allows you to run your tasks only on the slaves whose field values match the
regular expression.
via the Marathon gem:
$ marathon start -i sleep -C 'sleep 60' -n 3 --constraint rack_id:LIKE:rack-[1-3]
via curl:
$ curl -X POST -H "Content-type: application/json" localhost:8080/v1/apps/start -d '{
"id": "sleep-group-by",
"cmd": "sleep 60",
"instances": 3,
"constraints": [["rack_id", "LIKE", "rack-[1-3]"]]
}'
Unlike
Just like LIKE operator, but only run tasks on slaves whose field values don't match the regular expression.
via the Marathon gem:
$ marathon start -i sleep -C 'sleep 60' -n 3 --constraint rack_id:UNLIKE:rack-[7-9]
via curl:
$ curl -X POST -H "Content-type: application/json" localhost:8080/v1/apps/start -d '{
"id": "sleep-group-by",
"cmd": "sleep 60",
"instances": 3,
"constraints": [["rack_id", "UNLIKE", "rack-[7-9]"]]
}'
Persisting Data
● Write data outside the sandbox, the other kids will not mind.
○ /var/lib/data/<tag>/<app>
● Careful about starvation, use the constraints and roles to manage this.
● Future improvements https://issues.apache.org/jira/browse/MESOS-2018 This is a
feature to provide better support for running stateful services on Mesos such as
HDFS (Distributed Filesystem), Cassandra (Distributed Database), or MySQL (Local
Database). Current resource reservations (henceforth called "static" reservations)
are statically determined by the slave operator at slave start time, and individual
frameworks have no authority to reserve resources themselves. Dynamic
reservations allow a framework to dynamically/lazily reserve offered resources, such
that those resources will only be re-offered to the same framework (or other
frameworks with the same role). This is especially useful if the framework's task
stored some state on the slave, and needs a guaranteed set of resources reserved
so that it can re-launch a task on the same slave to recover that state.
Running in Marathon
TAG=sample
APP=xyz
ID=$TAG-$APP
CMD=”./yourScript "'$HOST'" "'$PORT0'" "'$PORT1'
JSON=$(printf '{ "id": "%s", "cmd": "%s", "cpus": %s, "mem": %s, "instances":
%s, "uris": ["%s"], "ports": [0,0] , “env”:{ “JAVA_OPTS”,”%s”}' "$ID" “$CMD"
"0.1" "256" "1" "http://dns/path/yourScriptAndStuff.tgz" “-Xmx 128”)
curl -i -X POST -H "Content-Type: application/json" -d "$JSON"
http://localhost:8080/v2/apps
yourScript
#think of it as a distributed application launching in the cloud
HOST=$1
PORT0=$2
PORT1=$3
#talk to zookeeper
#call marathon rest api
#spawn another process, they are all in your cgroup =8^) woot woot
Scripts for running Kafka on Marathon
https://github.com/brndnmtthws/kafka-on-marathon
● initialize, zk_connect
● get_missing_brokers
● become_broker
● run
loop do
puts "About to run:"
puts env, cmd
GC.start # clean up memory
system env, cmd
finished = Time.now.to_f
if finished - last_finished < 120
# If the process was running for less than 2 minutes, abort. We're
# probably 'bouncing'. Occasional restarts are okay, but not continuous restarting.
$stderr.puts "Kafka exited too soon!"
exit 1
end
last_finished = finished
The future of Kafka on Mesos
● A Kafka framework https://github.com/stealthly/kafka-mesos
● Go the script option, use Marathon, it works!!!
● Pick the language you like (bash, python, ruby, go) and work a way to pass vars through.
○ One script for your journal nodes
○ One script for your namenodes
○ One script for your datanodes
● Use constraints
● Store local, seperate based on your marathon /var/lib/<tag>/hdfs/...
● HDFS Framework in progress https://github.com/mesosphere/hdfs
● Accumulo on Mesos, Go the script option, it works!!!
● Use service discovery from Marathon https://mesosphere.github.io/marathon/docs/service-
discovery-load-balancing.html
● Focus on variable substitutions
○ “env”:{ “HDFS”,”http://localhost:$HDFS_APP_PORT”}'
HDFS & Accumulo on Mesos
MesosCon, be there!!!
http://events.linuxfoundation.org/events/mesoscon
Questions?
/*******************************************
Joe Stein
Founder, Principal Consultant
Big Data Open Source Security LLC
http://www.stealth.ly
Twitter: @allthingshadoop
********************************************/

Weitere ähnliche Inhalte

Was ist angesagt?

Cassandra on Mesos Across Multiple Datacenters at Uber (Abhishek Verma) | C* ...
Cassandra on Mesos Across Multiple Datacenters at Uber (Abhishek Verma) | C* ...Cassandra on Mesos Across Multiple Datacenters at Uber (Abhishek Verma) | C* ...
Cassandra on Mesos Across Multiple Datacenters at Uber (Abhishek Verma) | C* ...
DataStax
 
Introduction to Mesos
Introduction to MesosIntroduction to Mesos
Introduction to Mesos
koboltmarky
 
Strata SC 2014: Apache Mesos as an SDK for Building Distributed Frameworks
Strata SC 2014: Apache Mesos as an SDK for Building Distributed FrameworksStrata SC 2014: Apache Mesos as an SDK for Building Distributed Frameworks
Strata SC 2014: Apache Mesos as an SDK for Building Distributed Frameworks
Paco Nathan
 

Was ist angesagt? (20)

Apache Mesos
Apache MesosApache Mesos
Apache Mesos
 
Deploying Docker Containers at Scale with Mesos and Marathon
Deploying Docker Containers at Scale with Mesos and MarathonDeploying Docker Containers at Scale with Mesos and Marathon
Deploying Docker Containers at Scale with Mesos and Marathon
 
Real-Time Distributed and Reactive Systems with Apache Kafka and Apache Accumulo
Real-Time Distributed and Reactive Systems with Apache Kafka and Apache AccumuloReal-Time Distributed and Reactive Systems with Apache Kafka and Apache Accumulo
Real-Time Distributed and Reactive Systems with Apache Kafka and Apache Accumulo
 
Cassandra on Mesos Across Multiple Datacenters at Uber (Abhishek Verma) | C* ...
Cassandra on Mesos Across Multiple Datacenters at Uber (Abhishek Verma) | C* ...Cassandra on Mesos Across Multiple Datacenters at Uber (Abhishek Verma) | C* ...
Cassandra on Mesos Across Multiple Datacenters at Uber (Abhishek Verma) | C* ...
 
Elastic HBase on Mesos - HBaseCon 2015
Elastic HBase on Mesos - HBaseCon 2015Elastic HBase on Mesos - HBaseCon 2015
Elastic HBase on Mesos - HBaseCon 2015
 
Introduction to Mesos
Introduction to MesosIntroduction to Mesos
Introduction to Mesos
 
Introduction to Apache Mesos
Introduction to Apache MesosIntroduction to Apache Mesos
Introduction to Apache Mesos
 
8a. How To Setup HBase with Docker
8a. How To Setup HBase with Docker8a. How To Setup HBase with Docker
8a. How To Setup HBase with Docker
 
Introduction to Apache Mesos
Introduction to Apache MesosIntroduction to Apache Mesos
Introduction to Apache Mesos
 
Strata SC 2014: Apache Mesos as an SDK for Building Distributed Frameworks
Strata SC 2014: Apache Mesos as an SDK for Building Distributed FrameworksStrata SC 2014: Apache Mesos as an SDK for Building Distributed Frameworks
Strata SC 2014: Apache Mesos as an SDK for Building Distributed Frameworks
 
Cassandra Introduction & Features
Cassandra Introduction & FeaturesCassandra Introduction & Features
Cassandra Introduction & Features
 
Datacenter Computing with Apache Mesos - BigData DC
Datacenter Computing with Apache Mesos - BigData DCDatacenter Computing with Apache Mesos - BigData DC
Datacenter Computing with Apache Mesos - BigData DC
 
Spark on Mesos-A Deep Dive-(Dean Wampler and Tim Chen, Typesafe and Mesosphere)
Spark on Mesos-A Deep Dive-(Dean Wampler and Tim Chen, Typesafe and Mesosphere)Spark on Mesos-A Deep Dive-(Dean Wampler and Tim Chen, Typesafe and Mesosphere)
Spark on Mesos-A Deep Dive-(Dean Wampler and Tim Chen, Typesafe and Mesosphere)
 
Introduction of mesos persistent storage
Introduction of mesos persistent storageIntroduction of mesos persistent storage
Introduction of mesos persistent storage
 
HBaseConEast2016: HBase on Docker with Clusterdock
HBaseConEast2016: HBase on Docker with ClusterdockHBaseConEast2016: HBase on Docker with Clusterdock
HBaseConEast2016: HBase on Docker with Clusterdock
 
Scaling Big Data with Hadoop and Mesos
Scaling Big Data with Hadoop and MesosScaling Big Data with Hadoop and Mesos
Scaling Big Data with Hadoop and Mesos
 
Develop with linux containers and docker
Develop with linux containers and dockerDevelop with linux containers and docker
Develop with linux containers and docker
 
Nov 2011 HUG: Blur - Lucene on Hadoop
Nov 2011 HUG: Blur - Lucene on HadoopNov 2011 HUG: Blur - Lucene on Hadoop
Nov 2011 HUG: Blur - Lucene on Hadoop
 
Drupaljam 2017 - Deploying Drupal 8 onto Hosted Kubernetes in Google Cloud
Drupaljam 2017 - Deploying Drupal 8 onto Hosted Kubernetes in Google CloudDrupaljam 2017 - Deploying Drupal 8 onto Hosted Kubernetes in Google Cloud
Drupaljam 2017 - Deploying Drupal 8 onto Hosted Kubernetes in Google Cloud
 
Openstack study-nova-02
Openstack study-nova-02Openstack study-nova-02
Openstack study-nova-02
 

Andere mochten auch

Lessons Learned Running Hadoop and Spark in Docker Containers
Lessons Learned Running Hadoop and Spark in Docker ContainersLessons Learned Running Hadoop and Spark in Docker Containers
Lessons Learned Running Hadoop and Spark in Docker Containers
BlueData, Inc.
 
Accumulo Nutch/GORA, Storm, and Pig
Accumulo Nutch/GORA, Storm, and PigAccumulo Nutch/GORA, Storm, and Pig
Accumulo Nutch/GORA, Storm, and Pig
Jason Trost
 
Accumulo Summit 2015: Tracing in Accumulo and HDFS [Internals]
Accumulo Summit 2015: Tracing in Accumulo and HDFS [Internals]Accumulo Summit 2015: Tracing in Accumulo and HDFS [Internals]
Accumulo Summit 2015: Tracing in Accumulo and HDFS [Internals]
Accumulo Summit
 
Accumulo meetup 20130109
Accumulo meetup 20130109Accumulo meetup 20130109
Accumulo meetup 20130109
Sqrrl
 
Accumulo Summit 2016: Accumulo in the Enterprise
Accumulo Summit 2016: Accumulo in the EnterpriseAccumulo Summit 2016: Accumulo in the Enterprise
Accumulo Summit 2016: Accumulo in the Enterprise
Accumulo Summit
 
Accumulo Summit 2016: Embedding Authenticated Data Structures in Accumulo
Accumulo Summit 2016: Embedding Authenticated Data Structures in AccumuloAccumulo Summit 2016: Embedding Authenticated Data Structures in Accumulo
Accumulo Summit 2016: Embedding Authenticated Data Structures in Accumulo
Accumulo Summit
 

Andere mochten auch (20)

Hadoop on-mesos
Hadoop on-mesosHadoop on-mesos
Hadoop on-mesos
 
Hadoop on Docker
Hadoop on DockerHadoop on Docker
Hadoop on Docker
 
Big Data in Container; Hadoop Spark in Docker and Mesos
Big Data in Container; Hadoop Spark in Docker and MesosBig Data in Container; Hadoop Spark in Docker and Mesos
Big Data in Container; Hadoop Spark in Docker and Mesos
 
Scalable On-Demand Hadoop Clusters with Docker and Mesos
Scalable On-Demand Hadoop Clusters with Docker and MesosScalable On-Demand Hadoop Clusters with Docker and Mesos
Scalable On-Demand Hadoop Clusters with Docker and Mesos
 
Lessons Learned From Running Spark On Docker
Lessons Learned From Running Spark On DockerLessons Learned From Running Spark On Docker
Lessons Learned From Running Spark On Docker
 
Lessons Learned Running Hadoop and Spark in Docker Containers
Lessons Learned Running Hadoop and Spark in Docker ContainersLessons Learned Running Hadoop and Spark in Docker Containers
Lessons Learned Running Hadoop and Spark in Docker Containers
 
Accumulo Nutch/GORA, Storm, and Pig
Accumulo Nutch/GORA, Storm, and PigAccumulo Nutch/GORA, Storm, and Pig
Accumulo Nutch/GORA, Storm, and Pig
 
Using Clojure for Sentiment Analysis of the Twittersphere
Using Clojure for Sentiment Analysis of the TwittersphereUsing Clojure for Sentiment Analysis of the Twittersphere
Using Clojure for Sentiment Analysis of the Twittersphere
 
Accumulo Summit 2014: Four Orders of Magnitude: Running Large Scale Accumulo ...
Accumulo Summit 2014: Four Orders of Magnitude: Running Large Scale Accumulo ...Accumulo Summit 2014: Four Orders of Magnitude: Running Large Scale Accumulo ...
Accumulo Summit 2014: Four Orders of Magnitude: Running Large Scale Accumulo ...
 
Accumulo Summit 2015: Tracing in Accumulo and HDFS [Internals]
Accumulo Summit 2015: Tracing in Accumulo and HDFS [Internals]Accumulo Summit 2015: Tracing in Accumulo and HDFS [Internals]
Accumulo Summit 2015: Tracing in Accumulo and HDFS [Internals]
 
Accumulo design
Accumulo designAccumulo design
Accumulo design
 
Accumulo meetup 20130109
Accumulo meetup 20130109Accumulo meetup 20130109
Accumulo meetup 20130109
 
Accumulo Summit 2016: Accumulo in the Enterprise
Accumulo Summit 2016: Accumulo in the EnterpriseAccumulo Summit 2016: Accumulo in the Enterprise
Accumulo Summit 2016: Accumulo in the Enterprise
 
Apache Accumulo and the Data Lake
Apache Accumulo and the Data LakeApache Accumulo and the Data Lake
Apache Accumulo and the Data Lake
 
Large Scale Accumulo Clusters
Large Scale Accumulo ClustersLarge Scale Accumulo Clusters
Large Scale Accumulo Clusters
 
Accumulo Summit 2014: Benchmarking Accumulo: How Fast Is Fast?
Accumulo Summit 2014: Benchmarking Accumulo: How Fast Is Fast?Accumulo Summit 2014: Benchmarking Accumulo: How Fast Is Fast?
Accumulo Summit 2014: Benchmarking Accumulo: How Fast Is Fast?
 
Accumulo: A Quick Introduction
Accumulo: A Quick IntroductionAccumulo: A Quick Introduction
Accumulo: A Quick Introduction
 
Accumulo Summit 2016: Embedding Authenticated Data Structures in Accumulo
Accumulo Summit 2016: Embedding Authenticated Data Structures in AccumuloAccumulo Summit 2016: Embedding Authenticated Data Structures in Accumulo
Accumulo Summit 2016: Embedding Authenticated Data Structures in Accumulo
 
Accumulo Summit 2015: Accumulo In-Depth: Building Bulk Ingest [Sponsored]
Accumulo Summit 2015: Accumulo In-Depth: Building Bulk Ingest [Sponsored]Accumulo Summit 2015: Accumulo In-Depth: Building Bulk Ingest [Sponsored]
Accumulo Summit 2015: Accumulo In-Depth: Building Bulk Ingest [Sponsored]
 
Sqrrl real time_big_data_20130411
Sqrrl real time_big_data_20130411Sqrrl real time_big_data_20130411
Sqrrl real time_big_data_20130411
 

Ähnlich wie Apache Kafka, HDFS, Accumulo and more on Mesos

2013 05-fite-club-working-models-cloud-growing-up
2013 05-fite-club-working-models-cloud-growing-up2013 05-fite-club-working-models-cloud-growing-up
2013 05-fite-club-working-models-cloud-growing-up
Alex Heneveld
 
Scalable and Fault-Tolerant Apps with AWS
Scalable and Fault-Tolerant Apps with AWSScalable and Fault-Tolerant Apps with AWS
Scalable and Fault-Tolerant Apps with AWS
Fernando Rodriguez
 

Ähnlich wie Apache Kafka, HDFS, Accumulo and more on Mesos (20)

Elasticsearch
ElasticsearchElasticsearch
Elasticsearch
 
Amazon ECS Deep Dive
Amazon ECS Deep DiveAmazon ECS Deep Dive
Amazon ECS Deep Dive
 
2013 05-fite-club-working-models-cloud-growing-up
2013 05-fite-club-working-models-cloud-growing-up2013 05-fite-club-working-models-cloud-growing-up
2013 05-fite-club-working-models-cloud-growing-up
 
Programando sua infraestrutura com o AWS CloudFormation
Programando sua infraestrutura com o AWS CloudFormationProgramando sua infraestrutura com o AWS CloudFormation
Programando sua infraestrutura com o AWS CloudFormation
 
Deployment and Management on AWS:
 A Deep Dive on Options and Tools
Deployment and Management on AWS:
 A Deep Dive on Options and ToolsDeployment and Management on AWS:
 A Deep Dive on Options and Tools
Deployment and Management on AWS:
 A Deep Dive on Options and Tools
 
Introduction to mesos bay
Introduction to mesos bayIntroduction to mesos bay
Introduction to mesos bay
 
Understanding OpenStack Deployments - PuppetConf 2014
Understanding OpenStack Deployments - PuppetConf 2014Understanding OpenStack Deployments - PuppetConf 2014
Understanding OpenStack Deployments - PuppetConf 2014
 
DevOps Enabling Your Team
DevOps Enabling Your TeamDevOps Enabling Your Team
DevOps Enabling Your Team
 
AWS CloudFormation Session
AWS CloudFormation SessionAWS CloudFormation Session
AWS CloudFormation Session
 
Architecting world class azure resource manager templates
Architecting world class azure resource manager templatesArchitecting world class azure resource manager templates
Architecting world class azure resource manager templates
 
Scaling Drupal in AWS Using AutoScaling, Cloudformation, RDS and more
Scaling Drupal in AWS Using AutoScaling, Cloudformation, RDS and moreScaling Drupal in AWS Using AutoScaling, Cloudformation, RDS and more
Scaling Drupal in AWS Using AutoScaling, Cloudformation, RDS and more
 
(APP313) NEW LAUNCH: Amazon EC2 Container Service in Action | AWS re:Invent 2014
(APP313) NEW LAUNCH: Amazon EC2 Container Service in Action | AWS re:Invent 2014(APP313) NEW LAUNCH: Amazon EC2 Container Service in Action | AWS re:Invent 2014
(APP313) NEW LAUNCH: Amazon EC2 Container Service in Action | AWS re:Invent 2014
 
Scalable and Fault-Tolerant Apps with AWS
Scalable and Fault-Tolerant Apps with AWSScalable and Fault-Tolerant Apps with AWS
Scalable and Fault-Tolerant Apps with AWS
 
(BDT401) Big Data Orchestra - Harmony within Data Analysis Tools | AWS re:Inv...
(BDT401) Big Data Orchestra - Harmony within Data Analysis Tools | AWS re:Inv...(BDT401) Big Data Orchestra - Harmony within Data Analysis Tools | AWS re:Inv...
(BDT401) Big Data Orchestra - Harmony within Data Analysis Tools | AWS re:Inv...
 
2013 05-openstack-israel-heat
2013 05-openstack-israel-heat2013 05-openstack-israel-heat
2013 05-openstack-israel-heat
 
Streamline Hadoop DevOps with Apache Ambari
Streamline Hadoop DevOps with Apache AmbariStreamline Hadoop DevOps with Apache Ambari
Streamline Hadoop DevOps with Apache Ambari
 
Immutable Deployments with AWS CloudFormation and AWS Lambda
Immutable Deployments with AWS CloudFormation and AWS LambdaImmutable Deployments with AWS CloudFormation and AWS Lambda
Immutable Deployments with AWS CloudFormation and AWS Lambda
 
Burn down the silos! Helping dev and ops gel on high availability websites
Burn down the silos! Helping dev and ops gel on high availability websitesBurn down the silos! Helping dev and ops gel on high availability websites
Burn down the silos! Helping dev and ops gel on high availability websites
 
Advanced Task Scheduling with Amazon ECS
Advanced Task Scheduling with Amazon ECSAdvanced Task Scheduling with Amazon ECS
Advanced Task Scheduling with Amazon ECS
 
Null Bachaav - May 07 Attack Monitoring workshop.
Null Bachaav - May 07 Attack Monitoring workshop.Null Bachaav - May 07 Attack Monitoring workshop.
Null Bachaav - May 07 Attack Monitoring workshop.
 

Mehr von Joe Stein

Apache Kafka
Apache KafkaApache Kafka
Apache Kafka
Joe Stein
 
Hadoop Streaming Tutorial With Python
Hadoop Streaming Tutorial With PythonHadoop Streaming Tutorial With Python
Hadoop Streaming Tutorial With Python
Joe Stein
 

Mehr von Joe Stein (15)

SMACK Stack 1.1
SMACK Stack 1.1SMACK Stack 1.1
SMACK Stack 1.1
 
Real-Time Log Analysis with Apache Mesos, Kafka and Cassandra
Real-Time Log Analysis with Apache Mesos, Kafka and CassandraReal-Time Log Analysis with Apache Mesos, Kafka and Cassandra
Real-Time Log Analysis with Apache Mesos, Kafka and Cassandra
 
Developing Real-Time Data Pipelines with Apache Kafka
Developing Real-Time Data Pipelines with Apache KafkaDeveloping Real-Time Data Pipelines with Apache Kafka
Developing Real-Time Data Pipelines with Apache Kafka
 
Developing with the Go client for Apache Kafka
Developing with the Go client for Apache KafkaDeveloping with the Go client for Apache Kafka
Developing with the Go client for Apache Kafka
 
Current and Future of Apache Kafka
Current and Future of Apache KafkaCurrent and Future of Apache Kafka
Current and Future of Apache Kafka
 
Introduction Apache Kafka
Introduction Apache KafkaIntroduction Apache Kafka
Introduction Apache Kafka
 
Introduction to Apache Mesos
Introduction to Apache MesosIntroduction to Apache Mesos
Introduction to Apache Mesos
 
Developing Realtime Data Pipelines With Apache Kafka
Developing Realtime Data Pipelines With Apache KafkaDeveloping Realtime Data Pipelines With Apache Kafka
Developing Realtime Data Pipelines With Apache Kafka
 
Developing Real-Time Data Pipelines with Apache Kafka
Developing Real-Time Data Pipelines with Apache KafkaDeveloping Real-Time Data Pipelines with Apache Kafka
Developing Real-Time Data Pipelines with Apache Kafka
 
Real-time streaming and data pipelines with Apache Kafka
Real-time streaming and data pipelines with Apache KafkaReal-time streaming and data pipelines with Apache Kafka
Real-time streaming and data pipelines with Apache Kafka
 
Apache Cassandra 2.0
Apache Cassandra 2.0Apache Cassandra 2.0
Apache Cassandra 2.0
 
Storing Time Series Metrics With Cassandra and Composite Columns
Storing Time Series Metrics With Cassandra and Composite ColumnsStoring Time Series Metrics With Cassandra and Composite Columns
Storing Time Series Metrics With Cassandra and Composite Columns
 
Apache Kafka
Apache KafkaApache Kafka
Apache Kafka
 
Hadoop Streaming Tutorial With Python
Hadoop Streaming Tutorial With PythonHadoop Streaming Tutorial With Python
Hadoop Streaming Tutorial With Python
 
jstein.cassandra.nyc.2011
jstein.cassandra.nyc.2011jstein.cassandra.nyc.2011
jstein.cassandra.nyc.2011
 

Kürzlich hochgeladen

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Kürzlich hochgeladen (20)

Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 

Apache Kafka, HDFS, Accumulo and more on Mesos

  • 1.
  • 2. Joe Stein • Developer, Architect & Technologist • Founder & Principal Consultant => Big Data Open Source Security LLC - http://stealth.ly Big Data Open Source Security LLC provides professional services and product solutions for the collection, storage, transfer, real-time analytics, batch processing and reporting for complex data streams, data sets and distributed systems. BDOSS is all about the "glue" and helping companies to not only figure out what Big Data Infrastructure Components to use but also how to change their existing (or build new) systems to work with them. • Apache Kafka Committer & PMC member • Blog & Podcast - http://allthingshadoop.com • Twitter @allthingshadoop
  • 3. Overview ● Quick Intro To Mesos ● Architecture ● Frameworks ● Roles, Resources, Attributes ● Marathon ● Constraints ● Creating your own “executor” for Marathon ● Persisting Data ● Kafka, HDFS, Accumulo, And More!!
  • 4.
  • 5. Origins Mesos: A Platform for Fine-Grained Resource Sharing in the Data Center http://static.usenix.org/event/nsdi11/tech/full_papers/Hindman_new.pdf Datacenter Management with Apache Mesos https://www.youtube.com/watch?v=YB1VW0LKzJ4 Omega: flexible, scalable schedulers for large compute clusters http://eurosys2013.tudos.org/wp-content/uploads/2013/paper/Schwarzkopf.pdf 2011 GAFS Omega John Wilkes https://www.youtube.com/watch?v=0ZFMlO98Jkc&feature=youtu.be
  • 8. Static Partitioning IS Bad hard to utilize machines (i.e., X GB RAM and Y CPUs)
  • 9. Static Partitioning does NOT scale hard to scale elastically (to take advantage of statistical multiplexing)
  • 10. Failures === Downtime hard to deal with failures
  • 11. It doesn’t have to be that way
  • 12. Operating System === Datacenter
  • 13. Mesos => data center “kernel”
  • 14. Apache Mesos ● Scalability to 10,000s of nodes ● Fault-tolerant replicated master and slaves using ZooKeeper ● Support for Docker containers ● Native isolation between tasks with Linux Containers ● Multi-resource scheduling (memory, CPU, disk, and ports) ● Java, Python and C++ APIs for developing new parallel applications ● Web UI for viewing cluster state
  • 15.
  • 16.
  • 17. Sample Frameworks C++ - https://github.com/apache/mesos/tree/master/src/examples Java - https://github.com/apache/mesos/tree/master/src/examples/java Python - https://github.com/apache/mesos/tree/master/src/examples/python Scala - https://github.com/mesosphere/scala-sbt-mesos-framework.g8 Go - https://github.com/mesosphere/mesos-go
  • 18. Resources & Attributes The Mesos system has two basic methods to describe the slaves that comprise a cluster. One of these is managed by the Mesos master, the other is simply passed onwards to the frameworks using the cluster. Attributes The attributes are simply key value string pairs that Mesos passes along when it sends offers to frameworks. attributes : attribute ( ";" attribute )* attribute : labelString ":" ( labelString | "," )+
  • 19. Resources The Mesos system can manage 3 different types of resources: scalars, ranges, and sets. These are used to represent the different resources that a Mesos slave has to offer. For example, a scalar resource type could be used to represent the amount of memory on a slave. Each resource is identified by a key string. resources : resource ( ";" resource )* resource : key ":" ( scalar | range | set ) key : labelString ( "(" resourceRole ")" )? scalar : floatValue range : "[" rangeValue ( "," rangeValue )* "]" rangeValue : scalar "-" scalar set : "{" labelString ( "," labelString )* "}" resourceRole : labelString | "*" labelString : [a-zA-Z0-9_/.-] floatValue : ( intValue ( "." intValue )? ) | ... intValue : [0-9]+
  • 20. Predefined Uses & Conventions The Mesos master has a few resources that it pre-defines in how it handles them. At the current time, this list consist of: ● cpu ● mem ● disk ● ports In particular, a slave without cpu and mem resources will never have its resources advertised to any frameworks. Also, the Master’s user interface interprets the scalars inmem and disk in terms of MB. IE: the value 15000 is displayed as 14.65GB.
  • 21. Examples Here are some examples for configuring the Mesos slaves. --resources='cpu:24;mem:24576;disk:409600;ports:[21000-24000];bugs:{a,b,c}' --attributes='rack:abc;zone:west;os:centos5,full' In this case, we have three different types of resources, scalars, a range, and a set. They are called cpu, mem, disk, and the range type is ports. ● scalar called cpu, with the value 24 ● scalar called mem, with the value 24576 ● scalar called disk, with the value 409600 ● range called ports, with values 21000 through 24000 (inclusive) ● set called bugs, with the values a, b and c In the case of attributes, we end up with three attributes: ● rack with value abc
  • 22. Roles Total consumable resources per slave, in the form 'name(role):value;name(role):value...'. This value can be set to limit resources per role, or to overstate the number of resources that are available to the slave. --resources="cpus(*):8; mem(*):15360; disk(*):710534; ports(*):[31000-32000]" --resources="cpus(prod):8; cpus(stage):2 mem(*):15360; disk(*):710534; ports(*):[31000-32000]" All * roles will be detected, so you can specify only the resources that are not all roles (*). -- resources="cpus(prod):8; cpus(stage)" Frameworks bind a specific roles or any. A default roll (instead of *) can also be configured. Roles can be used to isolate and segregate frameworks.
  • 23. Marathon https://github.com/mesosphere/marathon Cluster-wide init and control system for services in cgroups or docker based on Apache Mesos
  • 24. Constraints Constraints control where apps run to allow optimizing for fault tolerance or locality. Constraints are made up of three parts: a field name, an operator, and an optional parameter. The field can be the slave hostname or any Mesos slave attribute. Fields Hostname field hostname field matches the slave hostnames, see UNIQUE operator for usage example. hostname field supports all operators of Marathon. Attribute field If the field name is none of the above, it will be treated as a Mesos slave attribute. Mesos slave attribute is a way to tag a slave node, see mesos-slave --help to learn how to set the attributes.
  • 25. Unique UNIQUE tells Marathon to enforce uniqueness of the attribute across all of an app's tasks. For example the following constraint ensures that there is only one app task running on each host: via the Marathon gem: $ marathon start -i sleep -C 'sleep 60' -n 3 --constraint hostname:UNIQUE via curl: $ curl -X POST -H "Content-type: application/json" localhost:8080/v1/apps/start -d '{ "id": "sleep-unique", "cmd": "sleep 60", "instances": 3, "constraints": [["hostname", "UNIQUE"]] }'
  • 26. CLUSTER allows you to run all of your app's tasks on slaves that share a certain attribute. $ curl -X POST -H "Content-type: application/json" localhost:8080/v1/apps/start -d '{ "id": "sleep-cluster", "cmd": "sleep 60", "instances": 3, "constraints": [["rack_id", "CLUSTER", "rack-1"]] }' You can also use this attribute to tie an application to a specific node by using the hostname property: $ curl -X POST -H "Content-type: application/json" localhost:8080/v1/apps/start -d '{ "id": "sleep-cluster", "cmd": "sleep 60", "instances": 3, "constraints": [["hostname", "CLUSTER", "a.specific.node.com"]] }' Cluster
  • 27. Group By GROUP_BY can be used to distribute tasks evenly across racks or datacenters for high availability. via the Marathon gem: $ marathon start -i sleep -C 'sleep 60' -n 3 --constraint rack_id:GROUP_BY via curl: $ curl -X POST -H "Content-type: application/json" localhost:8080/v1/apps/start -d '{ "id": "sleep-group-by", "cmd": "sleep 60", "instances": 3, "constraints": [["rack_id", "GROUP_BY"]] }' Optionally, you can specify a minimum number of groups to try and achieve.
  • 28. Like LIKE accepts a regular expression as parameter, and allows you to run your tasks only on the slaves whose field values match the regular expression. via the Marathon gem: $ marathon start -i sleep -C 'sleep 60' -n 3 --constraint rack_id:LIKE:rack-[1-3] via curl: $ curl -X POST -H "Content-type: application/json" localhost:8080/v1/apps/start -d '{ "id": "sleep-group-by", "cmd": "sleep 60", "instances": 3, "constraints": [["rack_id", "LIKE", "rack-[1-3]"]] }'
  • 29. Unlike Just like LIKE operator, but only run tasks on slaves whose field values don't match the regular expression. via the Marathon gem: $ marathon start -i sleep -C 'sleep 60' -n 3 --constraint rack_id:UNLIKE:rack-[7-9] via curl: $ curl -X POST -H "Content-type: application/json" localhost:8080/v1/apps/start -d '{ "id": "sleep-group-by", "cmd": "sleep 60", "instances": 3, "constraints": [["rack_id", "UNLIKE", "rack-[7-9]"]] }'
  • 30. Persisting Data ● Write data outside the sandbox, the other kids will not mind. ○ /var/lib/data/<tag>/<app> ● Careful about starvation, use the constraints and roles to manage this. ● Future improvements https://issues.apache.org/jira/browse/MESOS-2018 This is a feature to provide better support for running stateful services on Mesos such as HDFS (Distributed Filesystem), Cassandra (Distributed Database), or MySQL (Local Database). Current resource reservations (henceforth called "static" reservations) are statically determined by the slave operator at slave start time, and individual frameworks have no authority to reserve resources themselves. Dynamic reservations allow a framework to dynamically/lazily reserve offered resources, such that those resources will only be re-offered to the same framework (or other frameworks with the same role). This is especially useful if the framework's task stored some state on the slave, and needs a guaranteed set of resources reserved so that it can re-launch a task on the same slave to recover that state.
  • 31. Running in Marathon TAG=sample APP=xyz ID=$TAG-$APP CMD=”./yourScript "'$HOST'" "'$PORT0'" "'$PORT1' JSON=$(printf '{ "id": "%s", "cmd": "%s", "cpus": %s, "mem": %s, "instances": %s, "uris": ["%s"], "ports": [0,0] , “env”:{ “JAVA_OPTS”,”%s”}' "$ID" “$CMD" "0.1" "256" "1" "http://dns/path/yourScriptAndStuff.tgz" “-Xmx 128”) curl -i -X POST -H "Content-Type: application/json" -d "$JSON" http://localhost:8080/v2/apps
  • 32. yourScript #think of it as a distributed application launching in the cloud HOST=$1 PORT0=$2 PORT1=$3 #talk to zookeeper #call marathon rest api #spawn another process, they are all in your cgroup =8^) woot woot
  • 33. Scripts for running Kafka on Marathon https://github.com/brndnmtthws/kafka-on-marathon ● initialize, zk_connect ● get_missing_brokers ● become_broker ● run loop do puts "About to run:" puts env, cmd GC.start # clean up memory system env, cmd finished = Time.now.to_f if finished - last_finished < 120 # If the process was running for less than 2 minutes, abort. We're # probably 'bouncing'. Occasional restarts are okay, but not continuous restarting. $stderr.puts "Kafka exited too soon!" exit 1 end last_finished = finished
  • 34. The future of Kafka on Mesos ● A Kafka framework https://github.com/stealthly/kafka-mesos
  • 35. ● Go the script option, use Marathon, it works!!! ● Pick the language you like (bash, python, ruby, go) and work a way to pass vars through. ○ One script for your journal nodes ○ One script for your namenodes ○ One script for your datanodes ● Use constraints ● Store local, seperate based on your marathon /var/lib/<tag>/hdfs/... ● HDFS Framework in progress https://github.com/mesosphere/hdfs ● Accumulo on Mesos, Go the script option, it works!!! ● Use service discovery from Marathon https://mesosphere.github.io/marathon/docs/service- discovery-load-balancing.html ● Focus on variable substitutions ○ “env”:{ “HDFS”,”http://localhost:$HDFS_APP_PORT”}' HDFS & Accumulo on Mesos
  • 37. Questions? /******************************************* Joe Stein Founder, Principal Consultant Big Data Open Source Security LLC http://www.stealth.ly Twitter: @allthingshadoop ********************************************/