从库报 error 1205

1.mysql报错信息

[root@slave2(35.102) ~]# mysql -uroot -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 17236634
Server version: 5.7.18-log MySQL Community Server (GPL)

Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

root@ipanel 09:11:  [(none)]> show slave status \G;
*************************** 1. row ***************************
               Slave_IO_State: Waiting for master to send event
                  Master_Host: 192.168.35.101
                  Master_User: repl
                  Master_Port: 3306
                Connect_Retry: 60
              Master_Log_File: slave1-bin.000032
          Read_Master_Log_Pos: 239784353
               Relay_Log_File: slave2-relay-bin.090191
                Relay_Log_Pos: 1931045
        Relay_Master_Log_File: slave1-bin.000032
             Slave_IO_Running: Yes
            Slave_SQL_Running: No
              Replicate_Do_DB:
          Replicate_Ignore_DB:
           Replicate_Do_Table:
       Replicate_Ignore_Table:
      Replicate_Wild_Do_Table:
  Replicate_Wild_Ignore_Table:
                   Last_Errno: 1205
                   Last_Error: Slave SQL thread retried transaction 10 time(s) in vain, giving up. Consider raising the value of the slave_transaction_retries variable.
                 Skip_Counter: 0
          Exec_Master_Log_Pos: 218623234
              Relay_Log_Space: 23099318
              Until_Condition: None
               Until_Log_File:
                Until_Log_Pos: 0
           Master_SSL_Allowed: No
           Master_SSL_CA_File:
           Master_SSL_CA_Path:
              Master_SSL_Cert:
            Master_SSL_Cipher:
               Master_SSL_Key:
        Seconds_Behind_Master: NULL
Master_SSL_Verify_Server_Cert: No
                Last_IO_Errno: 0
                Last_IO_Error:
               Last_SQL_Errno: 1205
               Last_SQL_Error: Slave SQL thread retried transaction 10 time(s) in vain, giving up. Consider raising the value of the slave_transaction_retries variable.
  Replicate_Ignore_Server_Ids:
             Master_Server_Id: 1
                  Master_UUID: c6bf07ac-45f9-11e7-a93f-b8ca3a60c558
             Master_Info_File: /r2/mysqldata/master.info
                    SQL_Delay: 0
          SQL_Remaining_Delay: NULL
      Slave_SQL_Running_State:
           Master_Retry_Count: 86400
                  Master_Bind:
      Last_IO_Error_Timestamp:
     Last_SQL_Error_Timestamp: 180330 15:26:09
               Master_SSL_Crl:
           Master_SSL_Crlpath:
           Retrieved_Gtid_Set: c6bf07ac-45f9-11e7-a93f-b8ca3a60c558:2594841-4737183
            Executed_Gtid_Set: a975c1f6-45f9-11e7-8385-b8ca3a60cc28:1-71460,
c6bf07ac-45f9-11e7-a93f-b8ca3a60c558:1-4707081
                Auto_Position: 1
         Replicate_Rewrite_DB:
                 Channel_Name:
           Master_TLS_Version:
1 row in set (0.00 sec)

ERROR:
No query specified

2.日志


