使用 Azure 门户将 Azure Database for MySQL 服务器移到另一个区域Move an Azure Database for MySQL server to another region by using the Azure portal

备注

将要查看的是 Azure Database for MySQL 的新服务。You are viewing the new service of Azure Database for MySQL. 若要查看经典 MySQL Database for Azure 的文档,请访问此页To view the documentation for classic MySQL Database for Azure, please visit this page.

将现有 Azure Database for MySQL 服务器从一个区域移到另一个区域的方案有多种。There are various scenarios for moving an existing Azure Database for MySQL server from one region to another. 例如,可以按照灾难恢复计划将生产服务器移到另一个区域。For example, you might want to move a production server to another region as part of your disaster recovery planning.

可以使用 Azure Database for MySQL 跨区域只读副本来完成移到另一个区域的操作。You can use an Azure Database for MySQL cross-region read replica to complete the move to another region. 为此,请先在目标区域中创建一个只读副本。To do so, first create a read replica in the target region. 接下来,停止到只读副本服务器的复制,使其成为同时接受读取和写入流量的独立服务器。Next, stop replication to the read replica server to make it a standalone server that accepts both read and write traffic.

备注

本文重点介绍如何将服务器移到不同的区域。This article focuses on moving your server to a different region. 若要将服务器移到其他资源组或订阅,请参阅移动一文。If you want to move your server to a different resource group or subscription, refer to the move article.

先决条件Prerequisites

  • 只读副本功能仅适用于“常规用途”或“内存优化”定价层中的 Azure Database for MySQL 服务器。The read replica feature is only available for Azure Database for MySQL servers in the General Purpose or Memory Optimized pricing tiers. 请确保源服务器位于其中一个定价层中。Ensure the source server is in one of these pricing tiers.

  • 请确保 Azure Database for MySQL 源服务器位于要从中移动的 Azure 区域中。Make sure that your Azure Database for MySQL source server is in the Azure region that you want to move from.

准备移动Prepare to move

若要使用 Azure 门户在目标区域中创建跨区域只读副本服务器,请使用以下步骤:To create a cross-region read replica server in the target region using the Azure portal, use the following steps:

  1. 登录到 Azure 门户Sign into the Azure portal.
  2. 选择要用作源服务器的现有 Azure Database for MySQL 服务器。Select the existing Azure Database for MySQL server that you want to use as the source server. 此操作将打开“概述”页。This action opens the Overview page.
  3. 从菜单中的“设置”下,选择“复制”。Select Replication from the menu, under SETTINGS.
  4. 选择“添加副本”。Select Add Replica.
  5. 输入副本服务器的名称。Enter a name for the replica server.
  6. 选择副本服务器的位置。Select the location for the replica server. 默认位置与主服务器的位置相同。The default location is the same as the master server's. 验证是否已选择要在其中部署副本的目标位置。Verify that you've selected the target location where you want the replica to be deployed.
  7. 选择“确定”以确认创建该副本。Select OK to confirm creation of the replica. 在创建副本的过程中,数据将从源服务器复制到副本。During replica creation, data is copied from the source server to the replica. 创建时间可能会持续几分钟或更长时间,这与源服务器的大小成正比。Create time may last several minutes or more, in proportion to the size of the source server.

备注

创建副本时,该副本不会继承主服务器的 VNet 服务终结点。When you create a replica, it doesn't inherit the VNet service endpoints of the master server. 必须单独为副本设置这些规则。These rules must be set up independently for the replica.

移动Move

重要

独立服务器不能再次成为副本。The standalone server can't be made into a replica again. 在只读副本上停止复制之前,请确保副本包含所需的全部数据。Before you stop replication on a read replica, ensure the replica has all the data that you require.

停止复制到副本服务器,使其成为独立服务器。Stopping replication to the replica server, causes it to become a standalone server. 若要停止从 Azure 门户复制到副本的操作,请使用以下步骤:To stop replication to the replica from the Azure portal, use the following steps:

  1. 创建副本后,查找并选择你的 Azure Database for MySQL 源服务器。Once the replica has been created, locate and select your Azure Database for MySQL source server.
  2. 从菜单中的“设置”下,选择“复制”。Select Replication from the menu, under SETTINGS.
  3. 选择副本服务器。Select the replica server.
  4. 选择“停止复制”。Select Stop replication.
  5. 通过单击“确定”,确认要停止复制。Confirm you want to stop replication by clicking OK.

清除源服务器Clean up source server

你可能想要删除 Azure Database for MySQL 源服务器。You may want to delete the source Azure Database for MySQL server. 为此,请使用以下步骤:To do so, use the following steps:

  1. 创建副本后,查找并选择你的 Azure Database for MySQL 源服务器。Once the replica has been created, locate and select your Azure Database for MySQL source server.
  2. 在“概览”窗口中,选择“删除”。 In the Overview window, select Delete.
  3. 键入源服务器的名称,确认你要删除它。Type in the name of the source server to confirm you want to delete.
  4. 选择“删除” 。Select Delete.

后续步骤Next steps

在本教程中,你已使用 Azure 门户将 Azure Database for MySQL 服务器从一个区域移到了另一个区域,然后清理了不再需要的源资源。In this tutorial, you moved an Azure Database for MySQL server from one region to another by using the Azure portal and then cleaned up the unneeded source resources.