Hadoop Trainer Nosql Fan Boy
Total Page:16
File Type:pdf, Size:1020Kb
25.03.2014 uweseiler Welcome to 2 Your Travel Guide 25.03.2014 Big Data Nerd Hadoop Trainer NoSQL Fan Boy Photography Enthusiast Travelpirate 2 Your Travel Agency 25.03.2014 specializes on... Big Data Nerds Agile Ninjas Continuous Delivery Gurus Join us! Enterprise Java Specialists Performance Geeks 2 Your Travel Destination 25.03.2014 YARN App Land Enterprise Land Goodbye Photo HDFS 2 Land Welcome Office YARN Land 2 Stop #1: Welcome Office 25.03.2014 Welcome Office 2 In the beginning of Hadoop 25.03.2014 …there was MapReduce • It could handle data sizes way beyond those of its competitors • It was resilient in the face of failure • It made it easy for users to bring their code and algorithms to the data 2 Hadoop 1 (2007) 25.03.2014 …but it was too low level 2 Hadoop 1 (2007) 25.03.2014 …but it was too rigid 2 Hadoop 1 (2007) 25.03.2014 …but it was Batch Single App Single App Batch Batch Single App Single App Single App Batch Batch Batch HDFS HDFS HDFS 2 Hadoop 1 (2007) 25.03.2014 …but it had limitations • Scalability – Maximum cluster size ~ 4,500 nodes – Maximum concurrent tasks – 40,000 – Coarse synchronization in JobTracker • Availability – Failure kills all queued and running jobs • Hard partition of resources into map & reduce slots – Low resource utilization • Lacks support for alternate paradigms and services 2 Hadoop 2 (2013) 25.03.2014 YARN to the rescue! 2 Stop #2: YARN Land 25.03.2014 Welcome Office YARN Land 2 A brief history of Hadoop 2 25.03.2014 • Originally conceived & architected by the team at Yahoo! – Arun Murthy created the original JIRA in 2008 and now is the Hadoop 2 release manager • The community has been working on Hadoop 2 for over 4 years • Hadoop 2 based architecture running at scale at Yahoo! – Deployed on 35,000+ nodes for 6+ months 2 Hadoop 2: Next-gen platform 25.03.2014 Single use system Multi-purpose platform Batch Apps Batch, Interactive, Streaming, … Hadoop 1 Hadoop 2 MapReduce Others MapReduce Data processing Data processing Cluster resource mgmt. + data processing YARN Cluster resource management HDFS Redundant, reliable HDFS 2 storage Redundant, reliable storage 2 Taking Hadoop beyond batch 25.03.2014 Store all data in one place Interact with data in multiple ways Applications run natively in Hadoop Batch Interactive Online Streaming Graph In-Memory Other MapReduce Tez HOYA Storm, … Giraph Spark Search, … YARN Cluster resource management HDFS 2 Redundant, reliable storage 2 YARN: Design Goals 25.03.2014 • Build a new abstraction layer by splitting up the two major functions of the JobTracker • Cluster resource management • Application life-cycle management • Allow other processing paradigms • Flexible API for implementing YARN apps • MapReduce becomes YARN app • Lots of different YARN apps 2 Hadoop: BigDataOS™ 25.03.2014 Traditional Operating Hadoop System Execution / Scheduling: Execution / Scheduling: Processes / Kernel YARN Storage: Storage: File System HDFS 2 YARN: Architectural Overview 25.03.2014 Split up the two major functions of the JobTracker Cluster resource management & Application life-cycle management ResourceManager Scheduler NodeManager NodeManager NodeManager NodeManager AM 1 Container 1.1 Container 2.1 Container 2.3 NodeManager NodeManager NodeManager NodeManager Container 1.2 AM 2 Container 2.2 2 YARN: Multi-tenancy I 25.03.2014 ResourceManager Different types of applicationsScheduler on the same cluster NodeManager NodeManager NodeManager NodeManager MapReduce 1 map 1.1 reduce 2.2 map 2.1 Region server 2 reduce 2.1 nimbus 1 vertex 3 NodeManager NodeManager NodeManager NodeManager HBase Master map 1.2 MapReduce 2 map 2.2 nimbus 2 Region server 1 vertex 4 vertex 2 NodeManager NodeManager NodeManager NodeManager HOYA reduce 1.1 Tez map 2.3 vertex 1 Region server 3 Storm 2 YARN: Multi-tenancy II 25.03.2014 ResourceManager Scheduler NodeManager NodeManager NodeManager NodeManager MapReduce 1 map 1.1 reduce 2.2 map 2.1 root Region server 2 reduce 2.1 nimbus 1 vertex 3 30% 60% 10% NodeManagerDifferent usersNodeManager and NodeManager NodeManagerAd- User DWH Hoc organizationsHBase Master onmap the1.2 MapReduce 2 map 2.2 20% 80% 25% 75% nimbus 2 Region server 1 vertex 4 vertex 2 same cluster Dev Prod Dev Prod NodeManager NodeManager NodeManager NodeManager 60% 40% HOYA reduce 1.1 Tez map 2.3 Dev1 Dev2 vertex 1 Region server 3 Storm 2 YARN: Your own app 25.03.2014 MyApp Application ResourceManager YARNClient Client Protocol Scheduler App specific API Application Master Protocol NodeManager NodeManager myAM Container AMRMClient NodeManager Container DistributedShell is the NMClient new WordCount! Container Management Protocol 2 Stop #3: HDFS 2 Land 25.03.2014 HDFS 2 Land Welcome Office YARN Land 2 HDFS 2: In a nutshell 25.03.2014 • Removes tight coupling of Block Storage and Namespace • Adds (built-in) High Availability • Better Scalability & Isolation • Increased performance Details: https://issues.apache.org/jira/browse/HDFS-1052 2 HDFS 2: Federation 25.03.2014 NameNodes do not talk to each other NameNode 1 NameNode 2 NameNodes manages only slice of namespace Namespace 1 Namespace 2 Namespace Block Namespace Block State Map State Map Block Storage as generic storage service Pool 1 Pool 2 Block Pools DataNodes can store blocks managed by b3 b1 b2 b1 b3 b2 Data Nodes any NameNode b2 b4 b5 b5 b4 JBOD JBOD JBOD Horizontally scale IO and storage 2 HDFS 2: Architecture 25.03.2014 NFS Shared state on NFS or OR Journal Journal Journal Node Node Node Quorum based storage Maintains Block Map and Edits File Simultaneously Active NameNode Standby NameNode reads and applies the edits Block Edits Block Edits Take orders Map File Map File only from the Report to both NameNodes Active DataNode DataNode DataNode DataNode DataNode 2 HDFS 2: High Availability 25.03.2014 ZooKeeper ZooKeeper ZooKeeper Node Node Node Heartbeat Heartbeat ZKFailover Journal Journal Journal ZKFailover Controller Node Node Node Controller Shared State Holds special Active NameNode Standby NameNode Monitors health lock znode of NN, OS, HW Block Edits Block Edits Map File Map File DataNode DataNode DataNode DataNode DataNode Send Heartbeats & Block Reports 2 HDFS 2: Write-Pipeline 25.03.2014 • Earlier versions of HDFS • Files were immutable • Write-once-read-many model • New features in HDFS 2 • Files can be reopened for append • New primitives: hflush and hsync • Replace data node on failure Add new node to • Read consistency the pipeline Data Data Data DataNode DataNode DataNode DataNode Writer 1 2 3 4 Can read from any node and Reader then failover to any other node 2 HDFS 2: Snapshots 25.03.2014 • Admin can create point in time snapshots of HDFS • Of the entire file system • Of a specific data-set (sub-tree directory of file system) • Restore state of entire file system or data-set to a snapshot (like Apple Time Machine) • Protect against user errors • Snapshot diffs identify changes made to data set • Keep track of how raw or derived/analytical data changes over time 2 HDFS 2: NFS Gateway 25.03.2014 • Supports NFS v3 (NFS v4 is work in progress) • Supports all HDFS commands • List files • Copy, move files • Create and delete directories • Ingest for large scale analytical workloads • Load immutable files as source for analytical processing • No random writes • Stream files into HDFS • Log ingest by applications writing directly to HDFS client mount 2 HDFS 2: Performance 25.03.2014 • Many improvements • New AppendableWrite-Pipeline • Read path improvements for fewer memory copies • Short-circuit local reads for 2-3x faster random reads • I/O improvements using posix_fadvise() • libhdfs improvements for zero copy reads • Significant improvements: I/O 2.5 - 5x faster 2 Stop #4: YARN App Land 25.03.2014 YARN App Land HDFS 2 Land Welcome Office YARN Land 2 YARN Apps: Overview 25.03.2014 • MapReduce 2 Batch • Tez DAG Processing • Storm Stream Processing • Samza Stream Processing • Apache S4 Stream Processing • Spark In-Memory • HOYA HBase on YARN • Apache Giraph Graph Processing • Apache Hama Bulk Synchronous Parallel • Elastic Search Scalable Search 2 YARN Apps: Overview 25.03.2014 • MapReduce 2 Batch • Tez DAG Processing • Storm Stream Processing • Samza Stream Processing • Apache S4 Stream Processing • Spark In-Memory • HOYA HBase on YARN • Apache Giraph Graph Processing • Apache Hama Bulk Synchronous Parallel • Elastic Search Scalable Search 2 MapReduce 2: In a nutshell 25.03.2014 • MapReduce is now a YARN app • No more map and reduce slots, it’s containers now • No more JobTracker, it’s YarnAppmaster library now • Multiple versions of MapReduce • The older mapred APIs work without modification or recompilation • The newer mapreduce APIs may need to be recompiled • Still has one master server component: the Job History Server • The Job History Server stores the execution of jobs • Used to audit prior execution of jobs • Will also be used by YARN framework to store charge backs at that level • Better cluster utilization • Increased scalability & availability 2 MapReduce 2: Shuffle 25.03.2014 • Faster Shuffle • Better embedded server: Netty • Encrypted Shuffle • Secure the shuffle phase as data moves across the cluster • Requires 2 way HTTPS, certificates on both sides • Causes significant CPU overhead, reserve 1 core for this work • Certificates stored on each node (provision with the cluster), refreshed every 10 secs • Pluggable Shuffle Sort • Shuffle is the first phase in MapReduce that is guaranteed to not be data- local • Pluggable Shuffle/Sort allows application developers or hardware developers to intercept the network-heavy workload and optimize it • Typical implementations have hardware components like fast networks and software components like sorting algorithms • API will change with future versions of Hadoop 2 MapReduce 2: Performance 25.03.2014 • Key Optimizations • No hard segmentation of resource into map and reduce slots • YARN scheduler is more efficient • MR2 framework has become more efficient than MR1: shuffle phase in MRv2 is more performant with the usage of Netty.