Transcript
Page 1: [AWSマイスターシリーズ] Amazon Route53

© 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 マイスターシリーズ

Amazon Route 53

2013.08.21

アマゾン データ サービス ジャパン株式会社

ソリューションアーキテクト 吉荒 祐一

Page 2: [AWSマイスターシリーズ] Amazon Route53

© 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

Amazon Route 53

Page 3: [AWSマイスターシリーズ] Amazon Route53

© 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

What is Amazon Route 53?

3

AWSの提供するDNS権威サービス

DNSはドメイン名をIPアドレスに変換するインターネット上の「電話帳」

DNSはTier-0サービスともよばれる

• 可用性が最重要

高い拡張性

“Route 53” はDNSサーバがポート53番で動作することに由来

AWSでの柔軟、高性能、高可用性を持つアーキテクチャを可能にするツール

Route

53

Page 4: [AWSマイスターシリーズ] Amazon Route53

© 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

Users DNS Resolver

Route 53

www.example.com

はどこ?

知らないので権威サーバに尋ねます

1.2.3.4 1.2.3.4

53

Page 5: [AWSマイスターシリーズ] Amazon Route53

© 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

Amazon Route 53の機能追加

2013年2月:DNSフェイルオーバー 2013年5月:DNSフェイルオーバー、ELBのエンドポイントのサポートを追加 2013年6月:Amazon CloudFront経由で配信されるウェブサイトに対するzone apexのサポート 2013年6月:ヘルスチェックのCloudWatchメトリックス 2013年8月:ヘルスチェックグラフ 2013年8月:ゾーンファイルのインポート 2013年5月:新しいエッジロケーション(韓国) 2013年7月:新しいエッジロケーション(インド) http://aws.typepad.com/aws_japan/amazon-route53/

Page 6: [AWSマイスターシリーズ] Amazon Route53

© 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

Route 53 の設計原則

6

信頼性

高速

AWS サービスとの

統合

使いやすさ

経済性

柔軟性

•冗長化されたロケーション

• SLA設定

•全世界で動作するAnycastネットワーク

•変更の高速伝播

• IAM •エイリアス •レイテンシベース ルーティング

•DNSフェイルオーバー

•コンソール •プログラムできるAPI

•安価 •つかった分だけの課金

•重みづけ ラウンドロビン

Page 7: [AWSマイスターシリーズ] Amazon Route53

© 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

Route 53の特長的な機能

7

高可用性 DNS

エイリアス レコード

DNS フェイル オーバー

重みづけ ラウンド ロビン

レイテンシベース

ルーティング

CloudWatch メトリックス

•可用性、スケーラビリティの高いDNSサービス

• ELB(Elastic Load Balancer)、S3、CloudFrontでのゾーン名の利用

•訪問者のトラフィックを自動的に別の場所にルーティング

•異なったレスポンスをそれぞれ頻度を定義して利用可能

•ユーザから、複数のAWSリージョンで動作しているアプリケーションのうち、最も近いところに誘導

•ヘルスチェックの結果をCloudWatchにパブリッシュ

•グラフで表示

Page 8: [AWSマイスターシリーズ] Amazon Route53

© 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

CloudFront and Route53 Global Network

Ashburn, VA

Dallas/Fort Worth, TX

Hayward, CA

Jacksonville, FL

Los Angeles, CA

Miami, FL

New York, NY

Newark, NJ

Palo Alto, CA

San Jose, CA

Seattle, WA

South Bend, IN

St. Louis, MO

Amsterdam

Dublin

Frankfurt

London

Madrid

Milan

Paris

Stockholm

42 のエッジロケーション (2013年7月末)

Sao Paulo

Chennai

Hong Kong

Mumbai

Osaka

Seoul

Singapore

Sydney

Tokyo

Page 9: [AWSマイスターシリーズ] Amazon Route53

© 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

Route53を使用しない時の動作

DNSサーバ

Page 10: [AWSマイスターシリーズ] Amazon Route53

© 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

Route53使用時の動作

Anycast IPアドレスが 使用され,同じIPアドレスでも近いサーバにつながる

Page 11: [AWSマイスターシリーズ] Amazon Route53

© 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

Route53

DNS(Route 53)

1. クライアントは使用しているDNS解決用サーバ(local DNS)に、h.example.comのアドレスを問いあわせる ⇒ root DNSを案内

2. root DNSにh.example.comを問いあわせる。 ⇒ .com DNSを案内

