天天看點

Hadoop 生态系統1.概述2.内容3.總結4.結束語

  最近收到一些同學和朋友的郵件,說能不能整理一下 hadoop 生态圈的相關内容,然後分享一些,我覺得這是一個不錯的提議,于是,花了一些業餘時間整理了 hadoop 的生态系統,并将其進行了歸納總結,進而将其以表格的形式進行了羅列。涉及的内容有以下幾點:

分布式檔案系統

分布式程式設計模型

nosql 資料庫

sql-on-hadoop

資料采集

程式設計服務中間件

排程系統

系統部署

資料可視化

  在分布式檔案系統當中,首先為大家所熟悉的是 apache 的 hdfs。全稱為 hadoop distributed file system,由多台機器組建的叢集,存儲大資料檔案。hdfs 的靈感來自于 google file system(gfs)。hadoop 2.x 版本之前,namenode 是存在單點故障的。在 zookeeper 的高可用性功能解決了 hdfs 的這個問題,通過提供運作兩個備援的節點在同一個叢集中進行主備切換,即:active & standby

  相關連結位址如下所示:

<a href="http://hadoop.apache.org/" target="_blank">apache hadoop</a>

<a href="http://research.google.com/archive/gfs.html" target="_blank">google file system</a>

<a href="http://blog.cloudera.com/blog/2012/07/why-we-build-our-platform-on-hdfs/" target="_blank">cloudera</a>

<a href="http://hortonworks.com/blog/thinking-about-the-hdfs-vs-other-storage-technologies/" target="_blank">hortonworks</a>

  glusterfs 是一個擴充的網絡附加存儲檔案系統。glusterfs 最初是由 gluster 公司開發的,然後,由 red hat 公司在2011年進行了購買。2012年六月,red hat 存儲伺服器被宣布為商業支援的整合與 red hat 企業 linux glusterfs。gluster 檔案系統,現在稱為 red hat 存儲伺服器。

<a href="http://www.gluster.org/" target="_blank">gluster 官網</a>

<a href="http://www.redhat.com/about/news/archive/2013/10/red-hat-contributes-apache-hadoop-plug-in-to-the-gluster-community" target="_blank">red hat hadoop 插件</a>

  qfs 是一個開源的分布式檔案系統軟體包,用于對 mapreduce 批處理工作負載。她被設計為一種 apache hadoop 的 hdfs 另一種選擇方案,用于大型加工叢集提供更好的性能和成本效率。它用 c++ 和固定占用記憶體管理。qfs 使用 reed-solomon 糾錯保證可靠的資料通路方法。reed-solomon 編碼在海量存儲系統中被廣泛應用,以糾正與媒體缺陷相關的突發錯誤。而不是存儲每個檔案或是像 hdfs 一樣,存儲 3+ 次以上,qfs 僅僅需要 1.5 倍的原始容量,因為它存儲在哎九個不同的磁盤驅動上。

<a href="https://www.quantcast.com/engineering/qfs/" target="_blank">qfs 官網</a>

<a href="https://github.com/quantcast/qfs" target="_blank">github qfs</a>

<a href="https://issues.apache.org/jira/browse/hadoop-8885" target="_blank">hadoop-8885</a>

  ceph 是一個免費的軟體存儲平台,被設計為對象,塊和從單一節點到叢集的檔案存儲。它的主要目标是完全分布式無單點鼓掌,可水準擴充到 pb 容量,對多種工作負載的高性能,以及高可用性。

<a href="http://ceph.com/ceph-storage/file-system/" target="_blank">ceph filesystem 官網</a>

<a href="http://ceph.com/docs/next/cephfs/hadoop/" target="_blank">ceph and hadoop</a>

<a href="https://issues.apache.org/jira/browse/hadoop-6253" target="_blank">hadoop-6253</a>

  lustre 是由 linux 和 cluster 演變而來,是為了解決海量存儲問題而設計的全新的檔案系統。可支援達 1w 節點,pb 的存儲容量,100gb/s 的傳輸速度。lustre 是基于對象的存儲系統,減少中繼資料伺服器的 inode。它實際上還是将資料條帶化到各個存儲目标上,是以可以實作高度聚合 io 能力。lustre 原生态支援海量小檔案讀寫;且對大檔案讀寫在 linux 核心做了特殊優化。另外,lustre 是個對使用者透明的 share 檔案系統,條帶化資料的位置資訊不能完美的暴露出來,是以要用上 hadoop  的 mapreduce 優勢還需要做很多工作。

