使用 Azure 备份 MARS 代理备份 Windows 计算机Back up Windows machines by using the Azure Backup MARS agent

本文介绍如何使用 Azure 备份服务和 Microsoft Azure 恢复服务 (MARS) 代理备份 Windows 计算机。This article explains how to back up Windows machines by using the Azure Backup service and the Microsoft Azure Recovery Services (MARS) agent. MARS 也称为 Azure 备份代理。MARS is also known as the Azure Backup agent.

在本文中,学习如何:In this article, you learn how to:

  • 验证先决条件,并创建恢复服务保管库。Verify the prerequisites and create a Recovery Services vault.
  • 下载并设置 MARS 代理。Download and set up the MARS agent.
  • 创建备份策略和计划。Create a backup policy and schedule.
  • 执行按需备份。Perform an on-demand backup.

关于 MARS 代理About the MARS agent

Azure 备份使用 MARS 代理备份本地计算机和 Azure VM 中的文件、文件夹和系统状态。Azure Backup uses the MARS agent to back up files, folders, and system state from on-premises machines and Azure VMs. 这些备份存储在 Azure 中的恢复服务保管库中。Those backups are stored in a Recovery Services vault in Azure. 可在以下位置运行代理:You can run the agent:

  • 直接在本地 Windows 计算机上。Directly on on-premises Windows machines. 这些计算机可直接备份到 Azure 中的备份恢复服务保管库。These machines can back up directly to a Recovery Services vault in Azure.
  • 在运行 Windows(与 Azure VM 备份扩展一起运行)的 Azure VM 上。On Azure VMs that run Windows side by side with the Azure VM backup extension. 代理将备份 VM 上的特定文件和文件夹。The agent backs up specific files and folders on the VM.
  • 在 Microsoft Azure 备份服务器 (MABS) 实例或 System Center Data Protection Manager (DPM) 服务器上。On a Microsoft Azure Backup Server (MABS) instance or a System Center Data Protection Manager (DPM) server. 在此方案中,计算机和工作负荷将备份到 MABS 或 Data Protection Manager。In this scenario, machines and workloads back up to MABS or Data Protection Manager. 然后 MABS 或 Data Protection Manager 将通过 MARS 代理备份到 Azure 中的保管库。Then MABS or Data Protection Manager uses the MARS agent to back up to a vault in Azure.

可备份的数据取决于代理的安装位置。The data that's available for backup depends on where the agent is installed.

备注

通常我们会使用 VM 上的 Azure 备份扩展来备份 Azure VM。Generally, you back up an Azure VM by using an Azure Backup extension on the VM. 此方法将备份整个 VM。This method backs up the entire VM. 若要备份 VM 上的特定文件和文件夹,请安装 MARS 代理并将其与该扩展一起使用。If you want to back up specific files and folders on the VM, install and use the MARS agent alongside the extension. 有关详细信息,请参阅内置 Azure VM 备份的体系结构For more information, see Architecture of a built-in Azure VM backup.

备份过程的步骤

开始之前Before you start

验证 Internet 访问Verify internet access

如果计算机的 Internet 访问状态受限,请确保计算机或代理上的防火墙设置允许以下 URL 和 IP 地址:If your machine has limited internet access, ensure that firewall settings on the machine or proxy allow these URLs and IP address:

URLURLs

  • www.msftncsi.comwww.msftncsi.com
  • *.Microsoft.com*.Microsoft.com
  • *.WindowsAzure.cn*.WindowsAzure.cn
  • *.microsoftonline.com*.microsoftonline.com
  • *.chinacloudapi.cn*.chinacloudapi.cn
  • IP 地址IP addresses

  • 20.190.128.0/1820.190.128.0/18

  • 40.126.0.0/1840.126.0.0/18

对上面列出的所有 URL 和 IP 地址的访问都使用端口 443 上的 HTTPS 协议。Access to all of the URLs and IP addresses listed above uses the HTTPS protocol on port 443.

