Rechercher dans le manuel MySQL
17.4.9.2 Asynchronous Connection Failover for Replicas
From MySQL 8.0.27, asynchronous connection failover for replicas
is automatically activated for a replication channel on a Group
Replication primary when you set
SOURCE_CONNECTION_AUTO_FAILOVER=1
on the
CHANGE REPLICATION SOURCE
TO
statement for the channel. The feature is designed
for a group of senders and a group of receivers to keep
synchronized with each other even when some members are
temporarily unavailable. When the feature is active and
correctly configured, if the primary that is replicating goes
offline or into an error state, the new primary starts
replication on the same channel when it is elected. The new
primary uses the source list for the channel to select the
source with the highest priority (weight) setting, which might
not be the same as the original source.
To configure this feature, the replication channel and the
replication user account and password for the channel must be
set up on all the member servers in the replication group, and
on any new joining members. Ensure that the
SOURCE_RETRY_COUNT
and
SOURCE_CONNECT_RETRY
settings are set to
minimal numbers that just allow a few retry attempts, for
example 3 and 10. You can set up the replication channel using
the CHANGE REPLICATION SOURCE
TO
statement, or if the new servers are provisioned
using MySQL’s clone functionality, this all happens
automatically. The
SOURCE_CONNECTION_AUTO_FAILOVER
setting for
the channel is broadcast to group members from the primary when
they join. If you later disable
SOURCE_CONNECTION_AUTO_FAILOVER
for the
channel on the primary, this is also broadcast to the secondary
servers, and they change the status of the channel to match.
Asynchronous connection failover for replicas is activated and
deactivated using the Group Replication member action
mysql_start_failover_channels_if_primary
,
which is enabled by default. You can disable it for the whole
group by disabling that member action on the primary, using the
group_replication_disable_member_action
function, as in this example:
mysql> SELECT group_replication_disable_member_action("mysql_start_failover_channels_if_primary", "AFTER_PRIMARY_ELECTION");
The function can only be changed on a primary, and must be
enabled or disabled for the whole group, so you cannot have some
members providing failover and others not. When the
mysql_start_failover_channels_if_primary
member action is disabled, the channel does not need to be
configured on secondary members, but if the primary goes offline
or into an error state, replication stops for the channel. Note
that if there is more than one channel with
SOURCE_CONNECTION_AUTO_FAILOVER=1
, the
member action covers all the channels, so they cannot be
individually enabled and disabled by that method. Set
SOURCE_CONNECTION_AUTO_FAILOVER=0
on the
primary to disable an individual channel.
The source list for a channel with
SOURCE_CONNECTION_AUTO_FAILOVER=1
is
broadcast to all group members when they join, and also when it
changes. This is the case whether the sources are a managed
group for which the membership is updated automatically, or
whether they are added or changed manually using the
asynchronous_connection_failover_add_source()
,
asynchronous_connection_failover_delete_source()
,
asynchronous_connection_failover_add_managed()
or
asynchronous_connection_failover_delete_managed()
functions. All group members receive the current source list as
recorded in the
mysql.replication_asynchronous_connection_failover
and
mysql.replication_asynchronous_connection_failover_managed
tables. Because the sources do not have to be in a managed
group, you can set up the function to synchronize a group of
receivers with one or more alternative standalone senders, or
even a single sender. However, a standalone replica that is not
part of a replication group cannot use this feature.
Traduction non disponible
Le manuel MySQL n'est pas encore traduit en français sur l'infobrol. Seule la version anglaise est disponible pour l'instant.
Document créé le 26/06/2006, dernière modification le 26/10/2018
Source du document imprimé : https://www.gaudry.be/mysql-rf-replication-asynchronous-connection-failover-replica.html
L'infobrol est un site personnel dont le contenu n'engage que moi. Le texte est mis à disposition sous licence CreativeCommons(BY-NC-SA). Plus d'info sur les conditions d'utilisation et sur l'auteur.
Références
Ces références et liens indiquent des documents consultés lors de la rédaction de cette page, ou qui peuvent apporter un complément d'information, mais les auteurs de ces sources ne peuvent être tenus responsables du contenu de cette page.
L'auteur de ce site est seul responsable de la manière dont sont présentés ici les différents concepts, et des libertés qui sont prises avec les ouvrages de référence. N'oubliez pas que vous devez croiser les informations de sources multiples afin de diminuer les risques d'erreurs.