<a href="http://wiki.lustre.org/" target="_blank">lustre wiki</a>

<a href="http://wiki.lustre.org/index.php/running_hadoop_with_lustre" target="_blank">hadoop with lustre</a>

<a href="http://hadoop.intel.com/products/distribution" target="_blank">inter hpc hadoop</a>

  apache ignite 記憶體數組組織架構是一個高性能、內建和分布式的記憶體計算和事務平台,用于大規模的資料集處理,比傳統的基于磁盤或閃存的技術具有更高的性能,同時他還為應用和不同的資料源之間提供高性能、分布式記憶體中資料組織管理的功能。

  它包含一個分布式的 key/value 存儲在記憶體中,sql 執行能力,mapreduce 和其它計算,分布式資料結構,連續查詢,消息和事件子系統。hadoop 和 spark 均有內建。ignite 編譯于 java,提供 .net 和 c++ 的 api 接口。

<a href="http://ignite.apache.org/" target="_blank">apache ignite</a>

<a href="https://apacheignite.readme.io/" target="_blank">apache ignite documentation</a>

  這個大家應該不陌生,這是一個經典的程式設計模型,用于在叢集上處理并發,分布式大資料集。目前版本編譯于 yarn 架構。這裡就不多贅述了。

  相關連結位址,如下所示:

<a href="http://wiki.apache.org/hadoop/mapreduce/" target="_blank">apache mapreduce</a>

<a href="http://research.google.com/archive/mapreduce.html" target="_blank">google mapreduce paper</a>

<a href="http://hadoop.apache.org/docs/stable/hadoop-yarn/hadoop-yarn-site/writingyarnapplications.html" target="_blank">writing yarn applications</a>

  這個程式設計模型,大家也不會陌生,現在 spark 的應用場景和社群活躍度較高。快速的執行能力,豐富的程式設計 api 接口,使其備受恩寵。

<a href="http://spark.apache.org/" target="_blank">apache spark</a>

<a href="https://github.com/apache/spark" target="_blank">mirror of spark on github</a>

<a href="http://www.cs.berkeley.edu/~matei/papers/2012/nsdi_spark.pdf" target="_blank">rdds-paper</a>

<a href="https://people.csail.mit.edu/matei/papers/2010/hotcloud_spark.pdf" target="_blank">spark cluster computing</a>

<a href="http://spark.apache.org/research.html" target="_blank">spark research</a>

  做實時流水資料處理的同學,應該也不陌生,可以嫁接多種消息中間件(如kafka,mq等)。

<a href="http://storm-project.net/" target="_blank">storm project</a>

<a target="_blank">storm-on-yarn</a>

  apache flink 是一個面向分布式資料流處理和批量資料處理的開源計算平台,它能夠基于同一個flink運作時(flink runtime),提供支援流處理和批處理兩種類型應用的功能。現有的開源計算方案,會把流處理和批處理作為兩種不同的應用類型,因為他們它們所提供的sla是完全不相同的:流處理一般需要支援低延遲、exactly-once保證,而批處理需要支援高吞吐、高效處理,是以在實作的時候通常是分别給出兩套實作方法,或者通過一個獨立的開源架構來實作其中每一種處理方案。例如,實作批處理的開源方案有mapreduce、tez、crunch、spark,實作流處理的開源方案有samza、storm。 flink在實作流處理和批處理時,與傳統的一些方案完全不同,它從另一個視角看待流處理和批處理,将二者統一起來:flink是完全支援流處理,也就是說作為流處理看待時輸入資料流是無界的;批處理被作為一種特殊的流處理,隻是它的輸入資料流被定義為有界的。基于同一個flink運作時(flink runtime),分别提供了流處理和批處理api,而這兩種api也是實作上層面向流處理、批處理類型應用架構的基礎。

<a href="http://flink.incubator.apache.org/" target="_blank">apache flink</a>

<a href="http://stratosphere.eu/" target="_blank">stratosphere site</a>

這裡列舉了熱度較高的分布式程式設計模型,其它的程式設計模型,如下表所示:

相關連結位址

apache pig