3. .com DNSにh.example.comを問いあわせる。 ⇒ .example.com DNSを案内 (通常4つのIPアドレスが登録され、IP anycastが割り当てられている)

4. local DNSから3で得たIPアドレスにh.example.comを問いあわせると、一番近いどこかのASにあるRoute53に接続。 ⇒ IPアドレスを得る。

ユーザー

local DNS

1

4

example.com DNS

.com DNS

3

root DNS

2

AS1

AS2 AS1 AS3

IP1 IP2

IP3 IP4

Page 12: [AWSマイスターシリーズ] Amazon Route53

© 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

ホストゾーンとレコード

「ホストゾーン」とは管理可能なレコードの集合

• ユーザーあたり100ゾーンまで

• レコードは10,000個まで

• 上限緩和可能

レコードセットの4つのルーティングポリシー

• Simple シンプル

• Weighted 重みづけ

• Latency レイテンシーベースルーティング

• Failover フェイルオーバー

Page 13: [AWSマイスターシリーズ] Amazon Route53

© 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

サポートするレコードタイプ

Record Types:

A (address record)

AAAA (IPv6 address record)

CNAME (canonical name record)

MX (mail exchange record)

NS (name server record)

PTR (pointer record)

SOA (start of authority

record)

SPF (sender policy

framework)

SRV (service locator)

TXT (text record)

Page 14: [AWSマイスターシリーズ] Amazon Route53

© 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

始め方

サインアップする

ホストゾーンを作成する

DNSレコードを作成する

ドメインレジストラにRoute 53ネームサーバーを登録する

Page 15: [AWSマイスターシリーズ] Amazon Route53

© 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

ゾーンファイルのインポート

ゾーンファイル全体をインポートしてリソースレコードを作成

まずマネジメントコンソールでホストゾーンを作成

次にゾーンファイルをインポート • インポート元のゾーンファイルは、RFC1034、RFC1035に準拠した形式

• インポート先のゾーンは、自動的に作成されるSOA、NS以外、空でなければならない

• ホストゾーン名とレコードに含まれるドメイン名は一致

• インポート元のゾーンファイルの$ORIGIN、$TTLキーワードをサポート。 $GENERATE、$INCLUDEキーワードがあれば、インポートはエラー

• インポート元のゾーンファイルのSOAレコードは無視

• ホストゾーンと同じドメイン名のNSレコードは無視

• 最大1000レコード

• 1000レコードを超える場合は、”BIND to Amazon Route 53 Conversion Tool”を使用 • http://aws.amazon.com/developertools/Amazon-Route-

53/4495891528591897

Page 16: [AWSマイスターシリーズ] Amazon Route53

© 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

ドメイン名のみの扱い

“エイリアス”タイプ

• AWS独自のレコード。

• ELB、S3のウェブサイトバケット、CloudFrontのディストリビューションのDNS名をドメインだけの形にして割り当てできる。

• ルートドメインでWebサイトをホストできる。 (例. http://mysite.com)

• ELB、S3のウェブサイトバケット、CloudFrontのディストリビューションにマッピングされるエイリアスレコードに対するクエリは無料。

Page 17: [AWSマイスターシリーズ] Amazon Route53

© 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

重みづけラウンドロビン

レコードセットに重みを設定

0から255の間で設定可能

以下の式の値に比例し、同じ名前・種類のレコードセットからクエリーに返すレコードセットを選択

• 例)重み3 : 重み1の場合、75%:25%の時間割合

レコードセットの重み

同じ名前・種類のレコードセットの重みの合計

Page 18: [AWSマイスターシリーズ] Amazon Route53

© 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

レイテンシベースルーティング (LBR)

複数のリージョンでアプリケーションを動作させる

LBRレコードを作成

• どのリージョンでエンドポイントを動作させているかを記述

エンドポイントは、EC2インスタンス,Elastic IP、またはElastic Load Balancer (ELB)を指定する

Route 53 はエンドユーザからのアクセスをレイテンシ最小のエンドポイントへ誘導する

Page 19: [AWSマイスターシリーズ] Amazon Route53

© 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

レイテンシベースルーティングを使うメリット

19

単一のリージョンでのみ動作させている場合よりも良好なパフォーマンスを提供

信頼性の向上

DNSサーバでも実現可能だが。。

• Route 53を使えば自力で行うよりも楽

• 非常に安価

Page 20: [AWSマイスターシリーズ] Amazon Route53

© 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

レイテンシベースルーティングの舞台裏

インターネット上のホスト間のレイテンシは、時間と共に変化

舞台裏では、継続的にレイテンシの計測データを収集しRDSに蓄積

