您现在访问的是微软AZURE全球版技术文档网站,若需要访问由世纪互联运营的MICROSOFT AZURE中国区技术文档网站,请访问 https://docs.azure.cn.

使用 Azure Vm 和 SQL Server 来 Rehost 本地应用程序 Always On 可用性组Rehost an on-premises application with Azure VMs and SQL Server Always On availability groups

本文演示了在迁移到 Azure 的过程中,虚构的公司 Contoso 如何原名不同在 VMware 虚拟机上运行的两层 Windows .NET 应用程序 (Vm) 。This article demonstrates how the fictional company Contoso rehosts a two-tier Windows .NET application running on VMware virtual machines (VMs) as part of a migration to Azure. Contoso 使用 SQL Server Always On 可用性组在 Windows Server 故障转移群集中运行 SQL Server,将应用程序前端 VM 迁移到 Azure VM,并将应用程序数据库迁移到其他 Azure VM。Contoso migrates the application front-end VM to an Azure VM, and the application database to another Azure VM with SQL Server, running in a Windows Server failover cluster with SQL Server Always On availability groups.

本示例中使用的 SmartHotel360 应用程序作为开源软件提供。The SmartHotel360 application used in this example is provided as open-source software. 如果要将其用于自己的测试目的,请从 GitHub下载。If you want to use it for your own testing purposes, download it from GitHub.

业务驱动因素Business drivers

IT 领先团队与业务合作伙伴密切合作,以了解他们希望在此迁移中实现的目标。The IT leadership team has worked closely with business partners to understand what they want to achieve with this migration. 它们需要:They want to:

  • 解决业务增长。Address business growth. Contoso 正在不断增长,因此,对本地系统和基础结构有压力。Contoso is growing, and as a result there's pressure on on-premises systems and infrastructure.
  • 提高效率。Increase efficiency. Contoso 需要删除不必要的过程,并简化开发人员和用户的过程。Contoso needs to remove unnecessary procedures and streamline processes for developers and users. 业务需要快速而不是浪费时间或金钱,以更快地提供客户需求。The business needs IT to be fast and not waste time or money to deliver faster on customer requirements.
  • 提高灵活性。Increase agility. Contoso IT 需要对业务需求更加敏感。Contoso IT needs to be more responsive to the needs of the business. 它必须比 marketplace 中的更改更快地在全球经济中实现成功。It must react faster than the changes in the marketplace to enable success in a global economy. 它不得或成为业务阻止手段。IT mustn't get in the way or become a business blocker.
  • 纵向.Scale. 当业务成功发展时,Contoso IT 必须提供以相同步调增长的系统。As the business grows successfully, Contoso IT must provide systems that grow at the same pace.

迁移目标Migration goals

Contoso 云团队制定了本次迁移的目标。The Contoso cloud team has pinned down goals for this migration. 这些目标用于确定最佳迁移方式:These goals were used to determine the best migration method:

  • 迁移后,Azure 中的应用程序应具有与今天在 VMware 中的相同性能功能。After migration, the application in Azure should have the same performance capabilities as it does today in VMware. 当应用程序在本地时,应用程序将在云中保持重要。The application will remain as critical in the cloud as it is on-premises.
  • Contoso 不希望投资此应用程序。Contoso doesn't want to invest in this application. 这对于企业而言很重要,但在其当前形式中,Contoso 只需将它安全地移动到云。It's important to the business, but in its current form, Contoso simply wants to move it safely to the cloud.
  • 应用程序的本地数据库存在可用性问题。The on-premises database for the application has had availability issues. Contoso 希望在 Azure 中将其部署为具有故障转移功能的高可用性群集。Contoso want to deploy it in Azure as a high-availability cluster with failover capabilities.
  • Contoso 想要从其当前 SQL Server 2008 R2 平台升级到 SQL Server 2017。Contoso wants to upgrade from its current SQL Server 2008 R2 platform to SQL Server 2017.
  • Contoso 不希望对此应用程序使用 Azure SQL 数据库,而是寻找替代方法。Contoso doesn't want to use Azure SQL Database for this application and is looking for alternatives.

解决方案设计Solution design

在固定公司的目标和需求后,Contoso 设计和审查部署解决方案并识别迁移过程。After pinning down the company's goals and requirements, Contoso designs and reviews a deployment solution and identifies the migration process. 还将标识它将用于迁移的 Azure 服务。The Azure services that it will use for the migration also are identified.

当前体系结构Current architecture

  • 应用程序跨两个 Vm 进行分层 (WEBVMSQLVM) 。The application is tiered across two VMs (WEBVM and SQLVM).
  • 这两个 VM 位于 VMware ESXi 主机 contosohost1.contoso.com(版本 6.5)上。The VMs are located on VMware ESXi host contosohost1.contoso.com (version 6.5).
  • VMware 环境由 vcenter.contoso.com 在虚拟机上运行的 vCenter Server 6.5 () 进行管理。The VMware environment is managed by vCenter Server 6.5 (vcenter.contoso.com) that runs on a VM.
  • Contoso 有一个本地数据中心 (contoso-datacenter) 与本地域控制器 (contosodc1) 。Contoso has an on-premises datacenter (contoso-datacenter) with an on-premises domain controller (contosodc1).

建议的体系结构Proposed architecture

在本方案中:In this scenario:

  • Contoso 会将应用程序前端迁移 WEBVM 到 Azure 基础结构即服务 (IaaS) VM。Contoso will migrate the application front end WEBVM to an Azure infrastructure as a service (IaaS) VM.

    • Azure 中的前端 VM 将部署到 ContosoRG (用于生产资源) 的资源组中。The front-end VM in Azure will be deployed in the ContosoRG resource group (used for production resources).
    • 它将位于 Azure 生产网络中 (VNET-PROD-EUS2) () 的主要区域中 East US 2It will be located in the Azure production network (VNET-PROD-EUS2) in the primary region (East US 2).
  • 应用程序数据库将迁移到运行 SQL Server 的 Azure VM。The application database will be migrated to an Azure VM running SQL Server.

    • 它将位于 Contoso 的 Azure 数据库网络 (PROD-DB-EUS2) 在主区域 (East US 2) 中。It will be located in Contoso's Azure database network (PROD-DB-EUS2) in the primary region (East US 2).
    • 它将放在 Windows Server 故障转移群集中,其中两个节点使用 SQL Server Always On 可用性组。It will be placed in a Windows Server failover cluster with two nodes that uses SQL Server Always On availability groups.
    • 在 Azure 中,群集中的两个 SQL Server VM 节点将部署在 ContosoRG 资源组中。In Azure, the two SQL Server VM nodes in the cluster will be deployed in the ContosoRG resource group.
    • VM 节点将位于 Azure 生产网络中 (VNET-PROD-EUS2) () 的主要区域中 East US 2The VM nodes will be located in the Azure production network (VNET-PROD-EUS2) in the primary region (East US 2).
    • Vm 将运行 Windows Server 2016 SQL Server 2017 企业版。VMs will run Windows Server 2016 with SQL Server 2017 Enterprise edition. Contoso 没有此操作系统的许可证。Contoso doesn't have licenses for this operating system. 它将使用 Azure Marketplace 中的映像,该映像向公司的 Azure 企业协议承诺提供许可证。It will use an image in Azure Marketplace that provides the license as a charge to the company's Azure Enterprise Agreement commitment.
    • 除了唯一名称,两个 VM 使用的设置相同。Apart from unique names, both VMs use the same settings.
  • Contoso 将部署内部负载均衡器来侦听群集上的流量,并将其定向到适当的群集节点。Contoso will deploy an internal load balancer that listens for traffic on the cluster and directs it to the appropriate cluster node.

    • 内部负载均衡器将部署在 ContosoNetworkingRG (用于) 的网络资源。The internal load balancer will be deployed in ContosoNetworkingRG (used for networking resources).
  • 迁移完成后,Contoso 数据中心的本地 VM 将停止使用。The on-premises VMs in the Contoso datacenter will be decommissioned after the migration is done.

    显示方案体系结构图表的屏幕截图。