<a href="https://pig.apache.org/" target="_blank">1.官網</a>

<a href="https://github.com/alanfgates/programmingpig" target="_blank">2.示例</a>

 jaql

<a href="https://code.google.com/p/jaql/" target="_blank">1.jaqll in google code</a>

<a href="http://www-01.ibm.com/software/data/infosphere/hadoop/jaql/" target="_blank">2.what is jaql?</a>

 facebook corona

<a href="https://github.com/facebookarchive/hadoop-20/tree/master/src/contrib/corona" target="_blank">1.corona on github</a>

 apache twill

<a href="https://incubator.apache.org/projects/twill.html" target="_blank">1.twill 官網</a>

 apache tez

<a href="http://incubator.apache.org/projects/tez.html" target="_blank">1.tez 官網</a>

<a href="http://hortonworks.com/hadoop/tez/" target="_blank">2.hortonworks apacha tez page</a>

  靈感來自于 google 的 bigtable。非關系性分布式資料庫。随機實時讀寫操作列擴充的大表。

<a href="https://hbase.apache.org/" target="_blank">apache hbase home</a>

<a href="https://github.com/apache/hbase" target="_blank">hbase on github</a>

  apache cassandra 是一套開源分布式 key-value 存儲系統。它最初由 facebook 開發,用于儲存特别大的資料。 cassandra 不是一個資料庫,它是一個混合型的非關系的資料庫,類似于 google 的 bigtable。cassandra 的資料模型是基于列族(column family)的四維或五維模型。它借鑒了 amazon 的 dynamo 和 google's bigtable 的資料結構和功能特點,采用 memtable 和 sstable 的方式進行存儲。在 cassandra 寫入資料之前,需要先記錄日志 ( commitlog ),然後資料開始寫入到 column family 對應的 memtable 中,memtable 是一種按照 key 排序資料的記憶體結構,在滿足一定條件時,再把 memtable 的資料批量的重新整理到磁盤上,存儲為 sstable 。

<a href="https://github.com/apache/cassandra" target="_blank">cassandra on github</a>

<a href="https://academy.datastax.com/" target="_blank">training resources</a>

<a href="https://www.cs.cornell.edu/projects/ladis2009/papers/lakshman-ladis2009.pdf" target="_blank">cassandra-paper&lt;/&gt;</a>

  kudu 是 cloudera 開源的列式存儲引擎,具有一下幾個特點:

c++ 語言開發

高效處理類 olap 負載

與 mr,spark 以及 hadoop 生态系統中其它元件友好內建

可以與 cloudera impala 內建

靈活的一緻性模型

順序和随機寫并存的場景下,仍能達到良好的性能

高可用,使用 raft 協定保證資料高可靠存儲

結構化資料模型

<a href="http://getkudu.io/" target="_blank">apache kudu home</a>

<a href="http://github.com/cloudera/kudu" target="_blank">kudu on github</a>

<a href="http://getkudu.io/kudu.pdf" target="_blank">kudu technical</a>

  面向文檔的資料庫系統。它是資料庫系統中 nosql 家族的一部分。mongodb 存儲結構化資料以 json 格式的檔案形式進行存儲。

<a href="http://www.mongodb.org/" target="_blank">mongodb 官網</a>

  redis是一個開源的使用ansi c語言編寫、支援網絡、可基于記憶體亦可持久化的日志型、key-value資料庫,并提供多種語言的api。

<a href="http://redis.io/" target="_blank">redis home</a>

<a href="http://redislabs.com/" target="_blank">redis labs</a>

  一款由 facebook 開發的資料倉庫。資料聚合,查詢和分析。提供類 sql 語言:hiveql

<a href="http://hive.apache.org/" target="_blank">apache hive home</a>

<a href="https://github.com/apache/hive" target="_blank">hive on github</a>

  trafodion是一個建構在hadoop/hbase基礎之上的關系型資料庫,它完全開源免費。trafodion能夠完整地支援ansi sql,并且提供acid事務保證。和傳統關系資料庫不同的地方在于,trafodion利用底層hadoop的橫向擴充能力,可以提供極高的擴充性。而傳統資料庫,比如mysql,在資料量達到p級别的時候就很難處理。而trafodion卻可以借助hbase的擴充性,僅通過增加普通linux伺服器就可以增加計算和存儲能力,進而支援大資料應用。

