slave-skip-errors

Posted diuxie

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了slave-skip-errors相关的知识,希望对你有一定的参考价值。

--slave-skip-errors=[err_code1,err_code2, ... | all | ddl_exist_errors]

Normally, replication stops when an error occurs on the replica, which gives you the opportunity to resolve the inconsistency in the data manually. This option causes the replication SQL thread to continue replication when a statement returns any of the errors listed in the option value.

正常情况下,当有error时复制会中断,给机会手动解决数据不一致的问题。 slave-skip-errors 会使sql 线程忽略这些error 继续复制。

Do not use this option unless you fully understand why you are getting errors. If there are no bugs in your replication setup and client programs, and no bugs in mysql itself, an error that stops replication should never occur. Indiscriminate use of this option results in replicas becoming hopelessly out of synchrony with the source, with you hawww.pizei.comving no idea why this has occurred.

不要随便使用此参数,除非你完全了解为什么会报错。 在复制配置,客户端没有错误的情况下,Mysql 本身没有bug的情况下,复制是不会中断的。 随意的使用此参数会导致主从不一致。

For error codes, you should use the numbers provided by the error message in the replica\'s error log

and in the output of SHOW SLAVE STATUS. Appendix B, Error Messages and Common Problems, lists server error codes.

对于错误codes, 可以通过show slave status的输出页游的信息进行查看。

The shorthand value ddl_exist_errors is equivalent to the error code list

1007,1008,1050,1051,1054,1060,1061,1068,1094,1146.

相面列出了较为常见的ddl_exist_errors , 1007,1008,1050,1051,1054,1060,1061,1068,1094,1146.

You can also (but should not) use the very nonrecommended value of all to cause the replica to ignore all error messages and keeps going regardless of what happens. Needless to say, if you use all, there are no guarantees regarding the integrity of your data. Please do not complain (or file bug reports) in this case if the replica\'s data is not anywhere close to what it is on the source. You have been warned.

Examples:

--slave-skip-errors=1062,1053

--slave-skip-errors=all

--slave-skip-errors=ddl_exist_errors

以上是关于slave-skip-errors的主要内容,如果未能解决你的问题,请参考以下文章