0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

[AWS_20]EC2インスタンスの複製

0
Last updated at Posted at 2022-02-06

環境

AWS

前準備

冗長化後に障害試験を行なう際、どっちのWEBサーバにアクセスしているか分かるように、EC2にSSH接続してindex.phpを編集しておく。

Linux
sudo su -
cd /var/www/html

vi index.php

define( 'WP_USE_THEMES', true);の下に以下を挿入
echo '<p>web server 1</p>';
このあと新規EC2インスタンス複製するが、その後に新規インスタンスの方はweb server2とする。

実作業

  1. 既存EC2インスタンスの停止

    インスタンスの状態 > インスタンスの停止をクリックする。
  2. 既存EC2インスタンスからイメージの作成

    アクション > イメージとテンプレート > イメージの作成をクリックする。

    イメージ名: WebServer

    イメージの説明: WebServer

    イメージを作成をクリックする。
  3. AMIが使用可能になるのを待つ

    イメージ > AMIをクリックして、作成したAMIがAvailableになっていることを確認する。
  4. 新規インスタンスの起動

    インスタンス > インスタンスを起動をクリックする。

    ステップ1:マイAMI > WebServer

    ステップ2:t2.micro

    ステップ3:ネットワーク:MyVPC1

           サブネット:PublicSubnet2 | ap-northeast-1c

           自動割り当てパブリックIP:有効

    ステップ4:
    ステップ5:キー:Name

           値:WebServer2
    ステップ6:セキュリティグループ:Web-SG-1(既存)
    キーペアは既存のキーペアを選択して、インスタンスを作成する。
  5. 既存EC2インスタンスを起動
    構成図06.png
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?