O'Reilly logo

MySQL 8 Cookbook by Karthik Appigatla

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

How to do it...

On a high level, you need to install and enable semi-synchronous plugins on both the master and all slaves where you want semi-synchronous replication. You have to restart the slave IO thread to bring the changes into effect. You can adjust the value of rpl_semi_sync_master_timeout according to your network and application. A value of 1 second is a good start:

  1. On the master, install the rpl_semi_sync_master plugin:
mysql> INSTALL PLUGIN rpl_semi_sync_master SONAME 'semisync_master.so';Query OK, 0 rows affected (0.86 sec)

Verify that the plugin is activated:

mysql> SELECT PLUGIN_NAME, PLUGIN_STATUS FROM INFORMATION_SCHEMA.PLUGINS WHERE PLUGIN_NAME LIKE '%semi%';+----------------------+---------------+| PLUGIN_NAME | PLUGIN_STATUS ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required