Professional Documents
Culture Documents
GTID Replication Steps
GTID Replication Steps
vi /etc/my.cnf
server-id = 1
log-bin = mysql-bin
binlog_format = row
gtid-mode=ON
enforce-gtid-consistency
log-slave-updates
vi /etc/my.cnf
server-id = 2
log-bin = mysql-bin
relay-log = relay-log-server
read-only = ON
binlog_format = row
gtid-mode=ON
enforce-gtid-consistency
log-slave-updates
CHANGE MASTER TO
MASTER_HOST = '54.89.xx.xx',
MASTER_PORT = 3306,
MASTER_USER = 'repl_user',
MASTER_PASSWORD = 'XXXXXXXXX',
MASTER_AUTO_POSITION = 1;
SET @@GLOBAL.read_only = ON;
systemctl stop mysqld
mysqldump --all-databases -flush-privileges --single-transaction --flush-logs --triggers --routines --events -hex-blob --host=54.8
head -n30 mysqlbackup_dump.sql
source mysqlbackup_dump.sql ;
show global variables like 'gtid_executed';
The slave is now configured to use the master with GTID based transactions as the source for data replication