MySQL 5.7 Turn on parallel replication

Source: Internet
Author: User

To turn on multi-threaded replication, the default key parameters are two:

Mysql> Show variables like ' slave_parallel_% ';

+------------------------+---------------+

| variable_name | Value |

+------------------------+---------------+

| Slave_parallel_type | DATABASE |

| Slave_parallel_workers | 0 |

+------------------------+---------------+

2 rows in Set (0.00 sec)

Slave-parallel-type Default value is database

Slave-parallel-workers Default value is 0

Open Online:

mysql> stop slave Sql_thread;

Query OK, 0 rows affected (0.07 sec)


mysql> set global slave_parallel_type= ' Logical_clock ';

Query OK, 0 rows Affected (0.00 sec)

mysql> set global slave_parallel_workers=4;

Query OK, 0 rows Affected (0.00 sec)

mysql> start slave sql_thread;

Query OK, 0 rows affected (0.06 sec)

Optimization options:

The table mode is enabled because if the Master.info file is updated frequently in multithreaded mode, the cost is too high and the value is not very accurate

The table for master_info_repository=table corresponds to Mysql.slave_master_info

Relay_log_recovery=on

The table for relay_log_info_repository=table corresponds to Mysql.slave_relay_log_info

MySQL 5.7 Turn on parallel replication

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.