数据库注意事项Database considerations

在解决方案设计过程中,Contoso 对 Azure SQL 数据库和 SQL Server 做了功能比较。As part of the solution design process, Contoso did a feature comparison between Azure SQL Database and SQL Server. 以下注意事项有助于公司决定使用运行 SQL Server 的 Azure IaaS VM:The following considerations helped the company to decide to use an Azure IaaS VM running SQL Server:

  • 如果 Contoso 需要自定义操作系统或数据库服务器,或者可能想要在同一 VM 上归置和运行第三方应用程序,使用运行 SQL Server 的 Azure VM 似乎是最佳解决方案。Using an Azure VM running SQL Server seems to be an optimal solution if Contoso needs to customize the operating system or the database server, or if it might want to colocate and run third-party applications on the same VM.

解决方案评审Solution review

Contoso 通过组合一系列的优点和缺点来评估其建议的设计。Contoso evaluates its proposed design by putting together a list of pros and cons.

注意事项Consideration 详细信息Details
优点Pros WEBVM 将移动到 Azure,而不会发生更改,从而简化了迁移。WEBVM will be moved to Azure without changes, which makes the migration simple.

SQL Server 层将在 SQL Server 2017 和 Windows Server 2016 上运行,这会停用当前 Windows Server 2008 R2 操作系统。The SQL Server tier will run on SQL Server 2017 and Windows Server 2016, which retires the current Windows Server 2008 R2 operating system. 运行 SQL Server 2017 支持 Contoso 的技术要求和目标。Running SQL Server 2017 supports Contoso's technical requirements and goals. 在远离 SQL Server 2008 R2 时,它提供100% 的兼容性。IT provides 100 percent compatibility while moving away from SQL Server 2008 R2.

Contoso 可以通过使用 Azure 混合权益,充分利用其对软件保障的投资。Contoso can take advantage of its investment in Software Assurance by using the Azure Hybrid Benefit.

Azure 中的高可用性 SQL Server 部署提供容错功能,使应用程序数据层不再是单点故障转移。A high-availability SQL Server deployment in Azure provides fault tolerance so that the application data tier is no longer a single point of failover.
缺点Cons WEBVM 正在运行 Windows Server 2008 R2。WEBVM is running Windows Server 2008 R2. Azure 支持特定角色的操作系统(2018 年 7 月)。The operating system is supported by Azure for specific roles (July 2018). 若要了解详细信息,请参阅 Azure 虚拟机的 Microsoft 服务器软件支持To learn more, see Microsoft server software support for Azure Virtual Machines.

应用程序的 web 层仍是单点故障转移。The web tier of the application remains a single point of failover.

Contoso 需要继续支持作为 Azure VM 的 web 层,而不是迁移到托管服务,例如 Azure App Service。Contoso needs to continue supporting the web tier as an Azure VM rather than moving to a managed service such as Azure App Service.

使用所选解决方案,Contoso 将需要继续管理两个 SQL Server Vm,而不是迁移到托管平台,如 Azure SQL 托管实例。With the chosen solution, Contoso will need to continue managing two SQL Server VMs rather than moving to a managed platform, such as Azure SQL Managed Instance. 此外,对于软件保障,Contoso 可以在 Azure SQL 托管实例上交换其现有许可证的折扣率。In addition, with Software Assurance, Contoso could exchange its existing licenses for discounted rates on Azure SQL Managed Instance.

Azure 服务Azure services

服务Service 说明Description 成本Cost
Azure 数据库迁移服务Azure Database Migration Service Azure 数据库迁移服务实现了从多个数据库源到 Azure 数据平台的无缝迁移,且停机时间最短。Azure Database Migration Service enables seamless migration from multiple database sources to Azure data platforms with minimal downtime. 了解 受支持的区域Azure 数据库迁移服务的定价Learn about supported regions and Azure Database Migration Service pricing.
Azure MigrateAzure Migrate Contoso 使用 Azure Migrate 对其 VMware Vm 进行评估。Contoso uses Azure Migrate to assess its VMware VMs. Azure Migrate 评估计算机是否适合迁移。Azure Migrate assesses the migration suitability of the machines. 它对在 Azure 中运行时的大小和成本进行估算。It provides sizing and cost estimates for running in Azure. 无需额外付费即可使用 Azure Migrate。Azure Migrate is available at no additional charge. 它们可能会产生费用,具体取决于 (第一方或独立软件供应商) 他们决定用于评估和迁移的工具。They might incur charges depending on the tools (first-party or independent software vendor) they decide to use for assessment and migration. 了解有关 Azure Migrate 定价的详细信息。Learn more about Azure Migrate pricing.

迁移过程Migration process

Contoso 管理员将应用程序 Vm 迁移到 Azure。The Contoso admins will migrate the application VMs to Azure.

  • 他们将使用 Azure Migrate 将前端 VM 迁移到 Azure VM:They'll migrate the front-end VM to Azure VM by using Azure Migrate:

    • 第一步是准备并设置 Azure 组件,并准备本地 VMware 基础结构。As a first step, they'll prepare and set up Azure components and prepare the on-premises VMware infrastructure.
    • 待一切准备就绪后,即可开始复制 VM。With everything prepared, they can start replicating the VM.
    • 在复制已启用并正常工作后,它们将使用 Azure Migrate 迁移 VM。After replication is enabled and working, they migrate the VM by using Azure Migrate.
  • 验证数据库后,他们会使用 Azure 数据库迁移服务将数据库迁移到 Azure 中的 SQL Server 群集。After they've verified the database, they'll migrate the database to a SQL Server cluster in Azure by using Azure Database Migration Service.

    • 第一步,需要在 Azure 中预配 SQL Server Vm、设置群集和内部负载均衡器,并配置 Always On 可用性组。As a first step, they'll need to provision SQL Server VMs in Azure, set up the cluster and an internal load balancer, and configure Always On availability groups.
    • 这样就可以迁移数据库。With this in place, they can migrate the database.
  • 迁移后,它们将为数据库启用 Always On 可用性组。After the migration, they'll enable Always On availability groups for the database.

    显示迁移过程关系图的屏幕截图。

