SlideShare a Scribd company logo
1 of 30
HDInsight for Hadoopers
[蘇國鈞]
[monster.supreme@gmail.com]
1 / 30
Agenda
HDInsight 是 Microsoft 在 Azure 上頭提供的 Hadoop 服務,讓以往繁瑣的 Hadoop
Cluster 設定,變成只是幾個簡單的精靈頁面操作。Hadoop 的 HDFS 分散式檔案系
統,跟 Azure 的 Storage 整合在一起,MapReduce 應用程式則是直接丟到 Cluster 內的
各個 Windows Server 虛擬機器上面執行。這個 Session 主要就是帶領大家在 Microsoft
Azure 上頭從無到有,建置自己的 Hadoop Cluster,進行基本的 Hadoop 應用操作。
1. Hadoop 介紹
2. HDInsight 介紹
3. HDInsight 操作
2 / 30
Bio
在 Java SE 與 Java EE 領域有十多年的講師教學經驗,熟悉 XML/Web Services、
Design Patterns、EJB/JPA 等 Java EE 規格,Struts/Spring Framework/Hibernate 等
Open Source Framework,與 JBoss AS、GlassFish 等 Application Server。
自認為會的技術不多,但是學不會的也不多,最擅長把老闆交代的工作,以及找
不到老師教的技術,想辦法變成自己的專長。
目前負責 Java 與 .NET 雲端運算相關技術的推廣,主要包括 Hadoop Platform 與
NoSQL 等 Big Data 相關應用,Microsoft Azure、Google App Engine、與 CloudBees
等雲端平台的運用,以及 iOS、Android、Windows Phone 等 Smart Phone 的應用程
式開發。
3 / 30
資訊工業策進會 數位教育研究所 資訊技術訓練中心
http://www.iiiedu.org.tw/taipei
4 / 30
Hadoop 介紹
5 / 30
由創建 Lucene 與 Nutch 的 Doug Cutting 所建立
Lucene 是 Full-Featured Text Indexing and Searching Library
Nutch 是 Web Search Engine
依循著 Google 在 2003/2004 年發表的論文來開發
2006 年從 Nutch 計劃獨立出來,稱之為 Hadoop
2008 年 1 月變成 Apache 的 Top-Level Project
2009 年 7 月 Yahoo! 與 Microsoft 在 Search 達成合作協議
2009 年 9 月 Doug Cutting 加入 Cloudera 公司擔任 Architect
2011 年 6 月 Yahoo! 內部的 Hadoop 團隊 Spin Off 出去,成
立 Hortonworks 公司
Hadoop 簡史
6 / 30
Hadoop
的特色
Hadoop
的使用
情境
Accessible:普通 PC 或 VM 組成的 Cluster 就可以跑
Robust:所以要特別處理普通 PC 比較容易掛掉的問題
Scalable:隨著資料量增加,加入新機器就可以
Simple:透過 MapReduce 可以輕易寫出平行處理的程式
具備幾千個 Node 的 Scalability
把軟硬體發生 Failure 當成家常便飯
要處理的檔案多少不是重點,但是每個最好都很大
適合只會寫入一次/只有一人寫入,但是會讀取很多次
7 / 30
Hadoop 平台
兩大部份:Hadoop Distributed File System 與 MapReduce Programming Paradigm
以 Java 開發,但是不支援 Java SE 6 之前的 JDK 版本
原則上 Linux 平台是一個 Hadoop 有支援的 Development 與 Production Platform
Win32 可以是個 Development Platform,但是 Distributed Operation 沒有在 Win32
上面詳細測試過,所以不建議把 Win32 當成 Production Platform
不過,這件事因為 Hortonworks 把 Hadoop 移植到 Windows 平台,然後 Microsoft
又與 Hortonworks 合作,開始在 Azure 上支援 Hadoop 之後,有了改變
8 / 30
什麼是 HDFS
Self-Healing、Distributed File System
以 Block 方式儲存資料,打破 Disk 實體限制
透過 Replication 的方式實現 Reliability
提供熟悉的操作介面,以及可以客製化的 API
提供 RESTful 介面方便客製化
9 / 30
什麼是 MapReduce
一個 Computing Model
把一個處理大量資料的 Job,拆解成許多可以在一堆 Server 平行處理的 Task
把 Code 往 Data 所在的 Server 搬移,減少 Network Traffic
各個 Task 執行的結果,會整合在一起,得到最終的結果
10 / 30
MapReduce 的 Hello, Word Count!
11 / 30
HDInsight 介紹
12 / 30
Microsoft 的 Big Data Solution
13 / 30
什麼是 HDInsight
2012 年 10 月發佈
以 Hortonworks Data Platform (HDP) 平台為基礎
結合 Microsoft Windows 簡易操作與 Hortonworks HDP 的穩定與威力
14 / 30
HDInsight 操作
15 / 30
Demo
1. 建立 Azure Blob Storage
2. 在 Azure Blob Storgae 裡頭建立 Container
3. 建立 HDInsight Cluster
4. 透過 Windows Azure PowerShell 操作
5. MapReduce 示範
6. Hive 示範
7. Power Query for Excel 示範
16 / 30
建立 Azure Blob Storage
17 / 30
建立 Container
18 / 30
快速建立 HDInsight Cluster
19 / 30
自訂建立 HDInsight Cluster
* 3.1 現在已經是正式版本了
20 / 30
透過 WebPI 安裝 Windows Azure PowerShell
21 / 30
透過 PowerShell 登入 Azure
22 / 30
透過 PowerShell 執行 MapReduce 範例
$subscription = "Azure 訂閱名稱"
$cluster = "剛剛建立的 HDInsight Cluster 名稱"
$jarFile = "wasb:///example/jars/hadoop-mapreduce-examples.jar"
$className = "wordcount"
$arguments1 = "wasb:///example/data/gutenberg/davinci.txt"
$arguments2 = "wasb:///example/data/WordCountOutput"
$waitTimeoutInSeconds = 3600
$jobDefinition = New-AzureHDInsightMapReduceJobDefinition
-JarFile $jarFile -ClassName $className -Arguments $arguments1, $arguments2
Select-AzureSubscription $subscription
$job = Start-AzureHDInsightJob -Cluster $cluster -JobDefinition $jobDefinition
Wait-AzureHDInsightJob -Job $job -WaitTimeoutInSeconds $waitTimeoutInSeconds
Get-AzureHDInsightJobOutput -Cluster $cluster -JobId $job.JobId -StandardError
23 / 30
透過 PowerShell 上傳 Hive 測試資料
ggplot R package 裡頭提供了測試資料,下載網址是 http://had.co.nz/data/movies/,
解壓縮之後放在 C:。
$subscription = "Azure 訂閱名稱"
$cluster = "剛剛建立的 HDInsight Cluster 名稱"
Select-AzureSubscription $subscription
Use-AzureHDInsightCluster $cluster
$storageAccountName = "剛剛建立的 Storage 名稱"
$container = "剛剛建立的 Container 名稱"
$file = "C:movies.tab"
$blob = "movies/movies.tab"
$storageAccountKey = Get-AzureStorageKey –StorageAccountName $storageAccountName
$context = New-AzureStorageContext
–StorageAccountName $storageAccountName -StorageAccountKey $storageAccountKey.Primary
Set-AzureStorageBlobContent -Container $container -File $file -Blob $blob -Context $context
24 / 30
透過 PowerShell 執行 Hive 範例
$response = Invoke-Hive -Query @"
create external table movies(title string, year string, length int, budget float, rating float, votes int,
r1 float, r2 float, r3 float, r4 float, r5 float, r6 float, r7 float, r8 float, r9 float, r10 float, mpaa string,
Action boolean, Animation boolean, Comedy boolean, Drama boolean, Documentary boolean,
Romance boolean,Short boolean)
row format delimited fields terminated by 't' lines terminated by 'n';
"@
Write-Host $response
$response = Invoke-Hive -Query @"
load data inpath '/movies/movies.tab' overwrite into table movies;
"@
Invoke-Hive "select count(*) from movies"
Invoke-Hive "select year, count(*) from movies group by year;"
Invoke-Hive -Query @"
insert overwrite directory 'moviesoutput'
select concat_ws(',', cast(size(split(title, ' ')) as string), cast(count(*) as string))
from movies
group by size(split(title, ' '));
"@
25 / 30
Microsoft 商業智慧工具
Hadoop 運算的結果可以透過 ODBC 匯入 Excel,無痛使用 PowerPivot 與 Power
Query/Power View 等 BI 工具分析資料
Hadoop 運算的結果可以透過 Sqoop 匯入 SQL Server,跟 SQL Server Analysis
Service、Reporting Service 等 BI 工具無縫整合
26 / 30
下載 Power Query for Excel 安裝
27 / 30
POWER QUERY -> 取得外部資料 -> 從其他來源 -> 從 Windows Azure HDInsight
28 / 30
圖表化的資料呈現方式
29 / 30
謝謝
Q & A
30 / 30

