8.4 中文镜像

MySQL 8.4 参考手册 · 中文镜像

正文为中文,英文原文默认隐藏。点击任意中文段落即可展开 / 收起对应英文原文。

打开官方英文原文 ↗

译文由机器翻译生成,仅供理解参考;有疑问请以官方英文原文为准。

中文点击中文段落可显示 / 隐藏英文原文本页译文覆盖 100%

7.6.7 克隆插件7.6.7 The Clone Plugin

克隆插件允许从本地或远程 MySQL 服务器实例克隆数据。克隆的数据是存储在 InnoDB 中的数据的物理快照,包括模式、表、表空间和数据字典元数据。克隆的数据包含一个完全可用的数据目录,这允许使用克隆插件进行 MySQL 服务器的配置。The clone plugin permits cloning data locally or from a remote MySQL server instance. Cloned data is a physical snapshot of data stored in InnoDB that includes schemas, tables, tablespaces, and data dictionary metadata. The cloned data comprises a fully functional data directory, which permits using the clone plugin for MySQL server provisioning.

图 7.1 本地克隆操作Figure 7.1 Local Cloning Operation

The CLONE LOCAL statement clones the data directory on a local MySQL Server instance to another local directory, which is referred to as the clone directory.

本地克隆操作将数据从发起克隆操作的 MySQL 服务器实例克隆到同一服务器或运行 MySQL 服务器实例的节点上的目录中。A local cloning operation clones data from the MySQL server instance where the cloning operation is initiated to a directory on the same server or node where MySQL server instance runs.

图 7.2 远程克隆操作Figure 7.2 Remote Cloning Operation

The CLONE INSTANCE statement issued from the local recipient MySQL Server instance clones the data directory from the remote donor MySQL server instance to the data directory on the local recipient MySQL Server instance.

远程克隆操作涉及一个本地 MySQL 服务器实例(“接收端”),在此实例上启动克隆操作,以及一个远程 MySQL 服务器实例(“提供端”),源数据位于该实例。当在接收端启动远程克隆操作时,克隆的数据将通过网络从提供端传输到接收端。默认情况下,远程克隆操作在从提供端克隆数据之前,会删除接收端数据目录中现有的用户创建数据(模式、表、表空间)和二进制日志。可选地,您可以将数据克隆到接收端的不同目录,以避免删除当前接收端数据目录中的数据。A remote cloning operation involves a local MySQL server instance (the “recipient”) where the cloning operation is initiated, and a remote MySQL server instance (the “donor”) where the source data is located. When a remote cloning operation is initiated on the recipient, cloned data is transferred over the network from the donor to the recipient. By default, a remote cloning operation removes existing user-created data (schemas, tables, tablespaces) and binary logs from the recipient data directory before cloning data from the donor. Optionally, you can clone data to a different directory on the recipient to avoid removing data from the current recipient data directory.

对于本地克隆操作和远程克隆操作所克隆的数据没有区别。两种操作克隆的数据集是相同的。There is no difference with respect to data that is cloned by a local cloning operation as compared to a remote cloning operation. Both operations clone the same set of data.

克隆插件支持复制。除了克隆数据之外,克隆操作还会从源服务器提取并传输复制坐标到目标服务器,从而实现使用克隆插件为群组复制成员和副本提供资源。使用克隆插件进行资源分配比复制大量事务要快得多且更高效(参见第 7.6.7.7 节,“克隆用于复制”)。群组复制成员也可以配置为使用克隆插件作为替代恢复方法,使成员能够自动选择从种子成员检索群组数据的最有效方式。更多信息,请参见第 20.5.4.2 节,“分布式恢复的克隆”。The clone plugin supports replication. In addition to cloning data, a cloning operation extracts and transfers replication coordinates from the donor and applies them on the recipient, which enables using the clone plugin for provisioning Group Replication members and replicas. Using the clone plugin for provisioning is considerably faster and more efficient than replicating a large number of transactions (see Section 7.6.7.7, “Cloning for Replication”). Group Replication members can also be configured to use the clone plugin as an alternative method of recovery, so that members automatically choose the most efficient way to retrieve group data from seed members. For more information, see Section 20.5.4.2, “Cloning for Distributed Recovery”.

克隆插件支持加密和页面压缩数据的克隆。请参见 第 7.6.7.5 节,“克隆加密数据”,以及 第 7.6.7.6 节,“克隆压缩数据”。The clone plugin supports cloning of encrypted and page-compressed data. See Section 7.6.7.5, “Cloning Encrypted Data”, and Section 7.6.7.6, “Cloning Compressed Data”.

必须先安装克隆插件才能使用它。有关安装说明,请参见 第 7.6.7.1 节,“安装克隆插件”。有关克隆说明,请参见 第 7.6.7.2 节,“本地克隆数据”,以及 第 7.6.7.3 节,“远程克隆数据”。The clone plugin must be installed before you can use it. For installation instructions, see Section 7.6.7.1, “Installing the Clone Plugin”. For cloning instructions, see Section 7.6.7.2, “Cloning Data Locally”, and Section 7.6.7.3, “Cloning Remote Data”.

提供了 Performance Schema 表和仪表用于监控克隆操作。请参阅 第 7.6.7.10 节,“监控克隆操作”。Performance Schema tables and instrumentation are provided for monitoring cloning operations. See Section 7.6.7.10, “Monitoring Cloning Operations”.