Description:
I tried to setup MySQL Group replication refer to reference manual steps:
https://dev.mysql.com/doc/refman/8.0/en/group-replication-configuring-instances.html
But I faced below error when starting mysqld because group_replication is not loaded.
2018-12-11T05:07:58.845576Z 0 [ERROR] [MY-000067] [Server] unknown variable 'group_replication_group_name=d3a3f9aa-3b37-45af-a154-c309a1a169cf'.
So I added below setting in my.cnf, and could start mysqld.
> early-plugin-load="group_replication.so"
However, there are some strange point:
+ initial temporary password for root user is not set
+ mysql database have few tables
+ couldn't execute mysql_upgrade command
It seems that mysql database is corrupted.
How to repeat:
$ sudo rpm -ivh http://dev.mysql.com/get/mysql80-community-release-el7-1.noarch.rpm
$ sudo yum install -y mysql-community-server
$ sudo tee /etc/my.cnf << EOT
[mysqld]
log_error=/var/log/mysqld.log
server_id=10 ### server2=20 / server3=30
gtid_mode=ON
enforce_gtid_consistency=ON
binlog_checksum=NONE
log_bin=binlog
log_slave_updates=ON
binlog_format=ROW
master_info_repository=TABLE
relay_log_info_repository=TABLE
transaction_write_set_extraction=XXHASH64
group_replication_group_name="d3a3f9aa-3b37-45af-a154-c309a1a169cf"
group_replication_start_on_boot=off
group_replication_local_address="192.168.10.101:33061"
group_replication_group_seeds= "192.168.10.101:33061,192.168.10.102:33061,192.168.10.103:33061"
group_replication_bootstrap_group=off
EOT
$ sudo systemctl start mysqld
Job for mysqld.service failed because the control process exited with error code. See "systemctl status mysqld.service" and "journalctl -xe" for details.
$ sudo vi /etc/my.cnf
-> add below setting
+ early-plugin-load="group_replication.so"
$ sudo systemctl start mysqld
$ mysql -u root
-> initial temporary password is not set
mysql> show tables from mysql;
+--------------------+
| Tables_in_mysql |
+--------------------+
| innodb_index_stats |
| innodb_table_stats |
+--------------------+
2 rows in set (0.01 sec)
-> mysql database seems corrupted
$ sudo mysql_upgrade -u root
Checking if update is needed.
Checking server version.
Error occurred: Query against mysql.user table failed when checking the mysql.session.
-> we couldn't execute mysql_upgrade command
Suggested fix:
I think recommended procedure is to write below setting in my.cnf at first step:
+ early-plugin-load="group_replication.so"