mysql 只读副本_管理只读副本 - Azure 门户 - Azure Database for MySQL | Azure Docs

如何使用 Azure 门户在 Azure Database for MySQL 中创建和管理只读副本How to create and manage read replicas in Azure Database for MySQL using the Azure portal

11/09/2020

本文内容

备注

将要查看的是 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 门户在 Azure Database for MySQL 服务中创建和管理只读副本。In this article, you will learn how to create and manage read replicas in the Azure Database for MySQL service using the Azure portal.

先决条件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.

创建只读副本Create a read replica

重要

如果为没有现有副本的源服务器创建副本,源服务器将首先重启,以便为复制做好准备。When you create a replica for a source that has no existing replicas, the source will first restart to prepare itself for replication. 请考虑这一点并在非高峰期执行这些操作。Take this into consideration and perform these operations during an off-peak period.

可以使用以下步骤创建只读副本服务器:A read replica server can be created using the following steps:

选择要用作主服务器的现有 Azure Database for MySQL 服务器。Select the existing Azure Database for MySQL server that you want to use as a master. 此操作将打开“概述”页。This action opens the Overview page.

从菜单中的“设置”下,选择“复制”。Select Replication from the menu, under SETTINGS.

选择“添加副本”。Select Add Replica.

c892478a7657b2a6d4419371bc71f557.png

输入副本服务器的名称。Enter a name for the replica server.

ad2bd5267ed71e977d82531336044071.png

选择副本服务器的位置。Select the location for the replica server. 默认位置与源服务器的位置相同。The default location is the same as the source server's.

a93ece145e03e7fb652416a109275684.png

备注

若要详细了解可以在哪些区域中创建副本,请访问只读副本概念文章。To learn more about which regions you can create a replica in, visit the read replica concepts article.

选择“确定”以确认创建副本。Select OK to confirm creation of the replica.

备注

只读副本使用与主服务器相同的服务器配置创建。Read replicas are created with the same server configuration as the master. 副本服务器配置在创建后可以更改。The replica server configuration can be changed after it has been created. 始终在与源服务器相同的资源组和订阅中创建副本服务器。The replica server is always created in the same resource group and same subscription as the source server. 如果要将副本服务器创建到不同的资源组或不同的订阅,可以在创建后移动副本服务器。If you want to create a replica server to a different resource group or different subscription, you can move the replica server after creation. 建议副本服务器的配置应保持在与源服务器相同或更大的值,以确保副本能够跟上主服务器。It is recommended that the replica server's configuration should be kept at equal or greater values than the source to ensure the replica is able to keep up with the master.

一旦创建副本服务器,可以从“复制”边栏选项卡中进行查看。Once the replica server has been created, it can be viewed from the Replication blade.

aeedfc5d9bfeb730f71f13930a1b976d.png

停止复制到副本服务器Stop replication to a replica server

重要

停止复制到服务器操作不可逆。Stopping replication to a server is irreversible. 一旦源服务器和副本服务器之间的复制停止,将无法撤消它。Once replication has stopped between a source and replica, it cannot be undone. 然后,副本服务器将成为独立服务器,并且现在支持读取和写入。The replica server then becomes a standalone server and now supports both read and writes. 此服务器不能再次成为副本服务器。This server cannot be made into a replica again.

若要从 Azure 门户停止源服务器和副本服务器之间的复制,请使用以下步骤:To stop replication between a source and a replica server from the Azure portal, use the following steps:

在 Azure 门户中,选择源 Azure Database for MySQL 服务器。In the Azure portal, select your source Azure Database for MySQL server.

从菜单中的“设置”下,选择“复制”。Select Replication from the menu, under SETTINGS.

选择要停止复制的副本服务器。Select the replica server you wish to stop replication for.

a6aca611031bab661a89514fbf3ecdaf.png

选择“停止复制”。Select Stop replication.

c1a53adeb671de076ba3ddca2ed54a59.png

通过单击“确定”,确认要停止复制。Confirm you want to stop replication by clicking OK.

bf94afb6773a11d521513ad730df55e7.png

删除副本服务器Delete a replica server

若要从 Azure 门户删除只读副本服务器,请使用以下步骤:To delete a read replica server from the Azure portal, use the following steps:

在 Azure 门户中,选择源 Azure Database for MySQL 服务器。In the Azure portal, select your source Azure Database for MySQL server.

从菜单中的“设置”下,选择“复制”。Select Replication from the menu, under SETTINGS.

选择要删除的副本服务器。Select the replica server you wish to delete.

061d59cbc9b73bb9719c3e2a93a8b701.png

选择“删除副本”Select Delete replica

6f180e0d19a188096e3351a21574b631.png

键入副本的名称,然后单击“删除”以确认删除副本。Type the name of the replica and click Delete to confirm deletion of the replica.

277dee5a334d934c046049fe757a33fc.png

删除源服务器Delete a source server

重要

删除源服务器会停止复制到所有副本服务器,并删除源服务器本身。Deleting a source server stops replication to all replica servers and deletes the source server itself. 副本服务器成为现在支持读取和写入的独立服务器。Replica servers become standalone servers that now support both read and writes.

若要从 Azure 门户删除源服务器,请使用以下步骤:To delete a source server from the Azure portal, use the following steps:

在 Azure 门户中,选择源 Azure Database for MySQL 服务器。In the Azure portal, select your source Azure Database for MySQL server.

从“概览”中,选择“删除”。From the Overview , select Delete.

cb8ce1f5be5bed12eccb6faf42f7c2c4.png

键入源服务器的名称,然后单击“删除”以确认删除源服务器。Type the name of the source server and click Delete to confirm deletion of the source server.

058ce5799cee681856a6b4caa757f522.png

监视复制Monitor replication

在 Azure 门户中,选择要监视的副本 Azure Database for MySQL 服务器。In the Azure portal, select the replica Azure Database for MySQL server you want to monitor.

在边栏的“监视”部分,选择“指标”:Under the Monitoring section of the sidebar, select Metrics :

从可用指标的下拉列表中选择“复制延迟(秒)”。Select Replication lag in seconds from the dropdown list of available metrics.

2f9e3bedc2a8541763138e76814e0be8.png

选择要查看的时间范围。Select the time range you wish to view. 下图选择 30 分钟的时间范围。The image below selects a 30 minute time range.

c014a124729196a0739a6e6f54f8d276.png

查看所选时间范围的复制延迟时间。View the replication lag for the selected time range. 下图显示过去的 30 分钟。The image below displays the last 30 minutes.

c3f84ff6033cfa52183a52b3d49f4a6c.png

后续步骤Next steps

详细了解只读副本Learn more about read replicas

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值