zoukankan      html  css  js  c++  java
  • 17.2.2 Replication Relay and Status Logs 复制Relay 和状态日志;

    17.2.2 Replication Relay and Status Logs  复制Relay 和状态日志;
    
    17.2.2.1 The Slave Relay Log
    17.2.2.2 Slave Status Logs
    
    
    在复制过程中,一个slave server 创建几个logs 持有binary log events 中继从master 到slave,
    
    
    记录信息关于当前的状态和位置 在relay log里, 有3种类型的日志 如下:
    
    1.relay log 包含events 从master的binary log 读取 通过slave I/O thread写入。
    
    
    Events 在relay log 是在slave上呗执行作为SQL thread 的一部分
    
    2. master info log 包含了状态和当前配置信息 对于slave连接到master.
    
    log 持有的信息关于master host name, login credentials, coordinates  表明slave 已经从master的binary log读取多远
    
    
    
    在MySQL 5.6之前,这个log总是一个文件(master.info),但是在MySQL 5.6和以后版本,
    
    这个日志可以写入到mysql.slave_master_info代替文件,通过--master-info-repository=TABLE
    
    mysql> select * from mysql.slave_master_infoG;
    *************************** 1. row ***************************
           Number_of_lines: 23
           Master_log_name: mysql-bin.000017
            Master_log_pos: 234940920
                      Host: 192.168.11.186
                 User_name: backup
             User_password: kjk7787czcb
                      Port: 3306
             Connect_retry: 60
               Enabled_ssl: 0
                    Ssl_ca: 
                Ssl_capath: 
                  Ssl_cert: 
                Ssl_cipher: 
                   Ssl_key: 
    Ssl_verify_server_cert: 0
                 Heartbeat: 1800
                      Bind: 
        Ignored_server_ids: 0
                      Uuid: d6881046-9be4-11e6-8b6a-0050568a6b1d
               Retry_count: 86400
                   Ssl_crl: 
               Ssl_crlpath: 
     Enabled_auto_position: 0
    1 row in set (0.00 sec)
    
    ERROR: 
    No query specified
    
    
    
    relay log info log 持有状态信息关于在slave的relay log的执行点
    
    
    在MySQL 5.6之前,日志总是一个文件(relay-log.info),但是在MySQL 5.6和以后版本,
    
    日志可以写入到mysql.slave_relay_log_info 表带人体文件通过with --relay-log-info-repository=TABLE. 
    
    mysql> select * from mysql.slave_relay_log_infoG;
    *************************** 1. row ***************************
      Number_of_lines: 7
       Relay_log_name: ./mysqld-relay-bin.000007
        Relay_log_pos: 235865893
      Master_log_name: mysql-bin.000017
       Master_log_pos: 235865730
            Sql_delay: 0
    Number_of_workers: 0
                   Id: 1
    1 row in set (0.00 sec)
    
    ERROR: 
    No query specified
    
    
    
    在MySQL 5.6中,设置relay_log_info_repository and master_info_repository to 为TABLE 可以改善意外Hash的恢复能力。
    
    
    从5.6.6开始,那些表是使用InnoDB表
    
    
    在MySQL 5.6.5和早期版本,slave_master_info and slave_relay_log_info tables 默认是使用MyISAM 
    
    这以为这你需要在启动复制前改变存储引擎通过执行ALTER TABLE ... ENGINE=InnoDB
    
    
    ALTER TABLE mysql.slave_master_info ENGINE=InnoDB;
    ALTER TABLE mysql.slave_relay_log_info ENGINE=InnoDB;
    
    
    
    注意:
    
    不要尝试更新或者插入lave_master_info or slave_relay_log_info table 表手动的,
    
    这么做会导致未定义的行为,是不支持的
    

  • 相关阅读:
    spring boot web开发使用kindeditor中调用地图功能的异常情况"此内容不能显示在一个框架中"
    mysql在spring+mybatis中出现value '0000-00-00 00:00:00' can not be represented as java.sql.Timestamp的几种种解决办法
    spring oauth2 的认证流程
    mingw32 QT环境在集成一些librtmp代码由于zlib出现的一些错误:undefined reference to `inflate'
    QT下c和c++混编问题
    产品与开发那些事
    Qt5.6 windows下vs2015(vs2012)编译ODBC
    转 2018 疯狂微服务之死
    Source Tree时免登录安装
    Win7系统下局域连接OPC配置
  • 原文地址:https://www.cnblogs.com/hzcya1995/p/13350039.html
Copyright © 2011-2022 走看看