[root@slave2(35.102) ~]# tail -150 /r2/mysqldata/error.log
2018-03-30T15:24:34.877355+08:00 15454325 [Warning] Slave SQL for channel '': Error 'Lock wait timeout exceeded; try restarting transaction' on query. Default database: 'homed_iusm'. Query: 'UPDATE account_info set last_login_time=FROM_UNIXTIME(1522394668), last_used_device=1400357731, f_extend='{"EXTEND":"","LIP":"192.168.15.164","WORK_EXTEND":{"areaid":null,"departmentname":"粤BZ2000-a1523-13685926554_粤BZ2298-a1523-13685926554_粤B91278-a1523-15012993006_粤BZ2000-a1523-15012993006_粤BZ2000-a1523-15012993006_粤BZ2000-a1523-15012993006"},"monitor_areaid":"440300"}
' WHERE DA=50000106', Error_code: 1205
2018-03-30T15:24:40.878439+08:00 15454325 [Warning] Slave SQL for channel '': Error 'Lock wait timeout exceeded; try restarting transaction' on query. Default database: 'homed_iusm'. Query: 'UPDATE account_info set last_login_time=FROM_UNIXTIME(1522394668), last_used_device=1400357731, f_extend='{"EXTEND":"","LIP":"192.168.15.164","WORK_EXTEND":{"areaid":null,"departmentname":"粤BZ2000-a1523-13685926554_粤BZ2298-a1523-13685926554_粤B91278-a1523-15012993006_粤BZ2000-a1523-15012993006_粤BZ2000-a1523-15012993006_粤BZ2000-a1523-15012993006"},"monitor_areaid":"440300"}
' WHERE DA=50000106', Error_code: 1205

......

2018-03-30T15:26:09.912743+08:00 15454325 [ERROR] Slave SQL for channel '': Slave SQL thread retried transaction 10 time(s) in vain, giving up. Consider raising the value of the slave_transaction_retries variable. Error_code: 1205
2018-03-30T15:26:09.912755+08:00 15454325 [Warning] Slave: Lock wait timeout exceeded; try restarting transaction Error_code: 1205
2018-03-30T15:26:09.912763+08:00 15454325 [ERROR] Error running query, slave SQL thread aborted. Fix the problem, and restart the slave SQL thread with "SLAVE START". We stopped at log 'slave1-bin.000032' position 218623234

3,排错

参数innodb_lock_wait_time 设置的为15秒,单个事务在等待15秒后开始报1025错:因为锁执行超时并重启事务

参数slave_transaction_retries 设置的为10次,如果事务重试次数超过10次,复制中断

问题SQL

Default database: 'homed_iusm'. Query: 'UPDATE account_info set last_login_time=FROM_UNIXTIME(1522394668), last_used_device=1400357731, f_extend='{"EXTEND":"","LIP":"192.168.15.164","WORK_EXTEND":{"areaid":null,"departmentname":"粤BZ2000-a1523-13685926554_粤BZ2298-a1523-13685926554_粤B91278-a1523-15012993006_粤BZ2000-a1523-15012993006_粤BZ2000-a1523-15012993006_粤BZ2000-a1523-15012993006"},"monitor_areaid":"440300"}

解决 start slave

2018-04-02T09:15:23.733243+08:00 17236884 [Note] Slave SQL thread for channel '' initialized, starting replication in log 'slave1-bin.000032' atposition 218623234, relay log './slave2-relay-bin.090191' position: 1931045
[root@slave2(35.102) ~]#

