Movatterモバイル変換


[0]ホーム

URL:


44,240 views

[AWSマイスターシリーズ]Amazon Elastic Load Balancing (ELB)

Embed presentation

Downloaded 379 times
© 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マイスターシリーズElastic Load Balancing2013.6.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.2Agenda2. ELB各種機能詳細とTips5. まとめ1. ELB基本編3. ELBと各種サービスの連携4. ELB負荷試験時のTips
© 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. ELB基本編
© 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.4ELB: Elastic Load Balancingとは?AWSクラウド上のロードバランシングサービスELBの特徴 負荷分散 : リクエストを複数のバックエンドのサーバーに分散 スケーラブル: ELB自体が負荷に応じてキャパシティを増減 高い可用性: 複数のAvailability Zoneに跨がるトラフィック分配 ヘルスチェック機能: 健全なEC2にのみトラフィックを分配 安価な従量課金: 従量課金で利用可能AWS Management Console、API、コマンドラインツール、SDKでコントロール可
© 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.5ELBの概念図AZ a AZ bELBユーザークライアントWebコンソール開発者HTTP / HTTPS /TCP / SSLHTTP / HTTPS /TCP / SSLEC2 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.6ELBによる負荷分散バックエンドのEC2インスタンスのリクエスト数やコネクション数を基に負荷分散コネクション数・リクエスト数が均等になるよう割り振るサポートしているプロトコル(L7)HTTP, HTTPS(L4)TCP, SSL
© 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.7ELBのスケーリングELBは負荷の増減に応じて自動でスケール(キャパシティを自動で増加する)注:ELBがスケールするときには、IPアドレスが変化• ELBへアクセスするときには必ずDNS名で!• 独自ドメインに割り当てる際はCNAMEにて
© 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複数AZ利用による高い可用性AZ AAZ B ELBエンドポイントDNSラウンドロビン ELBによる負荷分散ELBによる負荷分散AZ配下のEC2台数はAZ間で均等化を推奨2段階で負荷分散• DNSラウンドロビンによるAZ間振り分け• AZ内ではコネクション数などを見ながら負荷分散Internet InternetGateway
© 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バックエンドのヘルスチェックELBは指定した設定に基づき、バックエンドのインスタンスのヘルスチェックを行う• Pingプロトコル:例:HTTP• Pingポート:例 80番• Pingパス(HTTP利用時):例 /index.html• ヘルスチェック間隔:例 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.10使いやすくて安価な従量課金時間当たりの利用料は、複数AZ配置構成でも同一ELBにリザーブドプランはなし処理量は右図の通り2013年6月12日現在50K⇒100K50K50K50K
© 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.112. ELBの各種機能詳細とTips
© 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.12ELBの各種機能詳細とTipsELB利用時のTips• AZとバックエンドキャパシティの関係• 独自ドメインでの利用• クライアントのIPアドレス取得• ELBとバックエンドのコネクションSSLサポートVPCでの利用ELBとSecurity GroupELBのスケーリングStickyセッション
© 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.13ELBの各種機能詳細とTipsELB利用時のTips• AZとバックエンドキャパシティの関係• 独自ドメインでの利用• クライアントのIPアドレス取得• ELBとバックエンドのコネクションSSLサポートVPCでの利用ELBとSecurity GroupELBのスケーリングStickyセッション
© 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.14ELBとアベイラビリティゾーン(AZ)とリージョンリージョン内の複数のAZに負荷分散可能• リージョンを越えたトラフィック分散は行わない規模を問わず複数AZの利用を推奨Availability Zone Availability ZonemyLB-xxx.elb.amazonaws.com
© 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.15ELBとAZ内キャパシティの関係ELBで有効になっているAZ間で均等に負荷分散されるAvailability ZoneAvailability Zone102Availability ZoneAvailability Zone66myLB-xxx.elb.amazonaws.commyLB-xxx.elb.amazonaws.com良くない例:AZ間でキャパシティが不均等 良い例:AZ間でキャパシティが均等
© 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独自ドメインの利用CNAMEを利用• ドメインのDNSサーバに設定を投入すれば完了• Zone Apexの場合• 通常のDNSサーバではCNAME設定不可 Route 53のエイリアスレコードを使うことで対応可能www.foo.example.com CNAME myLB-xxxx.ap-northeast-1.elb.amazonaws.com
© 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クライアントのIPアドレス取得バックエンドサーバのアクセスログにはELBのIPアドレスのみが含まれる• クライアントELB, ELBバックエンドのコネクションはそれぞれ独立しているためHTTPならX-Forwarded-Forリクエストヘッダで参照可• 例:X-Forwarded-For: 203.0.113.7, 10.12.33.44, 10.12.23.88Client IP address送信元 経由するルート
© 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.18ELBとTCPコネクションクライアント  ELB のコネクション• アイドル状態が60秒続くとそのコネクションを切断するELB バックエンドインスタンスのコネクション• Keepaliveの設定を推奨• コネクションタイムアウト値を60秒以上に設定することを推奨• 60秒以下の場合、ELBがその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.19ELBの各種機能詳細とTipsELB利用時のTips• AZとバックエンドキャパシティの関係• 独自ドメインでの利用• クライアントのIPアドレス取得• ELBとバックエンドのコネクションSSLサポートVPCでの利用ELBとSecurity GroupELBのスケーリングStickyセッション
© 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.20SSL TerminationELBでSSL Terminationも可能1. ELBでSSL Terminationし、バックエンドとはSSLなし2. ELBでSSL Terminationし、バックエンドと別途SSL3. SSLをバイパスしてバックエンドにTCPで送信• 1, 2の場合、SSL証明書をELBで一元管理可能• Cipherの選択も可能HTTP or HTTPS HTTP or HTTPS
© 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.21SSL Termination時のサーバ証明書ELBにSSL証明書をアップロード• バックエンドとの通信にSSLを用いないなら証明書の管理が容易• マネージメントコンソール or IAM APIで設定SSL証明書(*)証明書のライセンスに関しては、ドメイン単位/サーバ単位で発行などそれぞれ異なるので発行元に問い合わせの事
© 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.ELBでのSSL証明書の管理SSLを用いる場合、ウィザードの中でSSLの選択/インポート画面が出てくるELBへのSSL証明書の設定
© 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.23ELBへのSSL証明書の設定~API編~IAMのAPIを利用http://docs.aws.amazon.com/IAM/latest/UserGuide/InstallCert.htmliam-servercertupload -b public_key_certificate_file -ccertificate_chain_file -k privatekey.pem -s certificate_object_name
© 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バックエンドインスタンスの認証ELBとバックエンドインスタンス間でHTTPS/SSL使用時に、オプションでバックエンドの認証を利用可能
© 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.25ELBの各種機能詳細とTipsELB利用時のTips• AZとバックエンドキャパシティの関係• 独自ドメインでの利用• クライアントのIPアドレス取得• ELBとバックエンドのコネクションSSLサポートVPCでの利用ELBとSecurity GroupELBのスケーリングStickyセッション
© 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.26VPC内での利用AZ: aAZ: bSubnet : a1 Subnet : a2Subnet : b1ELBエンドポイントDNSラウンドロビンELBによる負荷分散ELBによる負荷分散AZ配下のEC2台数はAZ間で均等化を推奨VPCとELBは同一Region内にAZを超えて作成(※SubnetはAZをまたいだ構成ができない)VPC by default後、ELBはVPC内に配置が基本InternetInternetGateway
© 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.27VPC対応概要ELB inside VPCの機能 ELBのトラフィックをサブネットをまたいで分散も可能 ELBにセキュリティグループが設定可能ELB inside VPCの制約(2013年6月時点) IPv6サポート現状なし Dedicatedインスタンスはサポートせず /27 CIDRブロック以上のSubnetが必要
© 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.28VPC内のELB配置設定方法作成済のVPC一覧が表示されるため、ELBを配置するVPCを選択Public Subnet(Internet GatewayがアタッチされたSubnet)を作成(アタッチされていないとエラー)
© 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.29ELBを配置するVPC内Subnetの指定EC2-Classicの場合と違いVPC内に配置する場合はELBを配置するVPC Subnetを明示的に各AZにつき1つ指定ELBを配置するSubnetを指定複数AZ構成の場合各AZに1つSubnetを指定(注意)/27より小さなSubnetを選択するとエラー
© 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.30Internal ELBプライベートIPアドレスのみを持つELB グローバルIPアドレスを持たないこと以外は“VPC内ELBと同機能” VPC内のみで利用可(EC2-Classicでは不可) Internet GatewayがアタッチされていないVPCにも配置可Internal ELBの制約 VPC外では作成不可 VPC内ELBと同様
© 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.31ELBの各種機能詳細とTipsELB利用時のTips• AZとバックエンドキャパシティの関係• 独自ドメインでの利用• クライアントのIPアドレス取得• ELBとバックエンドのコネクションSSLサポートVPCでの利用ELBとSecurity GroupELBのスケーリングStickyセッション
© 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.32ELBのSecurity GroupバックエンドはELBからのみリクエストを受け付ける設定を推奨4438080808022EC2-ClassicではELBは全て“amazon-elb/amazon-elb-sg”に属する
© 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.33ELBのSecurity GroupVPCではELBに任意のSecurity Groupを設定可能• VPC Security Groupとして編集可• Outbound設定についてはELB自身が能動的に外部と通信を確立することはないため特に設定不要既存のVPC内のセキュリティグループの選択も可能新規作成も可能(この際はInboundのみ)sg-ELB443: 0.0.0.0/0sg-EC280:sg-ELB22:10.0.0.0/2444380808080CIDR : 10.0.0.0/2422
© 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.34ELBの各種機能詳細とTipsELB利用時のTips• AZとバックエンドキャパシティの関係• 独自ドメインでの利用• クライアントのIPアドレス取得• ELBとバックエンドのコネクションSSLサポートVPCでの利用ELBとSecurity GroupELBのスケーリングStickyセッション
© 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.35ELBのスケーリング詳細ELBは負荷に応じてスケールする但し、以下のような場合にELBがHTTP 503を返す• ELBへの接続・リクエストが瞬間的に急増したために、ELBのスケーリングが間に合わない場合• TVやメディアによるサービス紹介、等回避方法• 事前にELBをスケールさせておく• 負荷をかける• Pre-Warming(暖気運転)の申請を行う
© 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.36ELBの暖気運転(Pre-Warming)Business/Enterpriseサポートに加入者様向けにELBを事前にスケールさせておく操作急激なトラフィックの増加が予想される場合に有効• メディアで自社サイトが紹介される、等ELBの負荷テストで、段階的にスケールさせることが出来ない場合にも有効
© 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.37ELBの各種機能詳細とTipsELB利用時のTips• AZとバックエンドキャパシティの関係• 独自ドメインでの利用• クライアントのIPアドレス取得• ELBとバックエンドのコネクションSSLサポートVPCでの利用ELBとSecurity GroupELBのスケーリングStickyセッション
© 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.38StickyセッションStickyセッションを使うと、同じユーザから来たリクエストを全て同じインスタンスに送信可能Stickyセッションの種類は以下2パターン• Application Genereated Cookie Stickiness• Load Balancer Generated Cookie StickinessELBがどのくらいの期間同じインスタンスにルーティングし続けさせるかを決めることが重要
© 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.39Application GeneratedCookie Stickinessアプリケーション固有のセッション維持を行うアプリケーションに独自のセッションCookieがある場合等に利用例:Webサービスへのユーザーログイン時にCookieを生成。ログアウト時にCookie削除
© 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.40Load BalancerGenerated Cookie Stickiness期間ベースのセッション維持を行うアプリケーションに独自のセッションCookieがない場合、ELB側でセッション維持を管理したい場合に利用ELB側で期限付きCookieを生成
© 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.413. ELBと各種サービスの連携
© 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.42CloudWatchとの連携CloudWatchによりELBの以下を監視可能• 遅延時間• リクエスト数• 健全なホスト数• 不健全なホスト数• バックエンドの2xx-5xxレスポンス数• ELBの4xxと5xxのレスポンス数監視
© 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.43Auto Scalingとの連携Auto Scalingによるインスタンス増減時にELBへのアタッチ・デタッチが可能ELBのヘルスチェックの結果をAuto Scalingに反映可能利用例:• 一定間隔でレスポンスをチェックし、遅延が増加したらインスタンスを自動追加• ELBのヘルスチェックが成功したEC2インスタンスを常にX台以上Auto scaling Group増減
© 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.44Route53 DNSフェイルオーバ対応Route53のヘルスチェック機能と連携• 例:アプリケーション障害時にSorryページヘ誘導正常時 フェイルオーバ時S3 Bucket1. DBに問題発生2. AppサーバのELBヘルスチェック失敗3. ELB可に健全なインスタンスなし4. フェイルオーバ5. Sorryページ
© 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.45Route53 DNSフェイルオーバ対応設定方法• Alias Target にELBを指定し、Routing Policyに「Failover」を選択Evaluate TargetHealth:[Yes]「Associate withHealth Check」:既存のヘルスチェックとの関連付け。「ELB」の場合は原則「No」を選択
© 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.46User AWS ManagementConsoleスタックLoad BalancerレイヤーApp ServerレイヤーDatabaseレイヤーレシピレシピレシピ DBWeb/AppWeb/AppLB①スタックの作成②レイヤーの作成③レシピの作成・設定(ビルトインレシピ利用可)④レイヤーにインスタンス追加・起動⑤レシピによってパッケージインストール、設定LBとしてELBが選択可能にOpsWorksでELBをLBレイヤーに利用可能にOpsWorksのELB対応
© 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.474ELB負荷テストに関するTips
© 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.48ELBを負荷テストする必要性についてELBのいくつかの特長がテストシナリオに影響を与える可能性がある。• ELBのスケーリング• ELBの初期キャパシティ• アイドルコネクションタイムアウト• バックエンドインスタンスのヘルスチェック• Stickyセッション、等ご利用内容に合わせたシナリオでテストが必要
© 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.49ELBの負荷テスト方法の種類シングルクライアントテスト• 例:Apache Bench(ab)マルチクライアントテスト• 例:curl-loader(都度DNS解決を行うツールが望ましい)分散テスト• 例:Fabricフレームワーク、BeesWithMachineGuns※いずれのテストにおいても、クライアントの負荷が足りない場合はクライアント数を増やす等で対応可負荷生成クライアントバックエンドインスタンス
© 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推奨テストアプローチ想定する最大負荷のテスト通常のトラフィック時のテスト• トラフィックの多い時• トラフィックの少ない時• トラフィックの傾向に変化がある時(朝や昼の時間帯など)短い時間でトラフィックが大きく変化する場合のテスト※ELB以外にも負荷生成クライアント、バックエンド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.51負荷テストの注意事項ELBの初期スケールに注意• スケールするまでに、HTTP 503レスポンスを返す期間があり得る• 回避策:• ELBの暖気運転( Pre-Warming)申請をする• 5分間隔で50%以上のトラフィック増加をしないよう負荷テストを設定DNSクエリの仕方に注意• テストクライアント側で少なくとも1分に1回DNSの再解決をするスティッキーセッション利用時の割り振り方• 同じCookieでリクエストを続けた場合などは振り分けに偏りがバックエンドインスタンスのアイドルタイムアウト• 60秒以上に設定しないとELBが誤って不健全なホストと見なす可能性あり
© 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.525.まとめ
© 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まとめELBはAWSが提供するロードバランシングサービス• 運用管理コストを抑えながらスケーラブルで高可用なインフラを構築可能• 各種サービスとの連携もスムーズ&随時拡充• 負荷試験時はその特性を理解した上で• 急激な負荷の増大が想定される場合には、サポート加入の上で暖気申請(Pre-Warming)を
© 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日本語Link(クラウドサービス活用集に掲載)VPC内ELB配置設計指針ロードバランサとSocket接続を使用したイベント通知サーバの負荷分散Elastic Load Balancing開発者ガイド• http://docs.aws.amazon.com/ja_jp/ElasticLoadBalancing/latest/DeveloperGuide/Welcome.htmlElasitc Load Balancingを評価するためのベストプラクティス• http://d36cz9buwru1tt.cloudfront.net/jp/documentation/BestPracticesInEvaluatingELB-ja-final.pdf
© 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.55英語Link(最新版)参考資料• Amazon Elastic Load Balancing Developer Guidehttp://docs.aws.amazon.com/ElasticLoadBalancing/latest/DeveloperGuide/Welcome.html• Best Practices in Evaluating Elastic Load Balancinghttp://aws.amazon.com/articles/1636185810492479• Amazon ELB FAQhttp://aws.amazon.com/ec2/faqs/Elastic Load Balancing の箇所• AWS re: Invent CPN 205: Zero to Millions of Requestshttps://www.youtube.com/watch?v=xKF-Aawz9oc

