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

为多层 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 超过大多数本地灾难恢复解决方案的功能,并且总拥有成本 (TCO) 要低于竞争对手解决方案。Site Recovery exceeds the capabilities of most on-premises disaster recovery solutions, and at a lower total cost of ownership (TCO) 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 应用程序部署。This article describes how to protect SAP NetWeaver application deployments by using Azure Site Recovery. 本文讨论如何按照一些最佳做法,使用 Site Recovery 将 Azure 上的三层 SAP NetWeaver 部署复制到其他 Azure 数据中心,从而对其进行保护。The article covers best practices for protecting a three-tier SAP NetWeaver deployment on Azure by replicating to another Azure datacenter by using Site Recovery. 本文介绍了支持的方案和配置,以及如何执行测试故障转移(灾难恢复演练)和实际故障转移。It describes supported scenarios and configurations, and how to perform 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 灾难恢复)。SAP systems running in one Azure datacenter that replicate to another Azure datacenter (Azure-to-Azure disaster recovery). 有关详细信息,请参阅 Azure 到 Azure 复制体系结构For more information, see Azure-to-Azure replication architecture.
  • 本地 VMware(或物理)服务器上运行的 SAP 系统复制到 Azure 数据中心内的灾难恢复站点(VMware 到 Azure 灾难恢复)。SAP systems running on VMware (or physical) servers on-premises that replicate 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 系统复制到 Azure 数据中心内的灾难恢复站点(Hyper-V 到 Azure 灾难恢复)。SAP systems running on Hyper-V on-premises that replicate 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 灾难恢复方案演示 Site Recovery 的 SAP 灾难恢复功能。In this article, we use an Azure-to-Azure disaster recovery scenario to demonstrate 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 中运行的 Active Directory 域控制器和 DNS 服务器At least one 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 shows running SAP NetWeaver in a Windows environment on Azure with high availability. 此体系结构是使用可根据组织需求更改的特定虚拟机 (VM) 大小来部署的。This architecture is deployed with specific virtual machine (VM) sizes that can be changed to accommodate your organization’s needs.

典型 SAP 部署模式的示意图

灾难恢复注意事项Disaster Recovery considerations

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

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

Web 调度程序组件用作 SAP 应用程序服务器之间的 SAP 流量的负载均衡器。The Web Dispatcher component is used as a load balancer for SAP traffic among the SAP application servers. 为了实现 Web 调度程序组件的高可用性,在轮循机制配置中使用了 Azure 负载均衡器来实施并行 Web 调度程序设置,以便在均衡器池中的可用 Web 调度程序之间分配 HTTP(S) 流量。To achieve high availability for the Web Dispatcher component, Azure Load Balancer is used to implement the parallel Web Dispatcher setup in a round-robin configuration for HTTP(S) traffic distribution among the available Web Dispatchers in the balancer pool. 这将会使用 Azure Site Recovery(ASR) 进行复制,并且自动化脚本将用于在灾难恢复区域上配置负载均衡器。This will be replicated using Azure Site Recovery(ASR) and automation scripts will be used to configure load balancer on the disaster recovery region.

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

若要管理 ABAP 应用程序服务器的登录组,需使用 SMLG 事务。To manage logon groups for ABAP application servers, the SMLG transaction is used. 该事务使用 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 servers pool for SAPGUIs and RFC traffic. 这将会使用 Azure Site Recovery 进行复制This will be replicated using Azure Site Recovery

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

此参考体系结构在应用层中的 VM 上运行 Central Services。This reference architecture runs Central Services on VMs in the application tier. 如果将 Central Services 部署到单个 VM(高可用性不是一项要求时,通常采用这种部署方式),则它可能会成为潜在的单一故障点 (SPOF)。The Central Services is a potential single point of failure (SPOF) when deployed to a single VM—typical deployment when high availability is not a requirement.

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

备注

