翻訳は機械翻訳により提供されています。提供された翻訳内容と英語版の間で齟齬、不一致または矛盾がある場合、英語版が優先します。
基本的な IIS 移行の実行
このセクションでは、 eb migrate コマンドを使用して IIS アプリケーションを Elastic Beanstalk に移行するプロセスについて説明します。
IIS 環境の探索
変更を行う前に、サーバーに存在するリソースを理解する必要があります。まずeb migrate explore、次の例に示すように、 を実行して IIS サイトを調べます。
PS C:\migrations_workspace>
eb migrate explore
このコマンドは IIS サイトを表示します。次のリストを参照してください。
Default Web Site
Intranet
API.Internal
Reports
バインディング、アプリケーション、仮想ディレクトリなど、各サイトの設定の詳細を表示するには、次の例に示すように、 --verbose
オプションを追加します。
PS C:\migrations_workspace>
eb migrate explore --verbose
次のリストは、 コマンドが提供する環境に関する包括的な情報を示しています。
1: Default Web Site:
- Bindings:
- *
:80:www.example.com
- *
:443:www.example.com
- Application '/':
- Application Pool: DefaultAppPool
- Enabled Protocols: http
- Virtual Directories:
- /:
- Physical Path: C:\inetpub\wwwroot
- Logon Method: ClearText
- Application '/api':
- Application Pool: ApiPool
- Enabled Protocols: http
- Virtual Directories:
- /:
- Physical Path: C:\websites\api
- Logon Method: ClearText
2: Intranet:
...
3. API.Internal:
...
4. Reports:
...
検出出力について
詳細な出力は、移行計画に以下の重要な情報を提供します。
- サイト
-
検出出力には、サーバー上のすべての IIS サイトが一覧表示されます。各サイトは名前 (「デフォルトウェブサイト」、「イントラネット」、「API.内部」など) で識別され、順番に番号が付けられます。サーバーに複数のサイトが存在する場合、
eb migrate
コマンドは移行戦略に応じて、それぞれを個別に、またはまとめてパッケージ化してデプロイできます。 - バインディング
-
プロトコルバインディングは、サイトがどのプロトコル (HTTP/HTTPS) を使用し、どのポートで動作するかを明らかにします。バインディング情報には、ドメインベースのルーティング設定を定義するホストヘッダー要件が含まれます。
- アプリケーション
-
アプリケーションパスは、IIS 設定内のルートアプリケーション構造とネストされたアプリケーション構造の両方を表示します。アプリケーションプールの割り当ては、セキュリティとリソース管理のためにアプリケーションがどのように分離されているかを示します。
- 仮想ディレクトリ
-
物理パスマッピングは、コンテンツがファイルシステム上に存在する場所を示します。認証設定には、移行後に維持する必要がある特別なアクセス要件が表示されます。
移行の準備
環境を理解し、サーバーが前提条件を満たしていることを確認します。まず、次の PowerShell コマンドを使用して IIS バージョンを確認します。
PS C:\migrations_workspace>
Get-ItemProperty "HKLM:\SOFTWARE\Microsoft\InetStp\" -Name MajorVersion
IIS 7.0 以降が必要です。移行ツールは、Web Deploy 3.6 を使用してアプリケーションをパッケージ化します。次のコマンドを使用してインストールを確認します。
PS C:\migrations_workspace>
Get-ItemProperty "HKLM:\SOFTWARE\Microsoft\IIS Extensions\MSDeploy\3" -Name InstallPath
Web Deploy がサーバーにインストールされていない場合は、Microsoft Web Platform Installer
最初の移行
デフォルトウェブサイトの基本的な移行から始めましょう。次の例は、最も単純なコマンド を示していますeb migrate。
PS C:\migrations_workspace>
eb migrate
このコマンドは、次の出力例に示すように、一連の自動ステップを開始します。
Identifying VPC configuration of this EC2 instance (i-0123456789abcdef0)
id: vpc-1234567890abcdef0
publicip: true
elbscheme: public
ec2subnets: subnet-123,subnet-456,subnet-789
securitygroups: sg-123,sg-456
elbsubnets: subnet-123,subnet-456,subnet-789
Using .\migrations\latest to contain artifacts for this migration run.
Generating source bundle for sites, applications, and virtual directories...
Default Web Site/ -> .\migrations\latest\upload_target\DefaultWebSite.zip
移行ツールは、デプロイアーティファクトを含む構造化ディレクトリを作成します。次のリストは、ディレクトリ構造を示しています。
C:\migration_workspace\
└── .\migrations\latest\
└── upload_target\
├── DefaultWebSite.zip
├── aws-windows-deployment-manifest.json
└── ebmigrateScripts\
├── site_installer.ps1
├── permission_handler.ps1
└── >other helper scripts<
移行の制御
移行プロセスをより詳細に制御するには、次のコマンドを使用して、移行するサイトを正確に指定できます。
PS C:\migrations_workspace>
eb migrate --sites "Default Web Site,Intranet"
次のコマンド例に示すように、環境名とアプリケーション名をカスタマイズすることもできます。
PS C:\migrations_workspace>
eb migrate ` --sites "Default Web Site" ` --application-name "CorporateApp" ` --environment-name "Production"
オプションの完全なリストについては、「」を参照してくださいeb migrate。
進行状況の監視
移行中、 eb migrateはリアルタイムのステータス更新を提供します。次の出力例を参照してください。
... Creating application version Creating environment... This may take a few minutes 2024-03-18 18:12:15 INFO Environment details for: Production Application name: CorporateApp Region: us-west-2 Deployed Version: app-230320_153045 Environment ID: e-abcdef1234 Platform: 64bit Windows Server 2019 v2.7.0 running IIS 10.0 Tier: WebServer-Standard-1.0 CNAME: production.us-west-2.elasticbeanstalk.com Updated: 2024-03-20 15:30:45 2025-03-18 18:12:17 INFO createEnvironment is starting. 2025-03-18 18:12:19 INFO Using elasticbeanstalk-us-east-1-180301529717 as Amazon S3 storage bucket for environment data. 2025-03-18 18:12:40 INFO Created security group named: sg-0fdd4d696a26b086a 2025-03-18 18:12:48 INFO Environment health has transitioned to Pending. Initialization in progress (running for 7 seconds). There are no instances. ... 2025-03-18 18:23:59 INFO Application available at EBMigratedEnv-arrreal3.us-east-1.elasticbeanstalk.com. 2025-03-18 18:24:00 INFO Successfully launched environment: EBMigratedEnv-arrreal3
移行の検証
環境の準備が完了すると、Elastic Beanstalk はデプロイを検証するいくつかの方法を提供します。
- アプリケーションにアクセスする
-
ウェブブラウザでアプリケーション URL (CNAME) を開き、正しく動作していることを確認します。
- 環境の状態を確認する
-
eb health コマンドを使用して、環境の状態を表示します。
PS C:\migrations_workspace>
eb health
次の画面イメージは、インスタンスの状態、アプリケーションレスポンスメトリクス、およびシステムリソース使用率を示しています。
- eb logs コマンドを使用してログにアクセスし、問題をトラブルシューティングします。
-
PS C:\migrations_workspace>
eb logs --zip
eb logs コマンドは、
.elasticbeanstalk/logs
ディレクトリにログをダウンロードします。詳細については、「Amazon CloudWatch Logs で Elastic Beanstalk を使用する」を参照してください。 - インスタンスに接続する
-
移行中にキーペアを指定した場合は、RDP を使用してインスタンスに接続し、直接トラブルシューティングを行うことができます。
- Elastic Beanstalk コンソールにアクセスする
-
環境のヘルス、ログ、設定プロパティは、その環境の環境マネジメントコンソールから表示できます。
移行アーティファクトの管理
eb migrate コマンドは、移行プロセス中にローカルアーティファクトを作成します。これらのアーティファクトには機密情報が含まれており、時間の経過とともに大量のディスク容量を消費する可能性があります。次の例に示すように、 cleanupサブコマンドを使用してこれらのアーティファクトを管理します。
P
S C:\migrations_workspace>
eb migrate cleanup
Are you sure you would like to cleanup older artifacts within ./migrations/? (Y/N):
確認なしで強制クリーンアップするには、 --forceオプションを使用します。
PS C:\migrations_workspace>
eb migrate cleanup --force
クリーンアッププロセスでは、最後に成功した移行が ./migrations/latest
ディレクトリに保存され、古い移行ディレクトリが削除されます。