Tutorial: Apache Storm

Similar documents
Apache Storm. Hortonworks Inc Page 1

Before proceeding with this tutorial, you must have a good understanding of Core Java and any of the Linux flavors.

Streaming & Apache Storm

Spark Programming with RDD

Storm. Distributed and fault-tolerant realtime computation. Nathan Marz Twitter

STORM AND LOW-LATENCY PROCESSING.

Storm. Distributed and fault-tolerant realtime computation. Nathan Marz Twitter

CAP Theorem, BASE & DynamoDB

Data Analytics with HPC. Data Streaming

Paper Presented by Harsha Yeddanapudy

L3: Spark & RDD. CDS Department of Computational and Data Sciences. Department of Computational and Data Sciences

L5-6:Runtime Platforms Hadoop and HDFS

Scalable Streaming Analytics

Flying Faster with Heron

Putting it together. Data-Parallel Computation. Ex: Word count using partial aggregation. Big Data Processing. COS 418: Distributed Systems Lecture 21

Big Data Infrastructures & Technologies

R-Storm: A Resource-Aware Scheduler for STORM. Mohammad Hosseini Boyang Peng Zhihao Hong Reza Farivar Roy Campbell

Apache Storm: Hands-on Session A.A. 2016/17

Priority Based Resource Scheduling Techniques for a Multitenant Stream Processing Platform

L22-23: Graph Algorithms

Apache Storm. A framework for Parallel Data Stream Processing

REAL-TIME ANALYTICS WITH APACHE STORM

L1:Google File System Sanjay Ghemawat, Howard Gobioff, and Shun-Tak Leung ACM SOSP, 2003

Over the last few years, we have seen a disruption in the data management

Data Structures, Algorithms & Data Science Platforms

DS & 26. L4: Linear Lists

Strategies for real-time event processing

Scale-Out Algorithm For Apache Storm In SaaS Environment

DS ,21. L11-12: Hashmap

L20-21: Graph Data Structure

Shared Memory Parallelism using OpenMP

Working with Storm Topologies

L10: Dictionary & Skip List

FROM LEGACY, TO BATCH, TO NEAR REAL-TIME. Marc Sturlese, Dani Solà

Building a Transparent Batching Layer for Storm

10/24/2017 Sangmi Lee Pallickara Week 10- A. CS535 Big Data Fall 2017 Colorado State University

Fault Tolerance for Stream Processing Engines

STELA: ON-DEMAND ELASTICITY IN DISTRIBUTED DATA STREAM PROCESSING SYSTEMS LE XU THESIS

Typhoon: An SDN Enhanced Real-Time Big Data Streaming Framework

Large-Scale Data Engineering. Data streams and low latency processing

A STORM ARCHITECTURE FOR FUSING IOT DATA

TITLE: PRE-REQUISITE THEORY. 1. Introduction to Hadoop. 2. Cluster. Implement sort algorithm and run it using HADOOP

Apache Flink. Alessandro Margara

DS L9: Queues

L6,7: Time & Space Complexity

A Decision Support System for Automated Customer Assistance in E-Commerce Websites

A BIG DATA STREAMING RECIPE WHAT TO CONSIDER WHEN BUILDING A REAL TIME BIG DATA APPLICATION

10/26/2017 Sangmi Lee Pallickara Week 10- B. CS535 Big Data Fall 2017 Colorado State University

Spark Overview. Professor Sasu Tarkoma.

ELASTICITY AND RESOURCE AWARE SCHEDULING IN DISTRIBUTED DATA STREAM PROCESSING SYSTEMS BY BOYANG PENG THESIS

REAL-TIME PEDESTRIAN DETECTION USING APACHE STORM IN A DISTRIBUTED ENVIRONMENT

Hadoop ecosystem. Nikos Parlavantzas

Installing and Configuring Apache Storm

BigData and Map Reduce VITMAC03

Twitter Heron: Stream Processing at Scale

UMP Alert Engine. Status. Requirements

