Mais conteúdo relacionado
Semelhante a AWSマイスターシリーズ Instance Store(Ephemeral Disk) & Elastic Block Store (20)
Mais de Amazon Web Services Japan (20)
AWSマイスターシリーズ Instance Store(Ephemeral Disk) & Elastic Block Store
- 1. © 2012 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.
AWSマイスターシリーズ
Instance Store(Ephemeral Disk)
& Elastic Block Store
2014.1.29
アマゾン データサービス ジャパン株式会社
プリンシパル ソリューションアーキテクト
荒⽊木 靖宏
ソリューションアーキテクト
平⼭山 毅
re:Generate
- 2. © 2012 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.
2
Agenda
! ストレージサービス概要
! Instance Store (Ephemeral Disk)
! Elastic Block Store
! 使い分けの実践編
- 3. © 2012 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.
3
Ⅰ)ストレージ
サービス概要
- 4. © 2012 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.
4
4
ところで・・・
! AWS上でストレージはいくつある?
1. Simple Queue Service
2. Instance Store
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
- 5. © 2012 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
5
Instance Storage EBS S3 GlacierStorage Gateway
DynamoDBElastiCache RDS
Redshift
SimpleDB
揮発性
NoSQL
EC2へマウント バックアップ
YesSQL
各サービスの関係図
複数地点での冗⻑⾧長化
SQS
kinesis
- 6. © 2012 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.
6
ブロックストレージのサービス
AWS上でストレージはいくつある?
1. Simple Queue Service
2. Instance Storage
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. © 2012 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.
7
EC2からの接続⽅方法から⾒見見たストレージ分類
EBS
Provisioned
IOPS
EBS
Standard
S3 Glacier
Ephe
meral
Disk
IOPSが指定
可能なEBS
ブロックレベル
のディスク
WEB型の
オブジェクト
ストレージ
アーカイブ
専⽤用ストレージ
EC2インスタ
ンスの⼀一時
ディスク
揮発性 ⾮非揮発性(永続化)
コスト効果
(容量量あたり)
安価⾼高価
EC2
Storage
Gateway
選定するEC2
により起動時
にマッピング
アタッチ VTLStored
Cached
i-‐‑‒SCSI接続
無料料!
(Instance
料料⾦金金内に
含まれる)
- 8. © 2012 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
AMIから⾒見見たストレージ分類
・ 通常はこちらを⽤用いる
(2009年年後半に追加)
・ EC2に停⽌止/終了了のオプ
ション有
・ 停⽌止しても、ファイル
システムは永続する
EBS-‐‑‒
Backed AMI
AMI (Amazon Machine Image
EC2のコピーをとりテンプレート化
することで、再利利⽤用可能
Instance Store-‐‑‒
Backed AMI
• EC2開始当初からある
• EC2に停⽌止のオプションはない
• EC2を終了了するとデータは消える
- 9. © 2012 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.
9
Root DeviceがInstance Store
であるかの確認⽅方法
! EC2の場合 ! AMIの場合
「Describe」タブの
「Root Device Type」を確認
⇒「Instance Store」と表⽰示
AMI選択⼀一覧画⾯面の
「Root Device Type」を確認
⇒「instance store」と表⽰示
若若しくは、画⾯面右上の「Show/Hide」
で「Root Device」を表⽰示させる
- 10. © 2012 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.
10
Ⅱ)Instance Store
(Ephemeral Disk)
- 11. © 2012 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.
11
Instance Storeとは
! 特徴
• EC2の物理理筐体のローカルディスク
• EC2インスタンスタイプにより、サイズと
個数、HDD/SSD、が予め決まっている。
! 利利点
• 無料料!
• 任意のファイルシステムが利利⽤用可能
• ローカルディスクのため、ネットワークの
影響を受けにくい
! 注意
• インスタンスを停⽌止(Stop)すると、データ
が消去される
※[重要]再起動(Reboot)では消えない。
• スナップショット機能はない
• 別のEC2に付替えができない
EC2
/dev/xvdg
/dev/xvdf
揮発性
EC2へマウント
- 12. © 2012 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.
12
Instance Store のアーキテクチャーと
Ephemeral Disk
! Instance Store は各EC2インスタンスと同じ物理理ホストに存在
! ディスク名をEphemeral Disk(Instance Store Volume)と呼びます
! 物理理ホストに割当されているが、利利⽤用できるのは特定の1つのEC2インスタン
スのみ。(同じ物理理ホストの別EC2からの共有は不不可。)
物理理インタ
フェース
ハイパーバイザー
…
EC2インス
タンス
OS
アベイラビ
リティゾーン
リー
ジョン
EBS
EC2イ
ンスタ
ンス
OS
物理理インタ
フェース
ハイパーバイザー
…
EC2イ
ンスタ
ンス
EBSはEC2の
物理理ホストは
別に存在
OS
Ephe
meral
Ephe
meral
Ephe
meral
Ephe
meral
Ephe
meral
Ephe
meral
Ephe
meral
Ephe
meral
Instance
Store
Instance
Store
Instance
Store
- 13. © 2012 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.
13
EC2インスタンスタイプによる
選択可能な Instance Store
! 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⽇日時点
- 14. © 2012 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.
14
Instance Store の適⽤用箇所
OSブートディスク
としての利利⽤用
アプリ
データ
D:
システム
データ
C:
EBS
EC2
EBS
Windows
データ格納ディスク
としての利利⽤用
Ephe
meral
E:
データ計算⽤用
⼀一時ディスク
としての利利⽤用
- 15. © 2012 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.
15
Instance Storeを共有ディスク
構成で利利⽤用する場合の制約
Region
Availability Zone - a
Region
Availability Zone - a
EC2:N → EBS:1 EC2:1 → EBS:N
! 複数のEC2インスタンスから同時に1つのInstance Storeをアタッチできない
(逆に、1つのEC2インスタンスから複数のEBSのアタッチは可能)
! 共有ディスク型のクラスタソフトや Oracle RACといったソリューションをそ
のまま利利⽤用はできない
Nの上限数
は、EC2の
インスタンス
タイプに依存
Ephe
meral
Ephe
meral
Ephe
meral
- 16. © 2012 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.
16
Instance Storeは
別のEC2に付け替えもできない
EBS
Root
EBS
Root
EBS
Root
EBS
Root
Availability Zone - a Availability Zone - a
Ephe
Meral
Data
EBS
Data
Attach
Detach
EC2 EC2
EC2 EC2
Instance Store Elastic Block Store
- 17. © 2012 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.
17
Instance Store の 選択⽅方法
! AMIから起動する際に、Step 4の Add StorageでTypeで
Instance Storeを選択する。選択数はインスタンスタイプに依存。
! CLIの場合は、-‐‑‒b オプションで”デバイス名=ephemeral N”を記載
$ ec2-run-instances ami_id –b “/dev/xvda=ephemeral0”
-b “/dev/xvdb=ephemeral1” and –b “/dev/xvdc=ephemeral2”
- 18. © 2012 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.
18
EC2に接続するEphemeral Disk 数の変更更
! EC2インスタンスを起動後は、Instance Storeの変更更はできないた
め、再度度AMIから起動時に選択する必要があります
(Change Instance Typeでも変更更できません)
EBS
Root
Ephe
Meral
Ephe
Meral
EC2
m1.largeで
Ephemeral Disk
を1つで起動
m1.largeは2つまで
Ephemeral Diskが
付けられるが、EC2
に直接は付けられない
AMI
環境を残し
たい場合
m1.largeで
Ephemeral Disk
を2つで起動
EBS
Root
Ephe
Meral
EC2
Ephe
Meral
- 19. © 2012 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.
19
Instance Store サイズの変更更
! Instance Storeのサイズは、予めEC2のインスタンスタイプによって決め
られており、サイズ変更更ができない。
! 容量量が⾜足りない場合は、複数のEphemeral DiskをOSからストライブする
ことで拡張する⽅方法となります。
Ephe
Meral
420G
EC2
m1.large
Ephe
Meral
420G
OSでストライプし、
840Gに⾒見見せる
OS
! 例例えば、m1.largeでは、
420GのEpheral Disk
が2つまでと、決められている。
↓
2つのディスクをストライプ
して840Gとして、OSから
1ドライブで利利⽤用する。
- 20. © 2012 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.
20
Instance Store のデバイス名
! Instance Store のデバイス名は以下のパスにOSから認識識されます。
Device Name Instance
/dev/sda1, /dev/
xvda1, /dev/xvde1
root (/)でフォーマット&マウントされる
(Windowsの場合は、C:)
/dev/sda2,
xvdb
m1.smallとc1.mediumの場合、
/mmtまたは/media/ephemeral1で
フォーマット&マウントされる
/dev/sda3, /dev/
xvda3, /dev/xvde3
m1.smallとc1.mediumの場合、
OSのスワップ領領域として利利⽤用可能。
ただし、Linuxのみ。
/dev/sdb, xvdb M1.smallとc1.medium以外の場合、
/mnt または /media/ephemeral1
でフォーマット&マウントされる
※2014年年1⽉月29⽇日時点
- 21. © 2012 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.
21
スワップ領領域としての活⽤用
! AWSは、物理理環境を意識識しないため、メモリのオーバーコミットが
できないため、メモリ超過はスワップ領領域で回避することになる。
! メモリ容量量が⼩小さい t1.microとc1.mediumのLinuxでは、仮想メモ
リとして機能するための900MBのデバイスが別途に割当されており、
SwapOnすることで利利⽤用可能。
(Amazon Linuxではデフォルトで有効 )
スワップ領領域が
認識識されている
スワップ領領域デバイス
- 22. © 2012 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.
22
Ephemeral Diskの
Block Device Mappingの表⽰示
! 起動中のEC2は、Block Device MappingでEphemeral Diskのマッ
ピングを確認することができない。
! AMIについては、 Ephemeral Diskのマッピングが確認可能。
Instance
Store
Elastic
Block
Store
起動中EC2 AMI
Root
状態
- 23. © 2012 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.
23
起動中EC2のEphemeral Diskの
Block Device Mappingの確認⽅方法
! メタデータ情報に格納されているため、以下コマンドをEC2インス
タンス上から実⾏行行し、参照することで確認する。
$ GET http://169.254.169.254/latest/meta-data/block-device-mapping/
> WGET http://169.254.169.254/latest/meta-data/block-device-mapping/
Linux
Windows
例例)
Ephemeral Diskのマッピ
ングが認識識されている
- 24. © 2012 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.
24
Instance StoreのAMI化
! 「Create Image」でAMI作成時のボリュームでInstance Storeを
選択することで、 AMIのデバイスにInstance Storeがマッピング
される。(ただし、EBSと違い、データは保持されません)
- 25. © 2012 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.
25
Ephemeral Disk の Cloudwatch 監視
! EC2に紐紐づいているため、EC2インスタンスのDisk Metricを確認します。
(EBSの場合は、EBSのDisk Metricを確認します。)
! 注)複数のEphemeral Diskを利利⽤用の場合は、合計値が表⽰示されます。
(EBSの場合は、VolumeごとにMetricが分かれます。)
- 26. © 2012 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.
26
Hi Storage Instance での Instance Store
HS1 インスタンス (hs1.8xlarge)
・⼤大容量量ストレージ向けHPCインスタンスタイプ
・⼤大容量量のHDD(Instance Store)を内蔵
Cluster Compute
35 ECU
仮想16core
117GiB RAM
2TB x 24
Local HDD
合計48TBのデータ格納が可能。
※ビックデータ系のデータ格納にも有効
■Instance Store 全体の最⼤大スループット
2MBという⼤大きなブロックサイズの場合、
シーケンシャルなRead とWriteの合計で、
2.6 GB / 秒が最⼤大スループット
※2014年年1⽉月29⽇日時点
- 27. © 2012 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.
27
HI1 Instance での Instance Store
HI1 インスタンス (hi1.4xlarge)
・⾼高速ファイルI/Oを実現するHPCインスタンスタイプ
・⾼高速なSSD(Instance Store)を内蔵
Cluster Compute
35 ECU
仮想16core
60.5 GB RAM
1TB x 2
Local SSD
■Instance Store 全体の最⼤大スループット
Read 2 GB /秒
Write 1.1 GB /秒
■IOPS(2 SSD をストライピング前提)
Ⅰ) PV(準仮想化)Linuxの場合
■Block Size : 4KB , Randam
Read 120,000 IOPS
Write 10,000 – 85,000 IOPS
Ⅱ)HVM(完全仮想化)Linux,Windowsの場合
■Block Size : 4KB , Randam
Read 90,000 IOPS
Write 9,000 – 75,000 IOPS
※2014年年1⽉月29⽇日時点
- 28. © 2012 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.
28
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⽇日時点
- 29. © 2012 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
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⽇日時点
- 30. © 2012 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.
30
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⽇日時点
- 31. © 2012 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.
31
Ⅲ)Elastic Block Store
Update中⼼心
- 32. © 2012 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.
32
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
- 33. © 2012 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.
33
EBSの基本アーキテクチャ
物理理インタ
フェース
ファイア
ウォール
ハイパーバイザー
…
EC2イン
スタンス
OS
! EBSを作成すると、ボリュームが内部的に冗⻑⾧長化されている。
! 1つのEBSをアタッチすると、EC2インスタンスから1つのデバイスとして⾒見見
えるようになるが、OS側でファイルシステムで利利⽤用できるように設定が必要。
! EBSはネットワーク接続型だが、ネットワークを意識識しなくても良良い。
アベイラビリ
ティゾーン
リージョン
Snapshot
OSからはEBSが1つ
のSCSIデバイスとし
て認識識される
セキュリティグルー
プは意識識せず。
全ての通信ポートを
閉じてもEBSにア
タッチが可能
EBS
内部的に冗⻑⾧長化
- 34. © 2012 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.
34
EBSスナップショットとは?
! スナップショットとは?
• EBSボリュームの特定時点のスナップショットをS3に保存
• 2回⽬目移⾏行行のスナップショットは差分のみS3に保存する差分バックアップ
• スナップショットの世代管理理が可能
• 安価に⻑⾧長期保存が可能
• スナップショットからいくつでもAZ間でもEBSボリューム作成・復復元可能
• 他アカウントと共有設定も可能
• AZ固定ではない
• EBSのサイズ変更更もスナップショット活⽤用により実現可能
- 35. © 2012 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.
35
Snapshot Copyとは?
! 作成したSnapshotをコピーする機能
※Region内コピー、Region間コピー、の両⽅方可能(初のRegion間機能)
! 対象はEBS、MarketPlace、VM import経由のAMI、StorageGateway
のスナップショットを含む
※RDSやRedshiftのスナップショット、AMIのコピーも可能に! (2014年年1⽉月29⽇日時点)
「Create Image from EBS snapshot」を使えばLinuxのAMI化後の起動は可能
Region : A
Availability
Zone - a
Snapshot
EBS
Availability
Zone - b
Region : B
Availability
Zone - a
Availability
Zone - b
Internet
Snapshot
Copy
Snapshot Copy
EBS
AMI
Create EBS
from Snapshot
Create AMI
from Snapshot
- 36. © 2012 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.
36
Provisioned IOPSとは?
! IOPS数が指定できるEBS
! EBS-‐‑‒Optimizedインスタンスを前提としている
! Volume作成時にStandardかPIOPSを指定する
! IOPS値の指定は100〜~4000で1刻みが可能
(最⼤大値が4000まで可能に!従来は2000まで)
! Root VolumeのEBSもPIOPSを使⽤用可能
! OSからは通常のEBSと同じように⾒見見える
! EC2の作成時に、合わせて作成可能
! 合計20TB, 10,000IOPSの制限がある
§ 申請にて制限解除可能
EBS
IOPSとは?
Input Output per Second の略略で、
「1秒あたりのディスクI/O数」を意味し、
DISK性能に指標値の1つ
(算出式)
1
回転待ち時間+シーク時間+転送時間
Volume Typeに
Provisoned
IOPSを指定
IOPSの値を指定
- 37. © 2012 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.
37
EBS-‐‑‒Optimized Instanceとは?
! EBS⽤用にネットワーク帯域を最適化
! 確保される帯域は、500Mbps〜~2000Mbps
(最⼤大帯域が2000Mbpsまで可能に(HPCは除く)!従来は1000Mbpsまで)
! Standard EBS使⽤用時も効果がある
! “EBS-‐‑‒Optimized Instance” と “Provisioned IOPS”を組み合わせることで、I/
O値の最適化が可能
! ⼤大幅に対応したインスタンスが増加
EC2
EC2
normal
Net
work
PIOPS
EBS
PIOPS
EBS
EC2
通常 EBS-‐‑‒Optimized-‐‑‒Instance
EC2
EBS-‐‑‒
Optimized
Net
work
PIOPS
EBS
PIOPS
EBS
EC2
ストレージエリア
ネットワーク
通常
ネットワーク
ストレージエリア
ネットワーク
通常
ネットワーク
EBS向け帯域と競合 EBS向け帯域を専⽤用に確保
- 38. © 2012 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.
38
PIOPSとEBS-‐‑‒Optimizedの組合せ
EC2
normal
Net
work
EBS EBS
EC2
ストレージエリア
ネットワーク
通常
ネットワーク
EC2
EBS-‐‑‒
Optimized
Net
work
EBS EBS
EC2
ストレージエリア
ネットワーク
通常
ネットワーク
EC2
normal
Net
work
PIOPS
EBS
PIOPS
EBS
EC2
EC2
EBS-‐‑‒
Optimized
Net
work
PIOPS
EBS
PIOPS
EBS
EC2
ストレージエリア
ネットワーク
通常
ネットワーク
ストレージエリア
ネットワーク
通常
ネットワーク
①通常 ②EBS-‐‑‒optimized
③PIOPS ④PIOPS+EBS-‐‑‒optimized
P
IOPS
EBS-‐‑‒optimized
安定性の向上
⾼高速 推奨しない
(※PIOPSがEBS-‐‑‒Optimizedを前提とするため)
⾼高速なIO
の安定化
IOの安定化
- 39. © 2012 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.
39
EBS Optimized可能な
インスタンスと最⼤大スループット
! EBS Optimized が可能なEC2インスタンスが⼤大幅に増⼤大
! EBS Optimized した場合の最⼤大スループットで2000Mbpsも可能に
Instance Type Dedicated EBS
Throughput (Mbps)*
Max 16K IOPS
c1.xlarge 1,000 8,000
c3.xlarge 500 4,000
c3.2xlarge 1,000 8,000
c3.4xlarge 2,000 16,000
g2.2xlarge 1,000 8,000
i2.xlarge 500 4,000
i2.2xlarge 1,000 8,000
i2.4xlarge 2,000 16,000
m1.large 500 4,000
m1.xlarge 1,000 8,000
m2.2xlarge 500 4,000
m2.4xlarge 1,000 8,000
m3.xlarge 500 4,000
m3.2xlarge 1,000 8,000
※2014年年1⽉月29⽇日時点
- 40. © 2012 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.
40
Elastic Block Store 価格
(値下げ発表)
EBSスタンダードボ
リューム
旧料料⾦金金 新料料⾦金金 変更更
1か⽉月にプロビジョニン
グされたストレージ1GB
あたり
$0.12 $0.085 -‐‑‒29.1%
/100 万 I/O リクエスト $0.12 $0.085 -‐‑‒29.1%
! 2014年年2⽉月からEBS Standard Volumeの値下げを実施。
! 東京リージョンに関しては以下の価格帯
※東京リージョン2014年年2⽉月時点
100G
0.85$ 0.85$ 0.85$
例例1)3ヶ⽉月間を100G利利⽤用
100G
8.5+8.5×1/30/24=8.512$
200G
8.5×3=25.5$
例例2)1か⽉月で1時間のみ2倍に拡張
- 41. © 2012 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.
41
Provisioned IOPSと
EBS Snapshotの価格
2) IOPS
通常EBS⽉月間の総累累積I/O。PIOPSはIOPS期間累累計
例例3)通常のEBS
・⽉月間で10億I/O → $12
・15⽇日で10億I/O → $12
例例4)PIOPS
・⽉月間100IOPS のPIOPS利利⽤用 → 100×0.12=$12
・15⽇日200IOPS のPIOPS利利⽤用 → 200×0.12×15/30=$12
I/O数はCloudwatchやIostatで
取得しても良良いが「利利⽤用レポー
ト」のCSVが実測I/O値
(※この値を元に課⾦金金される)
3)S3 Snapshotデータ量量
実データの総量量になる
例例5)初回に20G、⽉月末に更更新差分2G
2$ 2.2$ 2.4$
20G 22G 24G
- 42. © 2012 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.
42
Ⅳ)使い分け実践編
- 43. © 2012 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.
43
! OSやDBなど、永続性が必要なデータの格納
! スナップショット取得が必要なデータ
! アベイラビリティゾーン/リージョンをまたいでコピーしたいデータ
! ランダムI/Oに有利利
EBSを使うべきなのは
EBS
S3
EBS
Snapshot
EBS
Region
Region
リージョン
間コピー
- 44. © 2012 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.
44
! Provisioned IOPS
• 1ボリューム最⼤大4000IOPSまで指定可能なオプション
• 16KB以下のブロックサイズの場合、指定IOPSの10%以
内に収まる性能を、年年間99.9%の時間で提供
! EBS-‐‑‒Optimized Instance
• EC2とEBS間のネットワークを最適化するオプション
• Provisioned IOPSと⼀一緒に利利⽤用すると効果が⾼高い
EC2
EBSの性能向上と⼀一定化オプション
EC2
Optimized
P-IOPS
- 45. © 2012 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.
45
Instance Storageを使うべきなのは
! 計算時の⼀一時ファイルや、画像処理理の⼀一時データ、キャッシュ
ファイル
! デプロイするアプリケーションコードの置き場所として
! 冗⻑⾧長化を⾃自分で作りこめる場合
! ⼤大容量量のデータを1インスタンスに格納する場合
! SSDのIO速度度が必要な場合
! ログの⼀一時保存場所として。流流量量の速いログを⼀一旦Instance
Storageに吐き出し、定期的にS3にアップロードする。
S3
- 46. © 2012 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.
46
! 様々な暗号化製品の利利⽤用が可能
• Windows Bitlocker (Microsoft)
• Secure Cloud(TrendMicro)
• SafeNet ProtectV (SafeNet)
• Crypt Setup(OSS)
! 冗⻑⾧長化機能や分散FSも利利⽤用可能
• DRBD(OSS)
• ClusterPro (NEC)
• GlusterFS (OSS)
• Redhat Storage Server (Redhat)
Ephemeral Disk の 暗号化/冗⻑⾧長化
EC2 disk
EC2 disk
レプリカ
- 47. © 2012 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.
47
シミュレーションの実施
! ⾃自分の利利⽤用シナリオをシミュレーションして何を使うかを決める
(特に性能要件が明確な場合)
! シミュレーションを⼿手伝うツール
・OS(Linux,Windows):Fio
・Oracle Databese: Oracle ORION
・Microsoft SQLserver: SQLIO
! 計測とトライアンドエラーができるクラウドのメリットを活⽤用
- 48. © 2012 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.
48
EC2とEBSの信頼性をどう考えるか?
Availability Zone - a Availability Zone - a
Instance Store Elastic Block Store
EBS
Root
EBS
Root
Ephe
Meral
Data
EC2
EC2
EBS
Data
Snap
Shot
Backup
Data
AZ障害、
EC2停⽌止障害でデータが消える
AZ障害、
EBS障害でデータが消える
- 49. © 2012 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.
49
Ephemeral Disk活⽤用例例①
バッチ処理理
! Ephemeral Disk をソート処理理が中⼼心なバッチ処理理で活⽤用する。
! バッチ処理理時のみ起動し、終了了後は削除。障害時は再実⾏行行。
Ephe
Meral
Data
EC2
AMI
EBS
Root
処理理前
データ
処理理後
データ
バッチ処理理開始
↓
EC2起動
バッチ処理理終了了
↓
EC2終了了
障害発⽣生時
バッチ
プログラム
- 50. © 2012 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.
50
バックアップ実装案
! EC2インスタンスの信頼性にデータ保障が依存するため、EC2イン
スタンスと同様に冗⻑⾧長化して、リプリケーションを実施。
! 更更にS3へのバックアップも推奨。
EC2
EBS
Root
Ephe
Meral
Data
EC2
EBS
Root
Ephe
Meral
Data
Availability Zone - a Availability Zone - b
OSやミドルウェアの機能
でレプリケーションを実施
CLIのS3 Sync等を活
⽤用してファイル同期
S3
- 51. © 2012 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.
51
Storage Gatewayと組合せ構成例例
! Storage Gatewayを活⽤用することで、1つのEC2上のOSから
1) Ephemeral , 2)EBS PIOPS , 3) EBS Standard , 4) S3
を⽤用途に応じて、OSから使い分けする事ができる。
EC2
EBS
Root
Ephe
Meral
(SSD)
Data
Storage
Gateway
EBS
Root
EBS
Cache
EBS
Upload
EBS
Data
Stan
dard
EBS
Data
PIOPS
OS
- 52. © 2012 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.
52
まとめ
! Instance Store (Ephemeral Disk)はt1.micro以外のイ
ンスタンスで利利⽤用でき、最新インスタンスではSSDを利利
⽤用できるタイプが増えています。
! Root VolumeはEBSとし、⼀一時データ格納⽤用やバッチ処
理理⽤用途として、コストの係らない Instance Store
(Ephemeral Disk)を活⽤用するのがお勧めです。
! Instance Store (Ephemeral Disk)上データの耐久性は、
ファイルコピーやS3同期で向上させることが可能です。
- 53. © 2012 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.
53
Appendix-‐‑‒1
! 参考資料料
• Ephemeral Disk
http://docs.aws.amazon.com/ja_̲jp/AWSEC2/latest/
UserGuide/
InstanceStorage.html#StorageOnInstanceTypes
• Elastic Block Store
http://docs.aws.amazon.com/ja_̲jp/AWSEC2/latest/
UserGuide/AmazonEBS.html
- 54. © 2012 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.
54
Appendix-‐‑‒2
! 参考資料料
• EBS Optimized Instance (英語)
http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/
EBSOptimized.html
• HI1 Instance (英語)
http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/
storage_̲instances.html
• HS1 Instance (英語)
http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/
high_̲storage_̲instances.html
• I2 Instance(英語)
http://aws.amazon.com/jp/glacier/pricing/