71
Big Data取り扱い方の オンプレミスとクラウドの違い アマゾン ウェブ サービス ジャパン株式会社 テクニカルトレーナー 上原 誠 2017年8月3日 © 2017, Amazon Web Services, Inc. or its affiliates. All rights reserved. …そしてトレーニングへの誘い

20170803 bigdataevent

Embed Size (px)

Citation preview

Page 1: 20170803 bigdataevent

Big Data取り扱い方の

オンプレミスとクラウドの違い

アマゾン ウェブ サービス ジャパン株式会社

テクニカルトレーナー 上原 誠

2017年8月3日

© 2017, Amazon Web Services, Inc. or its affiliates. All rights reserved.

…そしてトレーニングへの誘い

Page 2: 20170803 bigdataevent

自己紹介 名前: 上原 誠 (うえはら まこと)

現職: AWS のテクニカルトレーナー

前職: 渋谷系のWeb系のインフラ系エンジニア

好きなHadoopエコシステム:ZooKeeper

好きなデータストア:Aerospike

Page 3: 20170803 bigdataevent

ビッグデータの「パイプライン」

収集

保存

処理と分析 可視化

深い理解データ

© 2016 Amazon Web Services, Inc. and its affiliates. All rights reserved.

Page 4: 20170803 bigdataevent

ビッグデータの「パイプライン」

収集

保存

処理と分析 可視化

深い理解データ

© 2016 Amazon Web Services, Inc. and its affiliates. All rights reserved.

別にオンプレでもでる

Page 5: 20170803 bigdataevent

ただ

オンプレミスだと大変なことがある

© 2016 Amazon Web Services, Inc. and its affiliates. All rights reserved.

Page 6: 20170803 bigdataevent

ここでは5つあげます

①ハードウェアの世代問題

②サイジングの課題

③バージョンアップの課題

④本番規模でテストしずらい問題

⑤ストレージの課題

© 2016 Amazon Web Services, Inc. and its affiliates. All rights reserved.

Page 7: 20170803 bigdataevent

①ハードウェアの世代が上がると

まったく同じスペックのものは調達

できない。Hadoopクラスタのノー

ド増設時に困る。

© 2016 Amazon Web Services, Inc. and its affiliates. All rights reserved.

Page 8: 20170803 bigdataevent

© 2016 Amazon Web Services, Inc. and its affiliates. All rights reserved.

これはサーバーを使い続けることによる問題※古い世代が残る、むやみに捨てられない

Page 9: 20170803 bigdataevent

© 2016 Amazon Web Services, Inc. and its affiliates. All rights reserved.

クラウドだと

Page 10: 20170803 bigdataevent

・Hadoopクラスタのノードは使い捨て

・クラウドのHadoopの使い方はクラスタ単位で使い、終わったら

消す、なので新しい世代のEC2が出たら全てそれを使い、使い終

わったら消す。古い効率の悪いEC2を使い続ける必要はない。

※厳密に同じスペックを保証するわけではないが、明確に古い世

代のEC2排除は可能

© 2016 Amazon Web Services, Inc. and its affiliates. All rights reserved.

Page 11: 20170803 bigdataevent

②Hadoopクラスタのノード数を増

やすとCPUとRAMとDISKが線形に

増える。追加ジョブ要件にマッチで

きない。

© 2016 Amazon Web Services, Inc. and its affiliates. All rights reserved.

Page 12: 20170803 bigdataevent

© 2016 Amazon Web Services, Inc. and its affiliates. All rights reserved.

CPU 10コアメモリ 100GBディスク 500GB

例えばこういうジョブがあったら

Page 13: 20170803 bigdataevent

© 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

Page 14: 20170803 bigdataevent

© 2016 Amazon Web Services, Inc. and its affiliates. All rights reserved.

CPU 10コアメモリ 100GBディスク 500GB

ビッグデータなのでデータは増え続ける線形に増えるのであれば大きな問題にはならない

Page 15: 20170803 bigdataevent

© 2016 Amazon Web Services, Inc. and its affiliates. All rights reserved.

例えば既存ジョブのデータ量や処理負荷が2倍になったら

CPU 20コアメモリ 200GB

ディスク 1000GB

Page 16: 20170803 bigdataevent

© 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

Page 17: 20170803 bigdataevent

© 2016 Amazon Web Services, Inc. and its affiliates. All rights reserved.

