Docsity

Hadoop e Big Data - Introduzione, Guide, Progetti e Ricerche di Ingegneria industriale

Anteprima parziale del testo

Scarica Hadoop e Big Data - Introduzione e più Guide, Progetti e Ricerche in PDF di Ingegneria industriale solo su Docsity!

Hadoop

Source

Alessandro Rezzani, Big Data - Architettura,

tecnologie e metodi per l’utilizzo di grandi

basi di dati , Apogeo Education, ottobre 2013

wikipedia

Hadoop

  • Apache Hadoop is an open-source software framework for storage and large scale processing of data-sets on clusters of commodity hardware.

Cluster of machines running Hadoop at Yahoo! (Source: Yahoo!)

Hadoop

Hadoop

  • All the modules in Hadoop are designed with a fundamental assumption that hardware failures (of individual machines, or racks of machines) are common and thus should be automatically handled in software by the framework.
  • Hadoop's MapReduce and HDFS components originally derived respectively from Google's MapReduce and Google File System (GFS) papers.

Hadoop

  • Hadoop consists of the Hadoop Common package, which provides filesystem and OS level abstractions, a MapReduce engine (either MapReduce/MR1 or YARN/MR2) and the Hadoop Distributed File System (HDFS).
  • The Hadoop Common package contains the necessary Java ARchive (JAR) files and scripts needed to start Hadoop.

Architecture

  • For effective scheduling of work, every Hadoop- compatible file system should provide location awareness: the name of the rack (more precisely, of the network switch) where a worker node is.
  • Hadoop applications can use this information to run work on the node where the data is, and, failing that, on the same rack/switch, reducing backbone traffic.
  • HDFS uses this method when replicating data to try to keep different copies of the data on different racks.
  • The goal is to reduce the impact of a rack power outage or switch failure, so that even if these events occur, the data may still be readable.

Architecture

Architecture

  • In a larger cluster, the HDFS is managed through a dedicated NameNode server to host the file system index, and a secondary NameNode that can generate snapshots of the namenode's memory structures
  • This prevents file-system corruption and reduce loss of data.
  • Similarly, a standalone JobTracker server can manage job scheduling.
  • In clusters where the Hadoop MapReduce engine is deployed against an alternate file system, the NameNode, secondary NameNode and DataNode architecture of HDFS is replaced by the file-system- specific equivalent. (^11)

Hadoop distributed file system

  • The Hadoop distributed file system (HDFS) is a distributed, scalable, and portable file-system written in Java for the Hadoop framework.
  • Each Hadoop instance typically has a single namenode; a cluster of datanodes form the HDFS cluster.
  • Each datanode serves up blocks of data over the network using a block protocol specific to HDFS.

Hadoop distributed file system

  • The file system uses the TCP/IP layer for communication. Machines use Remote procedure call (RPC) to communicate between each other
  • HDFS stores large files (typically in the range of gigabytes to terabytes) across multiple machines.
  • It achieves reliability by replicating the data across multiple hosts, and hence does theoretically not require RAID storage on hosts (but to increase I/O performance some RAID configurations are still useful).

Hadoop distributed file system

  • HDFS added the high-availability capabilities, as announced for release 2.0 in May 2012, allowing the main metadata server (the NameNode) to be failed over manually to a backup server in the event of failure.
  • The project has also started developing automatic fail-over.

Hadoop distributed file system

  • An advantage of using HDFS is data awareness between the job tracker and task tracker.
  • The job tracker schedules map or reduce jobs to task trackers with an awareness of the data location.
  • For example: if node A contains data (x,y,z) and node B contains data (a,b,c), the job tracker schedules node B to perform map or reduce tasks on (a,b,c) and node A would be scheduled to perform map or reduce tasks on (x,y,z).
  • This reduces the amount of traffic that goes over the network and prevents unnecessary data transfer

Hadoop distributed file system

  • Files are organized as sequences of blocks of the same dimension (typically 64 MB or 128 MB), redundant on more than one node
  • Block dimensions and replica numbers can be configured per file
  • Read request are answered by nodes closer to the client

Hadoop distributed file system

  • File access can be achieved through the native Java API, the Thrift API to generate a client in the language of the users' choosing (C++, Java, Python, PHP, Ruby, Erlang, Perl, Haskell, C#, Cocoa, Smalltalk, and OCaml), the WebHDFS REST API, the command-line interface, or browsed through the HDFS-UI webapp over HTTP.