为多层 SAP NetWeaver 应用部署设置灾难恢复Set up disaster recovery for a multi-tier SAP NetWeaver app deployment

大多数大型和中型 SAP 部署具有某种形式的灾难恢复解决方案。Most large-size and medium-size SAP deployments use some form of disaster recovery solution. 随着更多核心业务流程迁移到 SAP 等应用程序中,可靠和可测试的灾难恢复解决方案越来越重要。The importance of robust and testable disaster recovery solutions has increased as more core business processes are moved to applications like SAP. Azure Site Recovery 已经过测试并与 SAP 应用程序集成。Azure Site Recovery has been tested and integrated with SAP applications. Site Recovery 超过大多数本地灾难恢复解决方案的功能,并且总拥有成本要低于竞争对手解决方案。Site Recovery exceeds the capabilities of most on-premises disaster recovery solutions, and at a lower total cost of ownership than competing solutions.

使用 Site Recovery 可以:With Site Recovery, you can:

  • 将组件复制到 Azure,以便保护在本地运行的 SAP NetWeaver 和非 NetWeaver 生产应用程序。Enable protection of SAP NetWeaver and non-NetWeaver production applications that run on-premises by replicating components to Azure.
  • 将组件复制到其他 Azure 数据中心,以便保护在 Azure 中运行的 SAP NetWeaver 和非 NetWeaver 生产应用程序。Enable protection of SAP NetWeaver and non-NetWeaver production applications that run on Azure by replicating components to another Azure datacenter.
  • 使用 Site Recovery 将 SAP 部署迁移到 Azure,从而简化云迁移。Simplify cloud migration by using Site Recovery to migrate your SAP deployment to Azure.
  • 通过创建一个按需生产克隆来测试 SAP 应用程序,简化 SAP 项目的升级、测试和原型制作。Simplify SAP project upgrades, testing, and prototyping by creating a production clone on-demand for testing SAP applications.

可以使用 Azure Site Recovery 保护 SAP NetWeaver 应用程序部署。You can protect SAP NetWeaver application deployments by using Azure Site Recovery. 本文讨论如何按照一些最佳做法,在使用 Site Recovery 复制到其他 Azure 数据中心时保护 Azure 上的三层 SAP NetWeaver 部署。This article covers best practices for protecting a three-tier SAP NetWeaver deployment on Azure when you replicate to another Azure datacenter by using Site Recovery. 本文将介绍支持的方案和配置,以及如何执行测试故障转移(灾难恢复演练)和实际故障转移。The article describes supported scenarios and configurations, and how to do test failovers (disaster recovery drills) and actual failovers.

先决条件Prerequisites

开始之前,请确保自己知道如何执行以下任务:Before you begin, ensure that you know how to do the following tasks:

支持的方案Supported scenarios

使用 Azure Site Recovery 可以为以下方案实现灾难恢复解决方案:You can use Site Recovery to implement a disaster recovery solution in the following scenarios:

  • 在 Azure 数据中心内运行 SAP 系统,并将其复制到其他 Azure 数据中心(Azure 到 Azure 灾难恢复)。You have SAP systems running in one Azure datacenter, and you're replicating them to another Azure datacenter (Azure-to-Azure disaster recovery). 有关详细信息,请参阅 Azure 到 Azure 复制体系结构For more information, see Azure-to-Azure replication architecture.
  • 在本地 VMware(或物理)服务器上运行 SAP 系统。You have SAP systems running on VMware (or physical) servers on-premises. SAP 系统还会复制到 Azure 数据中心内的灾难恢复站点(VMware 到 Azure 灾难恢复)。You're also replicating the SAP systems to a disaster recovery site in an Azure datacenter (VMware-to-Azure disaster recovery). 此方案需要一些附加的组件。This scenario requires some additional components. 有关详细信息,请参阅 VMware 到 Azure 复制体系结构For more information, see VMware-to-Azure replication architecture.
  • 在本地 Hyper-V 上运行的 SAP 系统。You have SAP systems running on Hyper-V on-premises. SAP 系统还会复制到 Azure 数据中心内的灾难恢复站点(Hyper-V 到 Azure 灾难恢复)。You're also replicating the SAP systems to a disaster recovery site in an Azure datacenter (Hyper-V-to-Azure disaster recovery). 此方案需要一些附加的组件。This scenario requires some additional components. 有关详细信息,请参阅 Hyper-V 到 Azure 复制体系结构For more information, see Hyper-V-to-Azure replication architecture.

在本文中,你将使用 Azure 到 Azure 灾难恢复方案。In this article, we use an Azure-to-Azure disaster recovery scenario. 此方案将演示 Site Recovery 的 SAP 灾难恢复功能。The scenario shows you the SAP disaster recovery capabilities of Site Recovery. 由于 Site Recovery 复制过程不特定于应用程序,因此介绍的过程应该也适用于其他方案。Because Site Recovery replication isn't application-specific, the process that's described is expected to also apply to other scenarios.