<a href="http://trafodion.incubator.apache.org/" target="_blank">apache trafodion home</a>

<a href="https://cwiki.apache.org/confluence/display/trafodion/apache+trafodion+home" target="_blank">apache trafodion wiki</a>

<a href="https://github.com/apache/incubator-trafodion" target="_blank">apache trafodion on github</a>

   drill 是 apache 開源的,用于大資料探索的 sql 查詢引擎。她在大資料應用中,面對結構化資料和變化迅速的資料,她能夠去相容,并且高性能的去分析,同時,還提供業界都熟悉的标準的查詢語言,即:ansi sql 生态系統。drill 提供即插即用,在現有的 hive,hbase,s3 等存儲媒體中可以随時整合部署。

<a href="http://drill.apache.org/" target="_blank">apache drill home</a>

  類似于 drill 的一款大資料實時查詢引擎,依賴 cdh 環境。

<a href="http://www.cloudera.com/content/cloudera/en/products-and-services/cdh/impala.html" target="_blank">cloudera impala home</a>

<a href="https://github.com/cloudera/impala" target="_blank">impala on github</a>

  kylin 是一款開源的分布式資料分析引擎由 ebay 公司提供。支援 hadoop 大資料集 olap 業務/

<a href="http://kylin.apache.org/" target="_blank">apache kylin home</a>

  flume 是一個分布式,可靠的,可用的服務,有效的收集,聚合和移動海量的日志資料。它有一個簡單而靈活的架構,基于流資料流。具有很好的備援和容錯性,以及可靠性和多故障轉移和恢複機制。它使用一個簡單的可擴充資料模型,并允許線上分析應用。

<a href="http://flume.apache.org/" target="_blank">apache flume home</a>

  一款從 hdfs 到 rdbms 之間做資料互動的工具。類似于 flume。

<a href="http://sqoop.apache.org/" target="_blank">apache sqoop project</a>

  分布式釋出-訂閱消息系統,用于處理流式海量資料。kafka 是一個由 linkedin 開發的消息隊列。能嫁接 hdfs 這樣的存儲媒體,能被 storm,spark這類實時或類實時資料模型消費。

<a href="http://kafka.apache.org/" target="_blank">apache kafka</a>

<a href="https://github.com/apache/kafka/" target="_blank">kafka on github</a>

  apache nifi 是由美國國家安全局(nsa)貢獻給 apache 基金會的開源項目,目前已被順利孵化完成成為 apache 的頂級項目之一。apache nifi 其設計目标是自動化系統間的資料流。基于其工作流式的程式設計理念,nifi 擁有易使用,高可用以及高配置等特性。其尤為突出的兩大特性是:強大的使用者界面和良好的資料回溯工具。nifi 的使用者界面允許使用者在浏覽器中直覺的了解并與資料流進行互動,快速和安全的進疊代。其資料回溯特性允許使用者檢視一個對象如何在系統間流轉,回放以及可視化關鍵步驟之前以及之後發生的情況,包括大量複雜的圖式轉換,fork,join 以及其它操作等。另外,nifi 使用基于元件的擴充模型用以為複雜的資料流快速增加功能,開箱即用的元件中,處理檔案系統的包括 ftp,sftp 以及 http 等,同樣也支援 hdfs。

<a href="http://nifi.apache.org/index.html" target="_blank">apache nifi</a>

  另外,還有 facebook scribe,apache chukwa,netflix suro,apache samza,cloudera morphline,hiho 等套件就不一一介紹了,大家可以下去了解這些資料采集套件相關内容。

  thrift 是一個軟體架構,用來進行可擴充且跨語言的服務開發。它結合了功能強大的軟體堆棧和代碼生成引擎,用以建構在 c++,java,python,ruby 等程式設計語言上,進行無縫,高效的銜接。其最初由 facebook 開發用做系統内各個語言之間的 rpc 通信,後 facebook 貢獻給 apache,目前成為 apache 的頂級項目之一。

<a href="http://thrift.apache.org/" target="_blank">apache thrift</a>

  zookeeper 分布式服務架構是 apache hadoop 的一個子項目,它主要是用來解決分布式應用中經常遇到的一些資料管理問題,如:統一命名服務,狀态同步服務,叢集管理,分布式應用配置項的管理等。