创建恢复服务保管库Create a Recovery Services vault

恢复服务保管库存储你在不同时间创建的所有备份和恢复点。A Recovery Services vault stores all the backups and recovery points that you create over time. 它还包含针对已备份的计算机的备份策略。It also contains the backup policy for the backed-up machines.

若要创建保管库:To create a vault:

  1. 使用 Azure 订阅登录到 Azure 门户Sign in to the Azure portal by using your Azure subscription.

  2. 搜索并选择“恢复服务保管库” 。Search for and select Recovery Services vaults.

    选择恢复服务保管库

  3. 在“恢复服务保管库”菜单中,选择“添加”。 On the Recovery Services vaults menu, select Add.

    添加恢复服务保管库

  4. 对于“名称”,请输入一个友好名称以标识保管库 。For Name, enter a friendly name to identify the vault.

    • 名称对于 Azure 订阅需要是唯一的。The name needs to be unique for the Azure subscription.
    • 该名称可以包含 2 到 50 个字符。It can contain 2 to 50 characters.
    • 必须以字母开头。It must start with a letter.
    • 该名称只能包含字母、数字和连字符。It can contain only letters, numbers, and hyphens.
  5. 选择要在其中创建保管库的 Azure 订阅、资源组和地理区域。Select the Azure subscription, resource group, and geographic region in which the vault should be created. 备份数据将发送到保管库。Backup data is sent to the vault. 选择“创建” 。Select Create.

    添加恢复服务保管库的标识信息

    系统可能需要花费一段时间来创建保管库。The system might take a while to create the vault. 可以在门户的右上区域中监视状态通知。Monitor the status notifications in the upper-right area of the portal. 如果在几分钟后未看到该保管库,请选择“刷新”。 If you don't see the vault after several minutes, select Refresh.

    选择“刷新”按钮

设置存储冗余Set storage redundancy

Azure 备份会自动处理保管库的存储。Azure Backup automatically handles storage for the vault. 指定如何复制该存储。You specify how to replicate that storage.

  1. 在“恢复服务保管库”下,选择新保管库。 Under Recovery Services vaults, select the new vault. 在“设置”下,选择“属性”。 Under Settings, select Properties.

  2. 在“属性”中的“备份配置”下,选择“更新”。 In Properties, under Backup Configuration, select Update.

  3. 选择存储复制类型,然后选择“保存”。 Select the storage replication type, and select Save.

    设置新保管库的存储配置

如果使用 Azure 作为主要备份存储终结点,则我们建议继续使用默认的“异地冗余”设置。 We recommend that if you use Azure as a primary backup storage endpoint, continue to use the default Geo-redundant setting. 如果不使用 Azure 作为主要的备份存储终结点,请选择“本地冗余”,以减少 Azure 存储费用。 If you don't use Azure as a primary backup storage endpoint, select Locally redundant to reduce the Azure storage costs.

有关详细信息,请参阅异地冗余本地冗余For more information, see Geo-redundancy and Local redundancy.

下载 MARS 代理Download the MARS agent

下载 MARS 代理,以便可将其安装到所要备份的计算机上。Download the MARS agent so that you can install it on the machines that you want to back up.

