管理移动代理Manage the Mobility agent

使用 Azure Site Recovery 进行从 VMware VM 和物理服务器到 Azure 的灾难恢复时,请在服务器上设置移动代理。You set up mobility agent on your server when you use Azure Site Recovery for disaster recovery of VMware VMs and physical servers to Azure. 移动代理协调受保护计算机、配置服务器/横向扩展进程服务器之间的通信,并管理数据复制。Mobility agent coordinates communications between your protected machine, configuration server/scale-out process server and manages data replication. 本文概述了在部署移动代理后对其进行管理时要执行的常见任务。This article summarizes common tasks for managing mobility agent after it's deployed.

提示

若要下载特定 OS/Linux 发行版的安装程序,请参阅此处的指南。To download installer for a specific OS/Linux distro, refer to the guidance here. 若要从门户自动更新,则无需下载安装程序。To automatically update from portal, you do not need to download the installer. ASR 会从配置服务器自动提取安装程序,并更新代理ASR automatically fetches the installer from configuration server and updates the agent.

备注

本文进行了更新,以便使用新的 Azure PowerShell Az 模块。This article has been updated to use the new Azure PowerShell Az module. 你仍然可以使用 AzureRM 模块,至少在 2020 年 12 月之前,它将继续接收 bug 修补程序。You can still use the AzureRM module, which will continue to receive bug fixes until at least December 2020. 若要详细了解新的 Az 模块和 AzureRM 兼容性,请参阅新 Azure Powershell Az 模块简介To learn more about the new Az module and AzureRM compatibility, see Introducing the new Azure PowerShell Az module. 有关 Az 模块安装说明,请参阅安装 Azure PowerShellFor Az module installation instructions, see Install Azure PowerShell.

从 Azure 门户更新移动服务Update mobility service from Azure portal

  1. 开始在受保护的计算机上更新移动服务之前,请确保部署中的配置服务器、横向扩展进程服务器及所有主目标服务器均已更新。Before you start ensure that the configuration server, scale-out process servers, and any master target servers that are a part of your deployment are updated before you update the Mobility Service on protected machines.

    1. 从 9.36 版开始,对于 SUSE Linux Enterprise Server 11 SP3,请确保最新的安装程序在配置服务器和横向扩展进程服务器上可用From 9.36 version onwards, for SUSE Linux Enterprise Server 11 SP3, ensure the latest installer is available on the configuration server and scale-out process server.
  2. 在门户中打开保管库 >“复制的项”。 In the portal open the vault > Replicated items .

  3. 如果配置服务器是最新版本,则会看到一条通知,指出“新的 Site Recovery 复制代理更新已可用。If the configuration server is the latest version, you see a notification that reads "New Site recovery replication agent update is available. 单击可安装。”Click to install."

    “复制的项”窗口

  4. 单击该通知,并在“代理更新”中选择要在其上升级移动服务的计算机。 Click the notification, and in Agent update , select the machines on which you want to upgrade the Mobility service. Then click OK .

    “复制的项”VM 列表

  5. 将为所选的每台计算机启动“更新移动服务”作业。The Update Mobility Service job starts for each of the selected machines. 移动代理已更新到配置服务器的版本。Mobility agent is updated to the version of configuration server. 例如,如果配置服务器为版本 9.33,则受保护的 VM 上的移动代理也会更新为 9.33 版本。For example, if configuration server is on version 9.33, the mobility agent on a protected VM is also updated to 9.33 version.

在 Windows 服务器上通过 powershell 脚本更新移动服务Update Mobility service through powershell script on Windows server

开始在受保护的计算机上更新移动服务之前,请确保部署中的配置服务器、横向扩展进程服务器及所有主目标服务器均已更新。Before you start ensure that the configuration server, scale-out process servers, and any master target servers that are a part of your deployment are updated before you update the Mobility Service on protected machines.

使用以下脚本通过 power shell cmdlet 更新服务器上的移动服务Use following script to upgrade mobility service on a server through power shell cmdlet

