Installing MARIADB
Yum Install-y mariadb*
2. Start MARIADB
Systemctl Start mariadb
3. Modify the MARIADB root password
Mysqladmin-u root-p Password 123456
4. Modify the master configuration
Vi/etc/my.cnf.d/server.cnf
[Mysqld]
Log-bin=mysql-bin
server-id=227//IP Address Last
5. Modify the slave configuration
Vi/etc/my.cnf.d/server.cnf
[Mysqld]
Log-bin=mysql-bin
server-id=228//IP Address Last
6. Restart MARIADB
Systemctl Restart MARIADB
7. Slave Authorized on Master
GRANT REPLICATION SLAVE on * * to ' root ' @ '% ' identified by ' 123456 ';
8. View status
Show master status;
9. Configuring the Slave server
Change MASTER to master_host= ' 10.10.101.227 ', master_user= ' root ', master_password= ' 123456 ', master_log_file= ' Mysql-bin.000001 ', master_log_pos=1110;
START SLAVE;
SHOW SLAVE Status\g
MySQL master-slave replication configuration