如果已在任何计算机上安装该代理,请确保运行该代理的最新版本。If you've already installed the agent on any machines, make sure that you're running the latest version of the agent. 在门户中找到最新版本,或直接转到下载Find the latest version in the portal, or go directly to the download.

  1. 在保管库中的“开始使用”下,选择“备份”。 In the vault, under Getting Started, select Backup.

    打开备份代理

  2. 在“工作负荷的运行位置?”下,选择“本地”。 Under Where is your workload running?, select On-premises. 即使你要在 Azure VM 上安装 MARS 代理,也应选择此选项。Select this option even if you want to install the MARS agent on an Azure VM.

  3. 在“要备份哪些内容?”下,选择“文件和文件夹”。 Under What do you want to back up?, select Files and folders. 还可以选择“系统状态”。 You can also select System State. 还有其他一些可用选项,但仅当运行的是辅助备份服务器时,这些选项才受支持。Many other options are available, but these options are supported only if you're running a secondary backup server. 选择“准备基础结构”。 Select Prepare Infrastructure.

    配置文件和文件夹

  4. 对于“准备基础结构”,请在“安装恢复服务代理”下,下载 MARS 代理。 For Prepare infrastructure, under Install Recovery Services agent, download the MARS agent.

    准备基础结构

  5. 在下载菜单中选择“保存”。 In the download menu, select Save. 默认情况下,MARSagentinstaller.exe 文件将保存到 Downloads 文件夹。By default, the MARSagentinstaller.exe file is saved to your Downloads folder.

  6. 选择“已下载或使用最新的恢复服务代理”,然后下载保管库凭据。 Select Already download or using the latest Recovery Services Agent, and then download the vault credentials.

    下载保管库凭据

  7. 选择“保存” 。Select Save. 文件将下载到“下载”文件夹。The file is downloaded to your Downloads folder. 无法打开保管库凭据文件。You can't open the vault credentials file.

安装并注册代理Install and register the agent

  1. 在要备份的计算机上运行 MARSagentinstaller.exe 文件。Run the MARSagentinstaller.exe file on the machines that you want to back up.

  2. 在 MARS 代理安装向导中选择“安装设置”。 In the MARS Agent Setup Wizard, select Installation Settings. 在此处选择代理的安装位置以及缓存位置。There, choose where to install the agent, and choose a location for the cache. 然后,选择“下一步” 。Then select Next.

    • Azure 备份在将数据快照发送到 Azure 之前,会使用缓存来存储这些快照。Azure Backup uses the cache to store data snapshots before sending them to Azure.
    • 缓存位置的可用空间应该至少为所要备份的数据大小的 5%。The cache location should have free space equal to at least 5 percent of the size of the data you'll back up.

    在 MARS 代理安装向导中选择安装设置

  3. 对于“代理配置”中,请指定 Windows 计算机上运行的代理如何连接到 Internet。 For Proxy Configuration, specify how the agent that runs on the Windows machine will connect to the internet. 然后,选择“下一步” 。Then select Next.

    • 如果使用自定义代理,请指定任何所需的代理设置和凭据。If you use a custom proxy, specify any necessary proxy settings and credentials.
    • 请记住,代理需要有权访问特定的 URLRemember that the agent needs access to specific URLs.

    在 MARS 向导中设置 Internet 访问

  4. 对于“安装”,请复查先决条件,然后选择“安装”。 For Installation, review the prerequisites, and select Install.

  5. 安装代理后,选择“继续注册”。 After the agent is installed, select Proceed to Registration.

  6. 在“注册服务器向导” > “保管库标识”中,浏览并选择已下载的凭据文件。 In Register Server Wizard > Vault Identification, browse to and select the credentials file that you downloaded. 然后,选择“下一步” 。Then select Next.

    使用注册服务器向导添加保管库凭据

  7. 在“加密设置”页上,指定用于加密和解密计算机备份的通行短语。 On the Encryption Setting page, specify a passphrase that will be used to encrypt and decrypt backups for the machine.

    • 将通行短语保存在安全位置。Save the passphrase in a secure location. 还原备份时需要用到它。You need it to restore a backup.
    • 如果你丢失或忘记了该通行短语,Microsoft 将无法帮助你恢复备份数据。If you lose or forget the passphrase, Microsoft can't help you recover the backup data.
  8. 选择“完成”。 Select Finish. 现已安装代理,且已向保管库注册计算机。The agent is now installed, and your machine is registered to the vault. 接下来可以配置和计划备份。You're ready to configure and schedule your backup.

创建备份策略Create a backup policy

备份策略指定何时创建数据快照来创建恢复点。The backup policy specifies when to take snapshots of the data to create recovery points. 它还指定恢复点的保留期限。It also specifies how long to keep recovery points. 使用 MARS 代理配置备份策略。You use the MARS agent to configure a backup policy.