先决条件Prerequisites

若要运行此方案,Contoso 需具备以下项。Here's what Contoso needs to do for this scenario.

要求Requirements 详细信息Details
Azure 订阅Azure subscription Contoso 已在此系列的前面文章中创建了一个订阅。Contoso already created a subscription in an earlier article in this series. 如果还没有 Azure 订阅,可以创建一个免费帐户If you don't have an Azure subscription, create a free account.

如果创建的是免费帐户,则你是自己的订阅的管理员,可以执行所有操作。If you create a free account, you're the administrator of your subscription and can perform all actions.

如果你使用现有的订阅,并且你不是管理员,请与管理员合作,为你分配所有者或参与者权限。If you use an existing subscription and you're not the administrator, work with the admin to assign you Owner or Contributor permissions.

Azure 基础结构Azure infrastructure Contoso 按照用于迁移的 Azure 基础结构中所述设置 Azure 基础结构。Contoso set up the Azure infrastructure as described in Azure infrastructure for migration.

详细了解 Azure Migrate:服务器迁移的特定 先决条件 要求。Learn more about specific prerequisites requirements for Azure Migrate: Server Migration.
本地服务器On-premises servers 本地 vCenter Server 应运行版本5.5、6.0、6.5 或6.7。The on-premises vCenter Server should be running version 5.5, 6.0, 6.5, or 6.7.

运行版本5.5、6.0、6.5 或6.7 的 ESXi 主机。An ESXi host running version 5.5, 6.0, 6.5, or 6.7.

ESXi 主机上运行的一个或多个 VMware VM。One or more VMware VMs running on the ESXi host.
本地 VMOn-premises VMs 查看已获允在 Azure 上运行的 Linux 计算机Review Linux machines that are endorsed to run on Azure.

方案步骤Scenario steps

Contoso 按如下方式运行迁移:Here's how Contoso will run the migration:

  • 步骤1:准备 Always On 可用性组群集的 SQL Server。Step 1: Prepare a SQL Server Always On availability group cluster. 创建一个群集,用于在 Azure 中部署两个 SQL Server VM 节点。Create a cluster for deploying two SQL Server VM nodes in Azure.
  • 步骤2:部署并设置群集。Step 2: Deploy and set up the cluster. 准备 Azure 中的 SQL Server 群集。Prepare a SQL Server cluster in Azure. 数据库将迁移到此现有群集。Databases are migrated into this existing cluster.
  • 步骤3:部署 Azure 负载均衡器。Step 3: Deploy Azure Load Balancer. 部署一个负载均衡器,用于均衡发往 SQL Server 节点的流量。Deploy a load balancer to balance traffic to the SQL Server nodes.
  • 步骤4:为 Azure Migrate 准备 Azure。Step 4: Prepare Azure for Azure Migrate. 创建 Azure 存储帐户来保存复制的数据。Create an Azure Storage account to hold replicated data.
  • 步骤5:准备 Azure Migrate 的本地 VMware。Step 5: Prepare on-premises VMware for Azure Migrate. 准备用于 VM 发现和代理安装的帐户。Prepare accounts for VM discovery and agent installation. 准备本地 VM,使用户在迁移后可连接到 Azure VM。Prepare on-premises VMs so that users can connect to Azure VMs after migration.
  • 步骤6:将本地 Vm 复制到 Azure。Step 6: Replicate the on-premises VMs to Azure. 启用向 Azure 复制 VM。Enable VM replication to Azure.
  • 步骤7:通过 Azure 数据库迁移服务迁移数据库。Step 7: Migrate the database via Azure Database Migration Service. 使用 Azure 数据库迁移服务将数据库迁移到 Azure。Migrate the database to Azure by using Azure Database Migration Service.
  • 步骤8:用 SQL Server Always On 保护数据库。Step 8: Protect the database with SQL Server Always On. 为群集创建 Always On 可用性组。Create an Always On availability group for the cluster.
  • 步骤9:将 VM 与 Azure Migrate 迁移。Step 9: Migrate the VM with Azure Migrate. 运行测试迁移,确保一切按预期正常进行。Run a test migration to make sure everything's working as expected. 然后,运行到 Azure 的迁移。Then run a migration to Azure.

步骤1:准备 SQL Server Always On 可用性组群集Step 1: Prepare a SQL Server Always On availability group cluster

若要设置群集,Contoso 管理员:To set up the cluster, the Contoso admins:

  1. 选择 Azure Marketplace 中 SQL Server 2017 企业 Windows Server 2016 映像,创建两个 SQL Server Vm。Create two SQL Server VMs by selecting SQL Server 2017 Enterprise Windows Server 2016 image in the Azure Marketplace.

    显示 SQL VM SKU 的屏幕截图。

  2. 在 "创建虚拟机" 向导 > 基础 上,它们配置:In Create Virtual Machine Wizard > Basics, they configure:

    • Vm 的名称: SQLAOG1SQLAOG2Names for the VMs: SQLAOG1 and SQLAOG2.
    • 由于计算机是业务关键的,因此请启用虚拟机磁盘类型的 SSD。Because machines are business-critical, enable SSD for the VM disk type.
    • 指定计算机凭据。Specify machine credentials.
    • 它们会将主要区域中的 Vm 部署 (East US 2 ContosoRG 资源组中) 。They deploy the VMs in the primary region (East US 2) in the ContosoRG resource group.
  3. 其中 ,它们D2S v3 两个 vm 的实例开始。In Size, they start with D2S v3 instances for both VMs. 它们将根据需要进行缩放。They'll scale later as needed.

  4. 在 " 设置" 中,它们执行以下操作:In Settings, they do the following actions:

    • 由于这些虚拟机是应用程序的关键数据库,因此它们使用托管磁盘。Because these VMs are critical databases for the application, they use managed disks.

    • 它们将计算机置于数据库子网中, (PROD-DB-EUS2) (VNET-PROD-EUS2) 在主要区域 () 中的生产网络 East US 2They place the machines in the database subnet (PROD-DB-EUS2) of the production network (VNET-PROD-EUS2) in the primary region (East US 2).

    • 它们 SQLAOGAVSET 使用两个容错域和五个更新域创建 () 的新可用性集。They create a new availability set (SQLAOGAVSET) with two fault domains and five update domains.

      显示新可用性集的屏幕截图。

  5. SQL Server 设置 中,它们限制了到默认端口1433上的虚拟网络 (专用) 的 SQL 连接。In SQL Server settings, they limit SQL connectivity to the virtual network (private) on default port 1433. 对于身份验证,它们使用与站点 () 相同的凭据 contosoadminFor authentication, they use the same credentials as used on-site (contosoadmin).

    显示 SQL Server 设置的屏幕截图。

需要更多帮助?Need more help?

步骤 2:部署并设置群集Step 2: Deploy and set up the cluster

若要设置群集,Contoso 管理员:To set up the cluster, the Contoso admins:

  1. 设置 Azure 存储帐户以用作云见证。Set up an Azure Storage account to act as the cloud witness.
  2. 将 SQL Server Vm 添加到 Contoso 本地数据中心内的 Active Directory 域。Add the SQL Server VMs to the Active Directory domain in the Contoso on-premises datacenter.
  3. 在 Azure 中创建群集。Create the cluster in Azure.
  4. 配置云见证。Configure the cloud witness.
  5. 启用 SQL Always On 可用性组。Enable SQL Always On availability groups.

将存储帐户设置为云见证Set up a storage account as a cloud witness

要设置云见证,Contoso 需要一个 Azure 存储帐户来保留用于群集仲裁的 Blob 文件。To set up a cloud witness, Contoso needs an Azure Storage account that will hold the blob file used for cluster arbitration. 可使用同一个存储帐户设置多个群集的云见证。The same storage account can be used to set up cloud witness for multiple clusters.

若要创建存储帐户,Contoso 管理员:To create a storage account, the Contoso admins:

  1. 为帐户指定可识别的名称 (contosocloudwitness) 。Specify a recognizable name for the account (contosocloudwitness).

  2. 使用 LRS 部署常规的全部用途帐户。Deploy a general all-purpose account, with LRS.

  3. 将帐户置于第三个区域 (South Central US) 。Place the account in a third region (South Central US). 它们将其放在主要区域和次要区域外,使其在区域性故障期间保持可用。They place it outside the primary and secondary region so that it remains available during regional failure.

  4. 将其放在保存基础结构资源的资源组中 ContosoInfraRGPlace it in the resource group that holds infrastructure resources, ContosoInfraRG.

    显示云见证帐户名称的屏幕截图。

  5. 在公司创建存储帐户时,为其生成主访问密钥和辅助访问密钥。When they create the storage account, primary and secondary access keys are generated for it. 创建云见证时需使用主访问密钥。They need the primary access key to create the cloud witness. 密钥显示在 "存储帐户名称" > 访问密钥"下。The key appears under the storage account name > Access keys.

    显示访问密钥的屏幕截图。

将 SQL Server VM 添加到 Contoso 域Add SQL Server VMs to Contoso domain

  1. Contoso 将 SQLAOG1 和添加 SQLAOG2contoso.com 域。Contoso adds SQLAOG1 and SQLAOG2 to the contoso.com domain.
  2. 在每个 VM 上,管理员安装 Windows 故障转移群集功能和工具。On each VM, the admins install the Windows Failover Cluster feature and tools.

设置群集Set up the cluster

在 Contoso 管理员设置群集之前,它们会在每台计算机上创建 OS 磁盘的快照。Before the Contoso admins set up the cluster, they take a snapshot of the OS disk on each machine.

显示 "创建快照" 窗格的屏幕截图。

  1. 它们运行脚本来创建 Windows 故障转移群集。They run a script to create the Windows failover cluster.

    显示用于创建 Windows 故障转移群集的脚本的屏幕截图。

  2. 创建群集后,它们将验证 Vm 是否显示为群集节点。After the cluster is created, they verify that the VMs appear as cluster nodes.

    显示群集的屏幕截图。

配置云见证Configure the cloud witness

  1. Contoso 管理员使用故障转移群集管理器中的 仲裁配置向导 来配置云见证。The Contoso admins configure the cloud witness by using the Quorum Configuration Wizard in Failover Cluster Manager.

  2. 在向导中,他们选择使用存储帐户创建云见证。In the wizard, they select to create a cloud witness with the storage account.

  3. 配置云见证后,它将显示在故障转移群集管理器管理单元中。After the cloud witness is configured, it appears in the Failover Cluster Manager snap-in.

    已配置显示云见证的屏幕截图。

启用 SQL Server AlwaysOn 可用性组Enable SQL Server Always On availability groups

Contoso 管理员现在可以启用 Always On 可用性组:The Contoso admins can now enable Always On availability groups:

  1. 在 SQL Server 配置管理器中,为 SQL Server (MSSQLSERVER) 服务启用“Always On 可用性组”。In SQL Server Configuration Manager, they enable Always On availability groups for the SQL Server (MSSQLSERVER) service.

    屏幕截图,显示 "启用 Always On 可用性组" 复选框。

  2. 重启服务后,所作更改才能生效。They restart the service for changes to take effect.

启用 Always On 可用性组后,Contoso 可以设置将保护 SmartHotel360 数据库的 Always On 可用性组。With Always On availability groups enabled, Contoso can set up the Always On availability group that will protect the SmartHotel360 database.

需要更多帮助?Need more help?

步骤3:部署 Azure 负载均衡器Step 3: Deploy Azure Load Balancer

Contoso 管理员现在想要部署位于群集节点前面的内部负载均衡器。The Contoso admins now want to deploy an internal load balancer that sits in front of the cluster nodes. 负载均衡器侦听流量,并将其定向到适当的节点。The load balancer listens for traffic and directs it to the appropriate node.

显示负载均衡的关系图。

若要创建负载均衡器,Contoso 管理员:To create the load balancer, the Contoso admins:

  1. 在 Azure 门户中,请参阅 "网络" " > 负载均衡器",并设置新的内部负载均衡器: ILB-PROD-DB-EUS2-SQLAOGIn the Azure portal, go to Networking > Load balancer, and set up a new internal load balancer: ILB-PROD-DB-EUS2-SQLAOG.

  2. 将负载平衡器置于数据库子网中, (PROD-DB-EUS2 () 生产网络) VNET-PROD-EUS2Place the load balancer in the database subnet (PROD-DB-EUS2) of the production network (VNET-PROD-EUS2).

  3. 为其分配静态 IP 地址 (10.245.40.100) 。Assign it a static IP address (10.245.40.100).

  4. 作为网络元素,请在网络资源组中部署负载均衡器 ContosoNetworkingRGAs a networking element, deploy the load balancer in the networking resource group ContosoNetworkingRG.

    显示 "创建负载均衡器" 窗格的屏幕截图。

部署内部负载均衡器后,Contoso 管理员需要对其进行设置。After the internal load balancer is deployed, the Contoso admins need to set it up. 它们创建后端地址池,设置运行状况探测,并配置负载均衡规则。They create a back-end address pool, set up a health probe, and configure a load-balancing rule.

添加后端池Add a back-end pool