この計測データも用いて、AWS各リージョンからインターネット上のネットワークへの相対的なネットワークレイテンシのテーブルを作成

Route 53のレイテンシベースルーティングはこのテーブルに基づき行われる

例えば、米国西海岸リージョンと米国東海岸リージョンにサーバーがある場合に、ある週は、西海岸にルーティングされていても、翌週は、東海岸とのレイテンシが改善され、東海岸にルーティングされるような場合もある

Page 21: [AWSマイスターシリーズ] Amazon Route53

© 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

DNSフェイルオーバーとは?

ヘルスチェック • アプリケーションのエンド

ポイントがアップまたはダウンしているかを判断

• 世界中の複数の場所からアプリケーションのエンドポイントに向かって、定期的にインターネット経由のリクエストを送る形で実行

フェイルオーバー • 稼働し到達できるリソース

だけをクエリーに返答 • ウェブサイトが停止したこ

とを検出した場合、サイトにアクセスしたユーザーをダウンしているエンドポイントからリダイレクト

Page 22: [AWSマイスターシリーズ] Amazon Route53

© 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

DNSフェイルオーバー : 用語解説

エンドポイント

• インターネット上のロケーション

• IPアドレス、URL、またはELB名で指定

• 正常な応答が返るかどうか定期的にチェックされる

ヘルスチェック

• Route 53コンソールまたはAPIで作成

• エンドポイントのチェック結果によりHealthy、またはUnhealthyというステータスを持つ

• ヘルスチェックと一つ、または、複数のDNSレコードを関連付けできる

Page 23: [AWSマイスターシリーズ] Amazon Route53

© 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

DNSフェイルオーバーの動き

AWS各リージョン内からヘルスチェックを実施。

ヘルスチェックに際してRoute 53は指定したIPアドレス、URL、ELBに対して要求送信。成功応答を受けるとヘルスチェック合格、さもなければヘルスチェック失敗。

ヘルスチェックが失敗したら、関連づけられたDNSレコード全てがInactiveになり、バックアップとして構成されたレコードがActiveに。

ヘルスチェック対象のエンドポイントがフェイルしてからDNSフェイルオーバーまで3分程度

Page 24: [AWSマイスターシリーズ] Amazon Route53

© 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

ヘルスチェックの内容

ヘルスチェックを作成すると世界各地のサーバーに構成を伝播 最初は「Healthy」と推定 各データセンターのヘルスチェッカーが30秒毎にエンドポイントにリクエストを送信 三回連続してヘルスチェックがフェイルすると「Unhealthy」に変更 三回連続してヘルスチェックが成功すると「Unhealthy」から「Healthy」に変更 • 「Healthy」「Unhealthy」に関わらずヘルスチェックの頻度は一定

各々のヘルスチェッカーは全世界のRoute 53 DNSサーバに結果を伝播 各Route 53 DNSサーバでは、 • 一つ以上のヘルスチェッカーが「Healthy」と報告した場合は、そのヘルスチェックに関連付けら

れたレコードセットを応答に用いる • もしいずれのヘルスチェッカーも「Healthy」と報告しない場合は、そのヘルスチェックに関連付

けられたレコードセットを応答に用いない

TCPヘルスチェック • エンドポイントと4秒以内にTCPコネクションを確立できたかどうか

HTTPヘルスチェック • エンドポイントと4秒以内にTCPコネクションを確立できたかどうか • かつ、エンドポイントから200以上400未満のHTTPステータスコードの応答を接続後、 2秒以内

に受け取るか

Page 25: [AWSマイスターシリーズ] Amazon Route53

© 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

フェイルオーバーの注意点

連鎖的障害の回避 • 全てのレコードセットが「Unhealthy」と判断された場合、Route 53は逆に全てのリソー

スレコードセットは「Healthy」とみなす • 例えば、3つのエンドポイントの1つが過負荷で停止すると、Route 53 DNSサーバは、 残

りの2つから応答。万一、残りの2つも過負荷でフェイルした場合には、3つのエンドポイントすべてにリクエストを割り振る状態に復帰

インターネットの切断への対応 • インターネットの大規模な分断が発生した場合、Route 53の各ロケーションはエンドポイ

ントのヘルスチェックについて異なるステータスを持つ可能性。 • 例えば至近のリージョンからのヘルスチェック結果のみアクセス可能な場合があり。

• 例)南米への接続に影響を与えるようなインターネットの分断の場合、 • サンパウロのヘルスチェッカー:

