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


    salve复制线程停止,尝试start slave 时报ERROR 1872错误

    mysql> system perror 1872  
    MySQL error code 1872 (ER_SLAVE_RLI_INIT_REPOSITORY): Slave failed to initialize relay log info structure from the repository

    解决过程
    1.看样子是找不到中继日志的仓库,但是查看变量relay log的位置是设置了的

    mysql> show variables like 'relay%';
    +---------------------------+---------------------------------------------------+
    | Variable_name             | Value                                             |
    +---------------------------+---------------------------------------------------+
    | relay_log                 | relay-log                                         |
    | relay_log_basename        | /datadir/relay-log       |
    | relay_log_index           | /datadir/relay-log.index |
    | relay_log_info_file       | relay-log.info  

    2.master.infor中也记录日志相关的信息,查看后没有发现异常
    3.重置复制信息

    mysql> reset master;
    Query OK, 0 rows affected (0.00 sec)
    mysql> show slave statusG
    *************************** 1. row ***************************
                   Slave_IO_State: 
                      Master_Host: *******
                      Master_User: repl
                      Master_Port: 3306
                    Connect_Retry: 60
                  Master_Log_File: 
              Read_Master_Log_Pos: 4
                   Relay_Log_File: relay-log.000001
                    Relay_Log_Pos: 4

    注意:  依然有复制信息

    之后接着
    set global gtid_purged='*******';
    change master to ......;
    start slave时依旧报错
    4.MySQL DOC关于start slave的描述:
    RESET SLAVE does not change any replication connection parameters such as master host, master port, master user, or master password, which are retained in memory. This means that START SLAVE can be issued without requiring a CHANGE MASTER TO statement following RESET SLAVE.

    Connection parameters are reset by RESET SLAVE ALL.

    5.使用reset slave all清空所有的复制信息,然后重置gtid_purged和master.infor
    start slave后复制正常

  • 相关阅读:
    【LeetCode-栈】栈排序
    【LeetCode-数组】旋转数组
    【LeetCode-数组】两个数组的交集 II
    【LeetCode-树】二叉树的层次遍历 II
    【LeetCode-字符串】Fizz Buzz
    【LeetCode-数组】数组的相对排序
    解决Oracle表中数据乱码的问题
    docker搭建mysql 用户名密码忘记了怎么办
    java中如何将string 转化成long
    http三次握手四次挥手
  • 原文地址:https://www.cnblogs.com/Bccd/p/8496807.html
Copyright © 2020-2023  润新知