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.

【EC2】AMIを使用したインスタンスの複製

Posted at

やること

  • EC2インスタンス「web-1a」から「web-server」という名前のAMIイメージを作成する
  • AMIイメージ「web-server」から、新たなEC2インスタンス「web-1b」を起動する
  • web-1b」にssh接続し、複製が完了したことを確認する

1. 複製元のインスタンスを停止する

スクリーンショット 2020-08-10 18.06.18.png

2. AMIイメージを作成する

スクリーンショット 2020-08-10 18.09.12.png スクリーンショット 2020-08-10 18.11.29.png

作成完了

スクリーンショット 2020-08-10 18.13.37.png

3. AMIイメージからインスタンスを起動する

スクリーンショット 2020-08-10 18.35.47.png

4. インスタンスの設定をする

  • インスタンスタイプの選択
  • インスタンス詳細の設定
  • ストレージの追加
  • タグの追加:「Name」を「web-1b」に設定
  • セキュリティグループの設定:「HTTP」と「HTTPS」を追加
  • キーペアを作成または選択する

起動完了

スクリーンショット 2020-08-10 18.54.41.png

5. 起動したインスタンスにssh接続する

$ ssh -i ~/.ssh/[秘密鍵名].pem ec2-user@[web-1bのパブリックIP]

6. インストール済みのファイルを確認する

[ec2-user@ip-[web-1bのプライベートIP] ~]$ sudo su -
[root@ip-[web-1bのプライベートIP] ~]# yum list installed | grep httpd

複製完了

Apacheの設定ファイルがインストールされたインスタンスが複製されたことが確認出来る

generic-logos-httpd.noarch            18.0.0-4.amzn2                 @amzn2-core
httpd.x86_64                          2.4.43-1.amzn2                 @amzn2-core
httpd-filesystem.noarch               2.4.43-1.amzn2                 @amzn2-core
httpd-tools.x86_64                    2.4.43-1.amzn2                 @amzn2-core
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?