Azure 备份不会自动考虑夏令时 (DST)。Azure Backup doesn't automatically take daylight saving time (DST) into account. 此默认设置可能会导致实际时间与计划的备份时间存在一定的偏差。This default could cause some discrepancy between the actual time and the scheduled backup time.

创建备份策略:To create a backup policy:

  1. 下载并注册 MARS 代理后,打开代理控制台。After you download and register the MARS agent, open the agent console. 可以通过在计算机中搜索 Microsoft Azure 备份找到该代理。You can find it by searching your machine for Microsoft Azure Backup.

  2. 在“操作”下,选择“计划备份”。 Under Actions, select Schedule Backup.

    计划 Windows Server 备份

  3. 在计划备份向导中,选择“开始” > “下一步”。 In the Schedule Backup Wizard, select Getting started > Next.

  4. 在“选择要备份的项”下,选择“添加项”。 Under Select Items to Back up, select Add Items.

    添加要备份的项

  5. 在“选择项”框中,选择要备份的项,然后选择“确定”。 In the Select Items box, select items to back up, and then select OK.

    选择要备份的项

  6. 在“选择要备份的项”页上,选择“下一步”。 On the Select Items to Back Up page, select Next.

  7. 在“指定备份计划”页上,指定何时创建每日或每周备份。 On the Specify Backup Schedule page, specify when to take daily or weekly backups. 然后,选择“下一步” 。Then select Next.

    • 创建备份时会创建一个恢复点。A recovery point is created when a backup is taken.

    • 在环境中创建的恢复点数目取决于备份计划。The number of recovery points created in your environment depends on your backup schedule.

    • 可以计划每日备份,每天最多备份三次。You can schedule up to three daily backups per day. 在以下示例中,每日会执行两次备份,一次发生在午夜,另一次发生在下午 6:00。In the following example, two daily backups occur, one at midnight and one at 6:00 PM.

      设置每日备份计划

    • 也可以运行每周备份。You can run weekly backups too. 在以下示例中,将每隔两周在星期日和星期三上午 9:30 和凌晨 1:00 创建备份。In the following example, backups are taken every alternate Sunday and Wednesday at 9:30 AM and 1:00 AM.

      设置每周备份计划

  8. 在“选择保留策略”页上,指定如何存储数据的历史副本。 On the Select Retention Policy page, specify how to store historical copies of your data. 然后,选择“下一步” 。Then select Next.

    • 保留设置指定要存储哪些恢复点,以及要存储多长时间。Retention settings specify which recovery points to store and how long to store them.

    • 对于每日保留设置,可以指明在针对每日保留指定的时间,要将最新恢复点保留指定的天数。For a daily retention setting, you indicate that at the time specified for the daily retention, the latest recovery point will be retained for the specified number of days. 或者,可以指定每月保留策略,指明在每个月的 30 日创建的恢复点应保留 12 个月。Or you could specify a monthly retention policy to indicate that the recovery point created on the 30th of every month should be stored for 12 months.

    • 每日和每周恢复点的保留期通常与备份计划相一致。Retention for daily and weekly recovery points usually coincides with the backup schedule. 因此,当计划触发备份时,备份创建的恢复点的存储持续时间与每日或每周保留策略指定的持续时间相一致。So when the schedule triggers a backup, the recovery point that the backup creates is stored for the duration that the daily or weekly retention policy specifies.

    • 在以下示例中:In the following example:

      • 在午夜和下午 6:00 创建的每日备份将保留 7 天。Daily backups at midnight and 6:00 PM are kept for seven days.
      • 在星期六的午夜和下午 6:00 创建的备份将保留 4 周。Backups taken on a Saturday at midnight and 6:00 PM are kept for four weeks.
      • 在当月最后一个星期六的午夜和下午 6:00 创建的备份将保留 12 个月。Backups taken on the last Saturday of the month at midnight and 6:00 PM are kept for 12 months.
      • 在三月份最后一个星期六创建的备份将保留 10 年。Backups taken on the last Saturday in March are kept for 10 years.

      保留策略的示例

  9. 在“选择初始备份类型”页上,确定如何通过网络或使用脱机备份创建初始备份。 On the Choose Initial Backup Type page, decide if you want to take the initial backup over the network or use offline backup. 若要通过网络创建初始备份,请选择“自动通过网络” > “下一步”。 To take the initial backup over the network, select Automatically over the network > Next.

    选择初始备份类型

  10. 在“确认”页上复查信息,然后选择“完成”。 On the Confirmation page, review the information, and then select Finish.

    确认备份类型

  11. 在向导完成创建备份计划后,选择“关闭”。 After the wizard finishes creating the backup schedule, select Close.

    查看备份计划的进度

