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. AWSマイスターシリーズ Instance Store(Ephemeral Disk) & Elastic Block Store 2014.1.29 アマゾン データサービス ジャパン株式会社 プリンシパル ソリューションアーキテクト 荒 靖宏 ソリューションアーキテクト 平 毅 re:Generate

AWSマイスターシリーズ InstanceStore(EphemeralDisk) … · May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc. 12

  • Upload
    others

  • View
    3

  • Download
    0

Embed Size (px)

Citation preview

  • © 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

  • © 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!  使い分けの実践編

  • © 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

    Ⅰ)ストレージ      サービス概要

  • © 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  Service2.   Instance  Store3.   Elastic  Block  Store(EBS)4.   AWS  Storage  Gateway5.   Amazon  Simple  Storage  Service(S3)6.   Amazon  Glacier7.   Amazon  ElastiCache8.   Amazon  SimpleDB9.   Amazon  DynamoDB10.  Amazon  Relational  Database  Service(RDS)11.  Amazon  Redshift12.  Amazon  Kinesis

  • © 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 Glacier Storage Gateway

    DynamoDB ElastiCache RDS

    Redshift

    SimpleDB

    揮発性

    NoSQL

    EC2へマウント バックアップ

    YesSQL

    各サービスの関係図

    複数地点での冗⻑⾧長化

    SQS

    kinesis

  • © 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  Service2.   Instance  Storage3.   Elastic  Block  Store(EBS)4.   AWS  Storage  Gateway5.   Amazon  Simple  Storage  Service(S3)6.   Amazon  Glacier7.   Amazon  ElastiCache8.   Amazon  SimpleDB9.   Amazon  DynamoDB10.  Amazon  Relational  Database  Service(RDS)11.  Amazon  Redshift12.  Amazon  Kinesis

    EC2で利利⽤用可能な基本的なブロックストレージ

  • © 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

    EphemeralDisk

    IOPSが指定可能なEBS

    ブロックレベルのディスク

    WEB型のオブジェクトストレージ

    アーカイブ専⽤用ストレージ

    EC2インスタンスの⼀一時ディスク

    揮発性 ⾮非揮発性(永続化)

    コスト効果(容量量あたり)

    安価⾼高価

    EC2 StorageGateway

    選定するEC2により起動時にマッピング

    アタッチ VTL Stored Cached

    i-‐‑‒SCSI接続

    無料料!(Instance料料⾦金金内に含まれる)

  • © 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  ImageEC2のコピーをとりテンプレート化

    することで、再利利⽤用可能

    Instance  Store-‐‑‒Backed  AMI

    •  EC2開始当初からある•  EC2に停⽌止のオプションはない•  EC2を終了了するとデータは消える

  • © 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」を表⽰示させる

  • © 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)

  • © 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へマウント

  • © 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

    InstanceStore

    InstanceStore

    InstanceStore

  • © 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  Volumesm1.small 1  x  160  GB†m1.medium 1  x  410  GBm1.large 2  x  420  GB  (840  GB)m1.xlarge 4  x  420  GB  (1680  GB)m2.xlarge 1  x  420  GBm2.2xlarge 1  x  850  GBm2.4xlarge 2  x  840  GB  (1680  GB)m3.medium 1  x  4  GB  SSDm3.large 1  x  32  GB  SSDm3.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  SSDi2.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⽇日時点

  • © 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:

    データ計算⽤用⼀一時ディスクとしての利利⽤用

  • © 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

  • © 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

  • © 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”

  • © 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

  • © 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ドライブで利利⽤用する。

  • © 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⽇日時点

  • © 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ではデフォルトで有効  )

    スワップ領領域が認識識されている

    スワップ領領域デバイス

  • © 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のマッピングが確認可能。

    InstanceStore

    ElasticBlockStore

    起動中EC2 AMIRoot

    状態

  • © 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のマッピングが認識識されている

  • © 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と違い、データは保持されません)

  • © 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が分かれます。)

  • © 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⽇日時点

  • © 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⽇日時点

  • © 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 ECUs vCPUs

    Memory

    (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⽇日時点

  • © 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⽇日時点

  • © 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⽇日時点

  • © 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  StoreUpdate中⼼心

  • © 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

  • © 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

    内部的に冗⻑⾧長化

  • © 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のサイズ変更更もスナップショット活⽤用により実現可能

  • © 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

  • © 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の値を指定

  • © 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

    EC2normal

    Net work

    PIOPSEBS

    PIOPSEBS

    EC2

    通常 EBS-‐‑‒Optimized-‐‑‒Instance

    EC2EBS-‐‑‒

    OptimizedNet work

    PIOPSEBS

    PIOPSEBS

    EC2

    ストレージエリアネットワーク

    通常ネットワーク

    ストレージエリアネットワーク

    通常ネットワーク

    EBS向け帯域と競合 EBS向け帯域を専⽤用に確保

  • © 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の組合せ

    EC2normal

    Net work

    EBS EBS

    EC2

    ストレージエリアネットワーク

    通常ネットワーク

    EC2EBS-‐‑‒

    OptimizedNet work

    EBS EBS

    EC2

    ストレージエリアネットワーク

    通常ネットワーク

    EC2normal

    Net work

    PIOPSEBS

    PIOPSEBS

    EC2

    EC2EBS-‐‑‒

    OptimizedNet work

    PIOPSEBS

    PIOPSEBS

    EC2

    ストレージエリアネットワーク

    通常ネットワーク

    ストレージエリアネットワーク

    通常ネットワーク

    ①通常 ②EBS-‐‑‒optimized

    ③PIOPS ④PIOPS+EBS-‐‑‒optimized

    PIOPS

    EBS-‐‑‒optimized 安定性の向上

    ⾼高速 推奨しない (※PIOPSがEBS-‐‑‒Optimizedを前提とするため)

    ⾼高速なIOの安定化

    IOの安定化

  • © 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⽇日時点

  • © 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倍に拡張

  • © 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

  • © 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

    Ⅳ)使い分け実践編

  • © 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

    リージョン間コピー

  • © 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

  • © 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

  • © 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

    レプリカ

  • © 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

    !   計測とトライアンドエラーができるクラウドのメリットを活⽤用

  • © 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障害でデータが消える

  • © 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終了了

    障害発⽣生時

    バッチプログラム

  • © 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

  • © 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

    StorageGateway

    EBS Root

    EBS Cache

    EBS Upload

    EBS Data Stan dard

    EBS Data

    PIOPS

    OS

  • © 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同期で向上させることが可能です。

  • © 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  Diskhttp://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

  • © 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/