⇒ サンパウロ・リージョン内のエンドポイントは「Healthy」と判断 • サンパウロのRoute 53 DNSサーバ:

⇒ サンパウロ・リージョン内のエンドポイントのレコードを応答 • 米国東海岸のヘルスチェッカー:

⇒ サンパウロ・リージョン内のエンドポイントは「Unhealthy」と判断 • 米国東海岸のRoute 53 DNSサーバ:

⇒ サンパウロ・リージョン以外のエンドポイントのレコードを応答

• 結果として各地域からのアクセス可能性に応じたエンドポイントのレコードを応答

Page 26: [AWSマイスターシリーズ] Amazon Route53

© 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

単純フェイルオーバー

AWS Region

Primary (Active)

Secondary (Inactive)

Health Check = Healthy

Page 27: [AWSマイスターシリーズ] Amazon Route53

© 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

単純フェイルオーバー

AWS Region

Primary (Inactive)

Secondary (Active)

Health Check = Unhealthy

Page 28: [AWSマイスターシリーズ] Amazon Route53

© 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

マルチリージョンフェイルオーバー

AWS Region 1 AWS Region 2

LBR (Active)

Health Check = Healthy

Health Check = Healthy

LBR (Active)

ELB ELB

Page 29: [AWSマイスターシリーズ] Amazon Route53

© 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

マルチリージョンフェイルオーバー

AWS Region 1 AWS Region 2

LBR (Active)

Health Check = Healthy

Health Check = Unhealthy

LBR (Inactive)

ELB ELB

Region 2への ルーティングを停止

Page 30: [AWSマイスターシリーズ] Amazon Route53

© 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

ヘルスチェックグラフ

Route 53が Amazon CloudWatchにヘルスチェックの結果をパブリッシュ。

AWS Management ConsoleのRoute 53 タブ内でグラフ表示、さらに簡単にアクセス。

Page 31: [AWSマイスターシリーズ] Amazon Route53

© 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

Amazon Route 53の料金 Pay-as-you-go Pricing

ホストゾーンあたり • 最初の25ホストゾーン $0.50 USD(ホストゾーン・月ごと) • それを超えるホストゾーン $0.10 USD(ホストゾーン・月ごと)

標準的クエリ • 最初の10億クエリ $0.50 USD(100万クエリ・月ごと) • 10億クエリを超える分 $0.25 USD(100万クエリ・月ごと)

レイテンシーベースルーティングクエリ • 最初の10億クエリ $0.75 USD(100万クエリ・月ごと) • 10億クエリを超える分 $0.375 USD(100万クエリ・月ごと)

DNS フェイルオーバーのヘルスチェック • AWS内部のエンドポイントに対するヘルスチェック

$0.50 USD(1件・月ごと) • AWS外部のエンドポイントに対するヘルスチェック

$0.75 USD(1件・月ごと)

料金は下記URLをご参照ください • http://aws.amazon.com/jp/route53/pricing/

Page 32: [AWSマイスターシリーズ] Amazon Route53

© 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 Route 53の特長まとめ

高可用性および高信頼性 • インフラ • SLA

スケーラブル • 自動的に規模を拡大して大量の

クエリを処理

他のアマゾン ウェブ サービスと併用が可能 • ELB、S3、CloudFrontの

zone apexサポート • ELBと連携したDNSフェイル

オーバー

シンプル • セルフサービスでサインアップ • 数分で開始

迅速 • 全世界のグローバルエニーキャ

ストネットワーク

経済的 • Pay as you go • サービスは低コスト • 最低利用料金や前払金は不要

セキュア • Route 53 とIAMの統合

高い柔軟性 • 重みづけラウンドロビン • DNSフェイルオーバー

Page 33: [AWSマイスターシリーズ] Amazon Route53

© 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

Route53利用のFAQ

IPv6対応

• AAAA, PTRレコードはIPv6に対応していますが、Route53に対してIPv6で問いあわせても返答しません

プライベートIPアドレス目的の利用

• 可能ですが、誰からも参照可能です

デフォルトのTTL

• 全てのレコードに対して設定する必要あり

Page 34: [AWSマイスターシリーズ] Amazon Route53

© 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

Appendix

参考資料 • Amazon Route 53 Developer Guide

http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/Welcome.html

• Amazon Route 53 FAQ http://aws.amazon.com/jp/route53/faqs/

• Amazon Route 53 料金 http://aws.amazon.com/jp/route53/pricing/

• Amazon Route 53 SLA http://aws.amazon.com/jp/route53/sla/


Top Related