为了将流量分配到群集中的 Vm,Contoso 管理员设置了一个后端地址池,其中包含将从负载均衡器接收网络流量的 Vm 的 Nic 的 IP 地址。To distribute traffic to the VMs in the cluster, the Contoso admins set up a back-end address pool that contains the IP addresses of the NICs for VMs that will receive network traffic from the load balancer.

  1. 在门户中的负载平衡器设置中,Contoso 添加后端池: ILB-PROD-DB-EUS-SQLAOG-BEPOOLIn the load balancer settings in the portal, Contoso adds a back-end pool: ILB-PROD-DB-EUS-SQLAOG-BEPOOL.

  2. 管理员将池与可用性集相关联 SQLAOGAVSETThe admins associate the pool with availability set SQLAOGAVSET. 将 (和) 集中的 SQLAOG1 vm SQLAOG2 添加到池。The VMs in the set (SQLAOG1 and SQLAOG2) are added to the pool.

    显示 "添加后端池" 屏幕的屏幕截图。

创建运行状况探测器Create a health probe

Contoso 管理员创建一个运行状况探测,使负载均衡器能够监视应用程序的运行状况。The Contoso admins create a health probe so that the load balancer can monitor the application health. 探测根据其对运行状况检查的响应方式,动态添加或删除负载均衡器轮换中的 Vm。The probe dynamically adds or removes VMs from the load balancer rotation based on how they respond to health checks.

若要创建探测,Contoso 管理员:To create the probe, the Contoso admins:

  1. 在门户中的负载平衡器设置中,创建运行状况探测: SQLAlwaysOnEndPointProbeIn the load balancer settings in the portal, create a health probe: SQLAlwaysOnEndPointProbe.

  2. 设置探测以监视 TCP 端口59999上的 Vm。Set the probe to monitor VMs on TCP port 59999.

  3. 设置探测器之间的间隔5秒,阈值为2。Set an interval of 5 seconds between probes and a threshold of 2. 如果两次探测失败,VM 将被视为运行不正常。If two probes fail, the VM will be considered unhealthy.

    显示 "添加运行状况探测" 屏幕的屏幕截图。

配置负载均衡器用于接收流量Configure the load balancer to receive traffic

现在,Contoso 管理员设置了负载均衡器规则,用于定义将流量分配给 Vm 的方式。Now, the Contoso admins set up a load balancer rule to define how traffic is distributed to the VMs.

  • 前端 IP 地址处理传入的流量。The front-end IP address handles incoming traffic.
  • 后端 IP 池接收流量。The back-end IP pool receives the traffic.

若要创建规则,Contoso 管理员:To create the rule, the Contoso admins:

  1. 在门户中的负载平衡器设置中,添加新规则: SQLAlwaysOnEndPointListenerIn the load balancer settings in the portal, add a new rule: SQLAlwaysOnEndPointListener.

  2. 设置前端侦听器以接收 TCP 端口1433上的传入 SQL 客户端流量。Set a front-end listener to receive incoming SQL client traffic on TCP port 1433.

  3. 指定将流量路由到的后端池,以及 Vm 用于侦听流量的端口。Specify the back-end pool to which traffic will be routed and the port on which VMs listen for traffic.

  4. 启用浮动 IP (直接服务器返回) ,SQL Server Always On 始终需要该返回。Enable floating IP (direct server return), which is always required for SQL Server Always On.

    显示运行状况探测设置的屏幕截图。

需要更多帮助?Need more help?

步骤4:为 Azure Migrate 准备 AzureStep 4: Prepare Azure for Azure Migrate

以下是 Contoso 需要部署 Azure Migrate 的 Azure 组件:Here are the Azure components Contoso needs to deploy Azure Migrate:

  • 迁移 Vm 时将在其中放置 Vm 的虚拟网络。A virtual network in which VMs will be located when they're migrated.
  • 用于保存已复制数据的 Azure 存储帐户。An Azure Storage account to hold replicated data.

Contoso 管理员设置以下组件:The Contoso admins set up these components:

  1. Contoso 已经创建了一个网络/子网,它可以在 部署 Azure 基础结构时用于 Azure Migrate。Contoso already created a network/subnet it can use for Azure Migrate when it deployed the Azure infrastructure.

    • SmartHotel360 应用程序是一个生产应用程序, WEBVM 将迁移到 () 主要区域的 Azure 生产网络 (VNET-PROD-EUS2) East US 2The SmartHotel360 application is a production application, and WEBVM will be migrated to the Azure production network (VNET-PROD-EUS2) in the primary region (East US 2).
    • WEBVM 将放置在 ContosoRG 用于生产资源的资源组中,并在生产子网 (PROD-FE-EUS2) 中。WEBVM will be placed in the ContosoRG resource group, which is used for production resources, and in the production subnet (PROD-FE-EUS2).
  2. Contoso 管理员在主要区域中创建 () 的 Azure 存储帐户 contosovmsacc20180528The Contoso admins create an Azure Storage account (contosovmsacc20180528) in the primary region.

    • 使用具有标准存储和 LRS 复制的常规用途帐户。Use a general-purpose account with standard storage and LRS replication.

步骤5:准备 Azure Migrate 的本地 VMwareStep 5: Prepare on-premises VMware for Azure Migrate

下面是 Contoso 管理员在本地准备的内容:Here's what the Contoso admins prepare on-premises:

  • VCenter Server 或 vSphere ESXi 主机上的一个帐户,用于自动执行 VM 发现。An account on the vCenter Server or vSphere ESXi host to automate VM discovery.
  • 本地 VM 设置,以便 Contoso 可以在迁移后连接到复制的 Azure VM。On-premises VM settings so that Contoso can connect to the replicated Azure VM after migration.

为自动发现准备帐户Prepare an account for automatic discovery

Azure Migrate 需要访问 VMware 服务器:Azure Migrate needs access to VMware servers to:

  • 自动发现 VM。Automatically discover VMs.
  • 协调复制和迁移。Orchestrate replication and migration.
  • 至少需要一个只读帐户。At least a read-only account is required. 他们需要一个帐户,该帐户可以运行操作,如创建和删除磁盘以及打开 Vm。They need an account that can run operations such as creating and removing disks and turning on VMs.

若要设置帐户,Contoso 管理员:To set up the account, the Contoso admins:

  1. 在 vCenter 级别创建角色。Create a role at the vCenter level.
  2. 为该角色分配所需的权限。Assign that role the required permissions.

准备在迁移后连接到 Azure VmPrepare to connect to Azure VMs after migration

