Rechercher dans le manuel MySQL
17.3.11.2 Semisynchronous Replication Installation and Configuration
Semisynchronous replication is implemented using plugins, so the plugins must be installed into the server to make them available. After a plugin has been installed, you control it by means of the system variables associated with it. These system variables are unavailable until the associated plugin has been installed.
This section describes how to install the semisynchronous replication plugins. For general information about installing plugins, see Section 5.6.1, “Installing and Uninstalling Plugins”.
To use semisynchronous replication, the following requirements must be satisfied:
The capability of installing plugins requires a MySQL server that supports dynamic loading. To verify this, check that the value of the
have_dynamic_loading
system variable isYES
. Binary distributions should support dynamic loading.Replication must already be working, see Section 17.1, “Configuring Replication”.
There must not be multiple replication channels configured. Semisynchronous replication is only compatible with the default replication channel. See Section 17.2.3, “Replication Channels”.
To set up semisynchronous replication, use the following
instructions. The INSTALL PLUGIN
,
SET
GLOBAL
, STOP SLAVE
, and
START SLAVE
statements mentioned
here require the
REPLICATION_SLAVE_ADMIN
or
SUPER
privilege.
MySQL distributions include semisynchronous replication plugin files for the master side and the slave side.
To be usable by a master or slave server, the appropriate plugin
library file must be located in the MySQL plugin directory (the
directory named by the
plugin_dir
system variable). If
necessary, configure the plugin directory location by setting
the value of plugin_dir
at
server startup.
The plugin library file base names are
semisync_master
and
semisync_slave
. The file name suffix differs
per platform (for example, .so
for Unix and
Unix-like systems, .dll
for Windows).
The master plugin library file must be present in the plugin directory of the master server. The slave plugin library file must be present in the plugin directory of each slave server.
To load the plugins, use the INSTALL
PLUGIN
statement on the master and on each slave that
is to be semisynchronous (adjust the .so
suffix for your platform as necessary).
On the master:
On each slave:
If an attempt to install a plugin results in an error on Linux
similar to that shown here, you must install
libimf
:
- ERROR 1126 (HY000): Can't open shared library
- (errno: 22 libimf.so: cannot open shared object file:
- No such file or directory)
You can obtain libimf
from
https://dev.mysql.com/downloads/os-linux.html.
To see which plugins are installed, use the
SHOW PLUGINS
statement, or query
the INFORMATION_SCHEMA.PLUGINS
table.
To verify plugin installation, examine the
INFORMATION_SCHEMA.PLUGINS
table or
use the SHOW PLUGINS
statement
(see Section 5.6.2, “Obtaining Server Plugin Information”). For
example:
- FROM INFORMATION_SCHEMA.PLUGINS
- +----------------------+---------------+
- | PLUGIN_NAME | PLUGIN_STATUS |
- +----------------------+---------------+
- | rpl_semi_sync_master | ACTIVE |
- +----------------------+---------------+
If the plugin fails to initialize, check the server error log for diagnostic messages.
After a semisynchronous replication plugin has been installed, it is disabled by default. The plugins must be enabled both on the master side and the slave side to enable semisynchronous replication. If only one side is enabled, replication will be asynchronous.
To control whether an installed plugin is enabled, set the
appropriate system variables. You can set these variables at
runtime using SET
GLOBAL
, or at server startup on the command line or in
an option file.
At runtime, these master-side system variables are available:
On the slave side, this system variable is available:
For
rpl_semi_sync_master_enabled
or
rpl_semi_sync_slave_enabled
,
the value should be 1 to enable semisynchronous replication or 0
to disable it. By default, these variables are set to 0.
For
rpl_semi_sync_master_timeout
,
the value N
is given in milliseconds.
The default value is 10000 (10 seconds).
If you enable semisynchronous replication on a slave at runtime, you must also start the slave I/O thread (stopping it first if it is already running) to cause the slave to connect to the master and register as a semisynchronous slave:
- STOP SLAVE IO_THREAD;
- START SLAVE IO_THREAD;
If the I/O thread is already running and you do not restart it, the slave continues to use asynchronous replication.
At server startup, the variables that control semisynchronous
replication can be set as command-line options or in an option
file. A setting listed in an option file takes effect each time
the server starts. For example, you can set the variables in
my.cnf
files on the master and slave sides
as follows.
On the master:
[mysqld]
rpl_semi_sync_master_enabled=1
rpl_semi_sync_master_timeout=1000 # 1 second
On each slave:
[mysqld]
rpl_semi_sync_slave_enabled=1
Deutsche Übersetzung
Sie haben gebeten, diese Seite auf Deutsch zu besuchen. Momentan ist nur die Oberfläche übersetzt, aber noch nicht der gesamte Inhalt.Wenn Sie mir bei Übersetzungen helfen wollen, ist Ihr Beitrag willkommen. Alles, was Sie tun müssen, ist, sich auf der Website zu registrieren und mir eine Nachricht zu schicken, in der Sie gebeten werden, Sie der Gruppe der Übersetzer hinzuzufügen, die Ihnen die Möglichkeit gibt, die gewünschten Seiten zu übersetzen. Ein Link am Ende jeder übersetzten Seite zeigt an, dass Sie der Übersetzer sind und einen Link zu Ihrem Profil haben.
Vielen Dank im Voraus.
Dokument erstellt 26/06/2006, zuletzt geändert 26/10/2018
Quelle des gedruckten Dokuments:https://www.gaudry.be/de/mysql-rf-replication-semisync-installation.html
Die Infobro ist eine persönliche Seite, deren Inhalt in meiner alleinigen Verantwortung liegt. Der Text ist unter der CreativeCommons-Lizenz (BY-NC-SA) verfügbar. Weitere Informationen auf die Nutzungsbedingungen und dem Autor.
Referenzen
Diese Verweise und Links verweisen auf Dokumente, die während des Schreibens dieser Seite konsultiert wurden, oder die zusätzliche Informationen liefern können, aber die Autoren dieser Quellen können nicht für den Inhalt dieser Seite verantwortlich gemacht werden.
Der Autor Diese Website ist allein dafür verantwortlich, wie die verschiedenen Konzepte und Freiheiten, die mit den Nachschlagewerken gemacht werden, hier dargestellt werden. Denken Sie daran, dass Sie mehrere Quellinformationen austauschen müssen, um das Risiko von Fehlern zu reduzieren.