Jump to content

Apache Hadoop

From Wikipedia, the free encyclopedia

This is an old revision of this page, as edited by 216.145.54.15 (talk) at 00:46, 10 December 2011 (→‎Other users: NetFlix is now written Netflix.). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

Apache Hadoop
Developer(s)Apache Software Foundation
Stable release
0.20.204 / September 11, 2011 (2011-09-11)
Preview release
0.21.0 / August 23, 2010 (2010-08-23)
Repository
Written inJava
Operating systemCross-platform
TypeDistributed File System
LicenseApache License 2.0
Websitehadoop.apache.org

Apache Hadoop is a software framework that supports data-intensive distributed applications under a free license.[1] It enables applications to work with thousands of nodes and petabytes of data. Hadoop was inspired by Google's MapReduce and Google File System (GFS) papers.

Hadoop is a top-level Apache project being built and used by a global community of contributors,[2] written in the Java programming language. Yahoo! has been the largest contributor[3] to the project, and uses Hadoop extensively across its businesses.[4]

Hadoop was created by Doug Cutting,[5] who named it after his son's toy elephant.[6] It was originally developed to support distribution for the Nutch search engine project.[7]

Architecture

Hadoop consists of the Hadoop Common, which provides access to the filesystems supported by Hadoop. The Hadoop Common package contains the necessary JAR files and scripts needed to start Hadoop. The package also provides source code, documentation, and a contribution section which includes projects from the Hadoop Community.

For effective scheduling of work, every Hadoop-compatible filesystem 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, so reducing backbone traffic. The Hadoop Distributed File System (HDFS) uses this 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.[8]

Hadoop cluster
A multi-node Hadoop cluster

A small Hadoop cluster will include a single master and multiple worker nodes. The master node consists of a JobTracker, TaskTracker, NameNode, and DataNode. A slave or worker node acts as both a DataNode and TaskTracker, though it is possible to have data-only worker nodes, and compute-only worker nodes; these are normally only used in non-standard applications. Hadoop requires JRE 1.6 or higher. The standard startup and shutdown scripts require ssh to be set up between nodes in the cluster.

In a larger cluster, the HDFS is managed through a dedicated NameNode server to host the filesystem index, and a secondary NameNode that can generate snapshots of the namenode's memory structures, thus preventing filesystem corruption and reducing loss of data. Similarly, a standalone JobTracker server can manage job scheduling. In clusters where the Hadoop MapReduce engine is deployed against an alternate filesystem, the NameNode, secondary NameNode and DataNode architecture of HDFS is replaced by the filesystem-specific equivalent.

Filesystems

Hadoop Distributed File System

The HDFS is a distributed, scalable, and portable filesystem written in Java for the Hadoop framework. Each node in a Hadoop instance typically has a single datanode; a cluster of datanodes form the HDFS cluster. The situation is typical because each node does not require a datanode to be present. Each datanode serves up blocks of data over the network using a block protocol specific to HDFS. The filesystem uses the TCP/IP layer for communication; clients use RPC to communicate between each other. The HDFS stores large files (an ideal file size is a multiple of 64 MB[9]), across multiple machines. It achieves reliability by replicating the data across multiple hosts, and hence does not require RAID storage on hosts. With the default replication value, 3, data is stored on three nodes: two on the same rack, and one on a different rack. Data nodes can talk to each other to rebalance data, to move copies around, and to keep the replication of data high. HDFS is not fully POSIX compliant because the requirements for a POSIX filesystem differ from the target goals for a Hadoop application. The tradeoff of not having a fully POSIX compliant filesystem is increased performance for data throughput. The HDFS was designed to handle very large files.[9]

