不带MASTER_LOG_FILE,MASTER_LOG_POS参数,执行change master 语句复制异常

2024-05-04 01:38

本文主要是介绍不带MASTER_LOG_FILE,MASTER_LOG_POS参数,执行change master 语句复制异常,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

-------------分析日志-------------
1.先停止复制进程:
dbadmin@(none) 08:05:45>stop slave;
Query OK, 0 rows affected (0.10 sec)

2.查看丛库的状态及复制点坐标:
dbadmin@(none) 08:05:52>show slave status \G
*************************** 1. row ***************************
               Slave_IO_State:
                  Master_Host: Master_Host
                  Master_User: Master_User
                  Master_Port: 3306
                Connect_Retry: 60
              Master_Log_File: mysql-bin.004476
          Read_Master_Log_Pos: 289617713
               Relay_Log_File: mysqld-relay-bin.000067
                Relay_Log_Pos: 289617859
        Relay_Master_Log_File: mysql-bin.004476
             Slave_IO_Running: No
            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: 0
                   Last_Error:
                 Skip_Counter: 0
          Exec_Master_Log_Pos: 289617713
              Relay_Log_Space: 289618059
              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: 0
               Last_SQL_Error:
  Replicate_Ignore_Server_Ids:
             Master_Server_Id: 612
1 row in set (0.00 sec)

3.查看一下master.info与relay-log.info文件中的信息,此时文件中记录的信息与show slave status显示的信息一致。
dbadmin@(none) 08:05:55>system cat /vobiledata/mysqldata/master.info;
18
mysql-bin.004476
289617713
Master_Host
repl
pass
3306
60
0





0
0.000

0
dbadmin@(none) 08:07:52>system cat /vobiledata/mysqldata/relay-log.info;
./mysqld-relay-bin.000067
289617859
mysql-bin.004476
289617713

4.不带MASTER_LOG_FILE,MASTER_LOG_POS参数,执行change master 语句,按照mysql官方文档的说法,执行语句后的复制点应该与之前的复制点一致,然而事实并非如此,执行该语句后,复制点被清空,记录在master.info和relay-log.info文件中的关于复制点的信息也被清空,如下:
dbadmin@(none) 08:08:24>CHANGE MASTER TO MASTER_HOST='Master_Host', MASTER_USER='repl', MASTER_PASSWORD='pass';
Query OK, 0 rows affected (0.11 sec)

dbadmin@(none) 08:08:55>show slave status \G
*************************** 1. row ***************************
               Slave_IO_State:
                  Master_Host: Master_Host
                  Master_User: Master_User
                  Master_Port: 3306
                Connect_Retry: 60
              Master_Log_File:
          Read_Master_Log_Pos: 4
               Relay_Log_File: mysqld-relay-bin.000001
                Relay_Log_Pos: 4
        Relay_Master_Log_File:
             Slave_IO_Running: No
            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: 0
                   Last_Error:
                 Skip_Counter: 0
          Exec_Master_Log_Pos: 0
              Relay_Log_Space: 107
              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: 0
               Last_SQL_Error:
  Replicate_Ignore_Server_Ids:
             Master_Server_Id: 612
1 row in set (0.00 sec)


dbadmin@(none) 08:09:01>system cat /vobiledata/mysqldata/master.info;
18

4
Master_Host
repl
pass
3306
60
0





0
1800.000

0
60
0





0
0.000

0
dbadmin@(none) 08:09:17>system cat /vobiledata/mysqldata/relay-log.info;
./mysqld-relay-bin.000001
4

0
7859
mysql-bin.004476
289617713

重启复制进程,发现复制点被莫名奇妙的变成了另外一个值,这个值既不是执行语句前的复制点,也不是执行语句后的复制点。
dbadmin@(none) 08:09:26>start slave;
Query OK, 0 rows affected (0.00 sec)