More Related Content

What's hot

Full Stack Monitoring with Prometheus and Grafana (Updated)
Full Stack Monitoring with Prometheus and Grafana (Updated)Full Stack Monitoring with Prometheus and Grafana (Updated)
Full Stack Monitoring with Prometheus and Grafana (Updated)Jazz Yao-Tsung Wang
 
前端自動化工具
前端自動化工具前端自動化工具
前端自動化工具國昭 張
 
RxJS 6 新手入門
RxJS 6 新手入門RxJS 6 新手入門
RxJS 6 新手入門Will Huang
 
使用Ubuntu架設hadoop
使用Ubuntu架設hadoop使用Ubuntu架設hadoop
使用Ubuntu架設hadooptaishanla
 
快速入坑 Node.js - 0613 SITCON 雲林定期聚
快速入坑 Node.js - 0613 SITCON 雲林定期聚快速入坑 Node.js - 0613 SITCON 雲林定期聚
快速入坑 Node.js - 0613 SITCON 雲林定期聚Lorex L. Yang
 
Hadoop程式開發環境
Hadoop程式開發環境Hadoop程式開發環境
Hadoop程式開發環境立鼎 蘇
 
D2_node在淘宝的应用实践_pdf版
D2_node在淘宝的应用实践_pdf版D2_node在淘宝的应用实践_pdf版
D2_node在淘宝的应用实践_pdf版Jackson Tian
 
