INSTALL PLUGIN group_replication Failed: "ERROR 1123 (HY000): Can't initialize function 'group_repli

(Doc ID 2264721.1)

MySQL Server - Version 5.7 and later
Information in this document applies to any platform.

SYMPTOMS

When attempting to install the Group Replication plugin with the INSTALL PLUGIN command:

mysql> INSTALL PLUGIN group_replication SONAME 'group_replication.so';
ERROR 1123 (HY000): Can't initialize function 'group_replication'; Plugin initialization function failed.

The error log shows errors like:

2017-05-07T01:22:22.731774Z 4 [ERROR] For the creation of replication channels the master info and relay log info repositories must be set to TABLE
2017-05-07T01:22:22.731774Z 4 [ERROR] Plugin group_replication reported: 'Failure during Group Replication handler initialization'
2017-05-07T01:22:22.731774Z 4 [ERROR] Plugin 'group_replication' init function returned error.
2017-05-07T01:22:22.731774Z 4 [Note] Shutting down plugin 'group_replication'
2017-05-07T01:22:22.731774Z 4 [ERROR] Plugin group_replication reported: 'Failure when cleaning Group Replication server state'
2017-05-07T01:22:22.731774Z 4 [ERROR] Plugin group_replication reported: 'Failure when unregistering the server state observers'
2017-05-07T01:22:22.731784Z 4 [ERROR] Plugin group_replication reported: 'Failure when unregistering the transactions state observers'
2017-05-07T01:22:22.731785Z 4 [ERROR] Plugin group_replication reported: 'Failure when unregistering the binlog state observers'

CAUSE

The error is caused by the configuration of MySQL not being prepared to support Group Replication.

The Group Replication plugin requires some non-default settings to work. So it is necessary to update the MySQL configuration file before it is possible to install the plugin.

The Group Replication requirements are :

  • Infrastructure:
    • Data must use the InnoDB storage engine (this is the default for tables created in MySQL 5.5 and later).
    • All tables must have an explicit primary key.
    • The network must use IPv4.
    • Group Replication is designed to be deployed in an environment where the network latency is low and the network bandwidth is high between the members.
  • MySQL Instance Configuration:
    • log_bin must be enabled (it is recommended to set it to an absolute path)
    • log_slave_updates must be enabled
    • binlog_format = ROW (this is the default in MySQL 5.7)
    • gtid_mode = ON
    • master_info_repository = TABLE
    • relay_log_info_repository = TABLE
    • transaction_write_set_extraction = XXHASH64

SOLUTION

In order to install the Group Replication plugin:

  1. Update the MySQL configuration file to fulfill the requirements listed above.
  2. Optionally set the plugin-load option or the plugin-load-add option to load the plugin.
  3. Optionally (recommended): Add the Group Replication options needed to the MySQL configuration file. If the Group Replication plugin is not installed through step 2., add the loose- prefix to allow MySQL to start without knowing the options yet.
  4. Restart MySQL.
  5. If the Group Replication plugin was not installed in step 2., use the INSTALL PLUGIN command to install the plugin.
  6. If necessary configure the Group Replication plugin.

An example of setting up a test Group Replication system can be found in Note 2212994.1.

猜你喜欢

转载自blog.csdn.net/j_ychen/article/details/90049887
今日推荐