Documentation Home
MySQL 5.7 Reference Manual
Related Documentation Download this Manual
PDF (US Ltr) - 35.1Mb
PDF (A4) - 35.2Mb
Man Pages (TGZ) - 256.4Kb
Man Pages (Zip) - 361.2Kb
Info (Gzip) - 3.4Mb
Info (Zip) - 3.4Mb
Excerpts from this Manual

17.2.1.3 User Credentials

Group Replication uses the asynchronous replication protocol to achieveSection 17.9.5, “Distributed Recovery”, synchronizing group members before joining them to the group. The distributed recovery process relies on a replication channel namedgroup_replication_recovery which is used to transfer transactions from donor members to members that join the group. Therefore you need to set up a replication user with the correct permissions so that Group Replication can establish direct member-to-member recovery replication channels.

Start the MySQL server instance and then connect a client to it. Create a MySQL user with theREPLICATION SLAVE privilege. This process can be captured in the binary log and then you can rely on distributed recovery to replicate the statements used to create the user. Alternatively, you can disable binary logging usingSET SQL_LOG_BIN=0; and then create the user manually on each member, for example if you want to avoid the changes being propagated to other server instances. If you do decide to disable binary logging, ensure you renable it once you have configured the user.

In the following example the userrpl_user with the passwordpassword is shown. When configuring your servers use a suitable user name and password.

mysql> CREATE USERrpl_user@'%' IDENTIFIED BY 'password';mysql> GRANT REPLICATION SLAVE ON *.* TOrpl_user@'%';mysql> FLUSH PRIVILEGES;

If binary logging was disabled, enable it again once the user has been created usingSET SQL_LOG_BIN=1;.

Once the user has been configured, use theCHANGE MASTER TO statement to configure the server to use the given credentials for thegroup_replication_recovery replication channel the next time it needs to recover its state from another member. Issue the following, replacingrpl_user andpassword with the values used when creating the user.

mysql> CHANGE MASTER TO MASTER_USER='rpl_user', MASTER_PASSWORD='password' \\      FOR CHANNEL 'group_replication_recovery';

Distributed recovery is the first step taken by a server that joins the group and does not have the same set of transactions as the group members. If these credentials are not set correctly for thegroup_replication_recovery replication channel and therpl_user as shown, the server cannot connect to the donor members and run the distributed recovery process to gain synchrony with the other group members, and hence ultimately cannot join the group. SeeSection 17.9.5, “Distributed Recovery”.

Similarly, if the server cannot correctly identify the other members via the server'shostname the recovery process can fail. It is recommended that operating systems running MySQL have a properly configured uniquehostname, either using DNS or local settings. Thishostname can be verified in theMember_host column of theperformance_schema.replication_group_members table. If multiple group members externalize a defaulthostname set by the operating system, there is a chance of the member not resolving to the correct member address and not being able to join the group. In such a situation usereport_host to configure a uniquehostname to be externalized by each of the servers.