1 / 50

HDInsight によるビッグデータ ソリューションの開発

Masashi Narumoto Senior p rogram manager p atterns & practices. HDInsight によるビッグデータ ソリューションの開発. アジェンダ. ビッグデータ概要 HDInsight と関連技術のガイダンス まとめ. Sexiest job of the 21 st century. Source: HBR http://hbr.org/2012/10/data-scientist-the-sexiest-job-of-the-21st-century/. ビッグデータとは ?.

cleary
Download Presentation

HDInsight によるビッグデータ ソリューションの開発

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Masashi Narumoto Senior program manager patterns & practices HDInsightによるビッグデータソリューションの開発

  2. アジェンダ • ビッグデータ概要 • HDInsightと関連技術のガイダンス • まとめ

  3. Sexiest job of the 21st century Source: HBRhttp://hbr.org/2012/10/data-scientist-the-sexiest-job-of-the-21st-century/

  4. ビッグデータとは? 10x increase every 5 years VOLUME 4.3 connected devices per adult VELOCITY Relational Data Big Data VARIETY 85% from new data types

  5. Business Analytics for the New World of Data Tackling growth in the volume, velocity and variety of data 44% of users (350M people) access Facebook via mobile devices. 70% of U.S. smartphone owners regularly shop online via their devices. Mobility 50% of millennialsuse mobile devices to research products. Gaming consoles are now used an average of 60%of U.S. mobile data will be audio and video streaming by 2014. 2/3of the world's mobile data traffic will be video by 2016. 33%of BI will be consumed via handheld devices by 2013. Cloud Mobility 1.5 hrs/wk to connect to the Internet. Social Big Data 1 in 4 Facebook users add their location to posts (2B/month). 38% of people recommend a brand they “like” or follow on a social network. 80% growth of unstructured data is predicted over the next five years. 1.8 zettabytes of digital data were in use worldwide in 2011, up 30% from 2010. Brands get 500M Tweets are hosted on Twitter each day 100M Facebook “likes” per day.

  6. Big Data とRDBの違い

  7. Hadoop Ecosystem(Still) Rapidly Evolving Oozie (Workflow) Traditional BI Tools Cassandra Apache Mahout Flume Sqoop Hive (Warehouse and Data Access) Pig (Data Flow) Chukwa HBase (Column DB) MapReduce (Job Scheduling/Execution System) Hadoop = MapReduce + HDFS Avro (Serialization) Zookeeper (Coordination) HDFS (Hadoop Distributed File System)

  8. HDFS アーキテクチャ SecondaryNameNode NameNode NameSpace Backup Block Management DataNode DataNode DataNode DataNode BL1 BL1 BL1 BL1 BL3 BL3 BL3 BL3 BL2 BL2 BL2 BL2 BL1 BL1 BL1 BL1

  9. Job Tracker とTask Tracker JobTracker Client TaskTracker TaskTracker TaskTracker JVM JVM JVM JVM JVM JVM JVM JVM JVM JVM JVM JVM

  10. Map and Reduce John had a little cat Its eyes were blue as cobalt John went to the library yesterday He brought the cat with him map map map map John 1 had 1 a 1 little 1 Cat 1 John 1 Went 1 To 1 The 1 Library 1 Yesterday 1 Its 1 Eyes 1 Were 1 Blue 1 as 1 Cobalt 1 He 1 Brought 1 The 1 Cat 1 with 1 him 1 reduce reduce had 1 a 1 little 1 Cat 2 ………. John 2 Were 2 Brought 1 He 1 ………

  11. HDInsight

  12. HDInsightの利点 • クラウドとオンプレミスから選択可能 • WPIでワンクリックインストレーション,パッケージの動作検証済み • 豊富なBIツールとの組み合わせ • Microsoft Excel, Power Pivot, Power View, Data Explorer, SSRS • SQL Serverとの統合 • Hadoop とSQL Server間のデータ移動をサポート • シンプルな管理ソリューション • System Centerにより他のIT資産と同様の管理が可能 • セキュア • Active Directoryとの統合でセキュアな運用 • プロダクティブ • 既存のスキルを使ったMapReduce ジョブの開発とデプロイメント

  13. Demo : HDInsight

  14. DEV/DBAの視点 • ソリューションの設計 • テクノロジー選択、インフラ設計、アーキテクチャモデル • 実装 • データ収集, クエリー, 可視化 • テスト • ユニットテスト、ローカル、クラスター • デプロイメント • データとジョブ、スケジューリング、プロセスの自動化 • パフォーマンスの最適化 • コンフィギュレーション、データ圧縮、クエリー最適化 • モニタリング(トラブルシューティング) • メトリクスの設定、アラート

  15. Microsoft のbig data プラットフォーム

  16. データクエリと可視化

  17. DWH/BIとの統合

  18. 典型的なシナリオ • Web ログ解析 • Sentiment 分析 • リテール顧客分析 • メディカルデータ分析 • オンラインリコメンデーション • フィナンシャルモデリング • センサーデータ解析 • 予測分析

  19. Demo : Twitter Analysis

  20. Big Data アーキテクチャモデル • コモディティストレージ • データ転送とETL • スタンドアロンデータ分析 • BIとのインテグレーション

  21. コモディティストレージ・DWH • ビッグデータの分析・レポーティングのための統一ストレージ • 内部アプリケーションのために複数のデータセットを格納 • クラウドにより信頼性、弾力性、低コストを実現

  22. データ転送とETL • ストリームデータまたは非構造化データを既存のデータベースにロード • ロードする前にクレンジング、転送、バリデーションを実行 • 定期的にデータの可視化またはレポートの作成

  23. スタンドアロンデータ分析 • 新しいタイプのデータを検証 • 少人数によるインタラクティブな分析 • レポートの作成や外部または内部データの可視化

  24. BIとのインテグレーション • 外部データソースを内部の企業データウェアハウスと統合 • スケジュールされた間隔もしくはオンデマンドでデータ更新 • 外部データによりデータウェアハウスを強化

  25. テクノロジー選択 • プラットフォーム: Traditional DWH/BI or HDInsight • ランタイム: HDInsight in the Cloud or on-premises • ストレージ: ASV or HDFS • データ収集 : File upload, StreamInsight, SSIS, Custom App • クエリー: MR, Pig, Hive, UDF or Hadoop Streaming • データ可視化: EXCEL , Sharepoint, LINQ to Hive or Custom app • レポーティング : SSRS, SQL Azure Reporting, Crystal Report etc. • DWH 統合: Sqoop, SSIS, Hive ODBC, PolyBase • 他の要素 : ZooKeeper, Oozie, HCatalog, Mahout etc.

  26. データ収集パターン インタラクティブ 自動化されたバッチ リアルタイムストリーム リレーショナルデータ

  27. データ収集ガイドライン • アップローダー • アップローダーはライブラリーとして実装し、スクリプトやSSISから呼び出し可能とする • コマンドラインユーティリティを作成してインタラクティブなアップロードもサポートする • ASVへのアップロード • データを小さいサイズへと分割して同時アップロード • AzureのBlobサイズ • リトライ処理 • TOPAZなどの使用によるリトライ処理の実装

  28. データクエリー • Hive (+UDF) • データソースがある程度構造化されていて、表形式にマッピングできる • 必要なプロセスがHiveQLで表現できる • ユーザーがデータを取り出すためにテーブルレイヤーを作成 • Pig (+UDF) • カラムの宣言や値のグループ化によってリストラクチャする • 複数の操作のワークフローによる分析処理 • Map & Reduce • 完全な非構造化データをパースして構造を追加する • Pigや Hiveでは複雑になり過ぎる処理、(例:緯度・経度の計算) • パフォーマンスの最適化 • Hadoop Streaming • Java以外の言語でテキストデータを分析する • 複数のツールから起動 • インタラクティブコンソール、コマンドライン、.NET SDK、Oozie

  29. Demo : Hive, Pig and MapReduce

  30. その他のツール • HCatalog • データスキーマ、ロケーション、フォーマットのレポジトリ • Oozie • ワークフローエンジン • WebHCat(Templeton) • 管理用RESTインタフェース • .NETクライアント • .NET開発者向け管理とモニタリング用SDK

  31. データの可視化 • インタラクティブツール • HDInsightコンソール,EXCEL, Power Pivot, Power View, Data Explorer • SQL Server Reporting Services • Windows Azure SQL Reporting • Windows Azure SQL Database経由でレポート生成 • SQL Server Database • Linked Server, Sqoop, Polybase • Sharepoint Server • Business Data Connector, PerformancePointServices • LINQ to Hive,VS2012 アドイン • プログラマーへの選択肢 • 3rdパーティ-テクノロジー • D3.jsなど多数

  32. Demo : Data Explorer

  33. パフォーマンス最適化 • ストレージアクセス • ネットワークバンド幅 • メモリー量 • CPU使用量

  34. パフォーマンス最適化

  35. データ圧縮による最適化 • 最適化に最も有効な手段 • ストレージIOとネットワーク転送の負荷を軽減 • 処理速度とIOのトレードオフ • 解凍のためジョブにおけるCPU負荷は増大する • 圧縮するステージ • 入力データ, 中間データ, 出力データ • Codecの選択 • DEFLATE,GZIP, BZIP2 etc. • 複数MapperにはSplittableフォーマットを使用

  36. まとめ • ビッグデータ登場の背景 • Hadoopエコシステム • Microsoftの提供するHDInsightとその関連技術 • 4つのアーキテクチャモデル • 開発プロセスの各ステップにおける考慮事項

  37. リソース • http://WAG.Codeplex.com • http://www.windowsAzure.com • http://hadoop.apache.org • http://pnp.azurewebsites.net/en-us/

  38. Appendix

  39. Webログ解析シナリオ • 300GBのIIS logsを解析 • Webサイトの検索キーワードからホットトピックスを抽出 • EXCELとカスタムWebアプリケーションによる可視化

  40. Demo : MSDN Hot Topics

  41. Behind the scene HDFS Hive External Table Hive Standard Table スキーマを定義 クレンジング 正規化 グルーピング ソート HDInsight Windows Azure ASV Hive ODBC Driver オンプレミス データのクレンジングファイルをアップロード MSDN IIS Logs カスタムWeb App EXCEL Hive Pane + PowerView

  42. Questions?

  43. テスト • MRUnit • ネイティブMR用のユニットテスト • HDInsightサーバー • 小さいデータセットとローカルインスタンスによるテスト • HDInsightクラスター • クラウドで大きいデータセットを使用したテスト

  44. デプロイメント

  45. Job ワークフロー

  46. モニタリング • Hadoopメトリクスの設定 • Java仮想マシン • HDFS • MapReduceジョブ • RPC • メトリクスの可視化 • REST-API

  47. Map and Reduce • // Map function - runs on all nodes • var map = function (key, value, context) { • // split the data into an array of words • varhashtags = value.split(/[^0-9a-zA-Z#]/); • //Loop through the array, creating a value of 1 for each word beginning "#" • for (var i = 0; i < hashtags.length; i++) { • if (hashtags[i].substring(0, 1) == "#") { • context.write(hashtags[i].toLowerCase(), 1); • } • } • }; • //Reduce function - runs on reducer node(s) • var reduce = function (key, values, context) { • var sum = 0; • // Sum the counts of each tag found in the map function • while (values.hasNext()) { • sum += parseInt(values.next()); • } • context.write(key, sum); • };

  48. Pig • -- load tweets • Tweets = LOAD 'asv://uploads/data' AS (date, id, author, tweet); • -- split tweet into words • TweetWords = FOREACH Tweets GENERATE date, FLATTEN(TOKENIZE(tweet)) AS tag, id; • --filter words to find hashtags • Tags = FILTER TweetWords BY tag matches '#.*'; • -- clean tags by removing trailing periods • CleanTags = FOREACH Tags GENERATE date, LOWER(REPLACE(tag, '\\.', '')) as tag, id; • -- group tweets by date and tag • GroupedTweets = GROUP CleanTags BY (date, tag); • -- count tag mentions per group • CountedTagMentions = FOREACH GroupedTweets GENERATE group, COUNT(CleanTags.id) as mentions; • -- flatten the group to generate columns • TagMentions = FOREACH CountedTagMentions GENERATE FLATTEN(group) as (date, tag), mentions; • -- load the top tags found by map/reduce previously • TopTags = LOAD 'asv://results/countedtags/part-r-00000' AS (toptag, totalcount:long); • -- Join tweets and top tags based on matching tag • TagMentionsAndTopTags = JOIN TagMentions BY tag, TopTags BY toptag; • -- get the date, tag, totalcount, and mentions columns • TagMentionsAndTotals = FOREACH TagMentionsAndTopTags GENERATE date, tag, totalcount, mentions; • -- sort by date and mentions • SortedTagMentionsAndTotals = ORDER TagMentionsAndTotals BY date, mentions; • -- store the results as a file • STORE SortedTagMentionsAndTotals INTO 'asv://results/dailytagcounts';

  49. Hive • CREATE EXTERNAL TABLE dailytwittertags • (tweetdate STRING, • tag STRING, • totalcount INT, • daycount INT) • ROW FORMAT DELIMITED • FIELDS TERMINATED BY '\t' • STORED AS TEXTFILE LOCATION 'asv://tables/dailytagcount'

More Related