Deep Dive Amazon Kinesis. Ian Meyers, Principal Solution Architect - Amazon Web Services

2/20/2019 Week 5-B Sangmi Lee Pallickara

Hortonworks Cybersecurity Package

Distributed Computation Models

Real-time data processing with Apache Flink

Postprint.

Apache Flink- A System for Batch and Realtime Stream Processing

MapReduce. U of Toronto, 2014

1 Big Data Hadoop. 1. Introduction About this Course About Big Data Course Logistics Introductions

MillWheel:Fault Tolerant Stream Processing at Internet Scale. By FAN Junbo

Chapter 5: Stream Processing. Big Data Management and Analytics 193

A Distributed System Case Study: Apache Kafka. High throughput messaging for diverse consumers

Self Regulating Stream Processing in Heron

Voldemort. Smruti R. Sarangi. Department of Computer Science Indian Institute of Technology New Delhi, India. Overview Design Evaluation

Distributed computing: index building and use

Introduction to Data Intensive Computing

Functional Comparison and Performance Evaluation. Huafeng Wang Tianlun Zhang Wei Mao 2016/11/14

Apache Spark Internals

Benchmarking Distributed Stream Processing Platforms for IoT Applications

ISSN: [Gireesh Babu C N* et al., 6(7): July, 2017 Impact Factor: 4.116

Overview. Prerequisites. Course Outline. Course Outline :: Apache Spark Development::

Introduction to MapReduce

Data Structures, Algorithms & Data Science Platforms

StreamMine3G OneClick Deploy & Monitor ESP Applications With A Single Click

CS 398 ACC Streaming. Prof. Robert J. Brunner. Ben Congdon Tyler Kim

New Techniques to Curtail the Tail Latency in Stream Processing Systems

HDFS: Hadoop Distributed File System. CIS 612 Sunnie Chung

arxiv: v1 [cs.dc] 2 Dec 2017

Real-time Data Stream Processing Challenges and Perspectives

Chapter 5. The MapReduce Programming Model and Implementation

Memory Organization Redux

Portable stateful big data processing in Apache Beam

Challenges in Data Stream Processing

Lecture 21 11/27/2017 Next Lecture: Quiz review & project meetings Streaming & Apache Kafka

Adaptive Online Scheduling in Storm

Big Data Hadoop Course Content

Real-time Calculating Over Self-Health Data Using Storm Jiangyong Cai1, a, Zhengping Jin2, b

G-Storm: GPU-enabled High-throughput Online Data Processing in Storm

8/24/2017 Week 1-B Instructor: Sangmi Lee Pallickara

25/05/2018. Spark Streaming is a framework for large scale stream processing

Lecture Notes to Big Data Management and Analytics Winter Term 2017/2018 Apache Flink

Data-Intensive Distributed Computing

Spark, Shark and Spark Streaming Introduction

Masterarbeit. Distributed Stream Processing with the Intention of Mining. Alexey Egorov February 1, 2017

Transcription:

Indian Institute of Science Bangalore, India भ रत य वज ञ न स स थ न ब गल र, भ रत Department of Computational and Data Sciences DS256:Jan17 (3:1) Tutorial: Apache Storm Anshu Shukla 16 Feb, 2017 Yogesh Simmhan & Partha Talukdar, 2016 This work is licensed under a Creative Commons Attribution 4.0 International License Copyright for external content used with attribution is retained by their original authors

Apache Storm Open source distributed realtime computation system Can process million tuples processed per second per node. Scalable, fault-tolerant, guarantees your data will be processed Does for realtime processing what Hadoop did for batch processing. Key difference is that a MapReduce job eventually finishes, whereas a topology processes messages forever (or until you kill it). 2

Storm Architecture: Two kinds of nodes on a Storm cluster: Master node and the worker nodes Master node»runs a daemon called "Nimbus"»distributing code around the cluster, assigning tasks to machines, and monitoring for failures. Worker node» runs a daemon called the Supervisor"» listens for work assigned by nimbus to its machine and starts and stops worker processes»worker process executes a subset of a topology, a running topology consists of many worker processes spread across many machines. 3

Storm Architecture: Zookeeper Coordination between Nimbus and the Supervisors is done through a Zookeeper cluster Nimbus daemon and Supervisor daemons are fail-fast and stateless, state is kept in Zookeeper»can kill Nimbus or the Supervisors and they'll start back up like nothing happened. 4

Key abstractions Tuples: an ordered list of elements. Streams: an unbounded sequence of tuples. Spouts: sources of streams in a computation (e.g. a Twitter API) Bolts: process input streams and produce output streams. run functions (filter, aggregate, or join data or talk to databases). Topologies: Computation DAG, each node contains processing logic, and links between nodes indicate how data streams Spout Spout Bolt Bolt Bolt Bolt 5

Topology Example Contains a spout and two bolts, Spout emits words, and each bolt appends the string "!!!" to its input Nodes are arranged in a line e.g. spout emits the tuples ["bob"] and ["john"], then the second bolt will emit the words ["bob!!!!!!"] and [ john!!!!!!"] Last parameter, parallelism: how many threads should run for that component across the cluster "shuffle grouping" means that tuples should be randomly distributed to downstream tasks. 6

Spout and Bolt Processing logic implements the IRichSpout & IRichBolt interface for spouts & bolts. open/prepare method provides the bolt with an OutputCollector that is used for emitting tuples from this bolt, executed once. Execute method receives a tuple from one of the bolt's inputs, executes for every tuple. Cleanup method is called when a Bolt is being shutdown, executed once. 7

Stateful bolts (from v1.0.1) Abstractions for bolts to save and retrieve the state of its operations. By extending the BaseStatefulBolt and implement initstate(t state) method. initstate method is invoked by the framework during the bolt initialization (after prepare()) with the previously saved state of the bolt. 8

Stateful bolts (from v1.0.1) The framework periodically checkpoints the state of the bolt (default every second). Checkpoint is triggered by an internal checkpoint spout. If there is at-least one IStatefulBolt in the topology, the checkpoint spout is automatically added by the topology builder. Checkpoint tuples flow through a separate internal stream namely $checkpoint Non stateful bolts just forwards the checkpoint tuples so that the checkpoint tuples can flow through the topology DAG. 9

Example of a running topology Topology consists of three components: one BlueSpout and two bolts,greenbolt and YellowBolt #worker processes=2 for green Bolt: #executors =2 #tasks = 4 10

Running topology: worker processes, executors and tasks Worker processes executes a subset of a topology, and runs in its own JVM. An executor is a thread that is spawned by a worker process and runs within the worker s JVM (parallelism hint). A task performs the actual data processing and is run within its parent executor s thread of execution. # threads can change at run time, but not # tasks #threads <= #tasks 11

Updating the parallelism of a running topology Rebalancing: Increase or decrease the number of worker processes and/or executors without being required to restart the cluster or the topology, but not tasks. e.g. To reconfigure the topology "mytopology" to use 5 worker processes, # the spout "blue-spout" to use 3 executors. storm rebalance mytopology -n 5 -e blue-spout=3 Demo: 12

Stream groupings Stream grouping defines how that stream should be partitioned among the bolt's tasks. Shuffle grouping: random distribution, each bolt is guaranteed to get an equal number of tuples Fields grouping: stream is partitioned by the fields specified in the grouping Global grouping: entire stream goes to a single one of the bolt's tasks. All grouping: The stream is replicated across all the bolt's tasks. etc.. 13

Guaranteeing Message Processing Storm can guarantee at least once processing. Tuple coming off the spout triggers many tuples being created based on it forming Tuple tree. "fully processed tuple: tuple tree has been exhausted and every message in the tree has been processed (within a specified timeout). Spout while emitting provides a "message id" that will be used to identify the tuple later. Storm takes care of tracking the tree of messages that is created. if fully processed, Storm will call the ack method on the originating Spout task with its message id. if tuple times-out Storm will call the fail method on the Spout. 14

Guaranteeing Message Processing Things user have to do to achieve at-least once semantics. Anchoring: creating a new link in the tree of tuples. Acking: finished processing an individual tuple. Failing: to immediately fail tuple at the root of the tuple tree, to replay faster than waiting for the tuple to time-out. Acking Anchoring 15

Internal messaging within Storm worker processes 16

Resource Scheduling for DSPS Scheduling for the DSPS has two parts: Resource allocation - Determining the appropriate degrees of parallelism per task (i.e., threads of execution) Amount of computing resources per task (e.g., Virtual Machines (VMs)) for the given dataflow Resource mapping - Deciding the specific assignment of the threads to the VMs ensuring that the expected performance behavior and resource utilization is met. 17

Resource Allocation For a given DAG and input rate, allocation determines the number of resource slots(ρ) for DAG & number of threads(q), resources required for each task. Resource allocation algorithms: Linear Storm Allocation (LSA) Model Based Allocation (MBA) [3] Requires input rate to each task for finding the resource needs and data parallelism for that task. # of slots: [3] Model-driven Scheduling for Distributed Stream Processing Systems, Shukla,et al {under review} 18

Linear Storm Allocation Pseudocode: AllocateLSA(G,Ω){ for each task in DAG while(input rate for task ti > Peak rate with 1 thread) { add 1 thread decrease required rate by Peak rate with 1 thread increase resources allocated with that required for 1 thread } if(remaining input rate for task ti>0) { increase number of threads by 1 set input rate to zero add resources by scaling remaining rate with peak rate } return <#threads,cpu%,memory%> for each task e.g. For 105 tuples/sec rate. Threads=(52 thread * 2 tuples/sec)+(1 thread*1 tuple/sec) CPU% =52*6.73+3.3=353% Memory%=52*23.92+11.16=1255.8% Required #Slots=ceil (353%,1255.8%)=13 19

Default Mapping Not resource aware, so does not use the output of the performance model Threads are picked in any arbitrary order for mapping For each thread, next slot is picked in roundrobin fashion Unbalanced load distribution across the slots Pseudocode: MapDSM(R,S){ M<- new map() get the list of slots for each thread pick slots in round robin manner store mapping of thread to slot in M return M DAG with Thread Allocation for Tasks using Model Default Storm Mapping (DSM) Orange: 4 s 1 1 s 2 1 s 3 1 Blue: 5 B 1..B 5 O 1..O 4 Yellow: 3 Y 1..Y 3 Green: 5 G 1..G 5 = 6 slots B 1, O 2, G 1 B 3, O 4, G 3 B 5, Y 2, Y 5 s 1 2 s 2 2 B 2, O 3, G 2 B 4, Y 1, G 4 O 1, Y 3 v 1 v 2 v 3 20 s 3 2

Resource Aware Mapping[4] Use only resource usage for single thread from the performance model Network aware, places the threads on slots such that communication latency between adjacent tasks is reduced Threads are picked in order of BFS traversal of the DAG for locality. Slots are chosen by Distance function (minimum value) based on the available and required resources, and a network latency measure DAG with Thread Allocation for Tasks using Model Orange: 4 s 1 1 s 2 1 s 3 1 Blue: 5 Yellow: 3 Green: 5 B 1, O 1, Y 1 Y 2, G 2, B 3 B 4, G 4, G 5 s 2 1 s 2 2 s 2 3 G 1, B 2, O 2 O 3,Y 3,G 3,O 4 B 5 v 1 v 2 v 3 [4] Peng et.al. R-storm: Resource-aware scheduling in storm, in: Middleware 2016 21

References Apache Storm concepts http://storm.apache.org/releases/current/concepts.html Understanding the Parallelism of a Storm Topology http://www.michael-noll.com/blog/2012/10/16/understanding-the-parallelism-of-a-stormtopology/ Model-driven Scheduling for Distributed Stream Processing Systems, Shukla et. al. {under review} R-storm: Resource-aware scheduling in storm, Peng et.al.,in: Middleware 2016 14-Feb-17 22