所需基础服务Required foundation services

在本文所述的方案中,已部署以下基础服务:In the scenario we discuss in this article, the following foundation services are deployed:

  • Azure ExpressRoute 或 Azure VPN 网关Azure ExpressRoute or Azure VPN Gateway
  • 至少有一个在 Azure 中运行的 Azure Active Directory 域控制器和 DNS 服务器At least one Azure Active Directory domain controller and DNS server, running in Azure

建议在部署 Site Recovery 之前建立此基础结构。We recommend that you establish this infrastructure before you deploy Site Recovery.

参考 SAP 应用程序部署Reference SAP application deployment

此参考体系结构在具有高可用性的 Azure 上的 Windows 环境中运行 SAP NetWeaver。This reference architecture is running SAP NetWeaver in a Windows environment on Azure with high availability. 此体系结构是使用可根据组织需求更改的特定虚拟机 (VM) 大小来部署的。This architecture is deployed with specific virtual machine (VM) sizes that you can change to accommodate your organization's needs.

典型 SAP 部署模式的示意图

灾难恢复注意事项Disaster recovery considerations

对于灾难恢复,必须能够故障转移到次要区域。For disaster recovery, you must be able to fail over to a secondary region. 每个层使用不同的策略提供灾难恢复保护。Each tier uses a different strategy to provide disaster recovery protection.

运行 SAP Web 调度程序池的 VMVMs running SAP Web Dispatcher pools

Web 调度程序组件用作 SAP 应用程序服务器之间的 SAP 流量的负载均衡器。The Web Dispatcher component works as a load balancer for SAP traffic among the SAP application servers. 为了实现 Web 调度程序组件的高可用性,Azure 负载均衡器将实施并行的 Web 调度程序设置。To achieve high availability for the Web Dispatcher component, Azure Load Balancer implements the parallel Web Dispatcher setup. Web 调度程序使用轮循机制配置,在均衡器池中的可用 Web 调度程序之间分配 HTTP(S) 流量。Web Dispatcher uses a round-robin configuration for HTTP(S) traffic distribution among the available Web Dispatchers in the balancers pool.

运行应用程序服务器池的 VMVMs running application servers pools

SMLG 事务管理 ABAP 应用程序服务器的登录组。The SMLG transaction manages login groups for ABAP application servers. 该事务使用 Central Services 的消息服务器中的负载均衡功能,在 SAPGUI 的 SAP 应用程序服务器池之间分配工作负荷,以及分配 RFC 流量。It uses the load-balancing function within the message server of the Central Services to distribute workload among SAP application server pools for SAPGUIs and RFC traffic. 可以使用 Site Recovery 来复制此管理。You can replicate this management by using Site Recovery.

运行 SAP Central Services 群集的 VMVMs running SAP Central Services clusters

此参考体系结构在应用层中的 VM 上运行 Central Services。This reference architecture runs Central Services on VMs in the application tier. 在单个 VM 中,Central Services 是潜在的单一故障点。Central Services is a potential single point of failure when in a single VM. 不要求使用典型的部署和高可用性。Typical deployment and high availability aren't requirements.

若要实施高可用性解决方案,可以使用共享的磁盘群集或文件共享群集。To implement a high availability solution, you can use either a shared disk cluster or a file share cluster. 若要为共享磁盘群集配置 VM,请使用 Windows Server 故障转移群集。To configure VMs for a shared disk cluster, use Windows Server Failover Cluster. 建议将云见证用作仲裁见证。We recommend that you use the cloud witness as a quorum witness.

备注

由于 Site Recovery 不会复制云见证,因此我们建议将云见证部署在灾难恢复区域中。Because Site Recovery does not replicate the cloud witness, we recommend that you deploy the cloud witness in the disaster recovery region.

若要支持故障转移群集环境,SIOS DataKeeper Cluster Edition 可以执行群集共享卷功能。To support the failover cluster environment, SIOS DataKeeper Cluster Edition does the cluster shared volume function. 在该功能中,SIOS DataKeeper 群集将复制群集节点拥有的独立磁盘。In the function, SIOS DataKeeper Cluster replicates independent disks owned by the cluster nodes. Azure 原生并不支持共享磁盘,因此需要 SIOS 提供的解决方案。Because Azure does not natively support shared disks, it requires solutions provided by SIOS.

