- Followed https://mysqlserverteam.com/clone-create-mysql-instance-replica/ & https://dev.mysql.com/doc/refman/8.0/en/clone-plugin-remote.html - Donor setup - build used cat docs/INFO_SRC commit: a5b2e523c881ab8c68fd0adb478a6232dd69e522 date: 2019-06-25 11:50:40 +0200 build-date: 2019-06-25 12:24:04 +0200 short: a5b2e52 branch: mysql-8.0.17-release MySQL source 8.0.17 -- Startup commands for Donor and Recipient rm -rf 96657_Donor/ bin/mysqld --initialize-insecure --basedir=$PWD --datadir=$PWD/96657_Donor --log-error-verbosity=3 bin/mysqld_safe --no-defaults --basedir=$PWD --datadir=$PWD/96657_Donor --core-file --socket=/tmp/mysql_Donor.sock --port=3333 --log-error=$PWD/96657_Donor/log.err --mysqlx-port=33330 --mysqlx-socket=/tmp/mysql_x_ushastry.sock --log-error-verbosity=3 --secure-file-priv=/tmp/ 2>&1 & - Recipient setup rm -rf 96657_Recipient/ bin/mysqld --initialize-insecure --basedir=$PWD --datadir=$PWD/96657_Recipient --log-error-verbosity=3 bin/mysqld_safe --no-defaults --basedir=$PWD --datadir=$PWD/96657_Recipient --core-file --socket=/tmp/mysql_Recipient.sock --port=6666 --log-error=$PWD/96657_Recipient/log.err --mysqlx-port=33360 --mysqlx-socket=/tmp/mysql_x_Recipient.sock --log-error-verbosity=3 --secure-file-priv=/tmp/ 2>&1 & ### Donor bin/mysql -uroot -S /tmp/mysql_Donor.sock --prompt='Donor>' Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 7 Server version: 8.0.17 MySQL Community Server - GPL Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. Donor> Donor>INSTALL PLUGIN CLONE SONAME "mysql_clone.so"; Query OK, 0 rows affected (0.01 sec) Donor>SELECT PLUGIN_NAME, PLUGIN_STATUS FROM INFORMATION_SCHEMA.PLUGINS WHERE PLUGIN_NAME LIKE 'clone'; +-------------+---------------+ | PLUGIN_NAME | PLUGIN_STATUS | +-------------+---------------+ | clone | ACTIVE | +-------------+---------------+ 1 row in set (0.00 sec) Donor>CREATE USER clone_user IDENTIFIED BY "clone_password"; Query OK, 0 rows affected (0.01 sec) Donor>GRANT BACKUP_ADMIN ON *.* to clone_user; Query OK, 0 rows affected (0.00 sec) Donor>GRANT SELECT ON performance_schema.* TO clone_user; Query OK, 0 rows affected (0.00 sec) Donor>GRANT EXECUTE ON *.* to clone_user; Query OK, 0 rows affected (0.00 sec) Donor> -- provisioned some data Donor>use test; Database changed Donor>drop table if exists keyvalue; Query OK, 0 rows affected, 1 warning (0.00 sec) Donor>CREATE TABLE `keyvalue` ( -> `id` bigint(20) unsigned NOT NULL, -> `name1` varchar(250), -> `name2` varchar(250), -> `name3` varchar(250), -> `name4` varchar(250), -> PRIMARY KEY (`id`, name1(10)) -> ) ENGINE=innodb; Query OK, 0 rows affected, 1 warning (0.01 sec) Donor> Donor>set @id:=0; Query OK, 0 rows affected (0.00 sec) Donor> Donor> insert into `keyvalue` values -> (@id:=@id+1,md5(rand()*1000000),md5(rand()*1000000),md5(rand()*1000000),md5(rand()*1000000)) -> , (@id:=@id+1,md5(rand()*1000000),md5(rand()*1000000),md5(rand()*1000000),md5(rand()*1000000)) -> , (@id:=@id+1,md5(rand()*1000000),md5(rand()*1000000),md5(rand()*1000000),md5(rand()*1000000)) -> , (@id:=@id+1,md5(rand()*1000000),md5(rand()*1000000),md5(rand()*1000000),md5(rand()*1000000)); Query OK, 4 rows affected, 4 warnings (0.00 sec) Records: 4 Duplicates: 0 Warnings: 4 Donor> Donor> insert into `keyvalue`(`id`,`name1`,`name2`,`name3`,`name4`) -> select @id:=@id+1,md5(rand()*1000000),md5(rand()*1000000),md5(rand()*1000000),md5(rand()*1000000) from -> `keyvalue` k1, `keyvalue` k2, `keyvalue` k3, `keyvalue` k4,`keyvalue` k5,`keyvalue` k6, `keyvalue` k7, `keyvalue` k8, `keyvalue` k9, -> `keyvalue` k0,`keyvalue` ka, `keyvalue` kb, `keyvalue` kc, `keyvalue` kd limit 1000000; Query OK, 1000000 rows affected, 1 warning (29.09 sec) Records: 1000000 Duplicates: 0 Warnings: 1 ## Recipient bin/mysql -uroot -S /tmp/mysql_Recipient.sock --prompt='Recipient>' Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 7 Server version: 8.0.17 MySQL Community Server - GPL Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. Recipient>INSTALL PLUGIN CLONE SONAME "mysql_clone.so"; Query OK, 0 rows affected (0.01 sec) Recipient>SELECT PLUGIN_NAME, PLUGIN_STATUS FROM INFORMATION_SCHEMA.PLUGINS WHERE PLUGIN_NAME LIKE 'clone'; +-------------+---------------+ | PLUGIN_NAME | PLUGIN_STATUS | +-------------+---------------+ | clone | ACTIVE | +-------------+---------------+ 1 row in set (0.00 sec) Recipient>CREATE USER clone_user IDENTIFIED BY "clone_password"; Query OK, 0 rows affected (0.01 sec) Recipient>GRANT CLONE_ADMIN ON *.* to clone_user; Query OK, 0 rows affected (0.00 sec) Recipient>GRANT SELECT ON performance_schema.* TO clone_user; Query OK, 0 rows affected (0.00 sec) Recipient>GRANT EXECUTE ON *.* to clone_user; Query OK, 0 rows affected (0.00 sec) Recipient> Recipient>show variables like 'clone'; Empty set (0.00 sec) Recipient>SHOW VARIABLES LIKE 'clone_valid_donor_list'; +------------------------+-------+ | Variable_name | Value | +------------------------+-------+ | clone_valid_donor_list | | +------------------------+-------+ 1 row in set (0.00 sec) Recipient>SET GLOBAL clone_valid_donor_list = "localhost:3333"; Query OK, 0 rows affected (0.00 sec) Recipient>SHOW VARIABLES LIKE 'clone_valid_donor_list'; +------------------------+----------------+ | Variable_name | Value | +------------------------+----------------+ | clone_valid_donor_list | localhost:3333 | +------------------------+----------------+ 1 row in set (0.00 sec) Recipient>CLONE INSTANCE FROM clone_user@localhost:3333 IDENTIFIED BY 'clone_password'; Query OK, 0 rows affected (1.73 sec) Recipient> Recipient> Recipient>Restarting mysqld... 2019-08-27T07:21:41.323872Z mysqld_safe Number of processes running now: 0 2019-08-27T07:21:41.328298Z mysqld_safe mysqld restarted Recipient> Recipient> Recipient>select STATE, CAST(BEGIN_TIME AS DATETIME) as "START TIME", CASE WHEN END_TIME IS NULL THEN LPAD(sys.format_time(POWER(10,12) * (UNIX_TIMESTAMP(now()) - UNIX_TIMESTAMP(BEGIN_TIME))), 10, ' ') ELSE LPAD(sys.format_time(POWER(10,12) * (UNIX_TIMESTAMP(END_TIME) - UNIX_TIMESTAMP(BEGIN_TIME))), 10, ' ') END as DURATION from performance_schema.clone_status; ERROR 2006 (HY000): MySQL server has gone away No connection. Trying to reconnect... Connection id: 7 Current database: *** NONE *** +-----------+---------------------+------------+ | STATE | START TIME | DURATION | +-----------+---------------------+------------+ | Completed | 2019-08-27 09:21:36 | 5.91 s | +-----------+---------------------+------------+ 1 row in set (0.01 sec) - again clone Recipient from same Donor Recipient>SHOW VARIABLES LIKE 'clone_valid_donor_list'; +------------------------+-------+ | Variable_name | Value | +------------------------+-------+ | clone_valid_donor_list | | +------------------------+-------+ 1 row in set (0.01 sec) Recipient>SET GLOBAL clone_valid_donor_list = "localhost:3333"; Query OK, 0 rows affected (0.00 sec) Recipient>SHOW VARIABLES LIKE 'clone_valid_donor_list'; +------------------------+----------------+ | Variable_name | Value | +------------------------+----------------+ | clone_valid_donor_list | localhost:3333 | +------------------------+----------------+ 1 row in set (0.00 sec) Recipient>CLONE INSTANCE FROM clone_user@localhost:3333 IDENTIFIED BY 'clone_password'; Query OK, 0 rows affected (1.60 sec) Recipient>Restarting mysqld... 2019-08-27T07:23:41.827399Z mysqld_safe Number of processes running now: 0 2019-08-27T07:23:41.831700Z mysqld_safe mysqld restarted Recipient>select STATE, CAST(BEGIN_TIME AS DATETIME) as "START TIME", CASE WHEN END_TIME IS NULL THEN LPAD(sys.format_time(POWER(10,12) * (UNIX_TIMESTAMP(now()) - UNIX_TIMESTAMP(BEGIN_TIME))), 10, ' ') ELSE LPAD(sys.format_time(POWER(10,12) * (UNIX_TIMESTAMP(END_TIME) - UNIX_TIMESTAMP(BEGIN_TIME))), 10, ' ') END as DURATION from performance_schema.clone_status; ERROR 2006 (HY000): MySQL server has gone away No connection. Trying to reconnect... Connection id: 7 Current database: *** NONE *** +-----------+---------------------+------------+ | STATE | START TIME | DURATION | +-----------+---------------------+------------+ | Completed | 2019-08-27 09:23:36 | 6.29 s | +-----------+---------------------+------------+ 1 row in set (0.01 sec)