投影片中使用了一些非常簡單的社交網路分析(Social Network Analysis),只單純從「量」(社群成員數)來看社群發展,未來有時間應該要來做「質」的分析(活躍的社群成員及其關係)。
投影片中使用了一些非常簡單的社交網路分析(Social Network Analysis),只單純從「量」(社群成員數)來看社群發展,未來有時間應該要來做「質」的分析(活躍的社群成員及其關係)。
Taiwan Hadoop Ecosystem Workshop 2013
Q1
- 活動名稱:Taiwan Hadoop Ecosystem Workshop 2013 Q1
- 活動時間:2013/3/10(日) 10:00~16:00
- 活動地點:精誠內湖大樓(台北市內湖區瑞光路318號) 1F 演講廳
- 活動名額:開放 80 名座位,最高上限 100 名。依實際報到為準。
- 活動費用:本活動不收取費用,感謝精誠資訊贊助場地。
- 報名網址: https://www.facebook.com/events/456789427727154/
- 活動議程:
09:30~10:00 報到 10:00~11:00 運用 Lucene 對於 Spamming Botnet 進行快速索引與分群 (資策會 毛敬豪 博士) 11:00~12:00 HBase 簡介 : 資料格式與運作架構 (亦思 范姜冠宇 技術長) 12:00~13:00 中場休息 (這次是社群自發性活動,恕暫不提供午餐) 13:00~14:00 Solr Tutorial (趨勢, Javen Tsai) 14:00~15:00 Riak Tutorial (NoSQL Taiwan , Von Stark) 15:00~16:00 不可能更容易的 Hadoop 平台 -- Etu Appliance 技術內涵與 Demo (Etu 陳昭宇 首席顧問)
- Taiwan Hadoop Ecosystem Workshop 2013 Q1
- 10:00~16:00 March 10, 2013
- SYSTEX Building, Neihu, Taipei, Taiwan
- Agenda :
10:00~11:00 Indexing and clustering Spamming Botnet using Lucene (By III) 11:00~12:00 HBase Tutorial (By is-land CTO Hurbert ) 13:00~14:00 Solr Tutorial (By Trend Micro, Javen Tsai) 14:00~15:00 Riak Tutorial (NoSQL Taiwan , Von Stark) 15:00~16:00 Hadoop Appliance (By SYSTEX Etu)
Hadoop 叢集佈建初探 - 以 hiCloud 為例
國家高速網路與計算中心 王耀聰 副研究員
(續上篇)
Hadoop叢集版初探 -hiCloud Ubuntu Linux 版
上個小節我們介紹了如何在Windows上建立一個Hadoop的實驗環境,然而Windows版本存在著許多小問題,像是Cygwin的路徑與Java
Runtime認知的Windows路徑不同,因此許多時候,您在下指令的時候,還必須要透過cygpath指令將Cygwin路徑轉換成Windows路徑,相當不便。其次,假設您想要把多台hadoop4win串起來,有許多先決條件,像是必須要有不同的電腦名稱、要有相同的使用者名稱跟檔案存取權限。因此,一般我們在提供商業運轉的Hadoop環境時,仍舊會採用Linux版本。
雲端運算的五大基礎特徵中,第一點是「隨需自助服務」,其背後隱藏著「標準化」與「自動化」的精神。本文為了讓每位讀者能有標準化的實作環境,免除不同Linux版本造成的操作問題,此次採用的是中華電信hiCloud的Ubuntu 10.04虛擬機器當作示範架設Hadoop叢集版的環境。底下將示範如何在十台Ubuntu 10.04的虛擬機器上,建置一個Hadoop叢集。由於Hadoop安裝的指令繁瑣,筆者這裡提供一個自動化的安裝腳本程式,各位可至http://github.com/jazzwang/hicloud-hadoop或http://hidoop.sf.net下載原始碼。以下我們用圖解的方式,說明如何使用hicloud開啟十台虛擬機器,並設定成Hadoop叢集。
![]() STEP 1:請連線至hicloud.hinet.net 並點選右上角「客戶登入」 |
STEP 2:若您不是中華電信用戶, 請先加入會員,然後用取得帳號登入 |
STEP 3:點選上方「雲運算」 |
STEP 4:點選左方「虛擬主機」 |
STEP 5:點選左上角「申請」 |
STEP 6:確認同意中華電信hicloud租約 選擇「Linux微運算型XS」,按「下一步」 |
STEP 7:選擇「Ubuntu 10.0,32bit」 |
STEP 8:用hdp命名,產生10台虛擬機器 |
STEP 9:等待申裝狀態變為「已申裝」 |
STEP 10:請確認供裝狀態變為「已申裝」 點左上角「全選」,並選「開機」 |
STEP 11:點選右上角「預設密碼」,將password.zip儲存到桌面 |
STEP 12:用預設密碼解壓縮password.zip並匯入CSV格式的密碼檔案 |
STEP 13:我們從密碼表中挑選第一台 用PieTTY連線到該台虛擬機器 |
STEP 14:預設請使用root帳號登入, 密碼請根據您的密碼表輸入六碼預設密碼 |
做到這邊,我們已經把十台虛擬機器開機。請從hiCloud介面上確認每一台虛擬機器都已經進入「已開機」的狀態,接著使用您慣用的SSH連線軟體,這裡我們使用的是PieTTY,可以自http://ntu.csie.org/~piaip/pietty/ 下載。由於hicloud-hadoop自動安裝腳本是針對Linux環境撰寫的,因此我們直接挑選其中一台來進行安裝。您也可以在自己的Linux環境上執行以下的步驟。在執行hicloud-hadoop自動安裝腳本前,有一些前置作業:(1)產生SSH連線用的金鑰;(2)安裝Perl的Expect.pm函式庫,因為我們會使用Expect來幫忙您自動填入預設密碼,登入另外九台虛擬機器,並進行Hadoop安裝作業。現在請您在登入第一台虛擬機器的PieTTY視窗內中輸入以下兩個指令:
|
~# ssh-keygen -t rsa -P "" ~# apt-get install libexpect-perl |
接下來,讓我們下載hicloud-hadoop自動安裝腳本,並且解壓縮安裝檔。然後在hicloud-hadoop目錄底下建一個conf子目錄。
|
~# wget http://nchc.dl.sourceforge.net/project/hidoop/0.0.1/hicloud-hadoop-0.0.1.tar.gz ~# tar zxvf hicloud-hadoop-0.0.1.tar.gz ~# mkdir -p hicloud-hadoop/conf |
接著,使用記事本先編輯兩個檔案,一個叫master,一個叫slave。可用PieTTY或WinSCP上傳這兩個檔案到hicloud-hadoop/conf 底下,或參考底下的作法在conf底下建立兩個設定檔。
|
~# cat > hicloud-hadoop/conf/master << EOF 203.66.14.171 root 800773 EOF ~# cat > hicloud-hadoop/conf/slave << EOF 203.66.14.40 root 154737 ................. 210.65.10.139 root 367578 EOF |
以上的IP、帳號、密碼三個欄位,您可以直接從CSV貼到記事本,加入中間的空白,在貼到命令列。最後切換到hicloud-hadoop目錄,然後執行 install-ubuntu 自動安裝腳本。
|
~# cd hicloud-hadoop hicloud-hadoop# ./install-ubuntu |
|
從密碼表中挑選第一台的IP、帳號、密碼 貼到記事本,補上空格,然後轉貼到master |
從密碼表中挑選剩下的IP、帳號、密碼 貼到記事本,補上空格,然後轉貼到slave |
等自動安裝腳本執行完畢後,您會看到類似底下的訊息。此時,點選兩個網址,就會看到Hadoop的HDFS NameNode與MapReduce JobTracker網頁。
|
|
|
|
|
|
|
|
|
雲端精算師:好的設計可以省下更多錢
做到這邊,各位讀者應該可以繼續在hiCloud的十台虛擬機器上練習在Hadoop4Win的指令。不過這裡要提醒的一件很重要的事情:「不同於Amazon EC2有開機才計價,hiCloud是從申裝開始計費,退租才停止計費,就像您租用手機門號一樣,不管有沒有開機都會計費」。因此建議您如果口袋不夠深的話,練習完麻煩一台一台把虛擬機器退租吧!一節課程大約花個兩三個小時,14塊台幣/小時,跟買杯超商咖啡差不多,這就是雲端帶給各位的新學習環境。
|
免得收到帳單會很痛! |
|
學Hadoop叢集佈署 |
倘若您手邊有兩台以上的實體機器,或者多核心效能強大的伺服器,不妨安裝VirtualBox虛擬化軟體,在一台電腦上建立兩至三台Ubuntu 10.04的Linux環境,各位聰明的讀者可以透過上述的步驟來安裝您專屬的Hadoop叢集,就算是一個小型的私有雲了。
在本文最後,筆者想提出幾個關於「雲端精算師」的軟體設計精神,與各位讀者分享。目前hicloud-hadoop 0.0.1版本是循序安裝,因此機器愈多,安裝時間愈長。未來將加入多執行緒的程式碼,讓安裝流程能同時進行。對hiCloud這種按時計費的公有雲而言,如何節省安裝時間變得很重要。未來hiCloud若能讓使用者建立自己專屬的虛擬機器範本,相信能有效降低各位讀者荷包的負擔。
其次,中華電信的計價模式還包含網路流量,因此如何減少網路傳輸也是採用公有雲服務應該要思考的第二個重點。目前的腳本每一台虛擬機器都會重複下載Java與Hadoop安裝檔。若能把Hadoop安裝檔先存在同一個公有雲提供的「儲存服務」,讓資料來自於「內部網路」而非「網際網路」,不納入流量計費,那也是對用戶有利的計價模式。
最後,若能夠把要處理的事情變成自動化,計算完就關閉虛擬機器,以上這些考量就是在雲端時代程式設計師應該具備的「雲端精算師」精神,擁有節省成本的思考模式將是您未來在職場上的新競爭力!
Hadoop 叢集佈建初探 - 以 hiCloud 為例
國家高速網路與計算中心 王耀聰 副研究員
(乘上篇)
Hadoop單機版初探 - Windows 版
根據hadoop官方文件的建議,Hadoop最佳營運案例主要是在Linux作業系統底下運行。但在台灣,多數資訊從業人員仍以Windows為主要的作業系統。筆者為了降低各位學習Hadoop的門檻,撰寫了一套名為Hadoop4Win的懶人包安裝程式。目前在Windows XP與Windows 2000環境下測試正常,至於Windows 7環境下目前因為安全性權限較嚴格,需關閉UAC,常不易安裝成功,因此這次我們以Windows XP環境來做示範。
首先,請到http://hadoop4win.nchc.org.tw或http://hadoop4win.org下載0.1.5版本的hadoop4win完整安裝檔。Hadoop4win 0.1.5目前包含五大軟體組成:(1) Cygwin;(2) JDK 1.6.0 update 18;(3) Hadoop 0.20.2;(4) HBase 0.20.6;(5) Ant 1.8.2。因此整個完整版懶人包大約有189 MB,請點擊hadoop4win-setup-full_0.1.5.exe執行檔開始進行安裝的動作。
備註:由於hadoop4win會在安裝資料夾寫入數量眾多的檔案,假如您有安裝防毒軟體,安裝時間可能會比較長(因為每個檔案都被掃描過一次)。倘若您希望縮短安裝時間,可暫時性關閉防毒軟體。
當您完成hadoop4win的安裝後,有兩種方式可以在Windows上啟動Hadoop。其一是從「開始」選單選取
start-hadoop捷徑。其二是先點選
hadoop4win
捷徑,進入Cygwin指令操作的介面,才下指令start-hadoop來啟動Hadoop的五個背景服務(亦及NameNode、DataNode、JobTracker、TaskTracker與SecondaryNameNode)。
備註:安裝過程中,Windows防火牆會跳出警告說有Java程式嘗試開啟網路連線埠,這是因為Hadoop背景服務至少會開啟五個網路連線埠來進行底層的RPC通訊,請選擇「解除封鎖」。
接著,您可以根據hadoop4win網頁的說明,學習基本的Hadoop指令操作。礙於版面篇幅,這裡我們僅列舉三個指令操作來進行說明。首先,第一個指令叫jps,這個指令顧名思義就是列出所有java
process。單機版的Hadoop4Win,基本上應該要有五個Java程序。因此,倘若您無法看到如圖的五個Java程序名稱(前面的數字為PID,每次執行會不同),那代表您的電腦可能記憶體不足(最低需求為512MB,建議至少有1GB記憶體)。倘若您在執行上遇到任何問題,歡迎到forum.hadoop.tw提問。
如果您可以正常看到jps出現的五個Java程序,代表您的Hadoop環境已經在背景正常執行了。此時您可以點選「開始」選單的「NameNode
Web UI」與「JobTracker
Web UI」,或者直接用瀏覽器開啟http://localhost:50070與http://localhost:50030的網址。
第二個指令叫作hadoop
fs,這個指令是用來驗證Hadoop分散式檔案系統(HDFS,Hadoop
Distributed File
System)的功能是否正常。請在Cygwin指令視窗鍵入以下指令,將位於安裝目錄(c:\hadoop4win)的opt\hadoop\conf-pseudo子目錄,上傳到HDFS的抽象檔案系統:
|
$ cd /opt/hadoop $ hadoop fs -put conf-pseudo input ; hadoop fs -ls |
最後一個指令叫作hadoop
jar,這個指令是用來驗證Hadoop的MapReduce運算環境功能是否正常。請在Cygwin指令視窗中鍵入以下指令,將剛剛上傳到HDFS的input目錄,共計13個檔案,進行「字數統計(Word
Count)」的MapReduce範例運算。
|
$ hadoop jar hadoop-0.20.2-examples.jar wordcount input output |
|
STEP 1:首先請選擇語系 「繁體中文,Chinese (Traditional)」 |
|
STEP 2:本軟體採用Apache 2.0授權, 請按「我接受」 |
|
STEP 3:如果您不需要HBase跟Ant, 可以取消選取 |
|
STEP 4:選擇安裝目標資料夾, 預設為C:\hadoop4win |
|
STEP 5:接著安裝程式會開始解壓縮 |
|
STEP 6:接著會跳出Cygwin的安裝畫面 |
STEP 7:安裝完成後,請按關閉結束 |
STEP 8:您可以從「開始」→「程式集」 →「hadoop4win」點選start-hadoop 啟動Hadoop服務於背景 |
Hadoop 叢集佈建初探 - 以 hiCloud 為例
國家高速網路與計算中心 王耀聰 副研究員
用Hadoop打造您專屬的SMAQ資訊架構
隨著資訊科技的快速演進,我們每天產生數量眾多的數位文件、圖片、音樂跟影片等。根據EMC委託IDC對數位宇宙(Digital Universe)的研究報告指出,2007年全球人類所產生的資料量已經遠超過全球所有儲存設施的總容量,意味著我們已經進入資料大爆炸(Data Explosion)的時代。2011年數位宇宙的總容量更高達1.8 ZB(Zetabyte, 109 TB),因此2012年可以稱為「巨量資料(Big Data)」的元年。
根據Gartner CIO Agenda 2012的調查,2012年最重要的三大資訊科技分別為「商業智慧(Bussiness Intelligence,BI)」、「行動科技(Mobile Technology)」與「雲端運算(Cloud Computing)」。事實上商業智慧早在Gartner CIO Agenda 2009就名列第一名,為何四年後捲土重來?那是因為要達成商業智慧之前,企業必須先具備處理巨量資料的資訊架構,也就是2010年6月Edd Dumbill 於「The SMAQ stack for big data」一文中提出的SMAQ架構。



SMAQ架構說明了處理巨量資料須具備儲存(Storage)、平行運算(MApReduce)與查詢(Query)三層資訊架構。其中,儲存層用來儲存分散而沒有關聯(Non-relational) 的非結構化資料 (unstructured data),平行運算層採用谷歌提出的MapReduce演算法,將龐大的非結構化資料轉化成結構化資料(資訊,Information),並且將結構化資料儲存到查詢層的資訊系統,如資料庫、資料倉儲等。
透過SMAQ資訊架構,企業還再次將資料倉儲的龐大資料經過MapReduce運算,運用統計的方法,找出重複出現的經驗法則(知識,Knowledge)。企業有了這些經驗法則,才能夠進一步對充滿變數的未來進行預測,最後形成某種智慧(Wisdom)。十年前知識管理專家所提出的DIKW模型(Data、Information、Knowledge、Wisdom),如今終於在資訊系統中獲得了具體的實現。
Hadoop這套自由軟體實現了類似Google File System的儲存層,提供給企業一個具備彈性擴充的儲存設施;其次它也實作了MapReduce演算法,並且將谷歌的在地運算(Data Locality)精神融入Hadoop的核心設計中,大幅降低了資料搬運的時間與頻寬成本。此外,建構於Hadoop之上,存在著HBase分散式資料庫與Hive資料倉儲等查詢層軟體。
因此,透過導入Hadoop生態系相關軟體元件,能提供貴單位符合SMAQ的資訊架構。像Yahoo、Facebook、Tweeter、LinkedIn、Joost等均已採用Hadoop當背後的支援火力。連Oracle、Microsoft SQL Server都提供Hadoop的資料庫連結元件,足見業界對於Hadoop的重視。
Hadoop經過七年的開發,阿帕契軟體基金會(Apache
Software
Foundation)終於在2012年3月釋出1.0.1版本,其重點在於安全性的改良以及對HBase有更好的支援。此外1.0版也算是Hadoop成熟到能支持企業營運任務的重大里程碑。即便如此,目前Hadoop最令人望之怯步的關鍵點在於「不夠友善」。筆者自2009年起便在台灣推動Hadoop使用者社群(http://www.hadoop.tw),經營Hadoop論壇(http://forum.hadoop.tw),但初學者往往第一個要面對的問題是缺乏佈建Hadoop叢集所需的背景知識,如Linux、Java語言等。因此,撰寫本文讓更多資訊從業人員得以從實例操作中,學習如何使用Hadoop生態系。
(待續)
PS. 比較有趣的是今年大家都用英文命名,真是國際化呀!!
| Developer / 開發者 | ||
| 楊詠成(Gibson Yang) / 台灣雅虎 Yahoo! | oozie introduction | oozie introduction & experience sharing |
| Chia-Hung Lin | Bulk Synchronous Parallel | Hadoop MapReduce[1]. is a popular open source framework inspired by functional programming 's map and reduce functions, saving developers lots of works by covering many underlying complicated tasks. However, not all tasks fit into MapReduce's scenario, graph related computation task (e.g. social network analysis) is one such example. Google therefore developed their in-house product, Pregel[2], based on Bulk Synchronous Parallel[3] - a bridge model suitable for performing iterative algorithms, performing large scale graph processing. Outline: 1. What is Bulk Synchronous Parallel? 2. Apache Hama 3. Comparison between Hadoop MapReduce and Apache Hama [1]. http://hadoop.apache.org/mapreduce/ [2]. http://dl.acm.org/citation.cfm?id=1582723 [3]. http://dl.acm.org/citation.cfm?id=79173.79181 |
| Laurence Liew / Revolution Analytics, Asia Pacific. General Manager | Big Data Analytics - Trends and Best Practises | Using case studies from consumer behavior analytics to text mining and sentiment analysis, this session introduces big data analytics & the field of Data Science. An overview of data science and the data scientist toolkit will be presented. A discussion on use of R and Hadoop will also be presented. |
| Application / 應用案例 | ||
| 講者 / 單位名稱 | 演講主題 | 演講摘要 |
| 辜文元 / 逢甲大學GIS中心 | Hadoop於地理資訊系統之應用案例分享 | 近年來由於遙測技術之快速發展,單幅影像解析度大幅提高使得檔案需要更大的儲存空間,此外動態攝影在環境觀測與記錄使用上也愈來愈廣泛,資料動輒以GB或TB為單位成長,使得遙測資料儲存管理的需求性日益增加。面對如此巨量的資料量往往導致傳統伺服器頻繁的出現儲存空間不足的狀況,雖然傳統伺服器可以增加硬碟來增加儲存空間,但垂直的空間擴展有一定的限制,如何因應日益增加的影像儲存需求,將會是一個很重要的課題。 本研究提出以Hadoop來解決巨量遙測影像儲存問題,利用其內建的HDFS分散式檔案系統之分散儲存特性,將影像檔案分散儲存到不同的雲端節點上,當客戶端數量或客戶端存取量增加時,由於檔案分散儲存,大幅提昇客戶端存取的效率。 |
| Chun-Han Chen / OgilvyOne | Mohohan: An on-line video transcoding service via Hadoop | A famous cloud computing file system and developing framework named Hadoop is mainly designed for massive textual data management, such as counting, sorting, indexing, pattern finding, and so on. However, it is merely to seek a multimedia-oriented service via Hadoop. Mohohan is an on-line multimedia transcoding system for video resources, which implemented with Amazon Web Service (AWS) EC2, AWS S3, AWS EMR, Hadoop, and ffmpeg. Its goal is reducing the overall execution time by parallel transcoding via the Hadoop cluster. The concept of Mohohan is simple: 1) to divide the video into several chunk of frames, 2) to transcode the chunks in parallel with multiple nodes (i.e., task tracker) of Hadoop cluster, and 3) to merge the transcoded results into the output. On the homogeneous SaaS comparison, a test report from an impartial third party organization named CloudHarmony has been chosen. Finally, the experiment result shows that Mohohan performs quite better than other on-line video transcoding services mentioned in the test report, such as Encoding, Zencoder, Sorenson, and Panda. |
| Vincent Chen / TCloud / Business Development Director | 精準行銷上的應用- Hadoop in 移動裝置上網行為分析 | 精準行銷上的應用- Hadoop in 移動裝置上網行為分析: 此應用在於Hadoop平台上,利用MapReduce等相關技術,整合各種移動裝置用戶資料,利用語意分析、資料探勘等分詞、分類技術,定義出完整用戶profile,除了將分析結果轉化成行銷能力,並最終實現人與內容、人與商品、人與人的智能配對。 |
| Administrator / 維運者 | ||
| Jason Shih / Etu, SYSTEX Corp. | Hadoop Security Overview - From Security Infrastructure Deployment to High-Level Services | The increasing trend of adoption Hadoop open-source framework for speedy data processing and analytics capabilities for organizations to manage huge data volume have brought attention to enterprise wide security concern aiming for fine grain control of sensitive information and isolation from different level/group of access on sharing storage or computing facilities. Prior to Hadoop 0.20, Unix-like file permission were introduced, providing also cluster-wide simple authentication mechanism but lack of access control per job queue, submission and other operations. With Hadoop's new security feature and it's integration with Kerberos, it's now possible to bring strong authentication and authorization to ensure rigorous access control to data, resources and also isolation between running tasks. In this presentation, we will cover the deployment details of Hadoop security on cluster environment and implementation on high-level services base on kerberized security infrastructure. We introduce also the Etu Appliance providing fast-deployment, system-automation and built-in feature of cross-realm trust mechanism which fulfill the interoperation between existing Active Domain or external LDAP realm and help reducing both integration and operation-wide overhead from administrators. |
| Kenneth Ho | Hadoop hardware and network best practices. | |
|
首先,感謝 2011 年 12 月各位 Hadoop 使用者的熱情參與,也感謝中華電信訓練所的場地支援,讓第三屆台灣 Hadoop 使用者社群會議能圓滿落幕。上個月拿到錄影檔案,後續會再另文公佈相關錄影連結。有鑑於 2012 年上半年海量資料(Big Data)相關議題持續發燒,今年度感謝趨勢科技(Trend Micro)的邀約,擬將「第四屆台灣 Hadoop 使用者會議」擴大舉辦為「Hadoop in Taiwan 2012」。在此特別感謝中研院自由軟體鑄造場協助申請場地並贊助部份費用。活動目前初步規劃如下:
- 會議時間:2012 年 10 月 02 日(週二)
- 會議地點:中央研究院人文社會科學館 國際會議廳
(台北市南港區研究院路二段128號) - 主辦單位:趨勢科技
國家高速網路與計算中心 - 協辦單位:中研院自由軟體鑄造場
議程規劃:
| 時間 | 國際會議聽 | 第一會議室 | 第二會議室 |
| 09:00~09:10 | Opening / 開幕式 主辦單位 | ||
| 09:10~09:30 | Special Guest / 特別來賓 趨勢科技董事長 Steve Chang (待邀請) | ||
| 09:30~10:10 | Keynote: Cutting Edge Hadoop Technology and the Trend Andrew Purtell (Hadoop 架構師,HBase 主要貢獻者) | ||
| 10:10~10:20 | Break / 中場休息 | ||
| 10:20~11:00 | Keynote: Machine Learning in Cloud Era Grant Ingersoll (Apache Mahout 機器學習專案創始人) | ||
| 11:00~11:40 | Keynote: 趨勢科技的雲端發現之旅 - 以 Hadoop 建構企業核心競爭力的歷程分享 陳永強 (趨勢科技雲端解決方案總負責人) | ||
| 11:40~12:00 | Talk with Expert / 與專家有約 Grant Ingersoll, Andrew Purtell, 陳永強 | ||
| 12:00~13:00 | Lunch / 午餐 | ||
| Developer / 開發者 | Administrator / 維運者 | Application / 應用案例 | |
| 13:00~13:40 | 實用的海量資料查詢 HIVE & PIG | Hadoop 在多租戶環境 (Multi-tenancy) 的安全性確保 | Hadoop/HBase 於地理資訊系統之應用案例分享 |
| 13:40~14:20 | Mahout in Practice - 整合海量資料處理與機器學習 | Name Node 的高使用性設計 - 以 Facebook 的 Avatar Node 為例 | Ad hoc Query - 輕輕鬆鬆查詢海量資料 |
| 14:20~14:30 | Break / 中場休息 | ||
| 14:30~15:10 | 設計高效能 HBase Schema
-從了解HBase運作方式與資料特徵 | Hadoop 維運經驗分享 -規劃 Hadoop營運該注意的事項 | Hadoop 影音轉檔平台 Hadoop process video format transfer |
| 15:10~15:50 | 運用 Graph Database 對複雜的圖形關係的搜索 | Hadoop 網路設計、效能優化與監控 | Hadoop在精準行銷上的應用 |
| 15:50~16:00 | Break / 中場休息 | ||
| 16:00~16:40 | TBD | TBD | TBD |
| 16:40~16:50 | Closing / 閉幕式 主辦單位 | ||
目前除了上午時段的 Keynote 講者很榮幸可以邀請到兩位國外講者以外,也感謝趨勢科技不吝與各界分享他們運用 Hadoop 的相關經驗。下午時段將分為「開發者」、「營運者」與「應用案例」三個平行議程,目前已先由主辦單位草擬幾個題目,但仍在積極徵求講者。因此在此想詢問社群對於不同的議題提出建議,也歡迎有興趣分享相關經驗的熱血社群朋友,來信
重要日期:
- 公開徵求講者:2012/08/24(五) 16:00 截止
- 公告候選議程:2012/08/27(一) 16:00 公佈
- 社群議程票選:2012/08/31(五) 16:00 截止
- 公告議程初版:2012/09/07(五) 16:00 公佈
重要連結:
當你想要開始體驗 Spring Hadoop 的時候, 你會遇到各式各樣奇怪的問題, 目前也有人開始陸續回報了.
如果你只是想要簡單的試用一下, 又不想要自己解決這些疑難雜症, 建議大家可以參考下面的步驟來快速體驗一下 Spring Hadoop 的威力.
- 環境要求: Hadoop 0.20.2+
http://trac.nchc.org.tw/cloud/wiki/Hadoop_Lab1
當然你也可以直接申請國網中心的 Hadoop 環境來使用
http://hadoop.nchc.org.tw/
安裝之後, 那就讓我們來開始吧...
- Step1. 下載 Spring Hadoop, 這邊是使用 git 去下載, 如果你對 git 不熟悉的話, 也可以直接從官網下載再解壓縮
/home/evanshsu mkdir springhadoop
/home/evanshsu cd springhadoop
/home/evanshsu/springhadoop git init
/home/evanshsu/springhadoop git pull "git://github.com/SpringSource/spring-hadoop.git"
- Step2. build spring-hadoop.jar
/home/evanshsu/springhadoop ./gradlew jar
/home/evanshsu/springhadoop mkdir lib
/home/evanshsu/springhadoop cp build/libs/spring-data-hadoop-1.0.0.BUILD-SNAPSHOT.jar lib/
- Step3. get spring-framework.
/home/evanshsu/spring wget "http://s3.amazonaws.com/dist.springframework.org/release/SPR/spring-framework-3.1.1.RELEASE.zip"
/home/evanshsu/spring unzip spring-framework-3.1.1.RELEASE.zip
/home/evanshsu/spring cp spring-framework-3.1.1.RELEASE/dist/*.jar /home/evanshsu/springhadoop/lib/
- Step4. 修改 build file 讓我們可以把所有的 jar 檔, 封裝到同一個 jar 檔裡面
description = 'Spring Hadoop Samples - WordCount'
apply plugin: 'base'
apply plugin: 'java'
apply plugin: 'idea'
apply plugin: 'eclipse'
repositories {
flatDir(dirs: '/home/evanshsu/springhadoop/lib/')
// Public Spring artefacts
maven { url "http://repo.springsource.org/libs-release" }
maven { url "http://repo.springsource.org/libs-milestone" }
maven { url "http://repo.springsource.org/libs-snapshot" }
}
dependencies {
compile fileTree('/home/evanshsu/springhadoop/lib/')
compile "org.apache.hadoop:hadoop-examples:$hadoopVersion"
// see HADOOP-7461
runtime "org.codehaus.jackson:jackson-mapper-asl:$jacksonVersion"
testCompile "junit:junit:$junitVersion"
testCompile "org.springframework:spring-test:$springVersion"
}
jar {
from configurations.compile.collect { it.isDirectory() ? it : zipTree(it).matching{
exclude 'META-INF/spring.schemas'
exclude 'META-INF/spring.handlers'
} }
}
- Step5. 這邊有一個特殊的 hadoop.properties 主要是放置 hadoop 相關的設定資料.
另外, 還要把 hd.fs 改成你 hdfs 的設定
如果你是用國網中心 Hadoop 的話, 要把 hd.fs 改成 hd.fs=hdfs://gm2.nchc.org.tw:8020
/home/evanshsu/spring/samples/wordcount vim src/main/resources/hadoop.properties
wordcount.input.path=/user/evanshsu/input.txt
wordcount.output.path=/user/evanshsu/output
hive.host=localhost
hive.port=12345
hive.url=jdbc:hive://${hive.host}:${hive.port}
hd.fs=hdfs://localhost:9000
mapred.job.tracker=localhost:9001
path.cat=bin${file.separator}stream-bin${file.separator}cat
path.wc=bin${file.separator}stream-bin${file.separator}wc
input.directory=logs
log.input=/logs/input/
log.output=/logs/output/
distcp.src=${hd.fs}/distcp/source.txt
distcp.dst=${hd.fs}/distcp/dst
- Step6. 這是最重要的一個設定檔, 有用過 Spring 的人都知道這個設定檔是 Spring 的靈魂
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:hdp="http://www.springframework.org/schema/hadoop"
xmlns:p="http://www.springframework.org/schema/p"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/hadoop http://www.springframework.org/schema/hadoop/spring-hadoop.xsd">
<context:property-placeholder location="hadoop.properties"/>
<hdp:configuration>
fs.default.name=${hd.fs}
</hdp:configuration>
<hdp:job id="wordcount-job" validate-paths="false"
input-path="${wordcount.input.path}" output-path="${wordcount.output.path}"
mapper="org.springframework.data.hadoop.samples.wordcount.WordCountMapper"
reducer="org.springframework.data.hadoop.samples.wordcount.WordCountReducer"
jar-by-class="org.springframework.data.hadoop.samples.wordcount.WordCountMapper" />
<!-- simple job runner -->
<bean id="runner" class="org.springframework.data.hadoop.mapreduce.JobRunner" p:jobs-ref="wordcount-job"/>
</beans>
- Step7. 加上自己的 mapper, reducer
package org.springframework.data.hadoop.samples.wordcount;
import java.io.IOException;
import java.util.StringTokenizer;
import org.apache.hadoop.io.IntWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Mapper;
public class WordCountMapper extends Mapper<Object, Text, Text, IntWritable> {
private final static IntWritable one = new IntWritable(1);
private Text word = new Text();
public void map(Object key, Text value, Context context)
throws IOException, InterruptedException {
StringTokenizer itr = new StringTokenizer(value.toString());
while (itr.hasMoreTokens()) {
word.set(itr.nextToken());
context.write(word, one);
}
}
}
/home/evanshsu/spring/samples/wordcount vim src/main/java/org/springframework/data/hadoop/samples/wordcount/WordCountReducer.java
package org.springframework.data.hadoop.samples.wordcount;
import java.io.IOException;
import org.apache.hadoop.io.IntWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Reducer;
public class WordCountReducer extends
Reducer<Text, IntWritable, Text, IntWritable> {
private IntWritable result = new IntWritable();
public void reduce(Text key, Iterable<IntWritable> values, Context context)
throws IOException, InterruptedException {
int sum = 0;
for (IntWritable val : values) {
sum += val.get();
}
result.set(sum);
context.write(key, result);
}
}
- Step8. 加上 spring.schemas, spring.handlers
http\://www.springframework.org/schema/context/spring-context.xsd=org/springframework/context/config/spring-context-3.1.xsd
http\://www.springframework.org/schema/hadoop/spring-hadoop.xsd=/org/springframework/data/hadoop/config/spring-hadoop-1.0.xsd
/home/evanshsu/spring/samples/wordcount vim src/main/resources/META-INF/spring.handlers
http\://www.springframework.org/schema/p=org.springframework.beans.factory.xml.SimplePropertyNamespaceHandler
http\://www.springframework.org/schema/context=org.springframework.context.config.ContextNamespaceHandler
http\://www.springframework.org/schema/hadoop=org.springframework.data.hadoop.config.HadoopNamespaceHandler
- Step9. 終於到最後一步囉, 這一步我們要把所有的 jar 檔封裝在一起, 並且丟到 hadoop 上面去跑
/home/evanshsu/spring/samples/wordcount hadoop jar build/libs/wordcount-1.0.0.M1.jar org.springframework.data.hadoop.samples.wordcount.Main
- Step10. 最後來確認看看結果有沒有跑出來吧
(http://blog.springsource.org/2012/02/29/introducing-spring-hadoop/ )
This is definetly not a regular usage for spring-hadoop.
I make some change because I met some problems with dependencies and ipc issues.
- pre-requirement: hadoop 0.20.2+
http://trac.nchc.org.tw/cloud/wiki/Hadoop_Lab1
Of course, you can get a free one from NCHC too.
http://hadoop.nchc.org.tw/
- Step1. get spring-hadoop. you can get it by git or download from website.
/home/evanshsu/springhadoop git pull "git://github.com/SpringSource/spring-hadoop.git"
- Step2. build spring-hadoop.jar
/home/evanshsu/springhadoop mkdir lib
/home/evanshsu/springhadoop cp build/libs/spring-data-hadoop-1.0.0.BUILD-SNAPSHOT.jar lib/
- Step3. get spring-framework.
/home/evanshsu/spring unzip spring-framework-3.1.1.RELEASE.zip
/home/evanshsu/spring cp spring-framework-3.1.1.RELEASE/dist/*.jar /home/evanshsu/springhadoop/lib/
- Step4. change the build file. we will assembly all jars into 1 jar file.
description = 'Spring Hadoop Samples - WordCount'
apply plugin: 'base'
apply plugin: 'java'
apply plugin: 'idea'
apply plugin: 'eclipse'
repositories {
flatDir(dirs: '/home/evanshsu/springhadoop/lib/')
// Public Spring artefacts
maven { url "http://repo.springsource.org/libs-release" }
maven { url "http://repo.springsource.org/libs-milestone" }
maven { url "http://repo.springsource.org/libs-snapshot" }
}
dependencies {
compile fileTree('/home/evanshsu/springhadoop/lib/')
compile "org.apache.hadoop:hadoop-examples:$hadoopVersion"
// see HADOOP-7461
runtime "org.codehaus.jackson:jackson-mapper-asl:$jacksonVersion"
testCompile "junit:junit:$junitVersion"
testCompile "org.springframework:spring-test:$springVersion"
}
jar {
from configurations.compile.collect { it.isDirectory() ? it : zipTree(it).matching{
exclude 'META-INF/spring.schemas'
exclude 'META-INF/spring.handlers'
} }
}
- Step5. change hdfs hostname and wordcount paths (wordcount.input.path wordcount.output.path hd.fs) If you use nchc, please change hd.fs to hd.fs=hdfs://gm2.nchc.org.tw:8020
wordcount.input.path=/user/evanshsu/input.txt
wordcount.output.path=/user/evanshsu/output
hive.host=localhost
hive.port=12345
hive.url=jdbc:hive://${hive.host}:${hive.port}
hd.fs=hdfs://localhost:9000
mapred.job.tracker=localhost:9001
path.cat=bin${file.separator}stream-bin${file.separator}cat
path.wc=bin${file.separator}stream-bin${file.separator}wc
input.directory=logs
log.input=/logs/input/
log.output=/logs/output/
distcp.src=${hd.fs}/distcp/source.txt
distcp.dst=${hd.fs}/distcp/dst
- Step6. This is the most important part of spring-hadoop
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:hdp="http://www.springframework.org/schema/hadoop"
xmlns:p="http://www.springframework.org/schema/p"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/hadoop http://www.springframework.org/schema/hadoop/spring-hadoop.xsd">
<context:property-placeholder location="hadoop.properties"/>
<hdp:configuration>
fs.default.name=${hd.fs}
</hdp:configuration>
<hdp:job id="wordcount-job" validate-paths="false"
input-path="${wordcount.input.path}" output-path="${wordcount.output.path}"
mapper="org.springframework.data.hadoop.samples.wordcount.WordCountMapper"
reducer="org.springframework.data.hadoop.samples.wordcount.WordCountReducer"
jar-by-class="org.springframework.data.hadoop.samples.wordcount.WordCountMapper" />
<hdp:script id="clean-script" language="javascript">
// 'hack' default permissions to make Hadoop work on Windows
if (java.lang.System.getProperty("os.name").startsWith("Windows")) {
// 0655 = -rwxr-xr-x
org.apache.hadoop.mapreduce.JobSubmissionFiles.JOB_DIR_PERMISSION.fromShort(0655)
org.apache.hadoop.mapreduce.JobSubmissionFiles.JOB_FILE_PERMISSION.fromShort(0655)
}
inputPath = "${wordcount.input.path}"
outputPath = "${wordcount.output.path}"
if (fsh.test(inputPath)) { fsh.rmr(inputPath) }
if (fsh.test(outputPath)) { fsh.rmr(outputPath) }
// copy using the streams directly (to be portable across envs)
inStream = cl.getResourceAsStream("data/nietzsche-chapter-1.txt")
org.apache.hadoop.io.IOUtils.copyBytes(inStream, fs.create(inputPath), cfg)
</hdp:script>
<!-- simple job runner -->
<bean id="runner" class="org.springframework.data.hadoop.mapreduce.JobRunner" p:jobs-ref="wordcount-job"/>
</beans>
- Step7. Add your self mapper and reducer
package org.springframework.data.hadoop.samples.wordcount;
import java.io.IOException;
import java.util.StringTokenizer;
import org.apache.hadoop.io.IntWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Mapper;
public class WordCountMapper extends Mapper<Object, Text, Text, IntWritable> {
private final static IntWritable one = new IntWritable(1);
private Text word = new Text();
public void map(Object key, Text value, Context context)
throws IOException, InterruptedException {
StringTokenizer itr = new StringTokenizer(value.toString());
while (itr.hasMoreTokens()) {
word.set(itr.nextToken());
context.write(word, one);
}
}
}
/home/evanshsu/spring/samples/wordcount vim src/main/java/org/springframework/data/hadoop/samples/wordcount/WordCountReducer.java
package org.springframework.data.hadoop.samples.wordcount;
import java.io.IOException;
import org.apache.hadoop.io.IntWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Reducer;
public class WordCountReducer extends
Reducer<Text, IntWritable, Text, IntWritable> {
private IntWritable result = new IntWritable();
public void reduce(Text key, Iterable<IntWritable> values, Context context)
throws IOException, InterruptedException {
int sum = 0;
for (IntWritable val : values) {
sum += val.get();
}
result.set(sum);
context.write(key, result);
}
}
- Step8. add spring.schemas and spring.handlers.
http\://www.springframework.org/schema/context/spring-context.xsd=org/springframework/context/config/spring-context-3.1.xsd
http\://www.springframework.org/schema/hadoop/spring-hadoop.xsd=/org/springframework/data/hadoop/config/spring-hadoop-1.0.xsd
/home/evanshsu/spring/samples/wordcount vim src/main/resources/META-INF/spring.handlers
http\://www.springframework.org/schema/p=org.springframework.beans.factory.xml.SimplePropertyNamespaceHandler
http\://www.springframework.org/schema/context=org.springframework.context.config.ContextNamespaceHandler
http\://www.springframework.org/schema/hadoop=org.springframework.data.hadoop.config.HadoopNamespaceHandler
- Step9. build and run
/home/evanshsu/spring/samples/wordcount hadoop jar build/libs/wordcount-1.0.0.M1.jar org.springframework.data.hadoop.samples.wordcount.Main
- Step10. confirm it works












Recent Comments