gpt4 book ai didi

在版本 5.7.19、5.7.21 中找不到 MySQL 组复制插件

转载 作者:可可西里 更新时间:2023-11-01 07:32:06 25 4
gpt4 key购买 nike

我正在尝试在 MySQL 5.7.21 上启用 MySQL 组复制插件,根据文档 (https://dev.mysql.com/doc/refman/5.7/en/group-replication.html),它应该在 5.7 中可用

$ mysql --version
mysql Ver 14.14 Distrib 5.7.21, for Linux (x86_64) using EditLine wrapper

当我尝试通过 MySQL 启用插件时:

$ mysql> INSTALL PLUGIN group_replication SONAME 'group_replication.so';
ERROR 1126 (HY000): Can't open shared library '/usr/lib/mysql/plugin/group_replication.so' (errno: 2 /usr/lib/mysql/plugin/group_replication.so: cannot open shared object file: No such file or directory)

我的插件在 MySQL 中的输出:

$ mysql> SHOW PLUGINS;
+----------------------------+----------+--------------------+---------+---------+
| Name | Status | Type | Library | License |
+----------------------------+----------+--------------------+---------+---------+
| binlog | ACTIVE | STORAGE ENGINE | NULL | GPL |
| mysql_native_password | ACTIVE | AUTHENTICATION | NULL | GPL |
| sha256_password | ACTIVE | AUTHENTICATION | NULL | GPL |
| CSV | ACTIVE | STORAGE ENGINE | NULL | GPL |
| MEMORY | ACTIVE | STORAGE ENGINE | NULL | GPL |
| InnoDB | ACTIVE | STORAGE ENGINE | NULL | GPL |
| INNODB_TRX | ACTIVE | INFORMATION SCHEMA | NULL | GPL |
| INNODB_LOCKS | ACTIVE | INFORMATION SCHEMA | NULL | GPL |
| INNODB_LOCK_WAITS | ACTIVE | INFORMATION SCHEMA | NULL | GPL |
| INNODB_CMP | ACTIVE | INFORMATION SCHEMA | NULL | GPL |
| INNODB_CMP_RESET | ACTIVE | INFORMATION SCHEMA | NULL | GPL |
| INNODB_CMPMEM | ACTIVE | INFORMATION SCHEMA | NULL | GPL |
| INNODB_CMPMEM_RESET | ACTIVE | INFORMATION SCHEMA | NULL | GPL |
| INNODB_CMP_PER_INDEX | ACTIVE | INFORMATION SCHEMA | NULL | GPL |
| INNODB_CMP_PER_INDEX_RESET | ACTIVE | INFORMATION SCHEMA | NULL | GPL |
| INNODB_BUFFER_PAGE | ACTIVE | INFORMATION SCHEMA | NULL | GPL |
| INNODB_BUFFER_PAGE_LRU | ACTIVE | INFORMATION SCHEMA | NULL | GPL |
| INNODB_BUFFER_POOL_STATS | ACTIVE | INFORMATION SCHEMA | NULL | GPL |
| INNODB_TEMP_TABLE_INFO | ACTIVE | INFORMATION SCHEMA | NULL | GPL |
| INNODB_METRICS | ACTIVE | INFORMATION SCHEMA | NULL | GPL |
| INNODB_FT_DEFAULT_STOPWORD | ACTIVE | INFORMATION SCHEMA | NULL | GPL |
| INNODB_FT_DELETED | ACTIVE | INFORMATION SCHEMA | NULL | GPL |
| INNODB_FT_BEING_DELETED | ACTIVE | INFORMATION SCHEMA | NULL | GPL |
| INNODB_FT_CONFIG | ACTIVE | INFORMATION SCHEMA | NULL | GPL |
| INNODB_FT_INDEX_CACHE | ACTIVE | INFORMATION SCHEMA | NULL | GPL |
| INNODB_FT_INDEX_TABLE | ACTIVE | INFORMATION SCHEMA | NULL | GPL |
| INNODB_SYS_TABLES | ACTIVE | INFORMATION SCHEMA | NULL | GPL |
| INNODB_SYS_TABLESTATS | ACTIVE | INFORMATION SCHEMA | NULL | GPL |
| INNODB_SYS_INDEXES | ACTIVE | INFORMATION SCHEMA | NULL | GPL |
| INNODB_SYS_COLUMNS | ACTIVE | INFORMATION SCHEMA | NULL | GPL |
| INNODB_SYS_FIELDS | ACTIVE | INFORMATION SCHEMA | NULL | GPL |
| INNODB_SYS_FOREIGN | ACTIVE | INFORMATION SCHEMA | NULL | GPL |
| INNODB_SYS_FOREIGN_COLS | ACTIVE | INFORMATION SCHEMA | NULL | GPL |
| INNODB_SYS_TABLESPACES | ACTIVE | INFORMATION SCHEMA | NULL | GPL |
| INNODB_SYS_DATAFILES | ACTIVE | INFORMATION SCHEMA | NULL | GPL |
| INNODB_SYS_VIRTUAL | ACTIVE | INFORMATION SCHEMA | NULL | GPL |
| MyISAM | ACTIVE | STORAGE ENGINE | NULL | GPL |
| MRG_MYISAM | ACTIVE | STORAGE ENGINE | NULL | GPL |
| PERFORMANCE_SCHEMA | ACTIVE | STORAGE ENGINE | NULL | GPL |
| ARCHIVE | ACTIVE | STORAGE ENGINE | NULL | GPL |
| BLACKHOLE | ACTIVE | STORAGE ENGINE | NULL | GPL |
| FEDERATED | DISABLED | STORAGE ENGINE | NULL | GPL |
| partition | ACTIVE | STORAGE ENGINE | NULL | GPL |
| ngram | ACTIVE | FTPARSER | NULL | GPL |
+----------------------------+----------+--------------------+---------+---------+
44 rows in set (0.01 sec)

这是插件目录的内容:

$ ls -lah /usr/lib/mysql/plugin/
total 644K
drwxr-xr-x 2 root root 4.0K Sep 26 23:24 .
drwxr-xr-x 3 root root 4.0K Sep 26 23:24 ..
-rw-r--r-- 1 root root 21K Jul 19 14:10 adt_null.so
-rw-r--r-- 1 root root 6.2K Jul 19 14:10 auth_socket.so
-rw-r--r-- 1 root root 44K Jul 19 14:10 connection_control.so
-rw-r--r-- 1 root root 107K Jul 19 14:10 innodb_engine.so
-rw-r--r-- 1 root root 79K Jul 19 14:10 keyring_file.so
-rw-r--r-- 1 root root 151K Jul 19 14:10 libmemcached.so
-rw-r--r-- 1 root root 9.7K Jul 19 14:10 locking_service.so
-rw-r--r-- 1 root root 11K Jul 19 14:10 mypluglib.so
-rw-r--r-- 1 root root 6.2K Jul 19 14:10 mysql_no_login.so
-rw-r--r-- 1 root root 55K Jul 19 14:10 rewriter.so
-rw-r--r-- 1 root root 56K Jul 19 14:10 semisync_master.so
-rw-r--r-- 1 root root 15K Jul 19 14:10 semisync_slave.so
-rw-r--r-- 1 root root 27K Jul 19 14:10 validate_password.so
-rw-r--r-- 1 root root 31K Jul 19 14:10 version_token.so

这些是我的配置内容:

cat /etc/mysql/my.cnf

    [mysqld_safe]
nice = 0
socket = /var/run/mysqld/mysqld.sock

[mysqld]
basedir = /usr
bind_address = 123.45.67.89
binlog_checksum = NONE
binlog_format = ROW
datadir = /var/lib/mysql
enforce_gtid_consistency = ON
expire_logs_days = 10
general_log = 1
general_log_file = /var/log/mysql/mysql.log
gtid_mode = ON
key_buffer_size = 8388608
lc_messages_dir = /usr/share/mysql
log_bin = binlog
log_error = /var/log/mysql/mysql_error.log
log_slave_updates = ON
long_query_time = 60
loose-group_replication_bootstrap_group = OFF
loose-group_replication_enforce_update_everywhere_checks= ON
loose-group_replication_group_name = 34dee7cd-d20d-4f59-9500-f56ada9a1abz
loose-group_replication_group_seeds = 123.45.67.88:33061,123.45.67.89:33061
loose-group_replication_ip_whitelist = 123.45.67.88,123.45.67.89
loose-group_replication_local_address = 123.45.67.89:33061
loose-group_replication_recovery_use_ssl= 1
loose-group_replication_single_primary_mode= OFF
loose-group_replication_ssl_mode = REQUIRED
loose-group_replication_start_on_boot = OFF
master_info_repository = TABLE
max_allowed_packet = 16M
max_binlog_size = 100M
max_connect_errors = 100000000
pid-file = /var/run/mysqld/mysqld.pid
port = 3306
query_cache_limit = 1M
query_cache_size = 16M
relay_log = my-project-prod-relay-bin
relay_log_info_repository = TABLE
report_host = 123.45.67.88
require_secure_transport = ON
server_id = 2
skip_external_locking
slow_query_log = 1
slow_query_log_file = /var/log/mysql/mysql-slow-query.log
socket = /var/run/mysqld/mysqld.sock
thread_cache_size = 8
thread_stack = 192K
tmpdir = /tmp
transaction_write_set_extraction = XXHASH64
user = mysql

[mysqldump]
max_allowed_packet = 16M
quick
quote_names

[mysql]
no-auto-rehash

[isamchk]
key_buffer_size = 16M

[client]
port = 3306
socket = /var/run/mysqld/mysqld.sock

!includedir /etc/mysql/conf.d/

我想知道我是否使用了错误版本的 MySQL,或者是否需要一些其他步骤来安装组复制插件?

最佳答案

FWIW 我下载了 5.7.19 社区版 https://dev.mysql.com/doc/refman/5.7/en/group-replication.html在沙盒中运行它,我确认组复制 .so 文件存在。

我使用 INSTALL PLUGIN 语句加载了插件,就像您尝试的那样。

首先,我必须添加一些配置设置,这些设置记录在 https://dev.mysql.com/doc/refman/5.7/en/group-replication-configuring-instances.html

server_id=1 # or any value unique among your replica set
gtid_mode=ON
enforce_gtid_consistency=ON
master_info_repository=TABLE
relay_log_info_repository=TABLE
binlog_checksum=NONE
log_slave_updates=ON
log_bin=binlog
binlog_format=ROW

当然,在编辑配置设置后重启 mysqld。

根据讨论here ,看起来组复制插件可能已被故意排除在正常的 MySQL 服务器版本之外。

要知道您是否正在运行社区版,请运行 mysql:

> mysql -u root -p
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.7.20-log MySQL Community Server (GPL)
.....

要手动安装 Community Edition 5.7(或此处的其他存档版本:https://downloads.mysql.com/archives/community/),请运行以下命令:

sudo apt-get install libaio1
sudo apt-get install libmecab2
curl -OL https://downloads.mysql.com/archives/get/file/mysql-common_5.7.20-1ubuntu16.04_amd64.deb
curl -OL https://downloads.mysql.com/archives/get/file/mysql-community-client_5.7.20-1ubuntu16.04_amd64.deb
curl -OL https://downloads.mysql.com/archives/get/file/mysql-client_5.7.20-1ubuntu16.04_amd64.deb
curl -OL https://downloads.mysql.com/archives/get/file/mysql-community-server_5.7.20-1ubuntu16.04_amd64.deb
sudo dpkg -i mysql-common_5.7.20-1ubuntu16.04_amd64.deb
sudo dpkg -i mysql-community-client_5.7.20-1ubuntu16.04_amd64.deb
sudo dpkg -i mysql-client_5.7.20-1ubuntu16.04_amd64.deb
sudo dpkg -i mysql-community-server_5.7.20-1ubuntu16.04_amd64.deb

关于在版本 5.7.19、5.7.21 中找不到 MySQL 组复制插件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46535713/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com