8.4 中文镜像

MySQL 8.4 参考手册 · 中文镜像

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

打开官方英文原文 ↗

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

MySQL 8.4 参考手册 / 19 复制 / 19.1 配置复制 / 19.1.2 设置基于二进制日志文件位置的复制
中文点击中文段落可显示 / 隐藏英文原文本页译文覆盖 100%

19.1.2 基于二进制日志文件位置设置复制19.1.2 Setting Up Binary Log File Position Based Replication

本节介绍如何设置 MySQL 服务器以使用基于二进制日志文件位置的复制。设置复制的方法有多种,具体使用哪种方法取决于您如何设置复制,以及源数据库中是否已有您希望复制的数据。This section describes how to set up a MySQL server to use binary log file position based replication. There are a number of different methods for setting up replication, and the exact method to use depends on how you are setting up replication, and whether you already have data in the database on the source that you want to replicate.

Tip

要部署多个 MySQL 实例,您可以使用 InnoDB 集群,它使您能够在 MySQL Shell 中轻松管理一组 MySQL 服务器实例。InnoDB 集群在编程环境中封装了 MySQL 群组复制,使您可以轻松部署 MySQL 实例集群以实现高可用性。此外,InnoDB 集群可以与 MySQL Router 无缝接口,使您的应用程序无需编写自己的故障转移流程即可连接到集群。然而,对于不需要高可用性的类似用例,您可以使用 InnoDB 副本集。MySQL Shell 的安装说明可以在 这里 找到。To deploy multiple instances of MySQL, you can use InnoDB Cluster which enables you to easily administer a group of MySQL server instances in MySQL Shell. InnoDB Cluster wraps MySQL Group Replication in a programmatic environment that enables you easily deploy a cluster of MySQL instances to achieve high availability. In addition, InnoDB Cluster interfaces seamlessly with MySQL Router, which enables your applications to connect to the cluster without writing your own failover process. For similar use cases that do not require high availability, however, you can use InnoDB ReplicaSet. Installation instructions for MySQL Shell can be found here.

有一些通用任务适用于所有配置:There are some generic tasks that are common to all setups:

Note

设置过程中的某些步骤需要 SUPER 权限。如果您没有此权限,可能无法启用复制。Certain steps within the setup process require the SUPER privilege. If you do not have this privilege, it might not be possible to enable replication.

配置基本选项后,选择您的场景:After configuring the basic options, select your scenario:

在管理 MySQL 复制服务器之前,请阅读本章的全部内容,并尝试 第 15.4.1 节,“用于控制源服务器的 SQL 语句” 和 第 15.4.2 节,“用于控制副本服务器的 SQL 语句” 中提到的所有语句。同时熟悉 第 19.1.6 节,“复制及二进制日志选项和变量” 中描述的复制启动选项。Before administering MySQL replication servers, read this entire chapter and try all statements mentioned in Section 15.4.1, “SQL Statements for Controlling Source Servers”, and Section 15.4.2, “SQL Statements for Controlling Replica Servers”. Also familiarize yourself with the replication startup options described in Section 19.1.6, “Replication and Binary Logging Options and Variables”.