Agenda:
1. Building Two Virtual Machine (Ubuntu 20.04) on Microsoft Azure.
2. Installing MySQL 8.0 on both Ubuntu 20.04 box
3. Configuring Master & Slave (REPLICATION) on MySQL 8.0
4. Validating Master and Slav SYNC.
Please find below high level steps for your reference:
MASTER
1. Edit MySQL configuration file:
vi /etc/mysql/mysql.conf.d/mysqld.cnf
Change below config values
1. bind-address = 0.0.0.0
2. server-id = 1
3. log_bin = /var/log/mysql/mysql-bin.log
2. Create replication user & add REPLICATION privilleges:
CREATE USER 'repluser'@'10.0.0.5' IDENTIFIED WITH mysql_native_password BY 'India@12345';
GRANT REPLICATION SLAVE ON . TO 'repluser'@'10.0.0.5'
3. FLUSH PRIVILEGES
4. FLUSH TABLES WITH READ LOCK
5. Find Master status and copy file & position details for slave mapping:
SHOW MASTER STATUS
6. UNLOCK TABLES
SLAVE
1.
CHANGE MASTER TO
MASTER_HOST='10.0.0.4',
MASTER_USER='repluser',
MASTER_PASSWORD='India@12345',
MASTER_LOG_FILE='mysql-bin.000001',
MASTER_LOG_POS=849;
2. START SLAVE
3. SHOW SLAVE STATUS \G
Thanks
Rajesh Singh