Azure Site Recovery 不会复制云见证,因此建议将云见证部署在灾难恢复区域中。Azure Site Recovery does not replicate the cloud witness therefore it is recommended to deploy the cloud witness in the disaster recovery region.

为了支持故障转移群集环境,SIOS DataKeeper Cluster Edition 会通过复制群集节点拥有的独立磁盘来执行群集共享卷功能。To support the failover cluster environment, SIOS DataKeeper Cluster Edition performs the cluster shared volume function by replicating independent disks owned by the cluster nodes. Azure 原生并不支持共享磁盘,因此需要 SIOS 提供的解决方案。Azure does not natively support shared disks and therefore requires solutions provided by SIOS.

处理群集的另一种方法是实现文件共享群集。Another way to handle clustering is to implement 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 共享具有高可用性。However, it is still recommended to ensure that the /sapmnt UNC share is highly available. 这可在 Central Services 实例上实现:将 Windows Server 故障转移群集与 Windows Server 2016 中的横向扩展文件服务器 (SOFS) 和存储空间直通 (S2D) 功能配合使用。This can be done on the Central Services instance by using Windows Server Failover Cluster with Scale Out File Server (SOFS) and the Storage Spaces Direct (S2D) feature in Windows Server 2016.

备注

当前 Azure Site Recovery 支持仅崩溃一致的点使用 SIOS Datakeeper 的存储空间直通和被动节点的虚拟机的复制Currently Azure Site Recovery support only crash consistent point replication of virtual machines using storage spaces direct and Passive node of SIOS Datakeeper

灾难恢复注意事项Disaster recovery considerations

可以使用 Azure Site Recovery 跨 Azure 区域安排整个 SAP 部署的故障转移。You can use Azure Site Recovery to orchestrate the fail over of full SAP deployment across Azure regions. 下面是设置灾难恢复的步骤Below 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

下面是此示例中使用的每个层的灾难恢复建议。Below 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 using Site recovery
SAP Application 服务器池SAP Application server pool 使用 Site Recovery 进行复制Replicate using Site recovery
SAP Central Services 群集SAP Central Services cluster 使用 Site Recovery 进行复制Replicate using Site recovery
Active Directory 虚拟机Active directory virtual machines Active Directory 复制Active directory replication
SQL 数据库服务器SQL database servers SQL Always On 复制SQL 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 地址的屏幕截图

创建恢复计划Creating 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.

将虚拟机添加到故障转移组Adding 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 分组。Click on '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 after the failover or during a test failover. 可将某些故障转移后的操作自动化。You can automate some post-failover operations. 例如,可在恢复计划中添加相应的脚本,来更新 DNS 条目,以及更改绑定和连接。For example, you can update the DNS entry and change bindings and connections by adding corresponding scripts to the recovery plan.

可以单击下面的“部署到 Azure”按钮,将最常用的 Azure Site Recovery 脚本部署到自动化帐户。You can deploy the most commonly used Azure Site Recovery scripts into your Automation account clicking the 'Deploy to Azure' button below. 使用任何已发布的脚本时,请确保遵循脚本中的指导。When you are using any published script, ensure you follow the guidance in the script.

部署到 AzureDeploy to Azure

  1. 将操作前脚本添加到“组 1”,以故障转移 SQL 可用性组。Add a pre-action script to 'Group 1' to failover SQL Availability group. 使用示例脚本中发布的“ASR-SQL-FailoverAG”脚本。Use the 'ASR-SQL-FailoverAG' script published in the sample scripts. 确保遵循脚本中的指导,并相应地在脚本中进行所需的更改。Ensure you 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 on the failed over virtual machines of Web tier (Group 1). 使用示例脚本中发布的“ASR-AddSingleLoadBalancer”脚本。Use the 'ASR-AddSingleLoadBalancer' script published in the sample scripts. 确保遵循脚本中的指导,并相应地在脚本中进行所需的更改。Ensure you follow the guidance in the script and make the required changes in the script appropriately.

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, to clean the failover environment, select 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