Update-AzRecoveryServicesAsrMobilityService -ReplicationProtectedItem $rpi -Account $fabric.fabricSpecificDetails.RunAsAccounts[0]

在每个受保护的服务器上手动更新移动服务Update mobility service manually on each protected server

  1. 开始在受保护的计算机上更新移动服务之前,请确保部署中的配置服务器、横向扩展进程服务器及所有主目标服务器均已更新。Before you start ensure that the configuration server, scale-out process servers, and any master target servers that are a part of your deployment are updated before you update the Mobility Service on protected machines.

  2. 根据服务器的操作系统找到代理安装程序Locate the agent installer based on the operating system of the server.

    重要

    如果要在不同的 Azure 区域之间复制 Azure IaaS VM,请不要使用此方法。If you are replicating Azure IaaS VM from one Azure region to another, don't use this method.

  3. 将安装文件复制到受保护的计算机上,并运行该文件以更新移动代理。Copy the installation file on to the protected machine, and run it to update the mobility agent.

更新用于推送安装移动服务的帐户Update account used for push installation of Mobility service

在部署 Site Recovery 时,为了启用移动服务的推送安装,你已指定一个帐户,供 Site Recovery 进程服务器在为计算机启用了复制时,用来访问计算机和安装服务。When you deployed Site Recovery, to enable push installation of the Mobility service, you specified an account that the Site Recovery process server uses to access the machines and install the service when replication is enabled for the machine. 若要更新此帐户的凭据,请遵照这些说明操作。If you want to update the credentials for this account, follow these instructions.

卸载移动服务Uninstall Mobility service

在 Windows 计算机上On a Windows machine

从 UI 或命令提示符卸载。Uninstall from the UI or from a command prompt.

  • 通过 UI :在计算机的控制面板中,选择“程序”。 From the UI : In the Control Panel of the machine, select Programs . 选择“Azure Site Recovery 移动服务/主目标服务器” > “卸载”。 Select Azure Site Recovery Mobility Service/Master Target server > Uninstall .
  • 通过命令提示符 :在计算机上以管理员身份打开命令提示符窗口。From a command prompt : Open a command prompt window as an administrator on the machine. 运行以下命令:Run the following command:
    MsiExec.exe /qn /x {275197FC-14FD-4560-A5EB-38217F80CBD1} /L+*V "C:\ProgramData\ASRSetupLogs\UnifiedAgentMSIUninstall.log"
    

在 Linux 计算机上On a Linux machine

  1. 在 Linux 计算机上以 root 用户身份登录。On the Linux machine, sign in as a root user.
  2. 在终端中转到 /usr/local/ASR。In a terminal, go to /usr/local/ASR.
  3. 运行以下命令:Run the following command:
    uninstall.sh -Y
    

在源计算机上安装 Site Recovery VSS 提供程序Install Site Recovery VSS provider on source machine

源计算机上必须存在 Azure Site Recovery VSS 提供程序,否则无法生成应用程序一致性点。Azure Site Recovery VSS provider is required on the source machine to generate application consistency points. 如果通过推送安装来安装提供程序没有成功,请按下面的给定指南手动安装它。If the installation of the provider didn't succeed through push installation, follow the below given guidelines to install it manually.

  1. 打开管理员 cmd 窗口。Open admin cmd window.
  2. 导航到移动服务安装位置。Navigate to the mobility service installation location. (例如 C:\Program Files (x86)\Microsoft Azure Site Recovery\agent)(Eg - C:\Program Files (x86)\Microsoft Azure Site Recovery\agent)
  3. 运行 InMageVSSProvider_Uninstall.cmd 脚本。Run the script InMageVSSProvider_Uninstall.cmd . 这样会卸载该服务(如果已存在)。This will uninstall the service if it already exists.
  4. 运行 InMageVSSProvider_Install.cmd 脚本,手动安装 VSS 提供程序。Run the script InMageVSSProvider_Install.cmd to install the VSS provider manually.

后续步骤Next steps