如要探索資產,您必須將 Migration Center 用戶資產評估器 CLI 下載至可存取所有目標資產的電腦。機器可以是實體伺服器或虛擬機器 (VM) 執行個體。mcdc
CLI 可執行檔有兩個版本 (Linux 和 Windows),取決於您要安裝檔案的電腦作業系統。
mcdc
CLI 會在安裝 mcdc
的機器上,透過遠端方式在目標機器上執行收集指令碼,執行訪客探索作業。它也可以使用 IP 範圍掃描功能,找出並收集多部機器的資料。您可以在 VMware 上執行的 VM 上執行來賓探索,以及在與託管 mcdc
CLI 的機器上執行來賓探索。
或者,如要在 AWS 和 Azure 託管的 VM 上執行探索作業,或是在沒有 SSH 存取權的本機電腦上執行,您必須下載 Guest 收集指令碼,並在本機上執行。在 Linux 機器上使用 mcdc-linux-collect.sh
,在 Windows 機器上使用 mcdc-windows-collect.ps1
。
本文將說明如何下載 mcdc
CLI 和收集指令碼,以便探索及收集基礎架構資料。
事前準備
下載 mcdc
CLI
視機器的作業系統而定,下載 mcdc
CLI 的 Linux 或 Windows 執行檔。
Linux
- 在 Linux 機器上下載最新版的
mcdc
CLI,並讓其可執行:
curl -O "https://mcdc-release.storage.googleapis.com/$(curl -s https://mcdc-release.storage.googleapis.com/latest)/mcdc"
chmod +x mcdc
Windows
- 如要在 Windows 電腦上使用 Powershell 和
Invoke-WebRequest
下載最新版的mcdc
CLI,請按照下列步驟操作:
$ProgressPreference = 'SilentlyContinue'; $version = Invoke-RestMethod -Uri 'https://mcdc-release.storage.googleapis.com/latest'; Invoke-WebRequest -Uri "https://storage.googleapis.com/mcdc-release/$($version.Trim())/windows/mcdc.exe" -OutFile mcdc.exe
- 如要在 Windows 電腦上使用命令提示字元和
curl
下載最新版mcdc
CLI,請按照下列步驟操作:
for /f usebackq %V in (`curl -s https://mcdc-release.storage.googleapis.com/latest`) do curl -O https://mcdc-release.storage.googleapis.com/%V/windows/mcdc.exe
- 如要透過直接連結下載最新版
mcdc
CLI,請按照下列步驟操作:
https://mcdc-release.storage.googleapis.com/current/windows/mcdc.exe
查看 mcdc
CLI 的說明資訊
如要查看
mcdc
CLI 的說明資訊,請使用--help
標記:Linux
./mcdc --help
Windows
mcdc.exe --help
如要查看特定指令的說明,請搭配使用
--help
標記和指令。舉例來說,如要查看import
指令的說明,請執行下列指令:Linux
./mcdc discover import --help
Windows
mcdc.exe discover import --help
下載訪客資料收集指令碼
如要在目標電腦上下載訪客收集指令碼,請執行下列各節中的步驟。
在 Linux 電腦上下載訪客收集指令碼
如要在 Linux 電腦上下載 mcdc-linux-collect.sh
,請按照下列步驟操作:
登入電腦。
將訪客收集指令碼下載至機器,並將其設為可執行檔:
curl -O "https://mcdc-release.storage.googleapis.com/$(curl -s https://mcdc-release.storage.googleapis.com/latest)/mcdc-linux-collect.sh" chmod +x mcdc-linux-collect.sh
在 Windows 機器上下載訪客收集指令碼
如要在 Windows 電腦上下載 mcdc-windows-collect.ps1
,請按照下列步驟操作:
登入電腦並開啟 PowerShell。
將訪客收集指令碼下載到機器:
$version = Invoke-WebRequest -UseBasicParsing https://mcdc-release.storage.googleapis.com/latest $WebClient = New-Object System.Net.WebClient $WebClient.DownloadFile("https://mcdc-release.storage.googleapis.com/"+$version+"/mcdc-windows-collect.ps1", (Get-Location).Path + "\mcdc-windows-collect.ps1")