MySQL 8.0.17 clone plugin local remote backup, and build a master-slave summary

1, the two machines are mounted MySQL

192.168.56.16   es3
192.168.56.15   es2

[root@es2 ~]# yum -y install mysql-community-*
[root@es3 ~]# yum -y localinstall mysql-community-*

2, modify the configuration file

[root@es2 ~]# grep -Ev "^$|^[#;]" /etc/my.cnf
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
gtid-mode = ON
enforce-gtid-consistency = ON
log-slave-updates = ON
server-id=1
[root@es2 ~]#
[root@es3 ~]# grep -Ev "^$|^[#;]" /etc/my.cnf
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
gtid-mode = ON
enforce-gtid-consistency = ON
log-slave-updates = ON
server-id=2
[root@es3 ~]#

3, install the plug-clone, clone and create users and user copy

mysql> INSTALL PLUGIN clone SONAME 'mysql_clone.so';
Query OK, 0 rows affected (0.12 sec)

mysql> CREATE USER clone_user@'%' identified by 'iwSeuFagt0&31';
Query OK, 0 rows affected (0.07 sec)

mysql> GRANT BACKUP_ADMIN ON *.* TO 'clone_user';
Query OK, 0 rows affected (0.04 sec)

mysql> CREATE USER repl_user@'%' identified by 'iwSeuFagt0&31'     
    -> ;
Query OK, 0 rows affected (0.02 sec)

mysql>  grant replication slave on *.* to repl_user;
Query OK, 0 rows affected (0.00 sec)

mysql> flush privileges;
Query OK, 0 rows affected (0.04 sec)

mysql> exit


Guess you like

Origin blog.51cto.com/860143/2433497