迁移后,Contoso 希望连接到 Azure Vm 并允许 Azure 管理 Vm。After migration, Contoso wants to connect to the Azure VMs and allow Azure to manage the VMs. 为此,Contoso 管理员在迁移之前执行以下任务:To do this, the Contoso admins do the following tasks before migration:

  1. 为了通过 Internet 进行访问:For access over the internet, they:

    • 迁移之前,在本地 VM 上启用 RDP 或 SSH。Enable RDP or SSH on the on-premises VM before migration.
    • 确保为“公共”配置文件添加了 TCP 和 UDP 规则。Ensure that TCP and UDP rules are added for the Public profile.
    • 检查操作系统防火墙中是否允许使用 RDP 或 SSH。Check that RDP or SSH is allowed in the operating system firewall.
  2. 若要通过站点到站点 VPN 访问,请执行以下操作:For access over Site-to-Site VPN, they:

    • 迁移之前,在本地 VM 上启用 RDP 或 SSH。Enable RDP or SSH on the on-premises VM before migration.
    • 检查操作系统防火墙中是否允许使用 RDP 或 SSH。Check that RDP or SSH is allowed in the operating system firewall.
    • 对于 Windows,请将本地 VM 上的操作系统的 SAN 策略设置为 OnlineAllFor Windows, set the operating system's SAN policy on the on-premises VM to OnlineAll.
  3. 安装 Azure 代理:Install the Azure agent:

  4. 杂项Miscellaneous

    • 对于 Windows,触发迁移时,VM 上应该不会有任何挂起的 Windows 更新。For Windows, there should be no Windows updates pending on the VM when triggering a migration. 如果有,则在更新完成之前,Contoso 管理员无法登录到 VM。If there are, the Contoso admins won't be able to sign in to the VM until the update completes.
    • 迁移后,他们可以检查 启动诊断 以查看 VM 的屏幕截图。After migration, they can check Boot diagnostics to view a screenshot of the VM. 如果此操作不起作用,它们应该验证 VM 是否正在运行,并查看这些 故障排除提示If it doesn't work, they should verify that the VM is running and review these troubleshooting tips.

需要更多帮助?Need more help?

了解如何准备要 迁移的 vmLearn about how to prepare VMs for migration.

步骤6:将本地 Vm 复制到 AzureStep 6: Replicate the on-premises VMs to Azure

在 Contoso 管理员可运行迁移到 Azure 之前,需要设置并启用复制。Before the Contoso admins can run a migration to Azure, they need to set up and enable replication.

完成发现后,可以开始将 VMware Vm 复制到 Azure。With discovery finished, they can begin replication of VMware VMs to Azure.

  1. 在 Azure Migrate 项目中,它们会转向 服务器 > Azure Migrate:服务器迁移,然后选择 "复制"。In the Azure Migrate project, they go to Servers > Azure Migrate: Server Migration, and select Replicate.

    显示复制选项的屏幕截图。

  2. 复制 > 源设置 中, > 计算机是否已虚拟化?,它们选择 "是",并 VMware vSphereIn Replicate > Source settings > Are your machines virtualized?, they select Yes, with VMware vSphere.

  3. 本地设备 中,选择已设置的 Azure Migrate 设备的名称,然后选择 "确定"In On-premises appliance, they select the name of the Azure Migrate appliance that was set up, and then select OK.

    显示“源设置”选项卡的屏幕截图。

  4. 在 " 虚拟机" 中,选择要复制的计算机。In Virtual machines, they select the machines to replicate.

    • 如果 Contoso 管理员已经为 Vm 运行了评估,则他们可以在评估结果中应用 VM 大小和磁盘类型 (高级/标准) 建议。If the Contoso admins have run an assessment for the VMs, they can apply VM sizing and disk type (premium/standard) recommendations from the assessment results. 从 Azure Migrate 评估的 "导入迁移设置" 中,选择 "是" 选项。In Import migration settings from an Azure Migrate assessment?, they select the Yes option.
    • 如果他们没有运行评估或不想使用评估设置,则选择 " " 选项。If they didn't run an assessment or don't want to use the assessment settings, they select the No option.
    • 如果他们选择使用评估,则会选择 VM 组和评估名称。If they selected to use the assessment, they select the VM group and assessment name.

    显示选择评估的屏幕截图。

  5. 虚拟机 中,它们会根据需要搜索 vm,并检查每个 vm 是否迁移。In Virtual machines, they search for VMs as needed and check each VM to migrate. 然后选择 " 下一步:目标设置"。Then they select Next: Target settings.

  6. 在 " 目标设置" 中,选择要将订阅迁移到的订阅和目标区域,并指定迁移之后 Azure vm 所在的资源组。In Target settings, they select the subscription, and target region to which they'll migrate, and specify the resource group in which the Azure VMs will reside after migration. 在 " 虚拟网络" 中,选择 azure vm 在迁移后要连接到的 azure 虚拟网络/子网。In Virtual Network, they select the Azure virtual network/subnet to which the Azure VMs will be joined after migration.

  7. Azure 混合权益 中,Contoso 管理员:In Azure Hybrid Benefit, the Contoso admins:

    • 如果不想应用 Azure 混合权益,请选择 " "。Select No if they don't want to apply Azure Hybrid Benefit. 然后选择 " 下一步"。Then they select Next.
    • 如果有 Windows Server 计算机具有活动的软件保障或 Windows Server 订阅,则选择 "是" ,他们想要将权益应用于正在迁移的计算机。Select Yes if they have Windows Server machines that are covered with active Software Assurance or Windows Server subscriptions, and they want to apply the benefit to the machines they're migrating. 然后选择 " 下一步"。Then they select Next.
  8. 计算 中,它们查看 VM 名称、大小、OS 磁盘类型和可用性集。In Compute, they review the VM name, size, OS disk type, and availability set. VM 必须符合 Azure 要求VMs must conform with Azure requirements.

    • VM 大小: 如果他们使用的是评估建议,"VM 大小" 下拉列表将包含建议的大小。VM size: If they're using assessment recommendations, the VM size drop-down list contains the recommended size. 否则,Azure Migrate 会根据 Azure 订阅中最接近的匹配项选择大小。Otherwise, Azure Migrate picks a size based on the closest match in the Azure subscription. 或者,他们可以选择 AZURE VM 大小 的手动大小。Alternatively, they can pick a manual size in Azure VM size.
    • OS 磁盘: 它们为 VM 指定 OS (boot) 磁盘。OS disk: They specify the OS (boot) disk for the VM. OS 磁盘是包含操作系统引导加载程序和安装程序的磁盘。The OS disk is the disk that has the operating system bootloader and installer.
    • 可用性集: 如果在迁移后 VM 应位于 Azure 可用性集中,则它们将指定集。Availability set: If the VM should be in an Azure availability set after migration, they specify the set. 该集必须位于为迁移指定的目标资源组中。The set must be in the target resource group specified for the migration.
  9. 在 " 磁盘" 中,指定是否应将 VM 磁盘复制到 Azure。In Disks, they specify whether the VM disks should be replicated to Azure. 然后在 Azure 中选择磁盘类型 (标准 SSD/HDD 或高级托管磁盘) ,然后选择 " 下一步"。Then they select the disk type (standard SSD/HDD or premium managed disks) in Azure and select Next.

    • 可以从复制中排除磁盘。They can exclude disks from replication.
    • 如果排除了磁盘,则在迁移后它们将不会出现在 Azure VM 中。If disks are excluded, they won't be present on the Azure VM after migration.
  10. 若要 查看和开始复制,请查看设置。In Review + Start replication, they review the settings. 然后选择 " 复制 ",为服务器启动初始复制。Then they select Replicate to start the initial replication for the servers.

备注