云端的数据库
云端的数据库云端的数据库
云端的数据库thinkinlamp
 
FHIR Server 安裝與使用
FHIR Server 安裝與使用FHIR Server 安裝與使用
FHIR Server 安裝與使用Lorex L. Yang
 
Mongo db 簡介
Mongo db 簡介Mongo db 簡介
Mongo db 簡介昱劭 劉
 
Spark sql培训
Spark sql培训Spark sql培训
Spark sql培训Jiang Yu
 
Hadoop开发者入门专刊
Hadoop开发者入门专刊Hadoop开发者入门专刊
Hadoop开发者入门专刊liangxiao0315
 
Hadoop-分布式数据平台
Hadoop-分布式数据平台Hadoop-分布式数据平台
Hadoop-分布式数据平台Jacky Chi
 
初探 Elastic Observability 的實踐方法
初探 Elastic Observability 的實踐方法初探 Elastic Observability 的實踐方法
初探 Elastic Observability 的實踐方法Joe Wu
 
使用 TypeScript 駕馭 Web 世界的脫韁野馬:以 Angular 2 開發框架為例
使用 TypeScript 駕馭 Web 世界的脫韁野馬:以 Angular 2 開發框架為例使用 TypeScript 駕馭 Web 世界的脫韁野馬:以 Angular 2 開發框架為例
使用 TypeScript 駕馭 Web 世界的脫韁野馬:以 Angular 2 開發框架為例Will Huang
 
北護大/FHIR 開發簡介與應用
北護大/FHIR 開發簡介與應用北護大/FHIR 開發簡介與應用
北護大/FHIR 開發簡介與應用Lorex L. Yang
 
架設Hadoop叢集以及mapreduce開發環境
架設Hadoop叢集以及mapreduce開發環境架設Hadoop叢集以及mapreduce開發環境
架設Hadoop叢集以及mapreduce開發環境Phate334
 

What's hot (20)

Full Stack Monitoring with Prometheus and Grafana (Updated)
Full Stack Monitoring with Prometheus and Grafana (Updated)Full Stack Monitoring with Prometheus and Grafana (Updated)
Full Stack Monitoring with Prometheus and Grafana (Updated)
 
前端自動化工具
前端自動化工具前端自動化工具
前端自動化工具
 
RxJS 6 新手入門
RxJS 6 新手入門RxJS 6 新手入門
RxJS 6 新手入門
 
使用Ubuntu架設hadoop
使用Ubuntu架設hadoop使用Ubuntu架設hadoop
使用Ubuntu架設hadoop
 