在安装了代理的每台计算机上创建一个策略。Create a policy on each machine where the agent is installed.

执行脱机初始备份Do the initial backup offline

可以通过网络自动运行初始备份,也可以使用脱机备份。You can run an initial backup automatically over the network, or you can back up offline. 如果需要消耗大量的网络带宽来传输大量的数据,则初始备份的脱机种子设定非常有用。Offline seeding for an initial backup is useful if you have large amounts of data that will require a lot of network bandwidth to transfer.

若要执行脱机传输:To do an offline transfer:

  1. 将备份数据写入暂存位置。Write the backup data to a staging location.

  2. 使用 AzureOfflineBackupDiskPrep 工具将暂存位置中的数据复制到一个或多个 SATA 磁盘。Use the AzureOfflineBackupDiskPrep tool to copy the data from the staging location to one or more SATA disks.

    该工具会创建 Azure 导入作业。The tool creates an Azure Import job. 有关详细信息,请参阅什么是 Azure 导入/导出服务For more information, see What is the Azure Import/Export service.

  3. 将 SATA 磁盘寄送到 Azure 数据中心。Send the SATA disks to an Azure datacenter.

    在数据中心,磁盘数据将复制到 Azure 存储帐户。At the datacenter, the disk data is copied to an Azure storage account. Azure 备份将数据从存储帐户复制到保管库,并计划增量备份。Azure Backup copies the data from the storage account to the vault, and incremental backups are scheduled.

启用网络限制Enable network throttling

可以通过启用网络限制,来控制 MARS 代理使用网络带宽的方式。You can control how the MARS agent uses network bandwidth by enabling network throttling. 如果你需要在工作时间备份数据,但想要控制备份和还原活动占用的带宽量,则限制会很有帮助。Throttling is helpful if you need to back up data during work hours but you want to control how much bandwidth the backup and restore activity uses.

Azure 备份中的网络限制在本地操作系统上使用服务质量 (QoS)Network throttling in Azure Backup uses Quality of Service (QoS) on the local operating system.

针对备份的网络限制适用于 Windows Server 2012 和更高版本,以及 Windows 8 和更高版本。Network throttling for backups is available on Windows Server 2012 and later, and on Windows 8 and later. 操作系统应该运行最新的服务包。Operating systems should be running the latest service packs.

若要启用网络限制:To enable network throttling:

  1. 在 MARS 代理中,选择“更改属性”。 In the MARS agent, select Change Properties.

  2. 在“限制” 选项卡上,选择“为备份操作启用 Internet 带宽使用限制” 。On the Throttling tab, select Enable internet bandwidth usage throttling for backup operations.

    针对备份操作设置网络限制

  3. 指定在工作时间和下班时间允许的带宽。Specify the allowed bandwidth during work hours and nonwork hours. 带宽值最小为 512 Kbps,最大为 1,023 MBps。Bandwidth values begin at 512 Kbps and go up to 1,023 MBps. 然后选择“确定”。 Then select OK.