管理 复制计算机中开始复制之前,可以随时更新复制设置 > 。Replication settings can be updated any time before replication starts in Manage > Replicating machines. 开始复制后无法更改设置。Settings can't be changed after replication starts.

步骤7:通过 Azure 数据库迁移服务迁移数据库Step 7: Migrate the database via Azure Database Migration Service

Contoso 管理员按照分步 迁移教程操作,通过 Azure 数据库迁移服务迁移数据库。The Contoso admins migrate the database via Azure Database Migration Service by following the step-by-step migration tutorial. 它们可以联机、脱机和混合 (预览) 迁移。They can perform online, offline, and hybrid (preview) migrations.

总的来说,它们必须执行以下任务:As a summary, they must perform the following tasks:

  • 使用高级定价层创建连接到虚拟网络的 Azure 数据库迁移服务实例。Use the Premium pricing tier to create an Azure Database Migration Service instance that connects to the virtual network.
  • 确保实例可以通过虚拟网络访问远程 SQL Server。Ensure that the instance can access the remote SQL Server via the virtual network. 确保所有传入端口都允许从 Azure SQL Server 虚拟网络级别、网络 VPN 和承载 SQL Server 的计算机。Ensure that all incoming ports are allowed from Azure to SQL Server at the virtual network level, the network VPN, and the machine that hosts SQL Server.
  • 配置实例:Configure the instance:
    • 创建迁移项目。Create a migration project.
    • 添加源 (本地数据库) 。Add a source (on-premises database).
    • 选择一个目标。Select a target.
    • 选择要迁移的数据库。Select the databases to migrate.
    • 配置高级设置。Configure advanced settings.
    • 开始复制。Start the replication.
    • 解决任何错误。Resolve any errors.
    • 执行最终切换。Perform the final cutover.

步骤8:保护数据库的 SQL Server Always OnStep 8: Protect the database with SQL Server Always On

在上运行的应用程序数据库 SQLAOG1 中,Contoso 管理员现在可以使用 Always On 可用性组来保护它。With the application database running on SQLAOG1, the Contoso admins can now protect it by using Always On availability groups. 它们使用 SQL Server Management Studio 配置 SQL Server Always On,然后使用 Windows 群集分配侦听器。They configure SQL Server Always On by using SQL Server Management Studio and then assign a listener by using Windows clustering.

创建 Always On 可用性组Create an Always On availability group

  1. 在 SQL Server Management Studio 中,它们选择并按住 (或右键单击) Always On 高可用性 ,以启动 " 新建可用性组" 向导In SQL Server Management Studio, they select and hold (or right-click) Always On High Availability to start the New Availability Group Wizard.

  2. 指定选项 中,它们将命名可用性组 SHAOGIn Specify Options, they name the availability group SHAOG. 在 " 选择数据库" 中,选择 SmartHotel360 数据库。In Select Databases, they select the SmartHotel360 database.

    显示 "选择数据库" 窗格的屏幕截图。

  3. 指定副本 时,它们将两个 SQL 节点添加为可用性副本,并将其配置为通过同步提交提供自动故障转移。In Specify Replicas, they add the two SQL nodes as availability replicas and configure them to provide automatic failover with synchronous commit.

    显示 "副本" 选项卡的屏幕截图。

  4. 它们为组 (SHAOG) 和端口配置侦听器。They configure a listener for the group (SHAOG) and port. 内部负载均衡器的 IP 地址添加为静态 IP 地址 (10.245.40.100) 。The IP address of the internal load balancer is added as a static IP address (10.245.40.100).

    显示 "创建可用性组侦听器" 选项的屏幕截图。

  5. 在“选择数据同步”中,启用自动种子设定。In Select Data Synchronization, they enable automatic seeding. 使用此选项时,SQL Server 会自动为组中的每个数据库创建辅助副本,因此 Contoso 无需手动备份和还原它们。With this option, SQL Server automatically creates secondary replicas for every database in the group, so Contoso doesn't have to manually back up and restore them. 验证后,创建可用性组。After validation, the availability group is created.

    显示 Always On 可用性组的屏幕截图。

  6. Contoso 在组创建期间遇到问题。Contoso ran into an issue when creating the group. 它未使用 Active Directory Windows 集成安全性,并且需要向 SQL 登录名授予权限,以创建 Windows 故障转移群集角色。It isn't using Active Directory Windows integrated security and needs to grant permissions to the SQL login to create the Windows failover cluster roles.

    显示向 SQL 登录名授予权限的屏幕截图。

  7. 创建组后,它将显示在 SQL Server Management Studio 中。After the group is created, it appears in SQL Server Management Studio.

在群集上配置侦听器Configure a listener on the cluster

作为设置 SQL 部署的最后一步,Contoso 管理员将内部负载均衡器配置为群集上的侦听器,并使侦听器联机。As a last step in setting up the SQL deployment, the Contoso admins configure the internal load balancer as the listener on the cluster and bring the listener online. 它们使用脚本来执行此任务。They use a script to do this task.

显示群集侦听器的屏幕截图。

验证配置Verify the configuration

一切设置就绪后,Contoso 在 Azure 中有一个正常工作的可用性组,该组使用迁移的数据库。With everything set up, Contoso now has a functional availability group in Azure that uses the migrated database. 管理员通过连接到 SQL Server Management Studio 中的内部负载均衡器来验证配置。The admins verify the configuration by connecting to the internal load balancer in SQL Server Management Studio.

显示内部负载均衡器连接的屏幕截图。

需要更多帮助?Need more help?

步骤9:将 VM 与 Azure Migrate 迁移Step 9: Migrate the VM with Azure Migrate

Contoso 管理员运行快速测试故障转移,然后迁移 VM。The Contoso admins run a quick test failover and then migrate the VM.

运行测试迁移Run a test migration

运行测试迁移有助于确保在迁移之前一切按预期运行。Running a test migration helps ensure that everything's working as expected before the migration. Contoso 管理员:The Contoso admins:

  1. 运行测试故障转移到最新的可用时间点 (Latest processed) 。Run a test failover to the latest available point in time (Latest processed).

  2. 选择 " 在开始故障转移之前关闭计算机 ",以便 Azure Migrate 在触发故障转移之前尝试关闭源 VM。Select Shut down machine before beginning failover so that Azure Migrate attempts to shut down the source VM before triggering the failover. 即使关机失败,故障转移也仍会继续。Failover continues even if shutdown fails.

  3. 运行测试故障转移:A test failover runs:

    • 运行先决条件检查,确保满足迁移所需的所有条件。A prerequisites check runs to make sure all of the conditions required for migration are in place.
    • 故障转移处理数据,以便创建 Azure VM。Failover processes the data so that an Azure VM can be created. 如果选择了最新恢复点,则基于该数据创建恢复点。If the latest recovery point is selected, a recovery point is created from the data.
    • 使用上一步中处理的数据创建 Azure VM。An Azure VM is created by using the data processed in the previous step.
  4. 故障转移完成后,Azure VM 副本将在 Azure 门户中显示。After the failover finishes, the replica Azure VM appears in the Azure portal. 检查 VM 是否大小适当、已连接到正确的网络,并且正在运行。They check that the VM is the appropriate size, that it's connected to the right network, and that it's running.

  5. 验证后,清理故障转移,记录并保存任何观察结果。After verifying, they clean up the failover, and record and save any observations.