The HDFS does not provide high availability, because an HDFS filesystem instance requires one unique server, the name node. This is a single point of failure for an HDFS installation. If the name node goes down, the filesystem is offline. When it comes back up, the name node must replay all outstanding operations. This replay process can take over half an hour for a big cluster.[10] The filesystem includes what is called a Secondary Namenode, which misleads some people into thinking that when the Primary Namenode goes offline, the Secondary Namenode takes over. In fact, the Secondary Namenode regularly connects with the Primary Namenode and builds snapshots of the Primary Namenode's directory information, which is then saved to local/remote directories. These checkpointed images can be used to restart a failed Primary Namenode without having to replay the entire journal of filesystem actions, then edit the log to create an up-to-date directory structure.

An advantage of using the HDFS is data awareness between the jobtracker and tasktracker. The jobtracker schedules map/reduce jobs to tasktrackers with an awareness of the data location. An example of this would be if node A contained data (x,y,z) and node B contained data (a,b,c). The jobtracker will schedule node B to perform map/reduce tasks on (a,b,c) and node A would be scheduled to perform map/reduce tasks on (x,y,z). This reduces the amount of traffic that goes over the network and prevents unnecessary data transfer. When Hadoop is used with other filesystems this advantage is not always available. This can have a significant impact on the performance of job completion times, which has been demonstrated when running data intensive jobs.[11]

Another limitation of HDFS is that it cannot be directly mounted by an existing operating system. Getting data into and out of the HDFS file system, an action that often needs to be performed before and after executing a job, can be inconvenient. A Filesystem in Userspace (FUSE) virtual file system has been developed to address this problem, at least for Linux and some other Unix systems.

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 command-line interface, or browsed through the HDFS-UI webapp over HTTP.

Other Filesystems

By May 2011, the list of supported filesystems included:

  • HDFS: Hadoop's own rack-aware filesystem.[12] This is designed to scale to tens of petabytes of storage and runs on top of the filesystems of the underlying operating systems.
  • Amazon S3 filesystem. This is targeted at clusters hosted on the Amazon Elastic Compute Cloud server-on-demand infrastructure. There is no rack-awareness in this filesystem, as it is all remote.
  • CloudStore (previously Kosmos Distributed File System), which is rack-aware.
  • FTP Filesystem: this stores all its data on remotely accessible FTP servers.
  • Read-only HTTP and HTTPS file systems.

Hadoop can work directly with any distributed file system that can be mounted by the underlying operating system simply by using a file:// URL; however, this comes at a price: the loss of locality. To reduce network traffic, Hadoop needs to know which servers are closest to the data; this is information which Hadoop-specific filesystem bridges can provide.

Out-of-the-box, this includes Amazon S3, and the CloudStore filestore, through s3:// and kfs:// URLs directly.

A number of third party filesystem bridges have also been written, none of which are currently in Hadoop distributions. These may offer superior availability or scalability, and possibly a more general-purpose filesystem than HDFS, which is biased towards large files and only offers a subset of the expected semantics of a Posix Filesystem: no locking, or writing to anywhere other than the tail of a file.

  • In 2009 IBM discussed running Hadoop over the IBM General Parallel File System.[13] The source code was published in October 2009.[14]
  • In April 2010, Parascale published the source code to run Hadoop against the Parascale filesystem.[15]
  • In April 2010, Appistry released a Hadoop filesystem driver for use with its own CloudIQ Storage product.[16]
  • In June 2010, HP discussed a location-aware IBRIX Fusion filesystem driver.[17]
  • In May 2011, MapR Technologies, Inc. announced the availability of an alternate filesystem for Hadoop, which replaced the HDFS file system with a full random-access read/write file system, with advanced features like snaphots and mirrors, and get rid of the single point of failure issue of the default HDFS NameNode.

JobTracker and TaskTracker: the MapReduce engine

Above the file systems comes the MapReduce engine, which consists of one JobTracker, to which client applications submit MapReduce jobs. The JobTracker pushes work out to available TaskTracker nodes in the cluster, striving to keep the work as close to the data as possible. With a rack-aware filesystem, the JobTracker knows which node contains the data, and which other machines are nearby. If the work cannot be hosted on the actual node where the data resides, priority is given to nodes in the same rack. This reduces network traffic on the main backbone network. If a TaskTracker fails or times out, that part of the job is rescheduled. The TaskTracker on each node spawns off a separate Java Virtual Machine process to prevent the TaskTracker itself from failing if the running job crashes the JVM. A heartbeat is sent from the TaskTracker to the JobTracker every few minutes to check its status. The Job Tracker and TaskTracker status and information is exposed by Jetty and can be viewed from a web browser.

