SlideShare une entreprise Scribd logo
1  sur  38
Télécharger pour lire hors ligne
AmazonWebService(AWS)
   を使ってみたよ!
    タイムリミット80hで分かった事
  ∼技術的なじゃなくて世間話的な内容∼

                2013/3/30
                 山重 崇人
山重 崇人 (やましげ たかと)
広島市内の中小IT企業で
インフラ・ネットワークエンジニア風な事
をやっていますした。

サーバやネットワーク機器が好きです。
焼酎が好きです。
お肉が好きです。
猫も好きです。
好きなサービスは
VPCです(キリッ
AWSを使った仕事に参加
• 公開系のサービス
   (Apache+php+Mysql)
• すでに何となく構成が決定
• NFSを使うLB環境
• DBはRDSを使用
• 要件としてはAutoScalingあり
• とりあえずEC2で構成しよう
  →(DevはEC2のmicroで構築済)
• 10日(80h)という制限。できる所まで
私のスキル
• レイヤの低い順に得意
• LinuxよりもWindowsが好き
• 公開系のサービスは苦手
• DB苦手(というか、任せる)
  俺に任せろ!と言えるほどの
 スキル適合ではない(́・ω・`)
対象となる方?
• AWSを触ったことがあるけど、サービス利用したこ
 とのない方

• AWSの基本的な事はなんとなく理解できた(つも
 り)の方

• どういう事で問題が発生しそうかを見てみたい方
• 何かわからないけど、何となくモヤモヤしてる方
 (一緒に悩みましょう)
何が起こったか
• CDP本があるし余裕じゃね?
  →実装する段階でどう配置すれば?

• 環境を作ってみてから気づく事が多数
• 単純な仮想化以上に考慮する必要が
 個人的な見通しの甘さと認識の甘さから問題が多発!
CDP本もあるし、余裕じゃね?

        さてと。
        これを実装と・・・


        ん? これって。
        ネットワーク的にど
        うなってんの?
Plan A




Plan B
Plan A

•当時のEC2では実装できない
 (2NIC構成)
•必然的にVPCの利用が条件
•ネットワークの設計が必要
Plan B


•NFS+Web+DBアクセス。
全部同じNICに乗るけどいい
の?
EC2での設計

  • サブネットは設計でき
   ないのでインスタンス
   の配置と、論理的な接
   続をイメージして書く

   ※ただし
VPCでの設計




• サブネットを含めた設計が可能
• ELBはサブネットを跨げる
• 1つのインスタンスはAZを跨げない
EC2,VPCの比較
   項目           EC2      VPC
グローバルIP
               ○(非固定)      ✗
 (標準)

 ローカルIP          ✗      ○(指定可能)


サブネット定義          ✗      ○(指定可能)


SecurtyGroup     In      In/Out


   NACL          ✗       In/Out
ざっと見ても、こんなに違いが




   VPCさん、舐めてました。
      ごめんなさい。
やっぱ、触ってみないとわかんないよね。
おさわり❤開始
あー! 遠くに行きたい!
なー
         てん
       りし
  も っさ
何か
なー
          てん
        りし
     っさ      Pin
何 かも             g折
                   り
                      返
                       し
                          っ
                           て
                            こ
                               ん
                                な
                                   も
                                    ん?
なー
          てん
        りし
     っさ      Pin
何 かも             g折
                   り
                      返
                       し
                          っ
                           て
                            こ
                               ん
                                な
                                   も
                                    ん?

      あれ!?かーさん!!
    俺のインスタンス知らない!?
なー
          てん
        りし
     っさ      Pin
何 かも             g折
                   り
                      返
                       し
                          っ
 バージニアリージョンを
          こ
            ん
                           て
              な
                も
 利用する事案が多発!! ?    ん

      あれ!?かーさん!!
    俺のインスタンス知らない!?
まず確認

       リージョン
環境を作った後
•   EC2インスタンスを停止→開始するとIPアドレスが変わる

•   EC2でEIPを使っても停止→開始時にEIPが剥がされる(半泣き

•   NFSが遅い

•   EIP付与時の挙動がEC2とVPCでは異なる

•   2NICのインスタンスをAMI化→デプロイ 1NIC構成になる

•   ブラウザで表示するとサーバが見つからないエラー

•   2NIC構成は同一AZ内の各サブネットにだけ利用可能
EC2インスタンスを停止→開始する
    とIPアドレスが変わる

• そういうもん
• 検証中はあまり停止しないから気付き
 にくい

• EIPを使えば固定できる
EC2でEIPを使っても停止→開始時に
   EIPが剥がされる(半泣き
• そういうもん
• AWS Toolsを使って(ry おググりください。
 • cronに @rebootを指定して起動時におまじ
  ないをしてくっつける

• 検証中はあまり停止しないから気付きにくい
• インスタンスの停止→開始で想定外の事がな
 いかを確認する習慣をつける
 →物理サーバでの確認事項+αが必要
NFSでパフォーマンスが出ない

• EC2でのレイテンシ(2-3ms)
 VPCだと0.5ms程度
 →これは主要因では無い(asyncで対応)

• NFS自体の理解不足 
• プログラムとの相性
 →NFSにソースだけを置くと遅くない
  TMPファイルの取り扱いが問題
EIP付与時の挙動が
      EC2とVPCでは異なる
• EC2は無条件に外に出れるが、VPCはルー
 ティングが必要

• VPCを手動で作成した場合は
 InternetGatewayの作成と割り当ても必要

• PublicDNSの扱い
 EC2:FQDNが変わる
 VPC:PublicDNSは無い


• 内部からPublicをlookupすると、ローカルIP
 が返ってくる
2NICのインスタンスをAMI化

• 2NIC構成のインスタンスをAMI化→デプロイ
 すると、1NICとなる。

• これが、AutoScalingで問題になる。


      ←このWebインスタンスのような場合


                      未解決
ELBとサブネット指定

• ELB作成時に2サブネット構成
 片側にしかインスタンスを配置環境ではブラウザ接続時に「ページを
 表示で(ry」エラーが不定期に発生する→インスタンスがなくてもバ
 ランスしようとしてる?


• インスタンスを未配置なサブネットはELBに
 含めない
メンテナンス環境

• OpenVPNサーバをAWS上に配置し開発拠点
 内のクライアントにOpenVPNクライアント

• Tunnelモードで接続
• OpenVPN用のネットワークを作成
• VPC内でルーティングを定義 established
• ACLでアクセス管理       のみを要望

• AWS→クライアントについてはダイナミック
 ポート(32768以上とか)Rejectする事で制限
こんな感じ
OpenVPN構成の注意点

• VPCのルーティングにOpenVPNネットワー
 クへのルーティングを追加

• ACLは慎重に(双方向の試験を)
• インスタンスの「Change Source/Dest
 Check」を無効にする

• OpenVPNサーバの/etc/sysctl.confで
 net.ipv4.ip_foward=1 を定義
インスタンスサイズに関する考察

• 評価環境と本番環境
• 動けばOKであればmicroでもいいかな
• パフォーマンスも評価の一部なら本番と同じ
 インスタンスサイズ

• 「遅い」の切り分けを行うにあたってインス
 タンスサイズが小さい事が原因でした(・ω<)
 は、避けたい
セキュリティ診断について

• 公開前のセキュリティ診断等は事前に申請が
 必要

• 知らなかったけど、申請しないとマズイらし
 い

• 1∼2週刊ぐらい前に申請が必要(だった気
 がする)

• ドメイン取得、証明書等余裕を持って準備を
まとめ

• 海外気分を楽しみたければバージニア
• CDP本は魔法じゃない。頭のなかで組み立て
 よう

• 検証中もインスタンスの停止、部分停止など
 サービスへの影響を確認しよう

• 今日の常識は明日の非常識?
 活きのいいネタで勝負。

• VPCは色々と捗る
お詫び


 記載されているEC2に関する内容は、す
 でに古いものとなっております。
ご静聴
ありがとうございました。


(絶賛、スカウト受付中です!)

Contenu connexe

En vedette

Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTExpeed Software
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsPixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Applitools
 

En vedette (20)

Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 

20130330 awsを使ってみたよ