从库报 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. python decorator 装饰器

    python装饰器是个对嵌套函数的语法糖 作用是在函数调用方法不变的情况下,将函数包装成另一个函数来使用 ---- import time def sum1(): sum = 1 + 2 print ...

  2. Python模块化

    在Python中,一个.py文件就称之为一个模块(Module). 模块化的好处: 1.大大提高了代码的可维护性. 2.编写代码不必从零开始.当一个模块编写完毕,就可以被其他地方引用.我们在编写程序的 ...

  3. An error report file with more information is saved as hs_err_pid2756.log

    An error report file with more information is saved as hs_err_pid2756.log weblogic启服务时遇到的问题,重新部署都不行, ...

  4. CSS字幕滚动 !!!

    marquee的基本语法:<marquee> … </marquee>,与大多数HTML语法元素一样,它也是成双出现的,被修饰对象就放在起始符和终止符之间.而且它自己可以实现鼠 ...

  5. index、noindex、follow、nofollow的使用说明

    爬虫是目前最常见的网络程序,曾经有过统计,说是目前的网络流量有一半以上是爬虫使用的.虽然爬虫程序随处可见,但是并不代表这种做法就是合理合法的. 在抓取网页时,我们要让自己的爬虫遵守Robot.txt协 ...

  6. EasyAACEncoder海思/ARM平台优化G711、G726转AAC的CPU占用高问题

    本文转自EasyDarwin开源团队成员Kim的博客:http://blog.csdn.net/jinlong0603/article/details/75645378 引言 目前EasyDarwin ...

  7. Okhttp之RealConnection建立链接简单分析

    在之前的博客中我们知道Okhttp在发起链接请求先从链接池中获取连接,如果链接池中没有链接则创建新的链接RealConnection对象,然后执行其connet方法打开SOCKET链接(详见< ...

  8. 原生js 保存图片到本地

    <template> <div> <!--创建一个cavas 用来存放图片--> <canvas id="cavasimg" width= ...

  9. Shell 批量搜索关键词并保存结果到文件中(数组、循环)

    #!/bin/bash keywords=("不需要" "不用谢谢" "xxx" "xxx") for var in $ ...

  10. MySQL 5.7笔记

    1. 初始化 重命名my-default.ini为my.ini 添加character_set_server=utf8 运行mysqld --initialize 2. 重置密码 服务器运行: mys ...