If the JobTracker failed on Hadoop 0.20 or earlier, all ongoing work was lost. Hadoop version 0.21 added some checkpointing to this process; the JobTracker records what it is up to in the filesystem. When a JobTracker starts up, it looks for any such data, so that it can restart work from where it left off. In earlier versions of Hadoop, all active work was lost when a JobTracker restarted.

Known limitations of this approach are:

  • The allocation of work to TaskTrackers is very simple. Every TaskTracker has a number of available slots (such as "4 slots"). Every active map or reduce task takes up one slot. The Job Tracker allocates work to the tracker nearest to the data with an available slot. There is no consideration of the current system load of the allocated machine, and hence its actual availability.
  • If one TaskTracker is very slow, it can delay the entire MapReduce job - especially towards the end of a job, where everything can end up waiting for the slowest task. With speculative-execution enabled, however, a single task can be executed on multiple slave nodes.

Scheduling

By default Hadoop uses FIFO, and optional 5 scheduling priorities to schedule jobs from a work queue.[18] In version 0.19 the job scheduler was refactored out of the JobTracker, and added the ability to use an alternate scheduler (such as the Fair scheduler or the Capacity scheduler).[19]

Fair scheduler

The fair scheduler was developed by Facebook. The goal of the fair scheduler is to provide fast response times for small jobs and QoS for production jobs. The fair scheduler has three basic concepts.[20]

  1. Jobs are grouped into Pools.
  2. Each pool is assigned a guaranteed minimum share.
  3. Excess capacity is split between jobs.

By default jobs that are uncategorized go into a default pool. Pools have to specify the minimum number of map slots, reduce slots, and a limit on the number of running jobs.

Capacity scheduler

The capacity scheduler was developed by Yahoo. The capacity scheduler supports several features which are similar to the fair scheduler.[21]

  • Jobs are submitted into queues.
  • Queues are allocated a fraction of the total resource capacity.
  • Free resources are allocated to queues beyond their total capacity.
  • Within a queue a job with a high level of priority will have access to the queue's resources.

There is no preemption once a job is running.

Other applications

The HDFS filesystem is not restricted to MapReduce jobs. It can be used for other applications, many of which are under development at Apache. The list includes the HBase database, the Apache Mahout machine learning system, and the Apache Hive Data Warehouse system. Hadoop can in theory be used for any sort of work that is batch-oriented rather than real-time, that is very data-intensive, and able to work on pieces of the data in parallel. As of October 2009, commercial applications of Hadoop[22] included:

  • Log and/or clickstream analysis of various kinds
  • Marketing analytics
  • Machine learning and/or sophisticated data mining
  • Image processing
  • Processing of XML messages
  • Web crawling and/or text processing
  • General archiving, including of relational/tabular data, e.g. for compliance

Prominent users

Yahoo!

On February 19, 2008, Yahoo! Inc. launched what it claimed was the world's largest Hadoop production application. The Yahoo! Search Webmap is a Hadoop application that runs on more than 10,000 core Linux cluster and produces data that is now used in every Yahoo! Web search query.[23]

There are multiple Hadoop clusters at Yahoo!, and no HDFS filesystems or MapReduce jobs are split across multiple datacenters. Every hadoop cluster node bootstraps the Linux image, including the Hadoop distribution. Work that the clusters perform is known to include the index calculations for the Yahoo! search engine.

On June 10, 2009, Yahoo! made available the source code to the version of Hadoop it runs in production.[24] Yahoo! contributes back all work it does on Hadoop to the open-source community, the company's developers also fix bugs and provide stability improvements internally, and release this patched source code so that other users may benefit from their effort.

Facebook

