zoukankan      html  css  js  c++  java
  • MySQL DBA 复制基础及应用场景(八)

    复制环境搭建

    MySQL复制结构

    MySQL复制原理

    MySQL复制应用在什么场景

    DTS=>row+GTID

    =====================================

    环境搭建 

    1.5.7.26

    2.GTID+row

     ******************************************************

    slave变成独立的节点

    stop slave;

    reset slave all;

    reset slave -- RESET SLAVE makes the slave forget its replication position in the master's binary log. This statement is meant to be used for a clean start: It clears the master info and relay log info repositories, deletes all the relay log files, and starts a new relay log file. It also resets to 0 the replication delay specified with the MASTER_DELAY option to CHANGE MASTER TO

     ******************************************************

    #d6ceb3

    ******************************************************

    清除数据,让实例变成全新数据库

    drop database xxx;

    reset master;

    show master status;

    ****************************************************** 

    select @@server_uuid;

    GTID:server_uuid+No

    主库初始化一个实例

    mysqld --defaults-file=xxx --initialize

    #binlog

    binlog_format=row

    log_bin=/data/mysql....

    #GTID

    gtid_mode=on

    enforce_gtid_consistency=on

    server_id=ip+port

    grant replication slave on *.* to  'repl'@'%'  identified by 'repl';

    reset master;

    丛库初始化一个实例

    mysqld --defaults-file=xxx --initialize

    reset master;

    change master to ...,master_auto_position=1;

    retriveved_Gtid_Set:xxxxxxxxxx

    Executed_Gtid_Set:

    ---------------------------------------

    mysqldump --master-data=2 --single-transaction -A >db3306-`date +%Y%m%d`.sql

    -- SET @@GLOBAL_GTID_PURGED='xxxxx';  --告诉io_thread从什么位置开始拉取日志

    5.6 database

    5.7binlog group commit

    8.0 writeSet

     

  • 相关阅读:
    VIM配置
    guanyuzhuguosha
    会议室同步时钟布置
    npm ERR! missing script: dev npm ERR! A complete log of this run can be found in: npm ERR!
    Xmind2021安装激活破解
    SpringCloudAlibaba 中文文档
    flex布局 滚动条失效
    Luogu P3397 地毯
    Luogu P4343 自动刷题机
    Luogu P1902 刺杀大使
  • 原文地址:https://www.cnblogs.com/geek-ace/p/11146080.html
Copyright © 2011-2022 走看看