博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
MySQL更改relay-bin名称导致同步停止的解决办法
阅读量:5810 次
发布时间:2019-06-18

本文共 6678 字,大约阅读时间需要 22 分钟。

今天在优化io的时候,移动了从库relay-bin的位置,并将hostname部分去掉了,启动后,从库slave状态如下:

mysql> show slave status\G;*************************** 1. row ***************************               Slave_IO_State:                   Master_Host: 127.0.0.1                  Master_User: root                  Master_Port: 3306                Connect_Retry: 60              Master_Log_File: mysql-bin.000226          Read_Master_Log_Pos: 175251675               Relay_Log_File: iZ23nn1p4mjZ-relay-bin.000464                Relay_Log_Pos: 175251629        Relay_Master_Log_File: mysql-bin.000226             Slave_IO_Running: No            Slave_SQL_Running: No              Replicate_Do_DB: db_rsk,db_sys          Replicate_Ignore_DB:            Replicate_Do_Table:        Replicate_Ignore_Table:       Replicate_Wild_Do_Table: db_rsk.tb_act_unitequitiesposition,db_rsk.tb_act_productposition,db_rsk.tb_act_productunitasset,db_rsk.tb_act_productaccount,db_rsk.tb_act_unitaccount,db_rsk.tb_act_operationconfig,db_rsk.tb_rsk_assetvaluecompliance,db_rsk.tb_rsk_stockcostcompliance,db_rsk.tb_rsk_stockpoolcompliance,db_rsk.tb_rsk_stockquantitycompliance,db_rsk.tb_rsk_stockvaluecompalince,db_rsk.tb_rsk_tradelimitcompliance,db_rsk.tb_rsk_reversetradecompliance,db_rsk.tb_rsk_navcompliance,db_rsk.tb_rsk_rulescompliancecode,db_rsk.tb_rsk_usernavsection,db_rsk.tb_rsk_complianceset,db_rsk.tb_rsk_customdimensionstock,db_rsk.tb_rsk_customdimensiontype,db_rsk.tb_rsk_indexstock,db_rsk.tb_rsk_indextype,db_rsk.tb_rsk_industryclassification,db_rsk.tb_rsk_industrystock,db_rsk.tb_rsk_industrytype,db_rsk.tb_rsk_userdimensionstock,db_rsk.tb_rsk_userdimensiontype,db_rsk.tb_rsk_productmonitorset,db_rsk.tb_rsk_stockmonitorset,db_sys.tb_sys_bond_info,db_sys.tb_sys_code_map,db_sys.tb_sys_company,db_sys.tb_sys_dictionary,db_sys.tb_sys_exchange_info,db_sys.tb_sys_function_info,db_sys.tb_sys_menu,db_sys.tb_sys_menu_function,db_sys.tb_sys_operator,db_sys.tb_sys_operator_company,db_sys.tb_sys_operator_menu,db_sys.tb_sys_operator_parameter,db_sys.tb_sys_operator_role,db_sys.tb_sys_operator_unit,db_sys.tb_sys_order_direction,db_sys.tb_sys_parameter,db_sys.tb_sys_role,db_sys.tb_sys_role_menu,db_sys.tb_sys_stock_type,db_sys.tb_sys_system_info,db_sys.tb_sys_trade_date,db_sys.tb_sys_trade_time,db_sys.tb_sys_task_ex  Replicate_Wild_Ignore_Table:                    Last_Errno: 1872                   Last_Error: Slave failed to initialize relay log info structure from the repository                 Skip_Counter: 0          Exec_Master_Log_Pos: 175251424              Relay_Log_Space: 0              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: NULLMaster_SSL_Verify_Server_Cert: No                Last_IO_Errno: 0                Last_IO_Error:                Last_SQL_Errno: 1872               Last_SQL_Error: Slave failed to initialize relay log info structure from the repository  Replicate_Ignore_Server_Ids:              Master_Server_Id: 0                  Master_UUID: 96b464e1-b68f-11e6-8321-00163f00368a             Master_Info_File: /usr/local/Percona-Server-5.7.16-10-Linux.x86_64.ssl101/data2/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: 170314 19:34:56               Master_SSL_Crl:            Master_SSL_Crlpath:            Retrieved_Gtid_Set:             Executed_Gtid_Set:                 Auto_Position: 0         Replicate_Rewrite_DB: (db_act,db_rsk)                 Channel_Name:            Master_TLS_Version: 1 row in set (0.00 sec)ERROR: No query specified

使用start slave命令开启失败:

  mysql> start slave;

  ERROR 1872 (HY000): Slave failed to initialize relay log info structure from the repository

  使用reset slave命令解决:

  mysql> reset slave;

  Query OK, 0 rows affected (0.01 sec)

  mysql> start slave;

  Query OK, 0 rows affected (0.03 sec)