CPU 10コアメモリ 100GBディスク 500GB

問題は追加のジョブ要件があった場合

CPU 10コアメモリ 100GBディスク 50GB

追加ジョブCPUメモリを多めに使うがディスクはあまりいらない

Page 18: 20170803 bigdataevent

© 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が密結合なので仕方ない

Page 19: 20170803 bigdataevent

© 2016 Amazon Web Services, Inc. and its affiliates. All rights reserved.

オンプレミスのHadoopクラスタは、永続的に動き続けるクラスタにジョブを入れ込んでいく考え方

Job1 Job3

Job2

Page 20: 20170803 bigdataevent

© 2016 Amazon Web Services, Inc. and its affiliates. All rights reserved.

クラウドだと

Page 21: 20170803 bigdataevent

Job3

Job2

Job1

© 2016 Amazon Web Services, Inc. and its affiliates. All rights reserved.

クラスタにジョブを入れ込んでいくのではなく

Page 22: 20170803 bigdataevent

© 2016 Amazon Web Services, Inc. and its affiliates. All rights reserved.

それぞれのジョブにクラスタを立てる

Job3

Job2

Job1

Page 23: 20170803 bigdataevent

© 2016 Amazon Web Services, Inc. and its affiliates. All rights reserved.

ジョブが終わったらジョブとともにクラスタも消すクラスタを使い捨てる

使い捨て!

Job2

Job3

Page 24: 20170803 bigdataevent

© 2016 Amazon Web Services, Inc. and its affiliates. All rights reserved.

そう、使い捨てこそがクラウドの

メリット

Page 25: 20170803 bigdataevent

© 2016 Amazon Web Services, Inc. and its affiliates. All rights reserved.

AWSのEC2と同じ考え方

サイジングや新しいツール検証様々な試験一時的な処理

Page 26: 20170803 bigdataevent

© 2016 Amazon Web Services, Inc. and its affiliates. All rights reserved.

AWSのEC2と同じ考え方

消す

サイジングや新しいツール検証様々な試験一時的な処理

終わったら

Page 27: 20170803 bigdataevent

これをクラスタ単位で行う

© 2016 Amazon Web Services, Inc. and its affiliates. All rights reserved.

Page 28: 20170803 bigdataevent

最適なサイジングができる

© 2016 Amazon Web Services, Inc. and its affiliates. All rights reserved.

Page 29: 20170803 bigdataevent

© 2016 Amazon Web Services, Inc. and its affiliates. All rights reserved.

それぞれのジョブにどのくらいのスペックのクラスタが適切かを事前に検証できる。なので最適なサイジングができる

使って、終わったら消せるんだからバンバン

試せばいい

Job1

Page 30: 20170803 bigdataevent

ということは

© 2016 Amazon Web Services, Inc. and its affiliates. All rights reserved.

Page 31: 20170803 bigdataevent

③バージョンアップも事前に試せる

© 2016 Amazon Web Services, Inc. and its affiliates. All rights reserved.

Page 32: 20170803 bigdataevent

Job3

© 2016 Amazon Web Services, Inc. and its affiliates. All rights reserved.

唯一無二のクラスタをバージョンアップするから怖かった(いや〜怖かった)

Job2

Job1

Page 33: 20170803 bigdataevent

バージョンアップも怖くない

© 2016 Amazon Web Services, Inc. and its affiliates. All rights reserved.

Page 34: 20170803 bigdataevent

同じ理由で、④新しいツールも試しやすい

例えば

© 2016 Amazon Web Services, Inc. and its affiliates. All rights reserved.

Page 35: 20170803 bigdataevent

MapReduceは素晴らしいと思っていたが(実際シンプ

ルで安定してて素晴らしかった)、Sparkが登場した。

© 2016 Amazon Web Services, Inc. and its affiliates. All rights reserved.

Page 36: 20170803 bigdataevent

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はゆっくりと死んでいく・・

Page 37: 20170803 bigdataevent

そんな時クラスタが「触るな危険」では試しずらい。

© 2016 Amazon Web Services, Inc. and its affiliates. All rights reserved.

Page 38: 20170803 bigdataevent

「テストしたいから同規模のクラスタをサクッと用意

して」と言われても辛い。

© 2016 Amazon Web Services, Inc. and its affiliates. All rights reserved.

Page 39: 20170803 bigdataevent

今後もよりいいものは必ずでてくる!

