Upload
makoto-uehara
View
95
Download
1
Embed Size (px)
Citation preview
Big Data取り扱い方の
オンプレミスとクラウドの違い
アマゾン ウェブ サービス ジャパン株式会社
テクニカルトレーナー 上原 誠
2017年8月3日
© 2017, Amazon Web Services, Inc. or its affiliates. All rights reserved.
…そしてトレーニングへの誘い
自己紹介 名前: 上原 誠 (うえはら まこと)
現職: AWS のテクニカルトレーナー
前職: 渋谷系のWeb系のインフラ系エンジニア
好きなHadoopエコシステム:ZooKeeper
好きなデータストア:Aerospike
ビッグデータの「パイプライン」
収集
保存
処理と分析 可視化
深い理解データ
© 2016 Amazon Web Services, Inc. and its affiliates. All rights reserved.
ビッグデータの「パイプライン」
収集
保存
処理と分析 可視化
深い理解データ
© 2016 Amazon Web Services, Inc. and its affiliates. All rights reserved.
別にオンプレでもでる
ただ
オンプレミスだと大変なことがある
© 2016 Amazon Web Services, Inc. and its affiliates. All rights reserved.
ここでは5つあげます
①ハードウェアの世代問題
②サイジングの課題
③バージョンアップの課題
④本番規模でテストしずらい問題
⑤ストレージの課題
© 2016 Amazon Web Services, Inc. and its affiliates. All rights reserved.
①ハードウェアの世代が上がると
まったく同じスペックのものは調達
できない。Hadoopクラスタのノー
ド増設時に困る。
© 2016 Amazon Web Services, Inc. and its affiliates. All rights reserved.
© 2016 Amazon Web Services, Inc. and its affiliates. All rights reserved.
これはサーバーを使い続けることによる問題※古い世代が残る、むやみに捨てられない
© 2016 Amazon Web Services, Inc. and its affiliates. All rights reserved.
クラウドだと
・Hadoopクラスタのノードは使い捨て
・クラウドのHadoopの使い方はクラスタ単位で使い、終わったら
消す、なので新しい世代のEC2が出たら全てそれを使い、使い終
わったら消す。古い効率の悪いEC2を使い続ける必要はない。
※厳密に同じスペックを保証するわけではないが、明確に古い世
代のEC2排除は可能
© 2016 Amazon Web Services, Inc. and its affiliates. All rights reserved.
②Hadoopクラスタのノード数を増
やすとCPUとRAMとDISKが線形に
増える。追加ジョブ要件にマッチで
きない。
© 2016 Amazon Web Services, Inc. and its affiliates. All rights reserved.
© 2016 Amazon Web Services, Inc. and its affiliates. All rights reserved.
CPU 10コアメモリ 100GBディスク 500GB
例えばこういうジョブがあったら
© 2016 Amazon Web Services, Inc. and its affiliates. All rights reserved.
CPU 10コアメモリ 100GBディスク 500GB
こんなクラスタになるクラスタサイズ
CPU 10コアメモリ 100GBディスク 500GBノード数 5台
1ノードサイズCPU 2コアメモリ 20GB
ディスク 100GB
© 2016 Amazon Web Services, Inc. and its affiliates. All rights reserved.
CPU 10コアメモリ 100GBディスク 500GB
ビッグデータなのでデータは増え続ける線形に増えるのであれば大きな問題にはならない
© 2016 Amazon Web Services, Inc. and its affiliates. All rights reserved.
例えば既存ジョブのデータ量や処理負荷が2倍になったら
CPU 20コアメモリ 200GB
ディスク 1000GB
© 2016 Amazon Web Services, Inc. and its affiliates. All rights reserved.
クラスタサイズも線形に2倍に増やすこれは別に問題ない
CPU 20コアメモリ 200GB
ディスク 1000GB
クラスタサイズCPU 20コアメモリ 200GB
ディスク 1000GBノード数 10台
1ノードサイズCPU 2コアメモリ 20GB
ディスク 100GB
© 2016 Amazon Web Services, Inc. and its affiliates. All rights reserved.
CPU 10コアメモリ 100GBディスク 500GB
問題は追加のジョブ要件があった場合
CPU 10コアメモリ 100GBディスク 50GB
追加ジョブCPUメモリを多めに使うがディスクはあまりいらない
© 2016 Amazon Web Services, Inc. and its affiliates. All rights reserved.
ディスク容量が要件にマッチせずに1000GBまで増えているさらに増設していくとさらに無駄も増えていく※スペックが異なるヘテロな構成も可能だが設定が煩雑になる
クラスタサイズCPU 20コアメモリ 200GB
ディスク 1000GBノード数 14台
ディスクは本来550GBでいいのに
1000GBまで増えてしまっている
CPU 10コアメモリ 100GBディスク 500GB
CPU 10コアメモリ 200GBディスク 50GB
MapReduceとHDFSが密結合なので仕方ない
© 2016 Amazon Web Services, Inc. and its affiliates. All rights reserved.
オンプレミスのHadoopクラスタは、永続的に動き続けるクラスタにジョブを入れ込んでいく考え方
Job1 Job3
Job2
© 2016 Amazon Web Services, Inc. and its affiliates. All rights reserved.
クラウドだと
Job3
Job2
Job1
© 2016 Amazon Web Services, Inc. and its affiliates. All rights reserved.
クラスタにジョブを入れ込んでいくのではなく
© 2016 Amazon Web Services, Inc. and its affiliates. All rights reserved.
それぞれのジョブにクラスタを立てる
Job3
Job2
Job1
© 2016 Amazon Web Services, Inc. and its affiliates. All rights reserved.
ジョブが終わったらジョブとともにクラスタも消すクラスタを使い捨てる
使い捨て!
Job2
Job3
© 2016 Amazon Web Services, Inc. and its affiliates. All rights reserved.
そう、使い捨てこそがクラウドの
メリット
© 2016 Amazon Web Services, Inc. and its affiliates. All rights reserved.
AWSのEC2と同じ考え方
サイジングや新しいツール検証様々な試験一時的な処理
© 2016 Amazon Web Services, Inc. and its affiliates. All rights reserved.
AWSのEC2と同じ考え方
消す
サイジングや新しいツール検証様々な試験一時的な処理
終わったら
これをクラスタ単位で行う
© 2016 Amazon Web Services, Inc. and its affiliates. All rights reserved.
最適なサイジングができる
© 2016 Amazon Web Services, Inc. and its affiliates. All rights reserved.
© 2016 Amazon Web Services, Inc. and its affiliates. All rights reserved.
それぞれのジョブにどのくらいのスペックのクラスタが適切かを事前に検証できる。なので最適なサイジングができる
使って、終わったら消せるんだからバンバン
試せばいい
Job1
ということは
© 2016 Amazon Web Services, Inc. and its affiliates. All rights reserved.
③バージョンアップも事前に試せる
© 2016 Amazon Web Services, Inc. and its affiliates. All rights reserved.
Job3
© 2016 Amazon Web Services, Inc. and its affiliates. All rights reserved.
唯一無二のクラスタをバージョンアップするから怖かった(いや〜怖かった)
Job2
Job1
バージョンアップも怖くない
© 2016 Amazon Web Services, Inc. and its affiliates. All rights reserved.
同じ理由で、④新しいツールも試しやすい
例えば
© 2016 Amazon Web Services, Inc. and its affiliates. All rights reserved.
MapReduceは素晴らしいと思っていたが(実際シンプ
ルで安定してて素晴らしかった)、Sparkが登場した。
© 2016 Amazon Web Services, Inc. and its affiliates. All rights reserved.
MapReduceは素晴らしいと思っていたが(実際シンプ
ルで安定してて素晴らしかった)、Sparkが登場した。
© 2016 Amazon Web Services, Inc. and its affiliates. All rights reserved.
※Hiveの資産を活用するためにHive on SparkやHive on Tezがあるが新規で作るならSparkでよいと思う。コード(java,scala,python)もシンプルに書けるので従来より生産性が高いMapReduceはゆっくりと死んでいく・・
そんな時クラスタが「触るな危険」では試しずらい。
© 2016 Amazon Web Services, Inc. and its affiliates. All rights reserved.
「テストしたいから同規模のクラスタをサクッと用意
して」と言われても辛い。
© 2016 Amazon Web Services, Inc. and its affiliates. All rights reserved.
今後もよりいいものは必ずでてくる!
エンジニアにはよりいいものを試し、よりいいプロダ
クトにしてほしい。それを止めるようなプラット
フォームじゃいけない。
© 2016 Amazon Web Services, Inc. and its affiliates. All rights reserved.
© 2016 Amazon Web Services, Inc. and its affiliates. All rights reserved.
そう、使い捨てこそがクラウドの
メリット(2回目)
だがデータが消えたのでは意味がない
© 2016 Amazon Web Services, Inc. and its affiliates. All rights reserved.
© 2016 Amazon Web Services, Inc. and its affiliates. All rights reserved.
クラスタを使い捨ててもデータは残したい
データは残したい
Job2
Job3
© 2016 Amazon Web Services, Inc. and its affiliates. All rights reserved.
コンピューティング処理レイヤとストレージレイヤを分けることでデータを永続化
ストレージレイヤの分離
ストレージ
Job2
Job3
© 2016 Amazon Web Services, Inc. and its affiliates. All rights reserved.
コンピューティング処理レイヤとストレージレイヤを疎結合にする
それぞれのクラスタの永続データはストレージレイヤに保存
ストレージ
Job2
Job3
⑤データは増え続ける。「数百TBや
数PBのストレージが欲しい」「と言
うか理想は容量無限のストレージが
欲しい」。そして数PBとかのバック
アップどうする??
© 2016 Amazon Web Services, Inc. and its affiliates. All rights reserved.
© 2016 Amazon Web Services, Inc. and its affiliates. All rights reserved.
オンプレだと
© 2016 Amazon Web Services, Inc. and its affiliates. All rights reserved.
無理
・ストレージ製品の拡張限界。
・データセンターであれば契約ラック数の限界、またはフロアス
ペース限界。
・バックアップのためにクラスタ冗長化や別途DASなどを使う
(無理じゃないけど辛い)
© 2016 Amazon Web Services, Inc. and its affiliates. All rights reserved.
© 2016 Amazon Web Services, Inc. and its affiliates. All rights reserved.
・ストレージ製品の拡張限界。
・データセンターであれば契約ラック数の限界、またはフロアス
ペース限界。
・バックアップのためにクラスタ冗長化や別途DASなどを使う
(無理じゃないけど辛い)
© 2016 Amazon Web Services, Inc. and its affiliates. All rights reserved.
クラウドだと
© 2016 Amazon Web Services, Inc. and its affiliates. All rights reserved.
できる
© 2016 Amazon Web Services, Inc. and its affiliates. All rights reserved.
そう、S3
© 2016 Amazon Web Services, Inc. and its affiliates. All rights reserved.
S3の3つの特徴
1.丈夫 (耐久性99.999999999%)
2.容量無制限
3.Hadoopから接続しやすい (EMRFS、s3n、s3a)
© 2016 Amazon Web Services, Inc. and its affiliates. All rights reserved.
S3の3つの特徴
1.丈夫 (耐久性99.999999999%)
2.容量無制限
3.Hadoopから接続しやすい (EMRFS、s3n、s3a)
バックアップが必要ならクロスリージョンレプリケーションを活用できる
© 2016 Amazon Web Services, Inc. and its affiliates. All rights reserved.
S3の3つの特徴
1.丈夫 (耐久性99.999999999%)
2.容量無制限
3.Hadoopから接続しやすい (EMRFS、s3n、s3a)
あと安い
バックアップが必要ならクロスリージョンレプリケーションを活用できる
© 2016 Amazon Web Services, Inc. and its affiliates. All rights reserved.
コンピューティング処理レイヤとストレージレイヤを分ける
ストレージにS3
Job2
Job3
ストレージ
© 2016 Amazon Web Services, Inc. and its affiliates. All rights reserved.
コンピューティング処理レイヤとストレージレイヤを分ける
Hadoopクラスタに
EMR
コンピューティング処理のHadoopクラスタにEMR
Job2
Job3
ストレージ
これでデータが一箇所に
データが一箇所にあるということは
© 2016 Amazon Web Services, Inc. and its affiliates. All rights reserved.
© 2016 Amazon Web Services, Inc. and its affiliates. All rights reserved.
一箇所のデータに対して最適なデータ処理エンジンを使える
ストレージ
Athena
Redshift
ストレージ
© 2016 Amazon Web Services, Inc. and its affiliates. All rights reserved.
一箇所のデータに対して最適なデータ処理エンジンを使える
Athena
Redshift
データレイク
Hadoopの考え方との違い
(Hadoopはオンプレミスを想定した
アーキテクチャ)
© 2016 Amazon Web Services, Inc. and its affiliates. All rights reserved.
© 2016 Amazon Web Services, Inc. and its affiliates. All rights reserved.
・データローカリティを活かした処理スループットの向上。
・起動し続けるのでクラスタではHDFSのデータは絶対。その司令
塔であるマスターノードはHA構成で死守する。
・Rack-awarenessでラック障害や距離を意識したデータ配置、
レプリケーション時のL2スイッチの上りの帯域の考慮、スイッチ
のDeepBuffer機能使ったりなど。
・データローカリティを活かした処理スループットの向上。
・起動し続けるのでクラスタではHDFSのデータは絶対。その司令
塔であるマスターノードはHA構成で死守する。
・Rack-awarenessでラック障害や距離を意識したデータ配置、
レプリケーション時のL2スイッチの上りの帯域の考慮、スイッチ
のDeepBuffer機能使ったりなど。
© 2016 Amazon Web Services, Inc. and its affiliates. All rights reserved.
スループットはS3でもそこそこ出る数時間のバッチ処理時間が1,2割増えて問題あるか?で検討する
使い捨てなのでHA機能ない。HDFSはテンポラリ用途として使う
ネットワークまわりはAWS側が全て行う
まとめ
© 2016 Amazon Web Services, Inc. and its affiliates. All rights reserved.
© 2016 Amazon Web Services, Inc. and its affiliates. All rights reserved.
クラウドらしさとは・リソースをすぐに使えて不要になったら捨てる
・容量無制限のストレージ
・バージョンアップの気軽さ、本番スケールのテストのしやすさ
・ジャストサイズでプロビジョニング
・運用負荷軽減で本来やりたいことに注力
・データローカリティは下がる
・HDFSはテンポラリ
・NameNodeのメタデータ操作にビビらない。NameNodeも作って壊す
・他にもビッグデータ処理に役立つサービスとしてAthena、Kinesis、
Redshift、Snowball、QuickSightなどなど
:
© 2016 Amazon Web Services, Inc. and its affiliates. All rights reserved.
クラウドらしいベストプラクティス・なるべくマネージドサービスを使って運用負荷軽減
・できるだけ一時クラスターを使う
・EC2スポットインスタンスの活用。「スポットフリート!」
・新しいインスタンスに移行してパフォーマンスを活用
・最適なサイジングの為のモニタリング
:
詳しくは・・
© 2016 Amazon Web Services, Inc. and its affiliates. All rights reserved.
・ディスカッションあるよ
© 2016 Amazon Web Services, Inc. and its affiliates. All rights reserved.
6月くらいに
Big Data 認定資格出ました
© 2016 Amazon Web Services, Inc. and its affiliates. All rights reserved.
認定資格、トレーニングの話
© 2016 Amazon Web Services, Inc. and its affiliates. All rights reserved.
71