Recommended

PDF
20190320 AWS Black Belt Online Seminar Amazon EBS
PDF
20190730 AWS Black Belt Online Seminar Amazon CloudFrontの概要
PDF
AWS Black Belt Online Seminar AWS Direct Connect
PDF
浸透するサーバーレス 実際に見るユースケースと実装パターン
PDF
AWS Black Belt Online Seminar 2018 Amazon DynamoDB Advanced Design Pattern
PDF
20190220 AWS Black Belt Online Seminar Amazon S3 / Glacier
PDF
20190130 AWS Black Belt Online Seminar AWS Identity and Access Management (AW...
PDF
20200219 AWS Black Belt Online Seminar オンプレミスとAWS間の冗長化接続
PDF
AWS Black Belt Online Seminar Elastic Load Balancing
PDF
20210216 AWS Black Belt Online Seminar AWS Database Migration Service
PDF
AWS Black Belt Techシリーズ Elastic Load Balancing (ELB)
PDF
マルチテナント化で知っておきたいデータベースのこと
PDF
202110 AWS Black Belt Online Seminar AWS Site-to-Site VPN
PDF
20200811 AWS Black Belt Online Seminar CloudEndure
PDF
202106 AWS Black Belt Online Seminar 小売現場のデータを素早くビジネス に活用するAWSデータ基盤
PDF
20180425 AWS Black Belt Online Seminar Amazon Relational Database Service (Am...
PDF
AWS Black Belt Online Seminar 2017 Amazon DynamoDB
PDF
CloudFrontのリアルタイムログをKibanaで可視化しよう
PDF
[Aurora事例祭り]Amazon Aurora を使いこなすためのベストプラクティス
PDF
AWS Black Belt Online Seminar AWS Key Management Service (KMS)
PDF
Amazon Athena 初心者向けハンズオン
PDF
20190129 AWS Black Belt Online Seminar AWS Identity and Access Management (AW...
PDF
20190326 AWS Black Belt Online Seminar Amazon CloudWatch
PPTX
Awsをオンプレドメコンに連携させる
PDF
AWSの課金体系
PDF
[JAWS DAYS 2019] Amazon DocumentDB(with MongoDB Compatibility)入門
PDF
20200812 AWS Black Belt Online Seminar Amazon Macie
PDF
20190521 AWS Black Belt Online Seminar Amazon Simple Email Service (Amazon SES)
PDF
AWS Black Belt Online Seminar 2017 Auto Scaling
PPTX
[社内勉強会]ELBとALBと数万スパイク負荷テスト

More Related Content

PDF
20190320 AWS Black Belt Online Seminar Amazon EBS
PDF
20190730 AWS Black Belt Online Seminar Amazon CloudFrontの概要
PDF
AWS Black Belt Online Seminar AWS Direct Connect
PDF
浸透するサーバーレス 実際に見るユースケースと実装パターン
PDF
AWS Black Belt Online Seminar 2018 Amazon DynamoDB Advanced Design Pattern
PDF
20190220 AWS Black Belt Online Seminar Amazon S3 / Glacier
PDF
20190130 AWS Black Belt Online Seminar AWS Identity and Access Management (AW...
PDF
20200219 AWS Black Belt Online Seminar オンプレミスとAWS間の冗長化接続
20190320 AWS Black Belt Online Seminar Amazon EBS
20190730 AWS Black Belt Online Seminar Amazon CloudFrontの概要
AWS Black Belt Online Seminar AWS Direct Connect
浸透するサーバーレス 実際に見るユースケースと実装パターン
AWS Black Belt Online Seminar 2018 Amazon DynamoDB Advanced Design Pattern
20190220 AWS Black Belt Online Seminar Amazon S3 / Glacier
20190130 AWS Black Belt Online Seminar AWS Identity and Access Management (AW...
20200219 AWS Black Belt Online Seminar オンプレミスとAWS間の冗長化接続

What's hot

PDF
AWS Black Belt Online Seminar Elastic Load Balancing
PDF
20210216 AWS Black Belt Online Seminar AWS Database Migration Service
PDF
AWS Black Belt Techシリーズ Elastic Load Balancing (ELB)
PDF
マルチテナント化で知っておきたいデータベースのこと
PDF
202110 AWS Black Belt Online Seminar AWS Site-to-Site VPN
PDF
20200811 AWS Black Belt Online Seminar CloudEndure
PDF
202106 AWS Black Belt Online Seminar 小売現場のデータを素早くビジネス に活用するAWSデータ基盤
PDF
20180425 AWS Black Belt Online Seminar Amazon Relational Database Service (Am...
PDF
AWS Black Belt Online Seminar 2017 Amazon DynamoDB
PDF
CloudFrontのリアルタイムログをKibanaで可視化しよう
PDF
[Aurora事例祭り]Amazon Aurora を使いこなすためのベストプラクティス
PDF
AWS Black Belt Online Seminar AWS Key Management Service (KMS)
PDF
Amazon Athena 初心者向けハンズオン
PDF
20190129 AWS Black Belt Online Seminar AWS Identity and Access Management (AW...
PDF
20190326 AWS Black Belt Online Seminar Amazon CloudWatch
PPTX
Awsをオンプレドメコンに連携させる
PDF
AWSの課金体系
PDF
[JAWS DAYS 2019] Amazon DocumentDB(with MongoDB Compatibility)入門
PDF
20200812 AWS Black Belt Online Seminar Amazon Macie
PDF
20190521 AWS Black Belt Online Seminar Amazon Simple Email Service (Amazon SES)
AWS Black Belt Online Seminar Elastic Load Balancing
20210216 AWS Black Belt Online Seminar AWS Database Migration Service
AWS Black Belt Techシリーズ Elastic Load Balancing (ELB)
マルチテナント化で知っておきたいデータベースのこと
202110 AWS Black Belt Online Seminar AWS Site-to-Site VPN
20200811 AWS Black Belt Online Seminar CloudEndure
202106 AWS Black Belt Online Seminar 小売現場のデータを素早くビジネス に活用するAWSデータ基盤
20180425 AWS Black Belt Online Seminar Amazon Relational Database Service (Am...
AWS Black Belt Online Seminar 2017 Amazon DynamoDB
CloudFrontのリアルタイムログをKibanaで可視化しよう
[Aurora事例祭り]Amazon Aurora を使いこなすためのベストプラクティス
AWS Black Belt Online Seminar AWS Key Management Service (KMS)
Amazon Athena 初心者向けハンズオン
20190129 AWS Black Belt Online Seminar AWS Identity and Access Management (AW...
20190326 AWS Black Belt Online Seminar Amazon CloudWatch
Awsをオンプレドメコンに連携させる
AWSの課金体系
[JAWS DAYS 2019] Amazon DocumentDB(with MongoDB Compatibility)入門
20200812 AWS Black Belt Online Seminar Amazon Macie
20190521 AWS Black Belt Online Seminar Amazon Simple Email Service (Amazon SES)

Viewers also liked

PDF
AWS Black Belt Online Seminar 2017 Auto Scaling
PPTX
[社内勉強会]ELBとALBと数万スパイク負荷テスト
PDF
実践!AWSクラウドデザインパターン
PDF
Amazon Simple Workflow Service (SWF)
PDF
AWSにおけるバッチ処理の ベストプラクティス - Developers.IO Meetup 05
PDF
[AWSマイスターシリーズ]Amazon CloudWatch & Auto Scaling
PDF
20120521 aws-meister-elb&as&cw-public
PDF
[AWSマイスターシリーズ]Amazon Simple Workflow Service (SWF)
PDF
AWSクラウドデザインパターン(CDP) - コンテンツ配信編 -
PDF
[AWSマイスターシリーズ] Amazon Elastic Compute Cloud (EC2)
PPTX
ELBの概要と勘所
PDF
[AWSマイスターシリーズ] Amazon Virtual Private Cloud (VPC)
PDF
負荷対策しておもったことまとめ~JMeterでSocket.IOもいけるでよ~
PDF
AWS Solution Architect Associate試験勉強メモ
PDF
アイデンティティ2.0とOAuth/OpenID Connect
PDF
SQSの活用事例
PDF
ELB & Auto Scaling & CloudWatch 詳細 -ほぼ週刊AWSマイスターシリーズ第5回-
PDF
AWS Blackbelt 2015シリーズ Elastic Load Balancing
PPTX
AWSクラウドデザインパターン VPC移行編
PDF
データモデルについて知っておくべき7つのこと 〜NoSQLに手を出す前に〜
AWS Black Belt Online Seminar 2017 Auto Scaling
[社内勉強会]ELBとALBと数万スパイク負荷テスト
実践!AWSクラウドデザインパターン
Amazon Simple Workflow Service (SWF)
AWSにおけるバッチ処理の ベストプラクティス - Developers.IO Meetup 05
[AWSマイスターシリーズ]Amazon CloudWatch & Auto Scaling
20120521 aws-meister-elb&as&cw-public
[AWSマイスターシリーズ]Amazon Simple Workflow Service (SWF)
AWSクラウドデザインパターン(CDP) - コンテンツ配信編 -
[AWSマイスターシリーズ] Amazon Elastic Compute Cloud (EC2)
ELBの概要と勘所
[AWSマイスターシリーズ] Amazon Virtual Private Cloud (VPC)
負荷対策しておもったことまとめ~JMeterでSocket.IOもいけるでよ~
AWS Solution Architect Associate試験勉強メモ
アイデンティティ2.0とOAuth/OpenID Connect
SQSの活用事例
ELB & Auto Scaling & CloudWatch 詳細 -ほぼ週刊AWSマイスターシリーズ第5回-
AWS Blackbelt 2015シリーズ Elastic Load Balancing
AWSクラウドデザインパターン VPC移行編
データモデルについて知っておくべき7つのこと 〜NoSQLに手を出す前に〜

Similar to [AWSマイスターシリーズ]Amazon Elastic Load Balancing (ELB)

PDF
[AWSマイスターシリーズ] AWS Elastic Beanstalk
PDF
ELB & CloudWatch & AutoScaling - AWSマイスターシリーズ
PPTX
Application Load Balancer
PDF
[AWS初心者向けWebinar] 利用者が実施するAWS上でのセキュリティ対策
PDF
初心者向けWebinar AWS上でのネットワーク構築
PDF
AWS 初心者向けWebinar 利用者が実施するAWS上でのセキュリティ対策
PDF
AWS Black Belt Techシリーズ Amazon Elastic Compute Cloud (Amazon EC2)
PDF
AWSでスケールアウト&スケールアップ
PDF
20120303 jaws summit-meister-02_elb-as-cw
PDF
ネットワークの負荷分散を手軽に - OSC2015 Hokkaido
PDF
Kixs.vol003 LBの夜 AWSにおけるロードバランサー
PDF
Aws summits2014 エンタープライズ向けawscdpネットワーク編
PDF
クックパッドでのVPC移行について
PDF
test
 
PDF
cloudpack導入資料(20120302版)
PDF
cloudpack導入資料(2011/05/06版)
PDF
[AWS Summit 2012] クラウドデザインパターン#4 CDP VPC移行編
PDF
JAWS-UG アーキテクチャ専門支部 re:Invent Management Tools ダイジェスト
PDF
cloudpack night #2 実践VPC
PDF
JAWS-UG浜松 #1 Amazon VPCでVPN
[AWSマイスターシリーズ] AWS Elastic Beanstalk
ELB & CloudWatch & AutoScaling - AWSマイスターシリーズ
Application Load Balancer
[AWS初心者向けWebinar] 利用者が実施するAWS上でのセキュリティ対策
初心者向けWebinar AWS上でのネットワーク構築
AWS 初心者向けWebinar 利用者が実施するAWS上でのセキュリティ対策
AWS Black Belt Techシリーズ Amazon Elastic Compute Cloud (Amazon EC2)
AWSでスケールアウト&スケールアップ
20120303 jaws summit-meister-02_elb-as-cw
ネットワークの負荷分散を手軽に - OSC2015 Hokkaido
Kixs.vol003 LBの夜 AWSにおけるロードバランサー
Aws summits2014 エンタープライズ向けawscdpネットワーク編
クックパッドでのVPC移行について
test
 
cloudpack導入資料(20120302版)
cloudpack導入資料(2011/05/06版)
[AWS Summit 2012] クラウドデザインパターン#4 CDP VPC移行編
JAWS-UG アーキテクチャ専門支部 re:Invent Management Tools ダイジェスト
cloudpack night #2 実践VPC
JAWS-UG浜松 #1 Amazon VPCでVPN

More from Amazon Web Services Japan

PPTX
[20220126] JAWS-UG 2022初頭までに葬ったAWSアンチパターン大紹介
PDF
SaaS テナント毎のコストを把握するための「AWS Application Cost Profiler」のご紹介
PDF
202205 AWS Black Belt Online Seminar Amazon VPC IP Address Manager (IPAM)
PPTX
20220409 AWS BLEA 開発にあたって検討したこと
PDF
Amazon Game Tech Night #25 ゲーム業界向け機械学習最新状況アップデート
PDF
パッケージソフトウェアを簡単にSaaS化!?既存の資産を使ったSaaS化手法のご紹介
PDF
Infrastructure as Code (IaC) 談義 2022
PDF
機密データとSaaSは共存しうるのか!?セキュリティー重視のユーザー層を取り込む為のネットワーク通信のアプローチ
PDF
202204 AWS Black Belt Online Seminar AWS IoT Device Defender
PDF
202201 AWS Black Belt Online Seminar Apache Spark Performnace Tuning for AWS ...
PDF
202205 AWS Black Belt Online Seminar Amazon FSx for OpenZFS
PDF
202202 AWS Black Belt Online Seminar AWS Managed Rules for AWS WAF の活用
PDF
202202 AWS Black Belt Online Seminar AWS SaaS Boost で始めるSaaS開発⼊⾨
PDF
Amazon QuickSight の組み込み方法をちょっぴりDD
PDF
202204 AWS Black Belt Online Seminar Amazon Connect を活用したオンコール対応の実現
PDF
202204 AWS Black Belt Online Seminar Amazon Connect Salesforce連携(第1回 CTI Adap...
PDF
202203 AWS Black Belt Online Seminar Amazon Connect Tasks.pdf
PDF
202202 AWS Black Belt Online Seminar Amazon Connect Customer Profiles
PDF
202111 AWS Black Belt Online Seminar AWSで構築するSmart Mirrorのご紹介
PDF
Amazon Game Tech Night #24 KPIダッシュボードを最速で用意するために
[20220126] JAWS-UG 2022初頭までに葬ったAWSアンチパターン大紹介
SaaS テナント毎のコストを把握するための「AWS Application Cost Profiler」のご紹介
202205 AWS Black Belt Online Seminar Amazon VPC IP Address Manager (IPAM)
20220409 AWS BLEA 開発にあたって検討したこと
Amazon Game Tech Night #25 ゲーム業界向け機械学習最新状況アップデート
パッケージソフトウェアを簡単にSaaS化!?既存の資産を使ったSaaS化手法のご紹介
Infrastructure as Code (IaC) 談義 2022
機密データとSaaSは共存しうるのか!?セキュリティー重視のユーザー層を取り込む為のネットワーク通信のアプローチ
202204 AWS Black Belt Online Seminar AWS IoT Device Defender
202201 AWS Black Belt Online Seminar Apache Spark Performnace Tuning for AWS ...
202205 AWS Black Belt Online Seminar Amazon FSx for OpenZFS
202202 AWS Black Belt Online Seminar AWS Managed Rules for AWS WAF の活用
202202 AWS Black Belt Online Seminar AWS SaaS Boost で始めるSaaS開発⼊⾨
Amazon QuickSight の組み込み方法をちょっぴりDD
202204 AWS Black Belt Online Seminar Amazon Connect を活用したオンコール対応の実現
202204 AWS Black Belt Online Seminar Amazon Connect Salesforce連携(第1回 CTI Adap...
202203 AWS Black Belt Online Seminar Amazon Connect Tasks.pdf
202202 AWS Black Belt Online Seminar Amazon Connect Customer Profiles
202111 AWS Black Belt Online Seminar AWSで構築するSmart Mirrorのご紹介
Amazon Game Tech Night #24 KPIダッシュボードを最速で用意するために

Recently uploaded

PDF
2026magazine tour tabisentsunagu たびせんつなぐ
PDF
【会社紹介資料】 株式会社カンゲンエージェント [ 11 月 30 日作成資料公開 ].pdf
PDF
2212slide.pdf
PDF
1ページでわかるTAPP_20251211________________
PDF
slideshare_ナハトエース会社説明資料_2025/12/11_SlideShare.pdf
PDF
SNS_Marketing_Company_ナハトエース会社説明資料_2025/12/10_SlideShare.pdf
2026magazine tour tabisentsunagu たびせんつなぐ
【会社紹介資料】 株式会社カンゲンエージェント [ 11 月 30 日作成資料公開 ].pdf
2212slide.pdf
1ページでわかるTAPP_20251211________________
slideshare_ナハトエース会社説明資料_2025/12/11_SlideShare.pdf
SNS_Marketing_Company_ナハトエース会社説明資料_2025/12/10_SlideShare.pdf

[AWSマイスターシリーズ]Amazon Elastic Load Balancing (ELB)

  • 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マイスターシリーズElastic Load Balancing2013.6.12アマゾンデータサービスジャパン株式会社ソリューション アーキテクト舟崎 健治 平山 毅 安川 健太
  • 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.2Agenda2. ELB各種機能詳細とTips5. まとめ1. ELB基本編3. ELBと各種サービスの連携4. ELB負荷試験時のTips
  • 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.31. ELB基本編
  • 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.4ELB: Elastic Load Balancingとは?AWSクラウド上のロードバランシングサービスELBの特徴 負荷分散 : リクエストを複数のバックエンドのサーバーに分散 スケーラブル: ELB自体が負荷に応じてキャパシティを増減 高い可用性: 複数のAvailability Zoneに跨がるトラフィック分配 ヘルスチェック機能: 健全なEC2にのみトラフィックを分配 安価な従量課金: 従量課金で利用可能AWS Management Console、API、コマンドラインツール、SDKでコントロール可
  • 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.5ELBの概念図AZ a AZ bELBユーザークライアントWebコンソール開発者HTTP / HTTPS /TCP / SSLHTTP / HTTPS /TCP / SSLEC2 EC2
  • 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.6ELBによる負荷分散バックエンドのEC2インスタンスのリクエスト数やコネクション数を基に負荷分散コネクション数・リクエスト数が均等になるよう割り振るサポートしているプロトコル(L7)HTTP, HTTPS(L4)TCP, SSL
  • 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.7ELBのスケーリングELBは負荷の増減に応じて自動でスケール(キャパシティを自動で増加する)注:ELBがスケールするときには、IPアドレスが変化• ELBへアクセスするときには必ずDNS名で!• 独自ドメインに割り当てる際はCNAMEにて
  • 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複数AZ利用による高い可用性AZ AAZ B ELBエンドポイントDNSラウンドロビン ELBによる負荷分散ELBによる負荷分散AZ配下のEC2台数はAZ間で均等化を推奨2段階で負荷分散• DNSラウンドロビンによるAZ間振り分け• AZ内ではコネクション数などを見ながら負荷分散Internet InternetGateway
  • 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バックエンドのヘルスチェックELBは指定した設定に基づき、バックエンドのインスタンスのヘルスチェックを行う• Pingプロトコル:例:HTTP• Pingポート:例 80番• Pingパス(HTTP利用時):例 /index.html• ヘルスチェック間隔:例 12分健全/不健全を判定するまでのヘルスチェックの成功・失敗回数は指定可能ヘルスチェックを意図的に失敗させることで特定のインスタンスへのリクエスト振り分けを止めることも可
  • 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使いやすくて安価な従量課金時間当たりの利用料は、複数AZ配置構成でも同一ELBにリザーブドプランはなし処理量は右図の通り2013年6月12日現在50K⇒100K50K50K50K
  • 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.112. ELBの各種機能詳細とTips
  • 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.12ELBの各種機能詳細とTipsELB利用時のTips• AZとバックエンドキャパシティの関係• 独自ドメインでの利用• クライアントのIPアドレス取得• ELBとバックエンドのコネクションSSLサポートVPCでの利用ELBとSecurity GroupELBのスケーリングStickyセッション
  • 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.13ELBの各種機能詳細とTipsELB利用時のTips• AZとバックエンドキャパシティの関係• 独自ドメインでの利用• クライアントのIPアドレス取得• ELBとバックエンドのコネクションSSLサポートVPCでの利用ELBとSecurity GroupELBのスケーリングStickyセッション
  • 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.14ELBとアベイラビリティゾーン(AZ)とリージョンリージョン内の複数のAZに負荷分散可能• リージョンを越えたトラフィック分散は行わない規模を問わず複数AZの利用を推奨Availability Zone Availability ZonemyLB-xxx.elb.amazonaws.com
  • 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.15ELBとAZ内キャパシティの関係ELBで有効になっているAZ間で均等に負荷分散されるAvailability ZoneAvailability Zone102Availability ZoneAvailability Zone66myLB-xxx.elb.amazonaws.commyLB-xxx.elb.amazonaws.com良くない例:AZ間でキャパシティが不均等 良い例:AZ間でキャパシティが均等
  • 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独自ドメインの利用CNAMEを利用• ドメインのDNSサーバに設定を投入すれば完了• Zone Apexの場合• 通常のDNSサーバではCNAME設定不可 Route 53のエイリアスレコードを使うことで対応可能www.foo.example.com CNAME myLB-xxxx.ap-northeast-1.elb.amazonaws.com
  • 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クライアントのIPアドレス取得バックエンドサーバのアクセスログにはELBのIPアドレスのみが含まれる• クライアントELB, ELBバックエンドのコネクションはそれぞれ独立しているためHTTPならX-Forwarded-Forリクエストヘッダで参照可• 例:X-Forwarded-For: 203.0.113.7, 10.12.33.44, 10.12.23.88Client IP address送信元 経由するルート
  • 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.18ELBとTCPコネクションクライアント  ELB のコネクション• アイドル状態が60秒続くとそのコネクションを切断するELB バックエンドインスタンスのコネクション• Keepaliveの設定を推奨• コネクションタイムアウト値を60秒以上に設定することを推奨• 60秒以下の場合、ELBがそのEC2インスタンスを不健全と判定し、トラフィックを送らなくなることがあるので注意
  • 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.19ELBの各種機能詳細とTipsELB利用時のTips• AZとバックエンドキャパシティの関係• 独自ドメインでの利用• クライアントのIPアドレス取得• ELBとバックエンドのコネクションSSLサポートVPCでの利用ELBとSecurity GroupELBのスケーリングStickyセッション
  • 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.20SSL TerminationELBでSSL Terminationも可能1. ELBでSSL Terminationし、バックエンドとはSSLなし2. ELBでSSL Terminationし、バックエンドと別途SSL3. SSLをバイパスしてバックエンドにTCPで送信• 1, 2の場合、SSL証明書をELBで一元管理可能• Cipherの選択も可能HTTP or HTTPS HTTP or HTTPS
  • 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.21SSL Termination時のサーバ証明書ELBにSSL証明書をアップロード• バックエンドとの通信にSSLを用いないなら証明書の管理が容易• マネージメントコンソール or IAM APIで設定SSL証明書(*)証明書のライセンスに関しては、ドメイン単位/サーバ単位で発行などそれぞれ異なるので発行元に問い合わせの事
  • 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.ELBでのSSL証明書の管理SSLを用いる場合、ウィザードの中でSSLの選択/インポート画面が出てくるELBへのSSL証明書の設定
  • 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.23ELBへのSSL証明書の設定~API編~IAMのAPIを利用http://docs.aws.amazon.com/IAM/latest/UserGuide/InstallCert.htmliam-servercertupload -b public_key_certificate_file -ccertificate_chain_file -k privatekey.pem -s certificate_object_name
  • 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バックエンドインスタンスの認証ELBとバックエンドインスタンス間でHTTPS/SSL使用時に、オプションでバックエンドの認証を利用可能
  • 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.25ELBの各種機能詳細とTipsELB利用時のTips• AZとバックエンドキャパシティの関係• 独自ドメインでの利用• クライアントのIPアドレス取得• ELBとバックエンドのコネクションSSLサポートVPCでの利用ELBとSecurity GroupELBのスケーリングStickyセッション
  • 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.26VPC内での利用AZ: aAZ: bSubnet : a1 Subnet : a2Subnet : b1ELBエンドポイントDNSラウンドロビンELBによる負荷分散ELBによる負荷分散AZ配下のEC2台数はAZ間で均等化を推奨VPCとELBは同一Region内にAZを超えて作成(※SubnetはAZをまたいだ構成ができない)VPC by default後、ELBはVPC内に配置が基本InternetInternetGateway
  • 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.27VPC対応概要ELB inside VPCの機能 ELBのトラフィックをサブネットをまたいで分散も可能 ELBにセキュリティグループが設定可能ELB inside VPCの制約(2013年6月時点) IPv6サポート現状なし Dedicatedインスタンスはサポートせず /27 CIDRブロック以上のSubnetが必要
  • 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.28VPC内のELB配置設定方法作成済のVPC一覧が表示されるため、ELBを配置するVPCを選択Public Subnet(Internet GatewayがアタッチされたSubnet)を作成(アタッチされていないとエラー)
  • 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.29ELBを配置するVPC内Subnetの指定EC2-Classicの場合と違いVPC内に配置する場合はELBを配置するVPC Subnetを明示的に各AZにつき1つ指定ELBを配置するSubnetを指定複数AZ構成の場合各AZに1つSubnetを指定(注意)/27より小さなSubnetを選択するとエラー
  • 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.30Internal ELBプライベートIPアドレスのみを持つELB グローバルIPアドレスを持たないこと以外は“VPC内ELBと同機能” VPC内のみで利用可(EC2-Classicでは不可) Internet GatewayがアタッチされていないVPCにも配置可Internal ELBの制約 VPC外では作成不可 VPC内ELBと同様
  • 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.31ELBの各種機能詳細とTipsELB利用時のTips• AZとバックエンドキャパシティの関係• 独自ドメインでの利用• クライアントのIPアドレス取得• ELBとバックエンドのコネクションSSLサポートVPCでの利用ELBとSecurity GroupELBのスケーリングStickyセッション
  • 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.32ELBのSecurity GroupバックエンドはELBからのみリクエストを受け付ける設定を推奨4438080808022EC2-ClassicではELBは全て“amazon-elb/amazon-elb-sg”に属する
  • 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.33ELBのSecurity GroupVPCではELBに任意のSecurity Groupを設定可能• VPC Security Groupとして編集可• Outbound設定についてはELB自身が能動的に外部と通信を確立することはないため特に設定不要既存のVPC内のセキュリティグループの選択も可能新規作成も可能(この際はInboundのみ)sg-ELB443: 0.0.0.0/0sg-EC280:sg-ELB22:10.0.0.0/2444380808080CIDR : 10.0.0.0/2422
  • 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.34ELBの各種機能詳細とTipsELB利用時のTips• AZとバックエンドキャパシティの関係• 独自ドメインでの利用• クライアントのIPアドレス取得• ELBとバックエンドのコネクションSSLサポートVPCでの利用ELBとSecurity GroupELBのスケーリングStickyセッション
  • 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.35ELBのスケーリング詳細ELBは負荷に応じてスケールする但し、以下のような場合にELBがHTTP 503を返す• ELBへの接続・リクエストが瞬間的に急増したために、ELBのスケーリングが間に合わない場合• TVやメディアによるサービス紹介、等回避方法• 事前にELBをスケールさせておく• 負荷をかける• Pre-Warming(暖気運転)の申請を行う
  • 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.36ELBの暖気運転(Pre-Warming)Business/Enterpriseサポートに加入者様向けにELBを事前にスケールさせておく操作急激なトラフィックの増加が予想される場合に有効• メディアで自社サイトが紹介される、等ELBの負荷テストで、段階的にスケールさせることが出来ない場合にも有効
  • 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.37ELBの各種機能詳細とTipsELB利用時のTips• AZとバックエンドキャパシティの関係• 独自ドメインでの利用• クライアントのIPアドレス取得• ELBとバックエンドのコネクションSSLサポートVPCでの利用ELBとSecurity GroupELBのスケーリングStickyセッション
  • 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.38StickyセッションStickyセッションを使うと、同じユーザから来たリクエストを全て同じインスタンスに送信可能Stickyセッションの種類は以下2パターン• Application Genereated Cookie Stickiness• Load Balancer Generated Cookie StickinessELBがどのくらいの期間同じインスタンスにルーティングし続けさせるかを決めることが重要
  • 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.39Application GeneratedCookie Stickinessアプリケーション固有のセッション維持を行うアプリケーションに独自のセッションCookieがある場合等に利用例:Webサービスへのユーザーログイン時にCookieを生成。ログアウト時にCookie削除
  • 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.40Load BalancerGenerated Cookie Stickiness期間ベースのセッション維持を行うアプリケーションに独自のセッションCookieがない場合、ELB側でセッション維持を管理したい場合に利用ELB側で期限付きCookieを生成
  • 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.413. ELBと各種サービスの連携
  • 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.42CloudWatchとの連携CloudWatchによりELBの以下を監視可能• 遅延時間• リクエスト数• 健全なホスト数• 不健全なホスト数• バックエンドの2xx-5xxレスポンス数• ELBの4xxと5xxのレスポンス数監視
  • 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.43Auto Scalingとの連携Auto Scalingによるインスタンス増減時にELBへのアタッチ・デタッチが可能ELBのヘルスチェックの結果をAuto Scalingに反映可能利用例:• 一定間隔でレスポンスをチェックし、遅延が増加したらインスタンスを自動追加• ELBのヘルスチェックが成功したEC2インスタンスを常にX台以上Auto scaling Group増減
  • 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.44Route53 DNSフェイルオーバ対応Route53のヘルスチェック機能と連携• 例:アプリケーション障害時にSorryページヘ誘導正常時 フェイルオーバ時S3 Bucket1. DBに問題発生2. AppサーバのELBヘルスチェック失敗3. ELB可に健全なインスタンスなし4. フェイルオーバ5. Sorryページ
  • 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.45Route53 DNSフェイルオーバ対応設定方法• Alias Target にELBを指定し、Routing Policyに「Failover」を選択Evaluate TargetHealth:[Yes]「Associate withHealth Check」:既存のヘルスチェックとの関連付け。「ELB」の場合は原則「No」を選択
  • 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.46User AWS ManagementConsoleスタックLoad BalancerレイヤーApp ServerレイヤーDatabaseレイヤーレシピレシピレシピ DBWeb/AppWeb/AppLB①スタックの作成②レイヤーの作成③レシピの作成・設定(ビルトインレシピ利用可)④レイヤーにインスタンス追加・起動⑤レシピによってパッケージインストール、設定LBとしてELBが選択可能にOpsWorksでELBをLBレイヤーに利用可能にOpsWorksのELB対応
  • 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.474ELB負荷テストに関するTips
  • 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.48ELBを負荷テストする必要性についてELBのいくつかの特長がテストシナリオに影響を与える可能性がある。• ELBのスケーリング• ELBの初期キャパシティ• アイドルコネクションタイムアウト• バックエンドインスタンスのヘルスチェック• Stickyセッション、等ご利用内容に合わせたシナリオでテストが必要
  • 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.49ELBの負荷テスト方法の種類シングルクライアントテスト• 例:Apache Bench(ab)マルチクライアントテスト• 例:curl-loader(都度DNS解決を行うツールが望ましい)分散テスト• 例:Fabricフレームワーク、BeesWithMachineGuns※いずれのテストにおいても、クライアントの負荷が足りない場合はクライアント数を増やす等で対応可負荷生成クライアントバックエンドインスタンス
  • 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推奨テストアプローチ想定する最大負荷のテスト通常のトラフィック時のテスト• トラフィックの多い時• トラフィックの少ない時• トラフィックの傾向に変化がある時(朝や昼の時間帯など)短い時間でトラフィックが大きく変化する場合のテスト※ELB以外にも負荷生成クライアント、バックエンドEC2インスタンスも監視すべき• アプリケーション内部の動作も要確認時間負荷
  • 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負荷テストの注意事項ELBの初期スケールに注意• スケールするまでに、HTTP 503レスポンスを返す期間があり得る• 回避策:• ELBの暖気運転( Pre-Warming)申請をする• 5分間隔で50%以上のトラフィック増加をしないよう負荷テストを設定DNSクエリの仕方に注意• テストクライアント側で少なくとも1分に1回DNSの再解決をするスティッキーセッション利用時の割り振り方• 同じCookieでリクエストを続けた場合などは振り分けに偏りがバックエンドインスタンスのアイドルタイムアウト• 60秒以上に設定しないとELBが誤って不健全なホストと見なす可能性あり
  • 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.525.まとめ
  • 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まとめELBはAWSが提供するロードバランシングサービス• 運用管理コストを抑えながらスケーラブルで高可用なインフラを構築可能• 各種サービスとの連携もスムーズ&随時拡充• 負荷試験時はその特性を理解した上で• 急激な負荷の増大が想定される場合には、サポート加入の上で暖気申請(Pre-Warming)を
  • 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日本語Link(クラウドサービス活用集に掲載)VPC内ELB配置設計指針ロードバランサとSocket接続を使用したイベント通知サーバの負荷分散Elastic Load Balancing開発者ガイド• http://docs.aws.amazon.com/ja_jp/ElasticLoadBalancing/latest/DeveloperGuide/Welcome.htmlElasitc Load Balancingを評価するためのベストプラクティス• http://d36cz9buwru1tt.cloudfront.net/jp/documentation/BestPracticesInEvaluatingELB-ja-final.pdf
  • 55.
    © 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.55英語Link(最新版)参考資料• Amazon Elastic Load Balancing Developer Guidehttp://docs.aws.amazon.com/ElasticLoadBalancing/latest/DeveloperGuide/Welcome.html• Best Practices in Evaluating Elastic Load Balancinghttp://aws.amazon.com/articles/1636185810492479• Amazon ELB FAQhttp://aws.amazon.com/ec2/faqs/Elastic Load Balancing の箇所• AWS re: Invent CPN 205: Zero to Millions of Requestshttps://www.youtube.com/watch?v=xKF-Aawz9oc

[8]ページ先頭

©2009-2025 Movatter.jp