还可以通过实施文件共享群集来处理群集组建。You can also handle clustering by implementing a file share cluster. SAP 最近修改了 Central Services 部署模式,以允许通过 UNC 路径访问 /sapmnt 全局目录。SAP recently modified the Central Services deployment pattern to access the /sapmnt global directories via a UNC path. 我们仍然建议确保 /sapmnt UNC 共享具有高可用性。We still recommend you ensure that the /sapmnt UNC share is highly available. 可以检查 Central Services 实例。You can check your Central Services instance. 配合 Windows Server 2016 中的横向扩展文件服务器 (SOFS) 和存储空间直通 (S2D) 功能使用 Windows Server 故障转移群集。Use Windows Server Failover Cluster with Scale Out File Server (SOFS) and the Storage Spaces Direct (S2D) feature in Windows Server 2016.

备注

Site Recovery 目前仅支持使用存储空间直通和 SIOS Datakeeper 的被动节点进行虚拟机的崩溃一致性恢复点复制。Site Recovery currently supports only crash-consistent point replication of virtual machines that use storage spaces direct and the passive node of SIOS Datakeeper.

其他灾难恢复注意事项More disaster recovery considerations

可以使用 Site Recovery 跨 Azure 区域安排整个 SAP 部署的故障转移。You can use Site Recovery to orchestrate the failover of full SAP deployment across Azure regions. 下面是设置灾难恢复的步骤:Following are the steps for setting up the disaster recovery:

  1. 复制虚拟机Replicate virtual machines
  2. 设计恢复网络Design a recovery network
  3. 复制域控制器Replicate a domain controller
  4. 复制数据库层Replicate data base tier
  5. 执行测试故障转移Do a test failover
  6. 执行故障转移Do a failover

下面是此示例中使用的每个层的灾难恢复建议。Following is the recommendation for disaster recovery of each tier used in this example.

SAP 层SAP tiers 建议 Recommendation
SAP Web 调度程序池SAP Web Dispatcher pool 使用 Site Recovery 进行复制Replicate by using Site Recovery
SAP Application 服务器池SAP Application server pool 使用 Site Recovery 进行复制Replicate by using Site Recovery
SAP Central Services 群集SAP Central Services cluster 使用 Site Recovery 进行复制Replicate by using Site Recovery
Active Directory 虚拟机Active directory virtual machines 使用 Active Directory 复制Use Active directory replication
SQL 数据库服务器SQL Database servers 使用 SQL Server Always On 复制Use SQL Server Always On replication

复制虚拟机Replicate virtual machines

若要开始将所有 SAP 应用程序虚拟机复制到 Azure 灾难恢复数据中心,请遵照将虚拟机复制到 Azure 中的指导。To start replicating all the SAP application virtual machines to the Azure disaster recovery datacenter, follow the guidance in Replicate a virtual machine to Azure.

网络配置Networking configuration

如果使用的是静态 IP,可以指定希望虚拟机采用的 IP 地址。If you use a static IP address, you can specify the IP address that you want the virtual machine to take. 若要设置 IP 地址,请转到“计算和网络设置” > “网络接口卡”。To set the IP address, go to Compute and Network settings > Network interface card.

演示如何在 Site Recovery 的“网络接口卡”窗格中设置专用 IP 地址的屏幕截图

创建恢复计划Create a recovery plan

恢复计划支持在故障转移期间将多层应用程序中的各个层排序。A recovery plan supports the sequencing of various tiers in a multi-tier application during a failover. 排序有助于保持应用程序一致性。Sequencing helps maintain application consistency. 为多层 Web 应用程序创建恢复计划时,请完成使用 Site Recovery 创建恢复计划中所述的步骤。When you create a recovery plan for a multi-tier web application, complete the steps described in Create a recovery plan by using Site Recovery.

将虚拟机添加到故障转移组Add virtual machines to failover groups

  1. 通过添加应用程序服务器、Web 调度程序和 SAP Central services VM 创建恢复计划。Create a recovery plan by adding the application server, web dispatcher, and SAP Central services VMs.
  2. 选择“自定义”将 VM 分组。 Select Customize to group the VMs. 默认情况下,所有 VM 属于“组 1”。By default, all VMs are part of Group 1.

将脚本添加到恢复计划Add scripts to the recovery plan

可能需要在 Azure 虚拟机上执行一些操作才能让应用程序正常工作。For your applications to function correctly, you might need to do some operations on the Azure virtual machines. 请在故障转移后或测试故障转移期间执行这些操作。Do these operations after the failover or during a test failover. 还可将某些故障转移后的操作自动化。You can also automate some post-failover operations. 例如,在恢复计划中添加相应的脚本,以更新 DNS 条目并更改绑定和连接。For example, update the DNS entry, and change bindings and connections by adding corresponding scripts to the recovery plan.

可以选择“部署到 Azure”,将最常用的 Site Recovery 脚本部署到 Azure 自动化帐户中。 You can deploy the most used Site Recovery scripts into your Azure Automation account by selecting Deploy to Azure. 使用任何已发布的脚本时,请遵循脚本中的指导。When you use any published script, follow the guidance in the script.