mysql> show slave status\G;*************************** 1. row ***************************               Slave_IO_State: Queueing master event to the relay log                  Master_Host: 127.0.0.1                  Master_User: root                  Master_Port: 3306                Connect_Retry: 60              Master_Log_File: mysql-bin.000223          Read_Master_Log_Pos: 62998               Relay_Log_File: relay-bin.000003                Relay_Log_Pos: 11565        Relay_Master_Log_File: mysql-bin.000223             Slave_IO_Running: Yes            Slave_SQL_Running: Yes              Replicate_Do_DB: db_rsk,db_sys          Replicate_Ignore_DB:            Replicate_Do_Table:        Replicate_Ignore_Table:       Replicate_Wild_Do_Table: db_rsk.tb_act_unitequitiesposition,db_rsk.tb_act_productposition,db_rsk.tb_act_productunitasset,db_rsk.tb_act_productaccount,db_rsk.tb_act_unitaccount,db_rsk.tb_act_operationconfig,db_rsk.tb_rsk_assetvaluecompliance,db_rsk.tb_rsk_stockcostcompliance,db_rsk.tb_rsk_stockpoolcompliance,db_rsk.tb_rsk_stockquantitycompliance,db_rsk.tb_rsk_stockvaluecompalince,db_rsk.tb_rsk_tradelimitcompliance,db_rsk.tb_rsk_reversetradecompliance,db_rsk.tb_rsk_navcompliance,db_rsk.tb_rsk_rulescompliancecode,db_rsk.tb_rsk_usernavsection,db_rsk.tb_rsk_complianceset,db_rsk.tb_rsk_customdimensionstock,db_rsk.tb_rsk_customdimensiontype,db_rsk.tb_rsk_indexstock,db_rsk.tb_rsk_indextype,db_rsk.tb_rsk_industryclassification,db_rsk.tb_rsk_industrystock,db_rsk.tb_rsk_industrytype,db_rsk.tb_rsk_userdimensionstock,db_rsk.tb_rsk_userdimensiontype,db_rsk.tb_rsk_productmonitorset,db_rsk.tb_rsk_stockmonitorset,db_sys.tb_sys_bond_info,db_sys.tb_sys_code_map,db_sys.tb_sys_company,db_sys.tb_sys_dictionary,db_sys.tb_sys_exchange_info,db_sys.tb_sys_function_info,db_sys.tb_sys_menu,db_sys.tb_sys_menu_function,db_sys.tb_sys_operator,db_sys.tb_sys_operator_company,db_sys.tb_sys_operator_menu,db_sys.tb_sys_operator_parameter,db_sys.tb_sys_operator_role,db_sys.tb_sys_operator_unit,db_sys.tb_sys_order_direction,db_sys.tb_sys_parameter,db_sys.tb_sys_role,db_sys.tb_sys_role_menu,db_sys.tb_sys_stock_type,db_sys.tb_sys_system_info,db_sys.tb_sys_trade_date,db_sys.tb_sys_trade_time,db_sys.tb_sys_task_ex  Replicate_Wild_Ignore_Table:                    Last_Errno: 0                   Last_Error:                  Skip_Counter: 0          Exec_Master_Log_Pos: 11360              Relay_Log_Space: 63396              Until_Condition: None               Until_Log_File:                 Until_Log_Pos: 0

 

转载地址:http://kecbx.baihongyu.com/

你可能感兴趣的文章
《Linux内核修炼之道》 之 高效学习Linux内核
查看>>
Java数据持久层框架 MyBatis之API学习九(SQL语句构建器详解)
查看>>
30分钟Git命令“从入门到放弃”
查看>>
nginx : TCP代理和负载均衡的stream模块
查看>>
MYSQL数据库间同步数据
查看>>
DevOps 前世今生 | mPaaS 线上直播 CodeHub #1 回顾
查看>>
iOS 解决UITabelView刷新闪动
查看>>
让前端小姐姐愉快地开发表单
查看>>
Dubbo笔记(四)
查看>>
Web前端JQuery入门实战案例
查看>>
java B2B2C Springboot电子商城系统- SSO单点登录之OAuth2.0 登出流程(3)
查看>>
12月26日云栖精选夜读:CDN新品发布:阿里云SCDN安全加速开放公测
查看>>
USB 通信原理
查看>>
7zZip zip RAR iOS
查看>>
date命令的详细用法!
查看>>
分布式存储ceph集群部署
查看>>
UiAutomator源码分析之UiAutomatorBridge框架
查看>>
python 开发之selenium
查看>>
Xcode3.2.5中找不到Mac OS X - Command Line Utility -...
查看>>
css的div垂直居中的方法,百分比div垂直居中
查看>>