快速入坑 Node.js - 0613 SITCON 雲林定期聚
快速入坑 Node.js - 0613 SITCON 雲林定期聚快速入坑 Node.js - 0613 SITCON 雲林定期聚
快速入坑 Node.js - 0613 SITCON 雲林定期聚
 
Vue ithome
Vue ithome Vue ithome
Vue ithome
 
Hadoop程式開發環境
Hadoop程式開發環境Hadoop程式開發環境
Hadoop程式開發環境
 
D2_node在淘宝的应用实践_pdf版
D2_node在淘宝的应用实践_pdf版D2_node在淘宝的应用实践_pdf版
D2_node在淘宝的应用实践_pdf版
 
云端的数据库
云端的数据库云端的数据库
云端的数据库
 
Mongo db 特性
Mongo db 特性Mongo db 特性
Mongo db 特性
 
FHIR Server 安裝與使用
FHIR Server 安裝與使用FHIR Server 安裝與使用
FHIR Server 安裝與使用
 
Mongo db 簡介
Mongo db 簡介Mongo db 簡介
Mongo db 簡介
 
Spark sql培训
Spark sql培训Spark sql培训
Spark sql培训
 
Hadoop开发者入门专刊
Hadoop开发者入门专刊Hadoop开发者入门专刊
Hadoop开发者入门专刊
 
Hadoop-分布式数据平台
Hadoop-分布式数据平台Hadoop-分布式数据平台
Hadoop-分布式数据平台
 
初探 Elastic Observability 的實踐方法
初探 Elastic Observability 的實踐方法初探 Elastic Observability 的實踐方法
初探 Elastic Observability 的實踐方法
 
使用 TypeScript 駕馭 Web 世界的脫韁野馬:以 Angular 2 開發框架為例
使用 TypeScript 駕馭 Web 世界的脫韁野馬:以 Angular 2 開發框架為例使用 TypeScript 駕馭 Web 世界的脫韁野馬:以 Angular 2 開發框架為例
使用 TypeScript 駕馭 Web 世界的脫韁野馬:以 Angular 2 開發框架為例
 
北護大/FHIR 開發簡介與應用
北護大/FHIR 開發簡介與應用北護大/FHIR 開發簡介與應用
北護大/FHIR 開發簡介與應用
 
架設Hadoop叢集以及mapreduce開發環境
架設Hadoop叢集以及mapreduce開發環境架設Hadoop叢集以及mapreduce開發環境
架設Hadoop叢集以及mapreduce開發環境
 
Mesos intro
Mesos introMesos intro
Mesos intro
 

Viewers also liked

Spring Data MongoDB 介紹
Spring Data MongoDB 介紹Spring Data MongoDB 介紹
Spring Data MongoDB 介紹Kuo-Chun Su
 
Hadoop 設定與配置
Hadoop 設定與配置Hadoop 設定與配置
Hadoop 設定與配置鳥 藍
 
Pretuieste lectura calendarul cartilor 2017 (1)
Pretuieste lectura   calendarul   cartilor 2017 (1)Pretuieste lectura   calendarul   cartilor 2017 (1)
Pretuieste lectura calendarul cartilor 2017 (1)Cimpeanemese
 
VIEW Inside My Marketing Technology Stack
VIEW Inside My Marketing Technology StackVIEW Inside My Marketing Technology Stack
VIEW Inside My Marketing Technology StackBill Schilling
 
Hadoop, the Apple of Our Eyes (這些年,我們一起追的 Hadoop)
Hadoop, the Apple of Our Eyes (這些年,我們一起追的 Hadoop)Hadoop, the Apple of Our Eyes (這些年,我們一起追的 Hadoop)
Hadoop, the Apple of Our Eyes (這些年,我們一起追的 Hadoop)Kuo-Chun Su
 
Redbooth Training - Introduction into a Project Management Software
Redbooth Training - Introduction into a Project Management SoftwareRedbooth Training - Introduction into a Project Management Software
Redbooth Training - Introduction into a Project Management SoftwareMark Copeland
 

Viewers also liked (9)

Spring Data MongoDB 介紹
Spring Data MongoDB 介紹Spring Data MongoDB 介紹
Spring Data MongoDB 介紹
 
Hadoop 設定與配置
Hadoop 設定與配置Hadoop 設定與配置
Hadoop 設定與配置
 
Electricity
ElectricityElectricity
Electricity
 
Tecnologia pucmm (1)
Tecnologia pucmm (1)Tecnologia pucmm (1)
Tecnologia pucmm (1)
 
