8.4 中文镜像

MySQL 8.4 参考手册 · 中文镜像

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

打开官方英文原文 ↗

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

MySQL 8.4 参考手册 / 20 组复制
中文点击中文段落可显示 / 隐藏英文原文本页译文覆盖 100%

第 20 章 组复制Chapter 20 Group Replication

本章介绍 MySQL 8.4 中的组复制,以及如何安装、配置和监控组。MySQL 组复制使您能够创建弹性、高可用、容错的复制拓扑结构。This chapter explains Group Replication in MySQL 8.4, and how to install, configure and monitor groups. MySQL Group Replication enables you to create elastic, highly-available, fault-tolerant replication topologies.

组可以在单主模式下运行,并具有自动主节点选举功能,此时一次只能有一个服务器接受更新。或者,组可以部署在多主模式下,此时所有服务器都可以接受更新,即使它们是同时发出的更新。Groups can operate in a single-primary mode with automatic primary election, where only one server accepts updates at a time. Alternatively, groups can be deployed in multi-primary mode, where all servers can accept updates, even if they are issued concurrently.

有一个内置的组成员服务,它可以在任何时候保持组的视图一致,并对所有服务器可用。服务器可以离开和加入组,视图会相应更新。有时服务器可能会意外离开组,在这种情况下,故障检测机制会检测到这一情况并通知组视图已更改。这一切都是自动完成的。There is a built-in group membership service that keeps the view of the group consistent and available for all servers at any given point in time. Servers can leave and join the group and the view is updated accordingly. Sometimes servers can leave the group unexpectedly, in which case the failure detection mechanism detects this and notifies the group that the view has changed. This is all automatic.

组复制保证数据库服务持续可用。然而,需要理解的是,如果某个组成员不可用,连接到该组成员的客户端必须使用连接器、负载均衡器、路由器或某种形式的中间件重定向或切换到组中的其他服务器。组复制并没有内置的方法来实现这一点。例如,请参见 MySQL Router 8.4。Group Replication guarantees that the database service is continuously available. However, it is important to understand that if one of the group members becomes unavailable, the clients connected to that group member must be redirected, or failed over, to a different server in the group, using a connector, load balancer, router, or some form of middleware. Group Replication does not have an inbuilt method to do this. For example, see MySQL Router 8.4.

组复制作为 MySQL 服务器的一个插件提供。您可以按照本章的说明在希望加入组的每个服务器实例上配置该插件,启动组,并监视和管理该组。部署 MySQL 服务器实例组的另一种方法是使用 InnoDB 集群。Group Replication is provided as a plugin to MySQL Server. You can follow the instructions in this chapter to configure the plugin on each of the server instances that you want in the group, start up the group, and monitor and administer the group. An alternative way to deploy a group of MySQL server instances is by using InnoDB Cluster.

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.

本章的结构如下:The chapter is structured as follows: