- 20.1 组复制背景20.1 Group Replication Background
- 20.2 入门20.2 Getting Started
- 20.3 要求和限制20.3 Requirements and Limitations
- 20.4 监控组复制20.4 Monitoring Group Replication
- 20.5 组复制操作20.5 Group Replication Operations
- 20.5.1 配置在线组20.5.1 Configuring an Online Group
- 20.5.2 重启组20.5.2 Restarting a Group
- 20.5.3 事务一致性保证20.5.3 Transaction Consistency Guarantees
- 20.5.4 分布式恢复20.5.4 Distributed Recovery
- 20.5.5 对 IPv6 及混合 IPv6 和 IPv4 组的支持20.5.5 Support For IPv6 And For Mixed IPv6 And IPv4 Groups
- 20.5.6 在组复制中使用 MySQL 企业备份20.5.6 Using MySQL Enterprise Backup with Group Replication
- 20.6 组复制安全20.6 Group Replication Security
- 20.6.1 连接安全管理的通信堆栈20.6.1 Communication Stack for Connection Security Management
- 20.6.2 使用安全套接字层 (SSL) 保障组通信连接安全20.6.2 Securing Group Communication Connections with Secure Socket Layer (SSL)
- 20.6.3 保障分布式恢复连接安全20.6.3 Securing Distributed Recovery Connections
- 20.6.4 组复制 IP 地址权限20.6.4 Group Replication IP Address Permissions
- 20.7 组复制性能和故障排除20.7 Group Replication Performance and Troubleshooting
- 20.7.1 组通信线程的微调20.7.1 Fine Tuning the Group Communication Thread
- 20.7.2 流量控制20.7.2 Flow Control
- 20.7.3 单一致性领导者20.7.3 Single Consensus Leader
- 20.7.4 消息压缩20.7.4 Message Compression
- 20.7.5 消息分片20.7.5 Message Fragmentation
- 20.7.6 XCom 缓存管理20.7.6 XCom Cache Management
- 20.7.7 对故障检测和网络分区的响应20.7.7 Responses to Failure Detection and Network Partitioning
- 20.7.8 处理网络分区和法定人数丢失20.7.8 Handling a Network Partition and Loss of Quorum
- 20.7.9 使用性能模式内存仪表监控组复制内存使用情况20.7.9 Monitoring Group Replication Memory Usage with Performance Schema Memory Instrumentation
- 20.8 升级组复制20.8 Upgrading Group Replication
- 20.9 组复制变量20.9 Group Replication Variables
- 20.10 常见问题解答20.10 Frequently Asked Questions
本章介绍 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.
要部署多个 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:
第 20.1 节,“组复制背景” 介绍了组的概念以及组复制的工作原理。Section 20.1, “Group Replication Background” provides an introduction to groups and how Group Replication works.
第 20.2 节,“入门” 说明了如何配置多个 MySQL 服务器实例以创建一个组。Section 20.2, “Getting Started” explains how to configure multiple MySQL Server instances to create a group.
第 20.3 节,“要求和限制” 解释了组复制的架构和设置要求及限制。Section 20.3, “Requirements and Limitations” explains architecture and setup requirements and limitations for Group Replication.
第 20.4 节,“监控组复制” 解释了如何监控一个组。Section 20.4, “Monitoring Group Replication” explains how to monitor a group.
第 20.5 节,“组复制操作” 解释了如何操作一个组。Section 20.5, “Group Replication Operations” explains how to work with a group.
第 20.6 节,“组复制安全” 解释了如何保护一个组。Section 20.6, “Group Replication Security” explains how to secure a group.
第 20.7 节,“组复制性能与故障排除” 解释了如何对一个组进行性能优化。Section 20.7, “Group Replication Performance and Troubleshooting” explains how to fine tune performance for a group.
第 20.8 节,“升级组复制” 解释了如何升级一个组。Section 20.8, “Upgrading Group Replication” explains how to upgrade a group.
第 20.9 节,“组复制变量” 是特定于组复制的系统变量参考。Section 20.9, “Group Replication Variables” is a reference for the system variables specific to Group Replication.
第 20.10 节,“常见问题解答” 提供了有关部署和运行组复制的一些技术问题的答案。Section 20.10, “Frequently Asked Questions” provides answers to some technical questions about deploying and operating Group Replication.