2. tercera reforma esalc
2. tercera reforma esalc2. tercera reforma esalc
2. tercera reforma esalc
 
Pretuieste lectura calendarul cartilor 2017 (1)
Pretuieste lectura   calendarul   cartilor 2017 (1)Pretuieste lectura   calendarul   cartilor 2017 (1)
Pretuieste lectura calendarul cartilor 2017 (1)
 
VIEW Inside My Marketing Technology Stack
VIEW Inside My Marketing Technology StackVIEW Inside My Marketing Technology Stack
VIEW Inside My Marketing Technology Stack
 
Hadoop, the Apple of Our Eyes (這些年,我們一起追的 Hadoop)
Hadoop, the Apple of Our Eyes (這些年,我們一起追的 Hadoop)Hadoop, the Apple of Our Eyes (這些年,我們一起追的 Hadoop)
Hadoop, the Apple of Our Eyes (這些年,我們一起追的 Hadoop)
 
Redbooth Training - Introduction into a Project Management Software
Redbooth Training - Introduction into a Project Management SoftwareRedbooth Training - Introduction into a Project Management Software
Redbooth Training - Introduction into a Project Management Software
 

Similar to HDInsight for Hadoopers

Hadoop Deployment Model @ OSDC.TW
Hadoop Deployment Model @ OSDC.TWHadoop Deployment Model @ OSDC.TW
Hadoop Deployment Model @ OSDC.TWJazz Yao-Tsung Wang
 
使用Ubuntu架設hadoop
使用Ubuntu架設hadoop使用Ubuntu架設hadoop
使用Ubuntu架設hadooptaishanla
 
twMVC#05 |開發與移轉 ASP.NET MVC 4.0 應用程式到 Windows Azure Platform
twMVC#05 |開發與移轉 ASP.NET MVC 4.0 應用程式到 Windows Azure PlatformtwMVC#05 |開發與移轉 ASP.NET MVC 4.0 應用程式到 Windows Azure Platform
twMVC#05 |開發與移轉 ASP.NET MVC 4.0 應用程式到 Windows Azure PlatformtwMVC
 
Hadoop 簡介 教師 許智威
Hadoop 簡介 教師 許智威Hadoop 簡介 教師 許智威
Hadoop 簡介 教師 許智威Awei Hsu
 
51 cto下载 51cto信息图:openshift vs cloudfoundry
51 cto下载 51cto信息图:openshift vs cloudfoundry51 cto下载 51cto信息图:openshift vs cloudfoundry
51 cto下载 51cto信息图:openshift vs cloudfoundryHong Cai
 
Continuous Delivery - Opening
Continuous Delivery - OpeningContinuous Delivery - Opening
Continuous Delivery - OpeningRick Hwang
 
Lab01 cloud project
Lab01 cloud projectLab01 cloud project
Lab01 cloud projectJeff Chu
 
0527 asus cloud day 開放。引領數位內容進軍國際 – 華碩雲端市集
0527 asus cloud day 開放。引領數位內容進軍國際 – 華碩雲端市集0527 asus cloud day 開放。引領數位內容進軍國際 – 華碩雲端市集
0527 asus cloud day 開放。引領數位內容進軍國際 – 華碩雲端市集ASUSCloud
 
Hadoop Map Reduce 程式設計
Hadoop Map Reduce 程式設計Hadoop Map Reduce 程式設計
Hadoop Map Reduce 程式設計Wei-Yu Chen
 
DRBL-live-hadoop at TSLC
DRBL-live-hadoop at TSLCDRBL-live-hadoop at TSLC
DRBL-live-hadoop at TSLCYu-Chin Tsai
 
Apache hadoop and cdh(cloudera distribution) introduction 基本介紹
Apache hadoop and cdh(cloudera distribution) introduction 基本介紹Apache hadoop and cdh(cloudera distribution) introduction 基本介紹
Apache hadoop and cdh(cloudera distribution) introduction 基本介紹Anna Yen
 
應用Ceph技術打造軟體定義儲存新局
應用Ceph技術打造軟體定義儲存新局應用Ceph技術打造軟體定義儲存新局
應用Ceph技術打造軟體定義儲存新局Alex Lau
 
前端框架發展
 前端框架發展 前端框架發展
前端框架發展Chi-wen Sun
 
hicloud PaaS雲創平台(Java/PHP介紹)
hicloud PaaS雲創平台(Java/PHP介紹)hicloud PaaS雲創平台(Java/PHP介紹)
hicloud PaaS雲創平台(Java/PHP介紹)hicloud-paas
 
Couchbase introduction - Chinese
Couchbase introduction - Chinese Couchbase introduction - Chinese
Couchbase introduction - Chinese Vickie Zeng
 
十二項架構設計原則
十二項架構設計原則十二項架構設計原則
十二項架構設計原則Philip Zheng
 
Hadoop基线选定
Hadoop基线选定Hadoop基线选定
Hadoop基线选定baggioss
 

Similar to HDInsight for Hadoopers (20)

Hadoop Deployment Model @ OSDC.TW
Hadoop Deployment Model @ OSDC.TWHadoop Deployment Model @ OSDC.TW
Hadoop Deployment Model @ OSDC.TW
 
雲端技術的新趨勢
雲端技術的新趨勢雲端技術的新趨勢
雲端技術的新趨勢
 
使用Ubuntu架設hadoop
使用Ubuntu架設hadoop使用Ubuntu架設hadoop
使用Ubuntu架設hadoop
 
Hadoop 介紹 20141024
Hadoop 介紹 20141024Hadoop 介紹 20141024
Hadoop 介紹 20141024
 
twMVC#05 |開發與移轉 ASP.NET MVC 4.0 應用程式到 Windows Azure Platform
twMVC#05 |開發與移轉 ASP.NET MVC 4.0 應用程式到 Windows Azure PlatformtwMVC#05 |開發與移轉 ASP.NET MVC 4.0 應用程式到 Windows Azure Platform
twMVC#05 |開發與移轉 ASP.NET MVC 4.0 應用程式到 Windows Azure Platform
 
Hadoop 簡介 教師 許智威
Hadoop 簡介 教師 許智威Hadoop 簡介 教師 許智威
Hadoop 簡介 教師 許智威
 
51 cto下载 51cto信息图:openshift vs cloudfoundry
51 cto下载 51cto信息图:openshift vs cloudfoundry51 cto下载 51cto信息图:openshift vs cloudfoundry
51 cto下载 51cto信息图:openshift vs cloudfoundry
 
Continuous Delivery - Opening
Continuous Delivery - OpeningContinuous Delivery - Opening
Continuous Delivery - Opening
 
Lab01 cloud project
Lab01 cloud projectLab01 cloud project
Lab01 cloud project
 
0527 asus cloud day 開放。引領數位內容進軍國際 – 華碩雲端市集
0527 asus cloud day 開放。引領數位內容進軍國際 – 華碩雲端市集0527 asus cloud day 開放。引領數位內容進軍國際 – 華碩雲端市集
0527 asus cloud day 開放。引領數位內容進軍國際 – 華碩雲端市集
 
IT03
IT03IT03
IT03
 
Hadoop Map Reduce 程式設計
Hadoop Map Reduce 程式設計Hadoop Map Reduce 程式設計
Hadoop Map Reduce 程式設計
 
DRBL-live-hadoop at TSLC
DRBL-live-hadoop at TSLCDRBL-live-hadoop at TSLC
DRBL-live-hadoop at TSLC
 
Apache hadoop and cdh(cloudera distribution) introduction 基本介紹
Apache hadoop and cdh(cloudera distribution) introduction 基本介紹Apache hadoop and cdh(cloudera distribution) introduction 基本介紹
Apache hadoop and cdh(cloudera distribution) introduction 基本介紹
 
應用Ceph技術打造軟體定義儲存新局
應用Ceph技術打造軟體定義儲存新局應用Ceph技術打造軟體定義儲存新局
應用Ceph技術打造軟體定義儲存新局
 
前端框架發展
 前端框架發展 前端框架發展
前端框架發展
 
hicloud PaaS雲創平台(Java/PHP介紹)
hicloud PaaS雲創平台(Java/PHP介紹)hicloud PaaS雲創平台(Java/PHP介紹)
hicloud PaaS雲創平台(Java/PHP介紹)
 
Couchbase introduction - Chinese
Couchbase introduction - Chinese Couchbase introduction - Chinese
Couchbase introduction - Chinese
 
十二項架構設計原則
十二項架構設計原則十二項架構設計原則
十二項架構設計原則
 
Hadoop基线选定
Hadoop基线选定Hadoop基线选定
Hadoop基线选定
 