运行按需备份Run an on-demand backup

  1. 在 MARS 代理中,选择“立即备份”。 In the MARS agent, select Back Up Now.

    在 Windows Server 中立即备份

  2. 如果 MARS 代理版本为 2.0.9169.0 或更高,则你可以设置自定义保留日期。If the MARS agent version is 2.0.9169.0 or newer, then you can set a custom retention date. 在“备份保留截止日期”部分,从日历中选择一个日期。 In the Retain Backup Till section, choose a date from the calendar.

    使用日历自定义保留日期

  3. 在“确认”页上复查设置,然后选择“备份”。 On the Confirmation page, review the settings, and select Back Up.

  4. 选择“关闭”以关闭向导。 Select Close to close the wizard. 如果在备份完成之前关闭向导,向导将继续在后台运行。If you close the wizard before the backup finishes, the wizard continues to run in the background.

完成初始备份后,备份控制台中显示“作业已完成”状态。 After the initial backup finishes, the Job completed status appears in the Backup console.

设置按需备份策略保留行为Set up on-demand backup policy retention behavior

备注

此信息仅适用于低于 2.0.9169.0 的 MARS 代理版本。This information applies only to MARS agent versions that are older than 2.0.9169.0.

备份计划选项Backup-schedule option 数据保留持续时间Duration of data retention
日期Day 默认保留期:相当于“每日备份的保留期(以天为单位)”。Default retention: Equivalent to the "retention in days for daily backups."

例外:如果为长期保留(周、月、年)设置的每日计划备份失败,则会考虑将失败后立即触发的按需备份进行长期保留。Exception: If a daily scheduled backup that's set for long-term retention (weeks, months, or years) fails, an on-demand backup that's triggered right after the failure is considered for long-term retention. 否则,将考虑进行下一次计划备份以进行长期保留。Otherwise, the next scheduled backup is considered for long-term retention.

示例方案:在星期四上午 8:00 进行的计划备份失败。Example scenario: The scheduled backup on Thursday at 8:00 AM failed. 考虑每周、每月或每年保留此备份。This backup was to be considered for weekly, monthly, or yearly retention. 因此,在下一次于星期五上午 8:00 执行计划备份之前触发的第一个按需备份将自动标记为每周、每月或每年保留。So the first on-demand backup triggered before the next scheduled backup on Friday at 8:00 AM is automatically tagged for weekly, monthly, or yearly retention. 此备份会替代星期四上午 8:00 的备份。This backup substitutes for the Thursday 8:00 AM backup.
WeekWeek 默认保留期:一天。Default retention: One day. 为使用每周备份策略的数据源创建的按需备份将在第二天删除。On-demand backups that are taken for a data source that has a weekly backup policy are deleted the next day. 即使它们是该数据源的最新备份,也仍会将其删除。They're deleted even if they're the most recent backups for the data source.

例外:如果为长期保留(周、月、年)设置的每周计划备份失败,则会考虑将失败后立即触发的按需备份进行长期保留。Exception: If a weekly scheduled backup that's set for long-term retention (weeks, months, or years) fails, an on-demand backup that's triggered right after the failure is considered for long-term retention. 否则,将考虑进行下一次计划备份以进行长期保留。Otherwise, the next scheduled backup is considered for long-term retention.

示例方案:在星期四上午 8:00 进行的计划备份失败。Example scenario: The scheduled backup on Thursday at 8:00 AM failed. 考虑每月或每年保留此备份。This backup was to be considered for monthly or yearly retention. 因此,在下一次于星期四上午 8:00 执行计划备份之前触发的第一个按需备份将自动标记为每月或每年保留。So the first on-demand backup that's triggered before the next scheduled backup on Thursday at 8:00 AM is automatically tagged for monthly or yearly retention. 此备份会替代星期四上午 8:00 的备份。This backup substitutes for the Thursday 8:00 AM backup.

有关详细信息,请参阅创建备份策略For more information, see Create a backup policy.

后续步骤Next steps

了解如何在 Azure 中还原文件Learn how to Restore files in Azure.