Rechercher dans le manuel MySQL
18.2.1.5 Bootstrapping the Group
The process of starting a group for the first time is called
bootstrapping. You use the
group_replication_bootstrap_group
system variable to bootstrap a group. The bootstrap should only
be done by a single server, the one that starts the group and
only once. This is why the value of the
group_replication_bootstrap_group
option was not stored in the instance's option file. If it is
saved in the option file, upon restart the server automatically
bootstraps a second group with the same name. This would result
in two distinct groups with the same name. The same reasoning
applies to stopping and restarting the plugin with this option
set to ON
. Therefore to safely bootstrap the
group, connect to s1 and issue:
Once the START GROUP_REPLICATION
statement returns, the group has been started. You can check
that the group is now created and that there is one member in
it:
- +---------------------------+--------------------------------------+-------------+-------------+---------------+
- | CHANNEL_NAME | MEMBER_ID | MEMBER_HOST | MEMBER_PORT | MEMBER_STATE |
- +---------------------------+--------------------------------------+-------------+-------------+---------------+
- | group_replication_applier | ce9be252-2b71-11e6-b8f4-00212844f856 | s1 | 3306 | ONLINE |
- +---------------------------+--------------------------------------+-------------+-------------+---------------+
The information in this table confirms that there is a member in
the group with the unique identifier
ce9be252-2b71-11e6-b8f4-00212844f856
, that it
is ONLINE
and is at s1
listening for client connections on port
3306
.
For the purpose of demonstrating that the server is indeed in a group and that it is able to handle load, create a table and add some content to it.
Check the content of table t1
and the binary
log.
- +----+------+
- | c1 | c2 |
- +----+------+
- | 1 | Luis |
- +----+------+
- +---------------+-----+----------------+-----------+-------------+--------------------------------------------------------------------+
- | Log_name | Pos | Event_type | Server_id | End_log_pos | Info |
- +---------------+-----+----------------+-----------+-------------+--------------------------------------------------------------------+
- | binlog.000001 | 123 | Previous_gtids | 1 | 150 | |
- | binlog.000001 | 270 | View_change | 1 | 369 | view_id=14724817264259180:1 |
- | binlog.000001 | 899 | Table_map | 1 | 942 | table_id: 108 (test.t1) |
- | binlog.000001 | 942 | Write_rows | 1 | 984 | table_id: 108 flags: STMT_END_F |
- +---------------+-----+----------------+-----------+-------------+--------------------------------------------------------------------+
As seen above, the database and the table objects were created and their corresponding DDL statements were written to the binary log. Also, the data was inserted into the table and written to the binary log, so it can be used for distributed recovery by state transfer from a donor's binary log.
Document created the 26/06/2006, last modified the 26/10/2018
Source of the printed document:https://www.gaudry.be/en/mysql-rf-group-replication-bootstrap.html
The infobrol is a personal site whose content is my sole responsibility. The text is available under CreativeCommons license (BY-NC-SA). More info on the terms of use and the author.
References
These references and links indicate documents consulted during the writing of this page, or which may provide additional information, but the authors of these sources can not be held responsible for the content of this page.
The author This site is solely responsible for the way in which the various concepts, and the freedoms that are taken with the reference works, are presented here. Remember that you must cross multiple source information to reduce the risk of errors.