HDInsight for Hadoopers

  • 2. Agenda HDInsight 是 Microsoft 在 Azure 上頭提供的 Hadoop 服務,讓以往繁瑣的 Hadoop Cluster 設定,變成只是幾個簡單的精靈頁面操作。Hadoop 的 HDFS 分散式檔案系 統,跟 Azure 的 Storage 整合在一起,MapReduce 應用程式則是直接丟到 Cluster 內的 各個 Windows Server 虛擬機器上面執行。這個 Session 主要就是帶領大家在 Microsoft Azure 上頭從無到有,建置自己的 Hadoop Cluster,進行基本的 Hadoop 應用操作。 1. Hadoop 介紹 2. HDInsight 介紹 3. HDInsight 操作 2 / 30
  • 3. Bio 在 Java SE 與 Java EE 領域有十多年的講師教學經驗,熟悉 XML/Web Services、 Design Patterns、EJB/JPA 等 Java EE 規格,Struts/Spring Framework/Hibernate 等 Open Source Framework,與 JBoss AS、GlassFish 等 Application Server。 自認為會的技術不多,但是學不會的也不多,最擅長把老闆交代的工作,以及找 不到老師教的技術,想辦法變成自己的專長。 目前負責 Java 與 .NET 雲端運算相關技術的推廣,主要包括 Hadoop Platform 與 NoSQL 等 Big Data 相關應用,Microsoft Azure、Google App Engine、與 CloudBees 等雲端平台的運用,以及 iOS、Android、Windows Phone 等 Smart Phone 的應用程 式開發。 3 / 30
  • 6. 由創建 Lucene 與 Nutch 的 Doug Cutting 所建立 Lucene 是 Full-Featured Text Indexing and Searching Library Nutch 是 Web Search Engine 依循著 Google 在 2003/2004 年發表的論文來開發 2006 年從 Nutch 計劃獨立出來,稱之為 Hadoop 2008 年 1 月變成 Apache 的 Top-Level Project 2009 年 7 月 Yahoo! 與 Microsoft 在 Search 達成合作協議 2009 年 9 月 Doug Cutting 加入 Cloudera 公司擔任 Architect 2011 年 6 月 Yahoo! 內部的 Hadoop 團隊 Spin Off 出去,成 立 Hortonworks 公司 Hadoop 簡史 6 / 30
  • 7. Hadoop 的特色 Hadoop 的使用 情境 Accessible:普通 PC 或 VM 組成的 Cluster 就可以跑 Robust:所以要特別處理普通 PC 比較容易掛掉的問題 Scalable:隨著資料量增加,加入新機器就可以 Simple:透過 MapReduce 可以輕易寫出平行處理的程式 具備幾千個 Node 的 Scalability 把軟硬體發生 Failure 當成家常便飯 要處理的檔案多少不是重點,但是每個最好都很大 適合只會寫入一次/只有一人寫入,但是會讀取很多次 7 / 30
  • 8. Hadoop 平台 兩大部份:Hadoop Distributed File System 與 MapReduce Programming Paradigm 以 Java 開發,但是不支援 Java SE 6 之前的 JDK 版本 原則上 Linux 平台是一個 Hadoop 有支援的 Development 與 Production Platform Win32 可以是個 Development Platform,但是 Distributed Operation 沒有在 Win32 上面詳細測試過,所以不建議把 Win32 當成 Production Platform 不過,這件事因為 Hortonworks 把 Hadoop 移植到 Windows 平台,然後 Microsoft 又與 Hortonworks 合作,開始在 Azure 上支援 Hadoop 之後,有了改變 8 / 30
  • 9. 什麼是 HDFS Self-Healing、Distributed File System 以 Block 方式儲存資料,打破 Disk 實體限制 透過 Replication 的方式實現 Reliability 提供熟悉的操作介面,以及可以客製化的 API 提供 RESTful 介面方便客製化 9 / 30
  • 10. 什麼是 MapReduce 一個 Computing Model 把一個處理大量資料的 Job,拆解成許多可以在一堆 Server 平行處理的 Task 把 Code 往 Data 所在的 Server 搬移,減少 Network Traffic 各個 Task 執行的結果,會整合在一起,得到最終的結果 10 / 30
  • 11. MapReduce 的 Hello, Word Count! 11 / 30
  • 13. Microsoft 的 Big Data Solution 13 / 30
  • 14. 什麼是 HDInsight 2012 年 10 月發佈 以 Hortonworks Data Platform (HDP) 平台為基礎 結合 Microsoft Windows 簡易操作與 Hortonworks HDP 的穩定與威力 14 / 30
  • 16. Demo 1. 建立 Azure Blob Storage 2. 在 Azure Blob Storgae 裡頭建立 Container 3. 建立 HDInsight Cluster 4. 透過 Windows Azure PowerShell 操作 5. MapReduce 示範 6. Hive 示範 7. Power Query for Excel 示範 16 / 30
  • 17. 建立 Azure Blob Storage 17 / 30
  • 20. 自訂建立 HDInsight Cluster * 3.1 現在已經是正式版本了 20 / 30
  • 21. 透過 WebPI 安裝 Windows Azure PowerShell 21 / 30
  • 22. 透過 PowerShell 登入 Azure 22 / 30
  • 23. 透過 PowerShell 執行 MapReduce 範例 $subscription = "Azure 訂閱名稱" $cluster = "剛剛建立的 HDInsight Cluster 名稱" $jarFile = "wasb:///example/jars/hadoop-mapreduce-examples.jar" $className = "wordcount" $arguments1 = "wasb:///example/data/gutenberg/davinci.txt" $arguments2 = "wasb:///example/data/WordCountOutput" $waitTimeoutInSeconds = 3600 $jobDefinition = New-AzureHDInsightMapReduceJobDefinition -JarFile $jarFile -ClassName $className -Arguments $arguments1, $arguments2 Select-AzureSubscription $subscription $job = Start-AzureHDInsightJob -Cluster $cluster -JobDefinition $jobDefinition Wait-AzureHDInsightJob -Job $job -WaitTimeoutInSeconds $waitTimeoutInSeconds Get-AzureHDInsightJobOutput -Cluster $cluster -JobId $job.JobId -StandardError 23 / 30
  • 24. 透過 PowerShell 上傳 Hive 測試資料 ggplot R package 裡頭提供了測試資料,下載網址是 http://had.co.nz/data/movies/, 解壓縮之後放在 C:。 $subscription = "Azure 訂閱名稱" $cluster = "剛剛建立的 HDInsight Cluster 名稱" Select-AzureSubscription $subscription Use-AzureHDInsightCluster $cluster $storageAccountName = "剛剛建立的 Storage 名稱" $container = "剛剛建立的 Container 名稱" $file = "C:movies.tab" $blob = "movies/movies.tab" $storageAccountKey = Get-AzureStorageKey –StorageAccountName $storageAccountName $context = New-AzureStorageContext –StorageAccountName $storageAccountName -StorageAccountKey $storageAccountKey.Primary Set-AzureStorageBlobContent -Container $container -File $file -Blob $blob -Context $context 24 / 30
  • 25. 透過 PowerShell 執行 Hive 範例 $response = Invoke-Hive -Query @" create external table movies(title string, year string, length int, budget float, rating float, votes int, r1 float, r2 float, r3 float, r4 float, r5 float, r6 float, r7 float, r8 float, r9 float, r10 float, mpaa string, Action boolean, Animation boolean, Comedy boolean, Drama boolean, Documentary boolean, Romance boolean,Short boolean) row format delimited fields terminated by 't' lines terminated by 'n'; "@ Write-Host $response $response = Invoke-Hive -Query @" load data inpath '/movies/movies.tab' overwrite into table movies; "@ Invoke-Hive "select count(*) from movies" Invoke-Hive "select year, count(*) from movies group by year;" Invoke-Hive -Query @" insert overwrite directory 'moviesoutput' select concat_ws(',', cast(size(split(title, ' ')) as string), cast(count(*) as string)) from movies group by size(split(title, ' ')); "@ 25 / 30
  • 26. Microsoft 商業智慧工具 Hadoop 運算的結果可以透過 ODBC 匯入 Excel,無痛使用 PowerPivot 與 Power Query/Power View 等 BI 工具分析資料 Hadoop 運算的結果可以透過 Sqoop 匯入 SQL Server,跟 SQL Server Analysis Service、Reporting Service 等 BI 工具無縫整合 26 / 30
  • 27. 下載 Power Query for Excel 安裝 27 / 30
  • 28. POWER QUERY -> 取得外部資料 -> 從其他來源 -> 從 Windows Azure HDInsight 28 / 30