dbadmin@(none) 08:09:47>show slave status \G
*************************** 1. row ***************************
               Slave_IO_State: Waiting for master to send event
                  Master_Host: Master_Host
                  Master_User: Master_User
                  Master_Port: 3306
                Connect_Retry: 60
              Master_Log_File: mysql-bin.004430
          Read_Master_Log_Pos: 9547576
               Relay_Log_File: mysqld-relay-bin.000003
                Relay_Log_Pos: 360
        Relay_Master_Log_File: mysql-bin.004429
             Slave_IO_Running: Yes
            Slave_SQL_Running: Yes
              Replicate_Do_DB:
          Replicate_Ignore_DB:
           Replicate_Do_Table:
       Replicate_Ignore_Table:
      Replicate_Wild_Do_Table:
  Replicate_Wild_Ignore_Table:
                   Last_Errno: 0
                   Last_Error:
                 Skip_Counter: 0
          Exec_Master_Log_Pos: 214
              Relay_Log_Space: 53239
              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: 436462
Master_SSL_Verify_Server_Cert: No
                Last_IO_Errno: 0
                Last_IO_Error:
               Last_SQL_Errno: 0
               Last_SQL_Error:
  Replicate_Ignore_Server_Ids:
             Master_Server_Id: 612
1 row in set (0.00 sec)

dbadmin@(none) 08:09:52>show slave status \G
*************************** 1. row ***************************
               Slave_IO_State: Waiting for master to send event
                  Master_Host: Master_Host
                  Master_User: Master_User
                  Master_Port: 3306
                Connect_Retry: 60
              Master_Log_File: mysql-bin.004430
          Read_Master_Log_Pos: 61188972
               Relay_Log_File: mysqld-relay-bin.000003
                Relay_Log_Pos: 360
        Relay_Master_Log_File: mysql-bin.004429
             Slave_IO_Running: Yes
            Slave_SQL_Running: Yes
              Replicate_Do_DB:
          Replicate_Ignore_DB:
           Replicate_Do_Table:
       Replicate_Ignore_Table:
      Replicate_Wild_Do_Table:
  Replicate_Wild_Ignore_Table:
                   Last_Errno: 0
                   Last_Error:
                 Skip_Counter: 0
          Exec_Master_Log_Pos: 214
              Relay_Log_Space: 53239
              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: 436482
Master_SSL_Verify_Server_Cert: No
                Last_IO_Errno: 0
                Last_IO_Error:
               Last_SQL_Errno: 0
               Last_SQL_Error:
  Replicate_Ignore_Server_Ids:
             Master_Server_Id: 612
1 row in set (0.00 sec)

赶紧停止复制,发现命令居然被长时间卡住,尝试停止mysql服务,超时异常,最后通过kill 系统进程,并重启mysql服务,重新设为正确的复制点。
dbadmin@(none) 08:10:12>stop slave;

查看error log,发现有如下日志:
160510  8:08:55 [Note] 'CHANGE MASTER TO executed'. Previous state master_host='192.168.110.113', master_port='3306', master_log_file='mysql-bin.004476', master_log_pos='289617713'. New state master_host='192.168.110.113', master_port='3306', master_log_file='', master_log_pos='4'.
160510  8:09:47 [Note] Slave SQL thread initialized, starting replication in log 'FIRST' at position 0, relay log './mysqld-relay-bin.000001' position: 4
160510  8:09:47 [Note] Slave I/O thread: connected to master 'repl@192.168.110.113:3306',replication started in log 'FIRST' at position 4

这篇关于不带MASTER_LOG_FILE,MASTER_LOG_POS参数,执行change master 语句复制异常的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/958084

相关文章

无人叉车3d激光slam多房间建图定位异常处理方案-墙体画线地图切分方案

墙体画线地图切分方案 针对问题:墙体两侧特征混淆误匹配,导致建图和定位偏差,表现为过门跳变、外月台走歪等 ·解决思路:预期的根治方案IGICP需要较长时间完成上线,先使用切分地图的工程化方案,即墙体两侧切分为不同地图,在某一侧只使用该侧地图进行定位 方案思路 切分原理:切分地图基于关键帧位置,而非点云。 理论基础:光照是直线的,一帧点云必定只能照射到墙的一侧,无法同时照到两侧实践考虑:关

Andrej Karpathy最新采访:认知核心模型10亿参数就够了,AI会打破教育不公的僵局

