24h購物| | PChome| 登入
2008-10-06 00:25:06| 人氣12,242| 回應1 | 上一篇 | 下一篇

Hadoop 的簡介!!

推薦 0 收藏 0 轉貼0 訂閱站台

 

     Hadoop 是什麼? 它本來是 Apache.org Lucene 下的一個專案,由 Dong Cutting 所開發 (1) ,而在 Lucene 的發展歷史中 (2),在搜尋引擎的應用上因 Google 的走紅,而使 Dong Cutting 也參考了由 Google 所發表的 MapReduce GFS ( Google File System) 的發表論文後 ( Google 是用這兩樣技術進行電腦的聯合運算,也就是我們最近耳熟能響的「雲端運算」技術 ),在 Hadoop 專案中,將 Map/Reduce GFS 進行了兩方面的實作,從這個開發原始碼的運用,使得大型機器在快速運算的能力延伸到了多台機器的聯合運算,並且利用分散式的架構概念及日漸成熟的 PC 運算,達到和大型主機類似的功能。廢話一下為什麼開始筆者注意到這一個專案,在我負責的工作中,Java 是常用的計算機語言,而搜尋、 Parser low data data processing 和一堆統計及運算的需求是每天工作所需要的,Lucene 在文詞對應上有許多可以應用的地方,而大量的運算統計在記憶體使用、磁碟空間使用、運算時所需的 CPU 、即時的 I/O 都反應了得到答案的時間。這樣的需求,使筆者在研究平行式運算、RMI 、Grid 上面投入了工作之外的大部分時間 (連出去玩、開車、坐車、甚至睡覺有時候還會爬起來想架構),如此二年多的時間在這上面,希能分享一些成果於對此方面有興趣者,特寫此文,如有不足或缺失,還請大家提點。

 

 

      搜尋項目中,在 Java 裡面最出色的兩大專案就是 「 Lucene 」 和 「 MG4J(3),Lucene 不是一個可以現成使用的搜尋引擎,應該稱它為一個 Full-Text Search Framework ,經由對全文檢索的一些共通的特性由 Dung 所實作的搜尋核心,再加上應用而產生符合自己需求的 Full-Text Search Engine 。

 

      在 Grid System 是源自於在  1990s 前 的"The Grid: Blueprint for a new computing infrastructure". 中被提到 ( 在 Grid System wiki 的 history 中有詳細的介紹 ),而 MapReduce 和 GFS 的使用概念也非 Google 公司所原創,但它是第一個將其真正完全商業化應用最完整的公司來定義,應不為過,也因為 Google 的應用,這樣的系統架構被大力的推廣和更多開發者和系統者投入其中參與及使用。並且 Globus  也在 Ian Foster, Carl Kesselman and Steve Tuecke 這三位的開發下,有了 Globus toolkits 使得網格的應用更加充分而容易的被使用。

 

        Hadoop (URL:http://hadoop.apache.org/core/ )的專案圖象是一頭可愛的大象,在 Hadoop 的專案網頁裡有它功能的介紹:「Hadoop is a software platform that lets one easily write and run applications that process vast amounts of data.」 一開頭就點明了它用來處理程式在大量檔案的處理。而這個 Hadoop 專案所要應付和解決的方案是什麼呢 ? 在網頁的簡介下也說明的很清楚: 1. Hadoop can reliably store and process petabytes. 用來處理大量的資料和儲存的能力;2. It distributes the data and processing across clusters of commonly available computers. These clusters can number into the thousands of nodes. 將資料和處理程序分散到可以使用的電腦上,並且這些電腦的數量可以達到上千台之多。3. By distributing the data, Hadoop can process it in parallel on the nodes where the data is located. This makes it extremely rapid. 籍由分散檔案的處理,Hadoop 可以平行的運算這些檔案,並且使得檔案的處理變的可以快速的回應。 4. Hadoop automatically maintains multiple copies of data and automatically redeploys computing tasks based on failures. 這一個機制使得 Hadoop 成為可以信賴的運算和放置資料的平台,它可以將運算的程序和放置的資料在每一個可以運行的 node (端點) 間進行複製和自動化的備份,可以避免執行中的程式或存放的資料,因為電腦的硬體或系統上的損壞而使程式消失或檔案損毀。

 

                

( Hadoop 的運算架構)

 

 

      在於 Hadoop 上的聯合應用,在開發工具上現在已經有相關的 plugin 可以在 Eclipse 編輯器上可以做擴充,而 Hadoop 也在許多開發人員的使用下,版本一步一步的推進到現在的 0.18 版本上(筆者從 2006 的 4 月 8 日版的 0.1.1 版開始使用 Hadoop 來進行一些測試) ,從當始的資料不同步、系統在記憶體使用上的問題、系統執行 too many files opened 這些 problem 中走來,看到 Hadoop 一天一天的成長、但在自己的工作應用上,該如何為它立各名目,讓更多的開發者可以投入在裡面,研發出更強大、更快速的程式系統? 但後來想想、也許不需要,只要將架構再調好,自己 keep walking 、也許有一天需求將來臨,找理由和藉口不如先做、做進去後自然就會有路可以走,於是就在快 2 年半的時間將至的時候,利用了幾個晚上和假日的時間,將開發環境可以在 Windows 和 eclipse 上進行開發、也可以在 Linux 的平台上開始執行 job 上的運算,希望將這個平台在整理好之後,可以再傳播出去;也許不止是在搜尋和資料分析上面,大量的檔案讀取和儲存都應該可以試看看這個解決方案。

 

          

 

 

另外補充 Hadoop 的相關應用上的文章:

  1. Yahoo用Hadoop處理4 PB的網頁 ( 來源: ITHome )

  2. 引用  ITHome 上的圖文 :(來源網址:http://www.ithome.com.tw/itadm/article.php?c=49410&s=4 )


Yahoo用開源的雲端運算技術Hadoop來提供服務

Yahoo於2前年開始參與開源的雲端運算框架Hadoop,並將其使用在內部服務中。今年2月Yahoo發表了目前最大的Hadoop應用,在2千臺伺服器上面,執行超過1萬個Hadoop虛擬機器,來處理超過5 Petabytes的網頁內容,分析大約1兆個網路連結,建立整個網際網路的網頁索引資料,壓縮過的索引資料庫大小,超過300 TB。目前Yahoo已經在日常提供的搜尋服務中,使用Hadoop技術。

 

          好壯觀的伺服器群 , 這是 Yahoo 投入在 Hadoop 上應用的架構.......令人汗顏........


     1Doug Cutting----- Lucene的貢獻者(程式的原始開發者) 是一位非常資深的全文索引/檢索方面的專家,他曾經

               V-Twin  搜索引擎 (AppleCopland作業系統) 的主要開發者,後在Excite擔任高級系統架構設計師,並從事

               於一些INTERNET底層架構的研究。他貢獻出的Lucene的目標是為各種中小型應用程式加入全文檢索功能。

      2 Lucene的發展歷程:早先發佈在作者自己的www.lucene.com,後來發佈在SourceForge2001年年底成為

                  APACHE 基金會jakarta的一個子項目:http://jakarta.apache.org/lucene/,並後來 Dong Cutting Yahoo 之邀參與

                  Hadoop Lucene 的開發工作為贊助,並繼續全職投入在這個原始碼的發展上。

     3:筆者現在手上收集及參考過的 Java 的搜尋引擎列表,除 Lucene MG4J 之外另有:

           (1).「 Egothor」 - One kind of Java search engine and supplemental libraries  Impressive demo is worth a look. Key features include: HTML, PDF, PS, and Microsoft's DOC, and XLS indexing; Golomb, Elias-Gamma and Block coding; Universal stemmer that can process almost any language; Boolean model and Vector model. Egothor is an Open Source, high-performance, full-featured text search engine written entirely in Java. It is technology suitable for nearly any application that requires full-text search, especially cross-platform. It can be configured as a standalone engine, metasearcher, peer-to-peer HUB, and, moreover, it can be used as a library for an application that needs full-text search.

              egothor 的特性

                       * Written in JAVA for cross platform compatibility.
                       * New dynamization algorithm for fast index updating.
                       * Fully 64-bit kernel
                       * Transactions (ACID)
                       * Document revisions, Xdelta
                       * Incremental updates
                       * Queries can be solved in a parallel manner
                       * Able to recognize the most familiar file formats: HTML, PDF, PS, and Microsoft's DOC, and XLS.
                       * High capacity robot which supports robots.txt recommendation.
                       * The best compression methods are used, i.e. Golomb, Elias-Gamma, Block coding.
                       * Based on the extended Boolean model which can operate as the Vector or Boolean models.
                       * Universal stemmer that processes any language.

         ( Ref URL :http://www.egothor.org/ )

              

           (2).「 Carrot2 」: It  is a research framework for experimenting with automated querying of various data sources ( such as search engines ), processing search results and their visualization. so It can call  an Open Source Search Results Clustering Engine. It can automatically organize (cluster) search results into thematic categories.

               Carrot2 的特性

                         Carrot2 provides an architecture  for acquiring search results from various sources (YahooAPI, GoogleAPI, MSN Search API, eTools Meta Search, Alexa Web Search, PubMed, OpenSearch, Lucene index, SOLR), clustering the results and visualising the clusters. Currently, 5 clustering algorithms are available that are suitable for different kinds of document clustering tasks.

             

          (Ref URL :http://project.carrot2.org/ )

         

           (3) 「OpenGrok 」:It is a fast and usable source code search and cross reference engine. (也就是文章或程式碼比對的引擎) 。It helps you search, cross-reference and navigate your source tree. It can understand various program file formats and version control histories like SCCS, RCS, CVS and Subversion. OpenGrok provides a fast search engine that can: search for full text, definitions, symbols, path and revision history; limit searches to any subtree (hierarchical search); search query with Google like syntax (eg. path:Makefile defs:target); search for files modified within a date range and search using wild cards like * (many characters) or ? (one character).

           (Ref URL: http://www.opensolaris.org/os/project/opengrok/ )

 

台長: 克理斯 在 Internet!
人氣(12,242) | 回應(1)| 推薦 (0)| 收藏 (0)| 轉寄
全站分類: 不分類

(悄悄話)
2013-05-22 09:42:10
是 (若未登入"個人新聞台帳號"則看不到回覆唷!)
* 請輸入識別碼:
請輸入圖片中算式的結果(可能為0) 
(有*為必填)
TOP
詳全文