MySQL 5.7.18 主从复制 Error1205的更多相关文章

  1. MySQL 5.7.18的安装及主从复制(主从同步)

    MySQL 5.7.18的安装与主从复制 IP 计算机名 角色 192.168.1.222 001 master 192.168.1.233 002 slave CentOS 6.9安装mysql5. ...

  2. MySQL 高可用架构 之 MHA (Centos 7.5 MySQL 5.7.18 MHA 0.58)

    目录 简介 环境准备 秘钥互信 安装基础依赖包 安装MHA组件 安装 MHA Node组件 安装 MHA Manager 组件 建立 MySQL 一主三从 初始化 MySQL 启动MySQL 并简单配 ...

  3. MySQL/MariaDB数据库的主从复制

     MySQL/MariaDB数据库的主从复制  作者:尹正杰  版权声明:原创作品,谢绝转载!否则将追究法律责任. 一.MySQL复制概述 1>.传统扩展方式 垂直扩展(也叫向上扩展,Sacle ...

  4. mysql -- mysql基于ssl的主从复制

    mysql基于ssl的主从复制由于mysql在复制过程中是明文的,所以就大大降低了安全性,因此需要借助于ssl加密来增加其复制的安全性. 主服务器node1:172.16.200.1从服务器node2 ...

  5. [MySQL Reference Manual] 18 复制

    18 复制 18 复制 18.1 复制配置 18.1.1 基于Binary Log的数据库复制配置 18.1.2 配置基于Binary log的复制 18.1.2.1 设置复制master的配置 18 ...

  6. Mysql实现企业级数据库主从复制架构实战

    场景 公司规模已经形成,用户数据已成为公司的核心命脉,一次老王一不小心把数据库文件删除,通过mysqldump备份策略恢复用了两个小时,在这两小时中,公司业务中断,损失100万,老王做出深刻反省,公司 ...

  7. 项目实战7—Mysql实现企业级数据库主从复制架构实战

    Mysql实现企业级数据库主从复制架构实战 环境背景:公司规模已经形成,用户数据已成为公司的核心命脉,一次老王一不小心把数据库文件删除,通过mysqldump备份策略恢复用了两个小时,在这两小时中,公 ...

  8. Window环境下配置MySQL 5.6的主从复制

    原文:Window环境下配置MySQL 5.6的主从复制 1.环境准备 Windows 7 64位 MySQL 5.6 主库:192.168.103.207 从库:192.168.103.208 2. ...

  9. CentOS 7使用通过二进制包安装MySQL 5.7.18

    安装依赖 yum install -y libaio 下载 wget https://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-5.7.18-linux- ...

随机推荐

  1. SQL语句中各个部分的执行顺序(转)

    原文链接:http://www.tuicool.com/articles/fERNv2 写在前面的话:有时不理解SQL语句各个部分执行顺序,导致理解上出现偏差,或者是书写SQL语句时随心所欲,所以有必 ...

  2. String类的编码和解码问题

    我们前面知道同一个字符在利用不同的编码表得到的结果一般是不一样的. 这里讨论个字符串的编码和解码问题 字符串的一些方法: String(byte[] b,Charset charset); Strin ...

  3. Alpha冲刺(2/10)

    前言 队名:拖鞋旅游队 组长博客:https://www.cnblogs.com/Sulumer/p/9960487.html 作业博客:https://edu.cnblogs.com/campus/ ...

  4. PostgreSQL CheckPoint设置(转)

    今天在研究checkpoint process的问题时,顺便复习了一下checkpoint设置问题,又有新的疑惑了. checkpoint又名检查点,在oracle中checkpoint的发生意味着之 ...

  5. Tornado 自定义session,与一致性哈希 ,基于redis 构建分布式 session框架

    Tornado 自定义session,与一致性哈希 ,基于redis 构建分布式 session import tornado.ioloop import tornado.web from myhas ...

  6. C++ writestring 为什么不能写进中文 CStdioFile向无法向文本中写入中文【二】

    本地化设置需要具备三个条件:a. 语言代码 (Language Code)b. 国家代码 (Country Code) c. 编码(Encoding)本地名字可以用下面这些部分来构造:语言代码_国家代 ...

  7. 为什么写《Tomcat内核设计剖析》

    三四年前更多地还是做web业务开发,基本不关心web层以下的东西,但是每次出故障时面对现象都不能从脑子里形成由底层到应用层的完整的逻辑,往往只能分析到Web应用就无法继续往下,Web容器完全就是一个黑 ...

  8. UE4 Sequencer的事件调用

    本文章由cartzhang编写,转载请注明出处. 所有权利保留. 文章链接:http://blog.csdn.net/cartzhang/article/details/73554691 作者:car ...

  9. BeautifulSoup的安装和使用

    Python用做数据处理还是相当不错的,如果你想要做爬虫,python是很好的选择,它有很多已经写好的类包,只要调用,即可完成很多复杂的功能,此文中所有的功能都是基于BeautifulSoup这个包. ...

  10. 借助CustomBehaviorsLibrary.dll写出水印效果(转)

    在项目中载入这个dll 之后引用 使用方法具体如下图: 在这里需要注意到是项目中对interactivity的引用 :       好文要顶 关注我 收藏该文