Configuring the Primary Database
- Configure parallel replication.
- Log in to the primary database.
1/usr/local/mysql/bin/mysql -uroot -p123456 -S /data/mysql/run/mysql.sock
- Configure parallel replication. For details about the parameters, see Table 1.
set global binlog_transaction_dependency_tracking=COMMIT_ORDER; set global transaction_write_set_extraction=XXHASH64; set global binlog_transaction_dependency_tracking=WRITESET; set global slave_parallel_type='LOGICAL_CLOCK'; set global slave_parallel_workers=96;
- Check whether parallel replication takes effect.
show variables like '%transaction_write_set_extraction%'; show variables like '%binlog_transaction_dependency_tracking%'; show variables like '%slave_parallel_type%'; show variables like '%slave_parallel_workers%';
If the queried values are the same as those configured in 1.b, the configuration takes effect.
If certain values are inconsistent, you need to log out of the database and log in to the database again for the values to take effect.
Parallel replication is used to improve the replay performance of the binlog. Therefore, parallel replication needs to be enabled only on secondary databases. However, parallel replication is configured on the primary database to prepare for primary/secondary switchover when the primary database is abnormal.
- Log in to the primary database.
- Query the status of the primary database.
- Log in to the primary database.
1/usr/local/mysql/bin/mysql -uroot -p123456 -S /data/mysql/run/mysql.sock
- Check the primary database status.
show master status;
- Exit the primary database.
exit
- Log in to the primary database.
Parent topic: Parallel Replication