运行故障转移Run a failover

  1. 在验证测试故障转移是否按预期工作后,它们会为迁移创建恢复计划,并将添加 WEBVM 到计划中。After verifying that the test failover worked as expected, they create a recovery plan for migration, and add WEBVM to the plan.

    显示创建恢复计划的屏幕截图

  2. 针对计划运行故障转移。They run a failover on the plan. 它们选择最新的恢复点。They select the latest recovery point. 它们指定 Azure Migrate 应在触发故障转移之前尝试关闭本地 VM。They specify that Azure Migrate should try to shut down the on-premises VM before triggering the failover.

    显示 "故障转移" 窗格的屏幕截图。

  3. 故障转移后,验证 Azure VM 是否按预期显示在 Azure 门户中。After the failover, they verify that the Azure VM appears as expected in the Azure portal.

    显示虚拟机的 "概述" 窗格的屏幕截图。

  4. 验证 Azure 中的 VM 后,它们将完成迁移,以完成迁移过程,停止 VM 复制,并停止 VM Azure Migrate 计费。After verifying the VM in Azure, they complete the migration to finish the migration process, stop replication for the VM, and stop Azure Migrate billing for the VM.

    显示完整迁移项的屏幕截图。

更新连接字符串Update the connection string

作为迁移过程的最后一步,Contoso 管理员更新了应用程序的连接字符串,以指向侦听器上运行的已迁移数据库 SHAOGAs the final step in the migration process, the Contoso admins update the connection string of the application to point to the migrated database running on the SHAOG listener. 此配置将在 WEBVM Azure 中正在运行的上更改。This configuration will be changed on the WEBVM now running in Azure. 此配置位于 web.config ASP.NET 应用程序的中。This configuration is located in the web.config of the ASP.NET application.

  1. Contoso 管理员在处找到文件 C:\inetpub\SmartHotelWeb\web.config ,并更改服务器的名称以反映 Always On 可用性组的 FQDN: shaog.contoso.comThe Contoso admins locate the file at C:\inetpub\SmartHotelWeb\web.config and change the name of the server to reflect the FQDN of the Always On availability group: shaog.contoso.com.

    显示 Always On 可用性组的 FQDN 的屏幕截图。

  2. 更新文件并保存后,它们将在上重新启动 IIS WEBVMAfter updating the file and saving it, they restart IIS on WEBVM. 它们在 iisreset /restart 命令提示符下使用。They use iisreset /restart from a command prompt.

  3. 重新启动 IIS 后,应用程序现在使用托管实例上运行的数据库。After IIS is restarted, the application now uses the database running on the managed instance.

需要更多帮助?Need more help?

迁移后的清理Clean up after migration

迁移后,SmartHotel360 应用程序会在 Azure VM 上运行。After migration, the SmartHotel360 application is running on an Azure VM. SmartHotel360 数据库位于 Azure 中的 SQL Server 群集上。The SmartHotel360 database is located in the SQL Server cluster in Azure.

现在,Contoso 需要完成这些清理步骤:Now, Contoso needs to finish these cleanup steps:

  • 从 vCenter 清单中删除本地 VM。Remove the on-premises VMs from the vCenter inventory.
  • 从本地备份作业中删除 VM。Remove the VMs from local backup jobs.
  • 更新内部文档,从而显示新位置以及 WEBVM 的 IP 地址。Update internal documentation to show the new locations and IP addresses for VMs.
  • 查看与已解除授权的 VM 进行交互的任何资源。Review any resources that interact with the decommissioned VMs. 更新任何相关设置或文档以反映新配置。Update any relevant settings or documentation to reflect the new configuration.
  • 将两个新 Vm (SQLAOG1SQLAOG2) 添加到生产监视系统。Add the two new VMs (SQLAOG1 and SQLAOG2) to production monitoring systems.

查看部署Review the deployment

Azure 中存在已迁移的资源后,Contoso 需要全面运营并保护其新基础设施。With the migrated resources in Azure, Contoso needs to fully operationalize and secure its new infrastructure.

安全性Security

Contoso 安全团队查看虚拟机 WEBVMSQLAOG1SQLAOG2 以确定任何安全问题。The Contoso security team reviews the virtual machines WEBVM, SQLAOG1, and SQLAOG2 to determine any security issues. 它们需要:They need to:

  • 查看 VM (Nsg) 的网络安全组,以控制访问。Review the network security groups (NSGs) for the VM to control access. NSG 用于确保仅允许到应用程序的流量可以通过。NSGs are used to ensure that only traffic allowed to the application can pass.
  • 请考虑使用 Azure 磁盘加密和 Azure Key Vault 来保护磁盘上的数据。Consider securing the data on the disk by using Azure Disk Encryption and Azure Key Vault.
  • 评估透明数据加密。Evaluate transparent data encryption. 然后在新 Always On 可用性组上运行的 SmartHotel360 数据库上启用它。Then enable it on the SmartHotel360 database running on the new Always On availability group. 详细了解 透明数据加密Learn more about transparent data encryption.

有关详细信息,请参阅 Azure 中 IaaS 工作负荷的最佳安全方案For more information, see Security best practices for IaaS workloads in Azure.

业务连续性和灾难恢复Business continuity and disaster recovery

对于业务连续性和灾难恢复,Contoso 采取了以下措施:For business continuity and disaster recovery, Contoso takes the following actions:

许可和成本优化Licensing and cost optimization

  • Contoso 现有的许可 WEBVM ,并将利用 Azure 混合权益。Contoso has existing licensing for its WEBVM and will take advantage of the Azure Hybrid Benefit. Contoso 将对现有的 Azure VM 进行转换,以利用此定价的优势。Contoso will convert the existing Azure VMs to take advantage of this pricing.
  • Contoso 将使用 Azure 成本管理 + 计费 来确保公司始终处于 IT 领导地位确立的预算范围内。Contoso will use Azure Cost Management + Billing to ensure the company stays within budgets established by the IT leadership.

结论Conclusion

在本文中,Contoso 通过使用 Azure Migrate 将应用程序前端 VM 迁移到 Azure,在 Azure 中重新承载 SmartHotel360 应用程序。In this article, Contoso rehosted the SmartHotel360 application in Azure by migrating the application front-end VM to Azure by using Azure Migrate. Contoso 使用 Azure 数据库迁移服务将应用程序数据库迁移到在 Azure 中预配的 SQL Server 群集,并在 SQL Server Always On 可用性组中对其进行保护。Contoso migrated the application database to a SQL Server cluster provisioned in Azure by using Azure Database Migration Service and protected it in a SQL Server Always On availability group.