In 2010 Facebook claimed that they have the largest Hadoop cluster in the world with 21 PB of storage.[25] On July 27, 2011 they announced the data has grown to 30 PB.[26]

Other users

Besides Facebook and Yahoo!, many other organizations are using Hadoop to run large distributed computations. Some of the notable users include:[2]

2

Hadoop on Amazon EC2/S3 services

It is possible to run Hadoop on Amazon Elastic Compute Cloud (EC2) and Amazon Simple Storage Service (S3).[34] As an example The New York Times used 100 Amazon EC2 instances and a Hadoop application to process 4 TB of raw image TIFF data (stored in S3) into 11 million finished PDFs in the space of 24 hours at a computation cost of about $240 (not including bandwidth).[35]

There is support for the S3 filesystem in Hadoop distributions, and the Hadoop team generates EC2 machine images after every release. From a pure performance perspective, Hadoop on S3/EC2 is inefficient, as the S3 filesystem is remote and delays returning from every write operation until the data are guaranteed not to be lost. This removes the locality advantages of Hadoop, which schedules work near data to save on network load.

Amazon Elastic MapReduce

Elastic MapReduce was introduced by Amazon in April 2009. Provisioning of the Hadoop cluster, running and terminating jobs, and handling data transfer between EC2 and S3 are automated by Elastic MapReduce. Apache Hive, which is built on top of Hadoop for providing data warehouse services, is also offered in Elastic MapReduce.[36]

Support for using Spot Instances was later added in August 2011.[37] Elastic MapReduce is fault tolerant for slave failures,[38] and it is recommended to only run the Task Instance Group on spot instances to take advantage of the lower cost while maintaining availability.[39]

Hadoop at Google and IBM

IBM and Google announced an initiative in 2007 to use Hadoop to support university courses in distributed computer programming.[40]

In 2008 this collaboration, the Academic Cloud Computing Initiative (ACCI), partnered with the National Science Foundation to provide grant funding to academic researchers interested in exploring large-data applications. This resulted in the creation of the Cluster Exploratory (CLuE) program.[41]

Running Hadoop in compute farm environments

Hadoop can also be used in compute farms and high-performance computing environments. Instead of setting up a dedicated Hadoop cluster, an existing compute farm can be used if the resource manager of the cluster is aware of the Hadoop jobs, and thus Hadoop jobs can be scheduled like other jobs in the cluster.

Grid Engine Integration

