Description:
Hi,
Firstly, the internal clone can work in the cluster. I.e. If I manually purge binary logs from primary and then start slave later, I can see slave can recovery by clone internally. Everything looks ok.
However, I want to try clone command manually, so that I can recover or copy new instance later if I needed. I tried following case.
Setup one innodb cluster, one run as primary and another run as slave, make sure two nodes can work well as cluster.
1. First, I create the one account named 'clone_user' for clone
mysql> show grants for clone_user;
+-----------------------------------------------------------+
| Grants for clone_user@% |
+-----------------------------------------------------------+
| GRANT USAGE ON *.* TO `clone_user`@`%` |
| GRANT BACKUP_ADMIN,CLONE_ADMIN ON *.* TO `clone_user`@`%` |
+-----------------------------------------------------------+
2. While group_replication is running on slave, I run clone command. It failed
mysql> clone instance from clone_user@10.50.10.249:3308 identified by '***';
ERROR 3875 (HY000): The clone operation cannot be executed when Group Replication is running.
3. So I stop group_replication and reset slave
mysql> stop group_replication;
Query OK, 0 rows affected (4.08 sec)
mysql> reset slave;
Query OK, 0 rows affected, 1 warning (0.03 sec)
4. Run clone again, it fails again because the slave is on super-read-only mode
mysql> clone instance from clone_user@10.50.10.249:3308 identified by '***';
ERROR 1290 (HY000): The MySQL server is running with the --super-read-only option so it cannot execute this statement
Please help if you have any idea. Thank you very much
How to repeat:
1. setup one innodb cluter first, and make it can work
2. On primary db, run as root, create one user account, clone_user, and grant both BACKUP_ADMIN and CLONE_ADMIN to it. Verify the permission
mysql> show grants for clone_user;
+-----------------------------------------------------------+
| Grants for clone_user@% |
+-----------------------------------------------------------+
| GRANT USAGE ON *.* TO `clone_user`@`%` |
| GRANT BACKUP_ADMIN,CLONE_ADMIN ON *.* TO `clone_user`@`%` |
+-----------------------------------------------------------+
3. On slave, set clone_valid_donor_list to primary ip:port
mysql> set global clone_valid_donor_list='10.50.10.249:3308';
Query OK, 0 rows affected (0.00 sec)
4. On slave, stop group_replication and reset slave first
mysql> stop group_replication;
Query OK, 0 rows affected (4.08 sec)
mysql> reset slave;
Query OK, 0 rows affected, 1 warning (0.03 sec)
4. On slave, login as clone_user, and run clone command
mysql> clone instance from clone_user@10.50.10.249:3308 identified by '***';
ERROR 1290 (HY000): The MySQL server is running with the --super-read-only option so it cannot execute this statement