Mais conteúdo relacionado
Semelhante a EC2のストレージどう使う? -Instance Storageを理解して高速IOを上手に活用!- (20)
EC2のストレージどう使う? -Instance Storageを理解して高速IOを上手に活用!-
- 1. © 2014 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
EC2のストレージどう使う?
Instance Storageを理理解して
⾼高速IOを上⼿手に活⽤用!
2014年3月17日
アマゾンデータサービスジャパン株式会社
ソリューションアーキテクト 今井雄太
- 2. © 2014 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
自己紹介
• 名前
– 今井雄太( yuimai@amazon.co.jp )
• 仕事
– ソリューションアーキテクト
– 広告業界・アドテクノロジープレイヤーのお客様を担当し
ています
– リスティング広告の配信システムの開発や媒体社で広告配
信システムまわりの開発・運⽤用を経験してきました。
- 3. © 2014 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
Agenda
Instance Storageとは?
Instance Storageの活⽤用シーン
1
2
- 4. © 2014 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
Agenda
Instance Storageとは?
Instance Storageの活⽤用シーン
1
2
- 5. © 2014 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
5
AWSのストレージサービス?
1. Simple Queue Service
2. Instance Store(Ephemeral Disk)
3. Elastic Block Store(EBS)
4. AWS Storage Gateway
5. Amazon Simple Storage Service(S3)
6. Amazon Glacier
7. Amazon ElastiCache
8. Amazon SimpleDB
9. Amazon DynamoDB
10. Amazon Relational Database Service(RDS)
11. Amazon Redshift
12. Amazon Kinesis
- 6. © 2014 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
ブロックストレージのサービス
1. Simple Queue Service
2. Instance Storage(Ephemeral Disk)
3. Elastic Block Store(EBS)
4. AWS Storage Gateway
5. Amazon Simple Storage Service(S3)
6. Amazon Glacier
7. Amazon ElastiCache
8. Amazon SimpleDB
9. Amazon DynamoDB
10. Amazon Relational Database Service(RDS)
11. Amazon Redshift
12. Amazon Kinesis
EC2で利利⽤用可能な基本的な
ブロックストレージ
- 7. © 2014 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
インスタンスストレージ?
もしくは
エフェメラルディスク?
- 8. © 2014 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
Instance Storageとは
• 特徴
– EC2の物理筐体のローカルディスク
– EC2インスタンスタイプにより、サイズと個
数、HDD/SSD、が予め決まっている。
• 利点
– 無料!
– 任意のファイルシステムが利用可能
– ローカルディスクのため、ネットワークの影
響を受けにくい(レイテンシ・帯域)
• 注意
– インスタンスを停止(Stop)すると、データが
消去される
※[重要]再起動(Reboot)では消えない。
– スナップショット機能はない
– 別のEC2に付替えができない
EC2
/dev/xvdg
/dev/xvdf
揮発性
EC2へマウント
- 9. © 2014 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
EBS?
- 10. © 2014 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
Amazon Elastic Block Storeとは
EBSとは、EC2に仮想外付けされる
ブロックレベルのストレージサービス
※各コンピュートサービスのデータ基盤
" サイズは1GB単位で〜~1TBまで
" サイズ/期間/IOで課⾦金金される
" 各EC2インスタンスで、複数EBSを使える
詳細
" データは永続的に保存される
" アベイラビリティゾーン(AZ) に存在
" 他のEC2インスタンスに付け替え可能
" バックアップから、EBSを作成可能
(他のAZに作成できる)
Region
Availability Zone - a
EBS EBS EBS
Availability Zone - b
EBS EBS
Amazon Simple
Storage Service
(S3)
EBS
Snapshot
EC2 EC2
- 11. © 2014 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
EBSと
Instance Storage
- 12. © 2014 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
EC2からの接続方法から見たストレージ分類
EBS
Provisioned
IOPS
EBS
Standard
S3 GlacierInstance
Storage
IOPSが指定
可能なEBS
ブロックレベル
のディスク
WEB型の
オブジェクト
ストレージ
アーカイブ
専⽤用ストレージ
EC2インスタ
ンスの⼀一時
ディスク
揮発性 ⾮非揮発性(永続化)
コスト効果
(容量量あたり)
安価⾼高価
EC2
Storage
Gateway
選定するEC2
により起動時
にマッピング
アタッチ VTLStored
Cached
i-‐‑‒SCSI接続
無料料!
(Instance
料料⾦金金内に
含まれる)
- 13. © 2014 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
Instance StorageとEBS
EC2
Instance Storage
• 内蔵ディスク
• EC2と不可分
• EC2をStop/Terminateするとクリアされる
• 性能・容量はインスタンスタイプごとに規定
• 追加費用なし
EBS
• ネットワークで接続
• EC2とは独立管理
• EC2をTerminateしてもEBSは保持可能
• Volumeごとに性能・容量を定義可能
• EBSの費用が発生
物理的には
ネットワーク経由
- 14. © 2014 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
Instance StorageとEBS
EC2
Instance Storage
• 内蔵ディスク
• EC2と不可分
• EC2をStop/Terminateするとクリアされる
• 性能・容量はインスタンスタイプごとに規定
• 追加費用なし
EBS
• ネットワークで接続
• EC2とは独立管理
• EC2をTerminateしてもEBSは保持可能
• Volumeごとに性能・容量を定義可能
• EBSの費用が発生
物理的には
ネットワーク経由
- 15. © 2014 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
AMIから見たストレージ分類
・ 通常はこちらを⽤用いる
(2009年年後半に追加)
・ EC2に停⽌止/終了了のオプ
ション有
・ 停⽌止しても、ファイル
システムは永続する
EBS-‐‑‒
Backed AMI
AMI (Amazon Machine Image
EC2のコピーをとりテンプレート化
することで、再利利⽤用可能
Instance Store-‐‑‒
Backed AMI
• EC2開始当初からある
• EC2に停止のオプションはない
• EC2を終了するとデータは消える
起動ディスク
EBS
起動ディスク
Instance
Storage
- 16. © 2014 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
Instance Storage の適用箇所
OSブートディスク
としての利用
アプリ
データ
D:
システム
データ
C:
EBS
EC2
EBS
Windows
データ格納ディスク
としての利利⽤用
Instance
Storage
E:
データ計算⽤用
⼀一時ディスク
としての利利⽤用
- 17. © 2014 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
Instance Store の適用箇所
OSブートディスク
としての利用
アプリ
データ
/dev/xvdf
システム
データ
/dev/xvda1
EBS
EC2
EBS
Linux
データ格納ディスク
としての利利⽤用
Instance
Storage
/dev/xvdg
データ計算⽤用
⼀一時ディスク
としての利利⽤用
- 18. © 2014 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
なぜいま
Instance Storage
の話なのか?
- 19. © 2014 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
Instance StorageにSSDを積んだイ
ンスタンスが増えてきた
• EC2のタイプによって、選択できるInstance Storeは以下の通り。
Instance Type Instance Store Volumes
m1.small 1 x 160 GB†
m1.medium 1 x 410 GB
m1.large 2 x 420 GB (840 GB)
m1.xlarge 4 x 420 GB (1680 GB)
m2.xlarge 1 x 420 GB
m2.2xlarge 1 x 850 GB
m2.4xlarge 2 x 840 GB (1680 GB)
m3.medium 1 x 4 GB SSD
m3.large 1 x 32 GB SSD
m3.xlarge 2 x 40 GB SSD (80 GB)
m3.2xlarge 2 x 80 GB SSD (160 GB)
t1.micro
None
(use Amazon EBS volumes)
c1.medium 1 x 350 GB†
c1.xlarge 4 x 420 GB (1680 GB)
Instance Type Instance Store Volumes
c3.large 2 x 16 GB SSD (32 GB)
c3.xlarge 2 x 40 GB SSD (80 GB)
c3.2xlarge 2 x 80 GB SSD (160 GB)
c3.4xlarge 2 x 160 GB SSD (320 GB)
c3.8xlarge 2 x 320 GB SSD (640 GB)
cc2.8xlarge 4 x 840 GB (3360 GB)
cg1.4xlarge 2 x 840 GB (1680 GB)
cr1.8xlarge 2 x 120 GB SSD (240 GB)
hi1.4xlarge 2 x 1024 GB SSD (2048 GB)
hs1.8xlarge 24 x 2048 GB (49 TB)
i2.xlarge 1 x 800 GB SSD
i2.2xlarge 2 x 800 GB SSD (1600 GB)
i2.4xlarge 4 x 800 GB SSD (3200 GB)
i2.8xlarge 8 x 800 GB SSD (6400 GB)
※2014年年1⽉月29⽇日時点
- 20. © 2014 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
I2 Instance での Instance Store
Size
EC
Us
vCP
Us
Memo
ry
(GiB)
Instance
Storage (GiB)
EBS-
Optimiz
ed
Read
IOPS
First
Write
IOPS
Network
Performance
i2.xlarge 14 4 30.5 1 x 800 (SSD) Yes 35,000 35,000 Moderate
i2.2xlarge 27 8 61 2 x 800 (SSD) Yes 75,000 75,000 High
i2.4xlarge 53 16 122 4 x 800 (SSD) Yes 175,000 155,000 High
i2.8xlarge 104 32 244 8 x 800 (SSD) - 365,000 315,000 10 Gigabit
I2 インスタンス
・⾼高I/Oを実現するインスタンスタイプ
・⾼高速なSSD(Instance Store)を内蔵
・以下の条件を満たす場合、最⼤大IOPSが以下のように明⽰示されている
・Linux Kernel 3.8以上
・ブロックサイズを4KBの倍数
※2014年年1⽉月29⽇日時点
- 21. © 2014 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
C3 Instance での Instance Store
C3 インスタンス
・⾼高CPUを実現するインスタンスタイプ
・⾼高速なSSD(Instance Store)を選択可能
Size ECUs vCPUs
Memory
(GiB)
Instance
Storage(GiB)
EBS-
Optimized
Network
Performance
c3.large 7 2 3.75 2 x 16 (SSD) - Moderate
c3.xlarge 14 4 7.5 2 x 40 (SSD) Yes Moderate
c3.2xlarge 28 8 15 2 x 80 (SSD) Yes High
c3.4xlarge 55 16 30 2 x 160 (SSD) Yes High
c3.8xlarge 108 32 60 2 x 320 (SSD) - 10 Gigabit
※2014年年1⽉月29⽇日時点
- 22. © 2014 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
M3 Instance でのInstance Store
Size ECUs vCPUs
Memory
(GiB)
Instance Storage (GiB)
EBS-
Optimized
Network
Performanc
e
m3.medium 3 1 3.75 1 x 4 (SSD) - Moderate
m3.large 6.5 2 7 1 x 32 (SSD) - Moderate
m3.xlarge 13 4 15 2 x 40 (SSD) Yes Moderate
m3.2xlarge 26 8 30 2 x 80 (SSD) Yes High
M3 インスタンス
・新型CPUを搭載したインスタンスタイプ
・従来はEBSのみ接続であったが、
⾼高速なSSD(Instance Store)を選択可能に!
※2014年年1⽉月29⽇日時点
- 23. © 2014 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
EBSでIOPSを
稼ぐには?
- 24. © 2014 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
• Provisioned IOPS
– 1ボリューム最大4000IOPSまで指定可能なオプ
ション
– 16KB以下のブロックサイズの場合、指定IOPSの
10%以内に収まる性能を、年間99.9%の時間で提
供
• EBS-Optimized Instance
– EC2とEBS間のネットワークを最適化するオプ
ション
– Provisioned IOPSと一緒に利用すると効果が高い
EC2
EBSの性能向上と⼀一定化オプション
EC2
Optimized
P-IOPS
- 25. © 2014 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
価格⾯面でEBS(PIOPS)と⽐比較してみる
• Read, Writeの性能や可用性、コストなどを考
慮するとトータルとしてどちら良いか?
Placement Group
i2.8xlarge
DRBD
32vCPU (104ECU)
244 GB Memory
SSD 800GB x8
32vCPU (88ECU)
244 GB Memory
PIOPS 4000 IOPS/800GB x8
cr1.8xlarge
PIOPS
3年 Reserved Instance
$ 4049.4
3年 Reserved Instance
$ 5814.3
- 26. © 2014 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
EBSと比べると
より安価に速い
SSDも使える
Instance Storage
- 27. © 2014 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
しかしEC2を
Terminateしたり、
Stopするとデータ
がなくなる
- 28. © 2014 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
いくつかの活用方
法についてのアイ
デアをご紹介して
いきます
- 29. © 2014 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
Agenda
Instance Storageとは?
Instance Storageの活⽤用シーン
1
2
- 30. © 2014 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
Instance Storageを使うべきなのは
• 高IOPS、高帯域なストレージが必要
な場合
• 消えても良い一次データの置き場と
して使う場合
• ストレージ冗長化を準備できる場合
S3活かしたいメリット
考慮すべき制約
- 31. © 2014 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
Instance Storageの活用シーン
• アプリケーションコードやログの吐
き出し先として
• バッチ処理等の一時ストレージとし
て
• ストレージやデータベースのディス
クとして
S3
- 32. © 2014 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
Instance Storageの活用シーン
• アプリケーションコードやログの吐
き出し先として
• バッチ処理等の一時ストレージとし
て
• ストレージやデータベースのディス
クとして
S3
- 33. © 2014 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
アプリケーションコードやログの吐き出し先
として
• 追加費⽤用が発⽣生しない
• ログ吐き出しを受ける⾼高速なIO
S3活かしたいメリット
考慮すべき制約
• インスタンスをStop/Terminateするとデータが
なくなるので、ログはS3などに吐き出すように
しておく
- 34. © 2014 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
アプリケーションコードやログの吐き出し先
として
AMI
- 35. © 2014 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
アプリケーションコードやログの吐き出し先
として
EC2
Instance
Storage
コード
AMI
- 36. © 2014 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
アプリケーションコードやログの吐き出し先
として
EC2
Instance
Storage
コード
ログ
AMI
- 37. © 2014 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
アプリケーションコードやログの吐き出し先
として
EC2
Instance
Storage
コード
ログ
AMI
コードはAMIやリポジトリ
から取得する
- 38. © 2014 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
アプリケーションコードやログの吐き出し先
として
EC2
Instance
Storage
コード
ログ
AMI
コードはAMIやリポジトリ
から取得する
ログはS3に吐き出す
- 39. © 2014 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
Instance Storageの活用シーン
• アプリケーションコードやログの吐
き出し先として
• バッチ処理等の一時ストレージとし
て
• ストレージやデータベースのディス
クとして
S3
- 40. © 2014 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
バッチ処理等の一時ディスクとして利用
• ⾼高速・⾼高帯域なIOを必要とするようなバッチ処
理理に
S3活かしたいメリット
考慮すべき制約
• インスタンス障害時にはデータのサルベージは
諦める
• インスタンスの障害等が起こった時に、S3から
再度度データを取り出してリトライが可能なアー
キテクチャに
- 41. © 2014 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
バッチ処理等の一時ディスクとして利用
EC2
Instance
Storage
Data
- 42. © 2014 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
バッチ処理等の一時ディスクとして利用
EC2
Instance
Storage
Data
バッチ処理!
- 43. © 2014 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
バッチ処理等の一時ディスクとして利用
EC2
Instance
Storage
Data
- 44. © 2014 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
バッチ処理等の一時ディスクとして利用
EC2
Instance
Storage
EC2
Instance
Storage
- 45. © 2014 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
バッチ処理等の一時ディスクとして利用
EC2
Instance
Storage
EC2
Instance
Storage
S3からデータを取得
してやり直す
- 46. © 2014 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
Instance Storageの活用シーン
• アプリケーションコードやログの吐
き出し先として
• バッチ処理等の一時ストレージとし
て
• ストレージやデータベースのディス
クとして
S3
- 47. © 2014 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
ストレージやデータベースのディスクとして
EC2
Instance
Storage
EC2EC2 EC2
Storage software
DBMS
- 48. © 2014 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
バッチ処理等の一時ディスクとして利用
• ストレージ層に⾼高速なIOを!
S3活かしたいメリット
考慮すべき制約
• ストレージデバイス単位の障害への耐久性
• EC2単位の障害への耐久性
• これらの耐久性について、OSやDBMS、スト
レージソフトウェアの層で対処する
- 49. © 2014 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
OS層での対策例: DRBD
AZ-A AZ-B
- 50. © 2014 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
ストレージソフトウェア層での対策例:
GlusterFS
GlusterFS
NFS
GlusterFS
NFS
GlusterFS
NFS
GlusterFS
NFS
GlusterFS
NFS
GlusterFS
NFS
GlusterFS
NFS
GlusterFS
NFS
GlusterFS
NFS
GlusterFS
NFS
GlusterFS
AZ-A
AZ-B
- 51. © 2014 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
DBMS層での対策例:非同期レプリケーション
トランザクションログ転送
Ephe
meral
Ephe
meral
Ephe
meral
Ephe
meral
Master
Slave
- 52. © 2014 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
MongoDB Sharded Replica sets
複数のAZに跨ってレプリカセットを配備することで高可用性を実現
- 53. © 2014 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
Leader
Compute 1 Compute 2 Compute 3 Compute n
A1 A2 A3
A3A2 A1
B3 B1 B2
B2B1 B3
Table A
primary,
secondary
data
Table B
primary,
secondary
data
A1
A2
B3
B1
DBMS層での対策例例:Redshift
- 54. © 2014 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
いろいろ
ありますね・・・
- 55. © 2014 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
デザインパターン
にしてみました
- 56. © 2014 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
デザインパターンにまとめてみる
EC2にデータ永続化をさせないパターン
EC2
Instance
Storage
Data
• コード
• ログ
• バッチ処理のデータ
• DBのSlave
- 57. © 2014 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
デザインパターンにまとめてみる
データを⾮非同期レプリケーションするパターン
EC2
Instance
Storage
EC2
Instance
Storage
Data
Async
- 58. © 2014 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
デザインパターンにまとめてみる
データを同期ミラーリングするパターン
EC2
Instance
Storage
EC2
Instance
Storage
Data Data
Sync
- 59. © 2014 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
デザインパターンにまとめてみる
データを持ち合うパターン
EC2
Instance
Storage
EC2
Instance
Storage
Data A Data B
Data B Data A
- 60. © 2014 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
注意:RAIDについて
RAIDのディスク冗⻑⾧長化は
あくまでホスト内の耐久性向上施策
EC2
Instance
Storage
Instance
Storage
Sync
• EC2ホスト内でのデータ耐
久性を上げるという対策と
してはあり
• ただし、EC2ホスト自体の
TerminateやStopへの対策
にはならないので注意!
- 62. © 2014 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
- 63. © 2014 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
• ネットワーク冗長化
– DRBD
– ClusterPro
– DataKeeper
• 分散FS
– GlusterFS (OSS)
– OrangeFS
– Lustre
– Windows Distributed File System (DFS)
– HDFS
参考)
OS層/ストレージソフトウェア層での対策群
- 64. © 2014 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
RDBMSの冗長化 (ログシッピング)
– MySQL + replication (+ MHA)
– PostgreSQL + streaming replication
– Oracle + Data Guard
– SQL Server + AlwaysOn
分散DB
– MySQL Cluster
– MongoDB
– Cassandra
– (Redshift)
参考)DBMS層での対策群