<a href="http://www.cnblogs.com/" target="_blank">apache zookeeper</a>

<a href="http://www.cnblogs.com/" target="_blank">google chubby</a>

  apache avro 是 hadoop 中的一個子項目,也是 apache 中的一個獨立的項目,avro 是一個基于二進制資料傳輸高性能的中間件。在 hadoop 的其它項目中,例如 hbase,hive 的 client 端與服務端的資料傳輸也采用了這個工具。avro 是一個資料序列化的系統,它可以将資料結構或對象轉化成便于存儲或傳輸的格式。avro 設計之初就用來支援資料密集型應用,适合于遠端或本地大規模資料的存儲和交換。擁有一下特點:

豐富的資料結構類型

快速可壓縮的二進制資料形式,對資料二進制序列化後可以節約資料存儲空間和網絡傳輸帶寬

存儲持久資料的檔案容器

可以實作遠端過程調用 rpc

簡單的動态語言結合功能

<a href="http://avro.apache.org/" target="_blank">apache avro</a>

  另外,還有 apache curator,twitter elephant bird,linkedin norbert 等工具,這裡就不一一介紹了。

  在 hadoop 中執行的任務有時候需要把多個 mr 作業連接配接到一起,這樣才能達到目的。在 hadoop 生态圈中,oozie 可以把多個 mr 作業組合到一個邏輯工作單元中,進而完成更大型的任務。oozie 是一種 java web 應用程式,它運作在 java servlet 容器中(即:tomcat)中,并使用資料庫來存儲一下内容:

工作流定義

目前運作的工作流執行個體,包括執行個體的狀态和變量

  oozie 工作流是放置在控制依賴 dag 中的一組動作(如 hadoop 的 mr 作業,pig 作業等),其中指定了動作執行的順序。

<a href="http://oozie.apache.org/" target="_blank">apache oozie</a>

<a href="https://github.com/apache/oozie" target="_blank">oozie on github</a>

  hadoop 工作流管理。提供友好的 web ui 界面進行批處理作業排程(定時或及時)。

<a href="http://azkaban.github.io/" target="_blank">azkaban home</a>

<a href="https://github.com/azkaban" target="_blank">azkaban on github</a>

  apache falcon 是一個面向 hadoop 的,新的資料處理和管理平台,設計用于資料移動,資料管道協調,生命周期管理和資料發現。它使用終端使用者可以快速的将他們的資料以及相關的處理和管理任務上載到 hadoop 叢集。在 apache falcon 中,基礎設施端點,資料集,處理規則均是聲明式的。這種聲明式配置顯式定義了實體之間的依賴關系。這也是該平台的一個特點,它本身隻維護依賴關系,而并不做任何繁重的工作,所有的功能和工作流狀态管理需求都委托給工作流排程程式來完成。

<a href="http://falcon.apache.org/" target="_blank">apache falcon</a>

  用于建立,管理,監控 hadoop 叢集的工具,可以很友善的安裝,調試 hadoop 叢集,支援的平台元件也是越來越多,如 spark,storm 等計算模型,以及資源排程平台 yarn 等,都能通過 ambari 輕松部署管理。

<a href="http://ambari.apache.org/" target="_blank">apache ambari</a>

  cloudera 公司的産品,類似于 ambari 産品,用于建立,管理,監控 hadoop 叢集。

<a href="http://www.cloudera.com/downloads/cdh/5-2-0.html" target="_blank">cdh</a>

  你可以制作出漂亮的資料,使用 sql,scala 或者其它。它擁有以下特性:

資料收集

資料發掘

資料分析

資料可視化和內建

  目前支援的中間件有:spark,md,sh,hive,tajo,flink,cassandra,phoenix,kylin 等

<a href="http://zeppelin.apache.org/" target="_blank">apache zeppelin</a>

  hadoop 生态圈是非常龐大的,上述列舉的隻是其生态圈中常用的一部分,下圖給大家展示了本篇部落格相關内容的關聯圖,如下圖所示:

Hadoop 生态系統1.概述2.内容3.總結4.結束語

  這篇部落格就和大家分享到這裡,如果大家在研究學習的過程當中有什麼問題,可以加群進行讨論或發送郵件給我,我會盡我所能為您解答,與君共勉!