Use the slave_exec_mod parameter in the MySQL replication Environment

Source: Internet
Author: User
Tags variable scope

Take a look at the official description of slave_exec_mod.

Command-Line Format --slave-exec-mode=mode
Option-File Format slave_exec_mode
System Variable Name slave_exec_mode
Variable Scope Global
Dynamic Variable Yes
  Permitted Values
Type enumeration
Default STRICT(ALL)
Default IDEMPOTENT(NDB)
Valid Values IDEMPOTENT
STRICT

Controls whether IDEMPOTENT or STRICT mode is used in replication conflict resolution and error checking. IDEMPOTENT mode causes suppression of duplicate-key and no-key-found errors.
This mode is needed for multi-master replication, circular replication, and some other special replication scenarios for MySQL Cluster Replication.

[Plain] view plaincopyprint?
SLAVE @ root @ test 07:21:41> show variables like 'slave _ exec_mode ';
+ ----------------- + -------- +
| Variable_name | Value |
+ ----------------- + -------- +
| Slave_exec_mode | STRICT |
+ ----------------- + -------- +
1 row in set (0.00 sec)

SLAVE @ root @ test 07:21:42>

SLAVE @ root @ test 07:21:41> show variables like 'slave _ exec_mode ';
+ ----------------- + -------- +
| Variable_name | Value |
+ ----------------- + -------- +
| Slave_exec_mode | STRICT |
+ ----------------- + -------- +
1 row in set (0.00 sec)

SLAVE @ root @ test 07:21:42>
The default value of slave_exec_mod is STRICT and the optional value is IDEMPOTENT. We recommend that you use the IDEMPOTENT value in multiple master and large copy systems to avoid errors such as duplicate-key and no-key-found. This parameter is dynamic and can be directly modified.

[Plain] view plaincopyprint?
SLAVE @ root @ test 07:39:58> show variables like 'slave _ exec_mode ';
+ ----------------- + ------------ +
| Variable_name | Value |
+ ----------------- + ------------ +
| Slave_exec_mode | IDEMPOTENT |
+ ----------------- + ------------ +
1 row in set (0.00 sec)

SLAVE @ root @ test 07:40:09> set global slave_exec_mode = 'strict ';
Query OK, 0 rows affected (0.00 sec)

SLAVE @ root @ test 07:40:23> show variables like 'slave _ exec_mode ';
+ ----------------- + -------- +
| Variable_name | Value |
+ ----------------- + -------- +
| Slave_exec_mode | STRICT |
+ ----------------- + -------- +
1 row in set (0.00 sec)

SLAVE @ root @ test 07:40:24> set global slave_exec_mode = 'idempotent ';
Query OK, 0 rows affected (0.00 sec)

Related Article

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.