备注

必须修改从 GitHub 存储库“azure-quickstart-templates”下载或参考的模板,以适应 Azure 中国云环境。Templates you downloaded or referenced from the GitHub Repo "azure-quickstart-templates" must be modified in order to fit in the Azure China Cloud Environment. 例如,替换某些终结点(将“blob.core.windows.net”替换为“blob.core.chinacloudapi.cn”,将“cloudapp.azure.com”替换为“cloudapp.chinacloudapi.cn”);必要时更改某些不受支持的位置、VM 映像、VM 大小、SKU 以及资源提供程序的 API 版本。For example, replace some endpoints -- "blob.core.windows.net" by "blob.core.chinacloudapi.cn", "cloudapp.azure.com" by "cloudapp.chinacloudapi.cn"; change some unsupported Location, VM images, VM sizes, SKU and resource-provider's API Version when necessary.

选择下面的“Deploy to Azure”后,请选择“Edit template”并根据 Azure 中国环境更新特定项。After select the below Deploy to Azure, select Edit template and update the specific items to meet Azure China Environment.

  • 在第 14 行将 automationRegion 参数的 allowedValues 属性替换为以下项。Replace the allowedValues propertis of automationRegion parameter with following items on the Line 14. chinaeast2,chinanorth,chinanorth2
  • 选择“保存”。Select save.

部署到 AzureDeploy to Azure

  1. 将操作前脚本添加到“组 1”,以故障转移 SQL Server 可用性组。Add a pre-action script to Group 1 to fail over the SQL Server availability group. 使用示例脚本中发布的 ASR-SQL-FailoverAG 脚本。Use the ASR-SQL-FailoverAG script published in the sample scripts. 遵循脚本中的指导,并相应地在脚本中进行所需的更改。Follow the guidance in the script and make the required changes in the script appropriately.
  2. 添加一个操作后脚本,以便在 Web 层的已故障转移虚拟机(组 1)上附加负载均衡器。Add a post-action script to attach a load balancer onto the failed-over virtual machines of the Web tier (Group 1). 使用示例脚本中发布的 ASR-AddSingleLoadBalancer 脚本。Use the ASR-AddSingleLoadBalancer script published in the sample scripts. 遵循脚本中的指导,并根据需要在脚本中进行更改。Follow the guidance in the script and make the required changes in the script as needed.

SAP 恢复计划

运行测试故障转移Run a test failover

  1. 在 Azure 门户中,选择恢复服务保管库。In the Azure portal, select your Recovery Services vault.
  2. 选择针对 SAP 应用程序创建的恢复计划。Select the recovery plan that you created for SAP applications.
  3. 选择“测试故障转移”。Select Test Failover.
  4. 若要启动测试故障转移过程,请选择恢复点和 Azure 虚拟网络。To start the test failover process, select the recovery point and the Azure virtual network.
  5. 当辅助环境启动时,执行验证。When the secondary environment is up, perform validations.
  6. 完成验证后,选择“清理测试故障转移”清理测试故障转移环境。When validations are complete, clean the failover environment by selecting Cleanup test failover.

有关详细信息,请参阅在 Site Recovery 中执行到 Azure 的测试故障转移For more information, see Test failover to Azure in Site Recovery.

运行故障转移Run a failover

  1. 在 Azure 门户中,选择恢复服务保管库。In the Azure portal, select your Recovery Services vault.
  2. 选择针对 SAP 应用程序创建的恢复计划。Select the recovery plan that you created for SAP applications.
  3. 选择“故障转移”。Select Failover.
  4. 若要启动故障转移过程,请选择恢复点。To start the failover process, select the recovery point.

有关详细信息,请参阅 Site Recovery 中的故障转移For more information, see Failover in Site Recovery.

后续步骤Next steps

  • 详细了解如何使用 Site Recovery 为 SAP NetWeaver 部署构建灾难恢复解决方案。Learn more about building a disaster recovery solution for SAP NetWeaver deployments by using Site Recovery. 请参阅可下载的白皮书 SAP NetWeaver:使用 Site Recovery 构建灾难恢复解决方案See the downloadable white paper SAP NetWeaver: Building a Disaster Recovery Solution with Site Recovery. 该白皮书针对各种 SAP 体系结构提供了建议。The white paper discusses recommendations for various SAP architectures. 可在其中查看 Azure 上的 SAP 支持的应用程序和 VM 类型。You can see supported applications and VM types for SAP on Azure. 其中还提供了用于测试灾难恢复解决方案的计划选项。There are also plan options for testing your disaster recovery solution.

  • 详细了解如何使用 Site Recovery 复制其他工作负荷Learn more about replicating other workloads by using Site Recovery.