エンジニアにはよりいいものを試し、よりいいプロダ

クトにしてほしい。それを止めるようなプラット

フォームじゃいけない。

© 2016 Amazon Web Services, Inc. and its affiliates. All rights reserved.

Page 40: 20170803 bigdataevent

© 2016 Amazon Web Services, Inc. and its affiliates. All rights reserved.

そう、使い捨てこそがクラウドの

メリット(2回目)

Page 41: 20170803 bigdataevent

だがデータが消えたのでは意味がない

© 2016 Amazon Web Services, Inc. and its affiliates. All rights reserved.

Page 42: 20170803 bigdataevent

© 2016 Amazon Web Services, Inc. and its affiliates. All rights reserved.

クラスタを使い捨ててもデータは残したい

データは残したい

Job2

Job3

Page 43: 20170803 bigdataevent

© 2016 Amazon Web Services, Inc. and its affiliates. All rights reserved.

コンピューティング処理レイヤとストレージレイヤを分けることでデータを永続化

ストレージレイヤの分離

ストレージ

Job2

Job3

Page 44: 20170803 bigdataevent

© 2016 Amazon Web Services, Inc. and its affiliates. All rights reserved.

コンピューティング処理レイヤとストレージレイヤを疎結合にする

それぞれのクラスタの永続データはストレージレイヤに保存

ストレージ

Job2

Job3

Page 45: 20170803 bigdataevent

⑤データは増え続ける。「数百TBや

数PBのストレージが欲しい」「と言

うか理想は容量無限のストレージが

欲しい」。そして数PBとかのバック

アップどうする??

© 2016 Amazon Web Services, Inc. and its affiliates. All rights reserved.

Page 46: 20170803 bigdataevent

© 2016 Amazon Web Services, Inc. and its affiliates. All rights reserved.

オンプレだと

Page 47: 20170803 bigdataevent

© 2016 Amazon Web Services, Inc. and its affiliates. All rights reserved.

無理

Page 48: 20170803 bigdataevent

・ストレージ製品の拡張限界。

・データセンターであれば契約ラック数の限界、またはフロアス

ペース限界。

・バックアップのためにクラスタ冗長化や別途DASなどを使う

(無理じゃないけど辛い)

© 2016 Amazon Web Services, Inc. and its affiliates. All rights reserved.

Page 49: 20170803 bigdataevent

© 2016 Amazon Web Services, Inc. and its affiliates. All rights reserved.

・ストレージ製品の拡張限界。

・データセンターであれば契約ラック数の限界、またはフロアス

ペース限界。

・バックアップのためにクラスタ冗長化や別途DASなどを使う

(無理じゃないけど辛い)

Page 50: 20170803 bigdataevent

© 2016 Amazon Web Services, Inc. and its affiliates. All rights reserved.

クラウドだと

Page 51: 20170803 bigdataevent

© 2016 Amazon Web Services, Inc. and its affiliates. All rights reserved.

できる

Page 52: 20170803 bigdataevent

© 2016 Amazon Web Services, Inc. and its affiliates. All rights reserved.

そう、S3

Page 53: 20170803 bigdataevent

© 2016 Amazon Web Services, Inc. and its affiliates. All rights reserved.

S3の3つの特徴

1.丈夫 (耐久性99.999999999%)

2.容量無制限

3.Hadoopから接続しやすい (EMRFS、s3n、s3a)

Page 54: 20170803 bigdataevent

© 2016 Amazon Web Services, Inc. and its affiliates. All rights reserved.

S3の3つの特徴

1.丈夫 (耐久性99.999999999%)

2.容量無制限

3.Hadoopから接続しやすい (EMRFS、s3n、s3a)

バックアップが必要ならクロスリージョンレプリケーションを活用できる

Page 55: 20170803 bigdataevent

© 2016 Amazon Web Services, Inc. and its affiliates. All rights reserved.

S3の3つの特徴

1.丈夫 (耐久性99.999999999%)

2.容量無制限

3.Hadoopから接続しやすい (EMRFS、s3n、s3a)

あと安い

バックアップが必要ならクロスリージョンレプリケーションを活用できる

Page 56: 20170803 bigdataevent

© 2016 Amazon Web Services, Inc. and its affiliates. All rights reserved.

コンピューティング処理レイヤとストレージレイヤを分ける

ストレージにS3

Job2

Job3

ストレージ

