Welcome 微信登录

首页 / 数据库 / MySQL / MySQL复制环境中使用slave_exec_mod参数

先看下slave_exec_mod官方描述
Command-Line Format--slave-exec-mode=mode
Option-File Formatslave_exec_mode
System Variable Nameslave_exec_mode
Variable ScopeGlobal
Dynamic VariableYes
 Permitted Values
Typeenumeration
DefaultSTRICT (ALL)
DefaultIDEMPOTENT (NDB)
Valid ValuesIDEMPOTENT
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>
意思是说slave_exec_mod默认是STRICT可选值是IDEMPOTENT,在多主大型复制系统中建议使用IDEMPOTENT值,它避免duplicate-key 和 no-key-found等错误。这个参数是动态的,可以直接修改。[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) 统计MySQL binlog中的DML语句MySQL禁用binlog中的语句相关资讯      MySQL参数  slave_exec_mod 
  • MySQL tmpdir参数修改  (02月20日)
  • MySQL 5.6 参数之 extra_port  (01月14日)
  • MySQL中show slave status 参数详  (07/29/2012 06:32:52)
  • MySQL参数调优最佳实践  (01月22日)
  • MySQL配置文件参数的一些说明  (09/07/2013 17:14:50)
本文评论 查看全部评论 (0)
表情: 姓名: 字数