Integration with Sun Grid Engine was released in 2008, and running Hadoop on Sun Grid (Sun's on-demand utility computing service) was possible.[42] In the initial implementation of the integration, the CPU-time scheduler has no knowledge of the locality of the data. Unfortunately, this means that the processing is not always done on the same rack as the data; this was a key feature of the Hadoop Runtime. An improved integration with data-locality was announced during the Sun HPC Software Workshop '09.[43]

In 2008-2009 Sun released the Hadoop Live CD OpenSolaris project, which allows running a fully functional Hadoop cluster using a live CD.[44] This distribution includes Hadoop 0.19 -as of April 2010 there has not been an updated release.

Condor Integration

The Condor High-Throughput Computing System integration was presented at the Condor Week conference in 2010.[45]

There are a number of companies offering commercial implementations and/or providing support for Hadoop.[46]

  • Cloudera offers CDH (Cloudera's Distribution including Apache Hadoop) and Cloudera Enterprise.[47]
  • IBM offers InfoSphere BigInsights [48] based on Hadoop in both a basic and enterprise edition.[49]
  • In March 2011, Platform Computing announced support for the Hadoop MapReduce API in its Symphony software.[50]
  • In May 2011, MapR Technologies, Inc. announced the availability of their distributed filesystem and MapReduce engine, the MapR Distribution for Apache Hadoop.[51] The MapR product includes most Hadoop eco-system components and adds capabilities such as snapshots, mirrors, NFS access and full read-write file semantics.[52]
  • Silicon Graphics International offers Hadoop optimized solutions based on the SGI Rackable and CloudRack server lines with implementation services.[53]
  • EMC released EMC Greenplum Community Edition and EMC Greenplum HD Enterprise Edition in May 2011. The community edition, with optional for-fee technical support, consists of Hadoop, HDFS, HBase, Hive, and the ZooKeeper configuration service. The enterprise edition is an offering based on the MapR product, and offers proprietary features such as snapshots and wide area replication.[54] [55]
  • In June 2011, Yahoo! and Benchmark Capital formed Hortonworks Inc., whose focus is on making Hadoop more robust and easier to install, manage and use for enterprise users.[56]
  • Google added AppEngine-MapReduce to support running Hadoop 0.20 programs on Google App Engine.[57][58]
  • In Oct 2011, Oracle announced the Big Data Appliance, which integrates Hadoop, Oracle Enterprise Linux, the R programming language, and a NoSQL database with the Exadata hardware.[59] [60]
  • Dovestech has released Ocean Sync Hadoop Management Software Freeware Edition. The software allows users to control and monitor all aspects of an Hadoop cluster[61].
  • Grand Logic's JobServer[62] product allows developers and admins to deploy, manage and monitor their Hadoop infrastructure, with support for Hadoop job processing and HDFS file/content management.

ASF's view on the use of "Hadoop" in product names

The Apache Software Foundation has stated that only software officially released by the Apache Hadoop Project can be called Apache Hadoop or Distributions of Apache Hadoop.[63] The naming of products and derivative works from other vendors and the term "compatible" are somewhat controversial within the Hadoop developer community. [64]

Papers

Papers that influence birth and growth of Hadoop and big data processing.

See also

References

  1. ^ "Hadoop is a framework for running applications on large clusters of commodity hardware. The Hadoop framework transparently provides applications both reliability and data motion. Hadoop implements a computational paradigm named map/reduce, where the application is divided into many small fragments of work, each of which may be executed or re-executed on any node in the cluster. In addition, it provides a distributed file system that stores data on the compute nodes, providing very high aggregate bandwidth across the cluster. Both map/reduce and the distributed file system are designed so that node failures are automatically handled by the framework." Hadoop Overview
  2. ^ a b Applications and organizations using Hadoop
  3. ^ Hadoop Credits Page
  4. ^ Yahoo! Launches World's Largest Hadoop Production Application
  5. ^ Hadoop creator goes to Cloudera
  6. ^ Ashlee Vance (2009-03-17). "Hadoop, a Free Software Program, Finds Uses Beyond Search". New York Times. Retrieved 2010-01-20.
  7. ^ "Hadoop contains the distributed computing platform that was formerly a part of Nutch. This includes the Hadoop Distributed Filesystem (HDFS) and an implementation of MapReduce." About Hadoop
  8. ^ http://hadoop.apache.org/common/docs/r0.20.2/hdfs_user_guide.html#Rack+Awareness
  9. ^ a b The Hadoop Distributed File System: Architecture and Design
  10. ^ Improve Namenode startup performance. "Default scenario for 20 million files with the max Java heap size set to 14 GB: 40 minutes. Tuning various Java options such as young size, parallel garbage collection, initial Java heap size : 14 minutes"
  11. ^ [1] Improving MapReduce Performance through Data Placement in Heterogeneous Hadoop Clusters April 2010
  12. ^ HDFS Users Guide - Rack Awareness
  13. ^ ", "Cloud analytics: Do we really need to reinvent the storage stack?"" (PDF). IBM. 2009-06. {{cite web}}: Check date values in: |date= (help)
  14. ^ "HADOOP-6330: Integrating IBM General Parallel File System implementation of Hadoop Filesystem interface". IBM. 2009-10-23.
  15. ^ "HADOOP-6704: add support for Parascale filesystem". Parascale. 2010-04-14.
  16. ^ "Replace HDFS with CloudIQ Storage". Appistry,Inc. 2010-07-06.
  17. ^ "High Availability Hadoop". HP. 2010-06-09.
  18. ^ job
  19. ^ [ https://issues.apache.org/jira/browse/HADOOP-3412] #HADOOP-3412 Refactor the scheduler out of the JobTracker - ASF JIRA
  20. ^ [2] Hadoop Fair Scheduler Design Document
  21. ^ [3] Capacity Scheduler Guide
  22. ^ "How 30+ enterprises are using Hadoop", in DBMS2
  23. ^ Yahoo! Launches World's Largest Hadoop Production Application (Hadoop and Distributed Computing at Yahoo!)
  24. ^ Hadoop and Distributed Computing at Yahoo!
  25. ^ [4]
  26. ^ [5]
  27. ^ "Apple Embraces Hadoop". Retrieved 2011-04-14.
  28. ^ "Using Hadoop to tackle Big Data at comScore".
  29. ^ "Building a terabyte-scale data cycle at LinkedIn with Hadoop and Project Voldemort". Retrieved 2011-04-14.
  30. ^ "Microsoft Expands Data Platform With SQL Server 2012, New Investments for Managing Any Data, Any Size, Anywhere". Retrieved 2011-10-13.
  31. ^ "Use Case Study of Hive/Hadoop". Retrieved 2011-04-14.
  32. ^ "HBase at StumbleUpon". Retrieved 2010-06-26.
  33. ^ "Mitula Search/Hadoop". Retrieved 2011-09-06.
  34. ^ http://aws.typepad.com/aws/2008/02/taking-massive.html Running Hadoop on Amazon EC2/S3
  35. ^ Gottfrid, Derek (November 1, 2007). "Self-service, Prorated Super Computing Fun!". The New York Times. Retrieved May 4, 2010.
  36. ^ Amazon Elastic MapReduce Developer Guide
  37. ^ Amazon Elastic MapReduce Now Supports Spot Instances
  38. ^ Amazon Elastic MapReduce FAQs
  39. ^ Using Spot Instances with EMR on YouTube
  40. ^ Google Press Center: Google and IBM Announce University Initiative to Address Internet-Scale Computing Challenges
  41. ^ NSF, Google, IBM form CLuE
  42. ^ "Creating Hadoop pe under SGE". Sun Microsystems. 2008-01-16.
  43. ^ "HDFS-Aware Scheduling With Grid Engine". Sun Microsystems. 2009-09-10.
  44. ^ "OpenSolaris Project: Hadoop Live CD". Sun Microsystems. 2008-08-29.
  45. ^ "Condor integrated with Hadoop's Map Reduce" (PDF). University of Wisconsin–Madison. 2010-04-15.
  46. ^ Why the Pace of Hadoop Innovation Has to Pick Up
  47. ^ Cloudera’s Distribution including Apache Hadoop
  48. ^ IBM InfoSphere BigInsights
  49. ^ IBM InfoSphere BigInsights Enterprise Edition analytics platform enables new class of solutions for gaining rapid insight through large-scale analysis of diverse data
  50. ^ Platform Computing Announces Support for MapReduce
  51. ^ MapR Distribution for Apache Hadoop
  52. ^ http://mapr.com/products/mapr-editions/m5-edition.html
  53. ^ Hadoop optimized solutions from SGI
  54. ^ Greenplum Community
  55. ^ Greenplum HD: Enterprise-Ready Apache Hadoop
  56. ^ Yahoo! and Benchmark Capital to Form Hortonworks to Increase Investment in Hadoop Technology and Accelerate Innovation and Adoption
  57. ^ appengine-mapreduce - Google App Engine API for running MapReduce jobs
  58. ^ Google I/O 2011: App Engine MapReduce on YouTube
  59. ^ Oracle Unveils the Oracle Big Data Appliance
  60. ^ Oracle rolls its own NoSQL and Hadoop
  61. ^ http://www.oceansync.com OceanSync.com Hadoop Management
  62. ^ http://www.grandlogic.com/content/html_docs/js_features.shtml
  63. ^ Defining Hadoop
  64. ^ Defining Hadoop Compatibility: revisited

Bibliography