Page 57: 20170803 bigdataevent

© 2016 Amazon Web Services, Inc. and its affiliates. All rights reserved.

コンピューティング処理レイヤとストレージレイヤを分ける

Hadoopクラスタに

EMR

コンピューティング処理のHadoopクラスタにEMR

Job2

Job3

ストレージ

Page 58: 20170803 bigdataevent

これでデータが一箇所に

データが一箇所にあるということは

© 2016 Amazon Web Services, Inc. and its affiliates. All rights reserved.

Page 59: 20170803 bigdataevent

© 2016 Amazon Web Services, Inc. and its affiliates. All rights reserved.

一箇所のデータに対して最適なデータ処理エンジンを使える

ストレージ

Athena

Redshift

Page 60: 20170803 bigdataevent

ストレージ

© 2016 Amazon Web Services, Inc. and its affiliates. All rights reserved.

一箇所のデータに対して最適なデータ処理エンジンを使える

Athena

Redshift

データレイク

Page 61: 20170803 bigdataevent

Hadoopの考え方との違い

(Hadoopはオンプレミスを想定した

アーキテクチャ)

© 2016 Amazon Web Services, Inc. and its affiliates. All rights reserved.

Page 62: 20170803 bigdataevent

© 2016 Amazon Web Services, Inc. and its affiliates. All rights reserved.

・データローカリティを活かした処理スループットの向上。

・起動し続けるのでクラスタではHDFSのデータは絶対。その司令

塔であるマスターノードはHA構成で死守する。

・Rack-awarenessでラック障害や距離を意識したデータ配置、

レプリケーション時のL2スイッチの上りの帯域の考慮、スイッチ

のDeepBuffer機能使ったりなど。

Page 63: 20170803 bigdataevent

・データローカリティを活かした処理スループットの向上。

・起動し続けるのでクラスタではHDFSのデータは絶対。その司令

塔であるマスターノードはHA構成で死守する。

・Rack-awarenessでラック障害や距離を意識したデータ配置、

レプリケーション時のL2スイッチの上りの帯域の考慮、スイッチ

のDeepBuffer機能使ったりなど。

© 2016 Amazon Web Services, Inc. and its affiliates. All rights reserved.

スループットはS3でもそこそこ出る数時間のバッチ処理時間が1,2割増えて問題あるか?で検討する

使い捨てなのでHA機能ない。HDFSはテンポラリ用途として使う

ネットワークまわりはAWS側が全て行う

Page 64: 20170803 bigdataevent

まとめ

© 2016 Amazon Web Services, Inc. and its affiliates. All rights reserved.

Page 65: 20170803 bigdataevent

© 2016 Amazon Web Services, Inc. and its affiliates. All rights reserved.

クラウドらしさとは・リソースをすぐに使えて不要になったら捨てる

・容量無制限のストレージ

・バージョンアップの気軽さ、本番スケールのテストのしやすさ

・ジャストサイズでプロビジョニング

・運用負荷軽減で本来やりたいことに注力

・データローカリティは下がる

・HDFSはテンポラリ

・NameNodeのメタデータ操作にビビらない。NameNodeも作って壊す

・他にもビッグデータ処理に役立つサービスとしてAthena、Kinesis、

Redshift、Snowball、QuickSightなどなど

Page 66: 20170803 bigdataevent

© 2016 Amazon Web Services, Inc. and its affiliates. All rights reserved.

クラウドらしいベストプラクティス・なるべくマネージドサービスを使って運用負荷軽減

・できるだけ一時クラスターを使う

・EC2スポットインスタンスの活用。「スポットフリート!」

・新しいインスタンスに移行してパフォーマンスを活用

・最適なサイジングの為のモニタリング

Page 67: 20170803 bigdataevent

詳しくは・・

© 2016 Amazon Web Services, Inc. and its affiliates. All rights reserved.

Page 68: 20170803 bigdataevent

・ディスカッションあるよ

© 2016 Amazon Web Services, Inc. and its affiliates. All rights reserved.

Page 69: 20170803 bigdataevent

6月くらいに

Big Data 認定資格出ました

© 2016 Amazon Web Services, Inc. and its affiliates. All rights reserved.

Page 70: 20170803 bigdataevent

認定資格、トレーニングの話

© 2016 Amazon Web Services, Inc. and its affiliates. All rights reserved.

Page 71: 20170803 bigdataevent

71