夕小瑶科技说 原创  作者 | 海野 AI圈子的红人,AI大神Andrej Karpathy,曾是OpenAI联合创始人之一,特斯拉AI总监。上一次的动态是官宣创办一家名为 Eureka Labs 的人工智能+教育公司 ,宣布将长期致力于AI原生教育。 近日,Andrej Karpathy接受了No Priors(投资博客)的采访,与硅谷知名投资人 Sara Guo 和 Elad G

C++11第三弹:lambda表达式 | 新的类功能 | 模板的可变参数

🌈个人主页: 南桥几晴秋 🌈C++专栏: 南桥谈C++ 🌈C语言专栏: C语言学习系列 🌈Linux学习专栏: 南桥谈Linux 🌈数据结构学习专栏: 数据结构杂谈 🌈数据库学习专栏: 南桥谈MySQL 🌈Qt学习专栏: 南桥谈Qt 🌈菜鸡代码练习: 练习随想记录 🌈git学习: 南桥谈Git 🌈🌈🌈🌈🌈🌈🌈🌈🌈🌈🌈🌈🌈�

如何在页面调用utility bar并传递参数至lwc组件

1.在app的utility item中添加lwc组件: 2.调用utility bar api的方式有两种: 方法一,通过lwc调用: import {LightningElement,api ,wire } from 'lwc';import { publish, MessageContext } from 'lightning/messageService';import Ca

内核启动时减少log的方式

内核引导选项 内核引导选项大体上可以分为两类:一类与设备无关、另一类与设备有关。与设备有关的引导选项多如牛毛,需要你自己阅读内核中的相应驱动程序源码以获取其能够接受的引导选项。比如,如果你想知道可以向 AHA1542 SCSI 驱动程序传递哪些引导选项,那么就查看 drivers/scsi/aha1542.c 文件,一般在前面 100 行注释里就可以找到所接受的引导选项说明。大多数选项是通过"_

4B参数秒杀GPT-3.5:MiniCPM 3.0惊艳登场!

​ 面壁智能 在 AI 的世界里,总有那么几个时刻让人惊叹不已。面壁智能推出的 MiniCPM 3.0,这个仅有4B参数的"小钢炮",正在以惊人的实力挑战着 GPT-3.5 这个曾经的AI巨人。 MiniCPM 3.0 MiniCPM 3.0 MiniCPM 3.0 目前的主要功能有: 长上下文功能:原生支持 32k 上下文长度,性能完美。我们引入了

maven 编译构建可以执行的jar包

💝💝💝欢迎莅临我的博客,很高兴能够在这里和您见面!希望您在这里可以感受到一份轻松愉快的氛围,不仅可以获得有趣的内容和知识,也可以畅所欲言、分享您的想法和见解。 推荐:「stormsha的主页」👈,「stormsha的知识库」👈持续学习,不断总结,共同进步,为了踏实,做好当下事儿~ 专栏导航 Python系列: Python面试题合集,剑指大厂Git系列: Git操作技巧GO

AI(文生语音)-TTS 技术线路探索学习:从拼接式参数化方法到Tacotron端到端输出

AI(文生语音)-TTS 技术线路探索学习:从拼接式参数化方法到Tacotron端到端输出 在数字化时代,文本到语音(Text-to-Speech, TTS)技术已成为人机交互的关键桥梁,无论是为视障人士提供辅助阅读,还是为智能助手注入声音的灵魂,TTS 技术都扮演着至关重要的角色。从最初的拼接式方法到参数化技术,再到现今的深度学习解决方案,TTS 技术经历了一段长足的进步。这篇文章将带您穿越时

Thymeleaf:生成静态文件及异常处理java.lang.NoClassDefFoundError: ognl/PropertyAccessor

我们需要引入包: <dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-thymeleaf</artifactId></dependency><dependency><groupId>org.springframework</groupId><artifactId>sp

fzu 2277 Change 线段树

Problem 2277 Change Time Limit: 2000 mSec    Memory Limit : 262144 KB  Problem Description There is a rooted tree with n nodes, number from 1-n. Root’s number is 1.Each node has a value ai.