zoukankan      html  css  js  c++  java
  • MySql开启GTID和多线程复制功能

    1.修改参数
    master:
    gtid_mode = ON                        --开启gtid这个必须打开
    enforce-gtid-consistency = ON    --开启gtid这个必须打开
    slave_parallel_workers=4           --开启基于库的多线程复制默认0不开启  5.6只能支持一个数据库开启一个线程,5.7可以一个数据库开启多个线程
    binlog_cache_size = 8M 
    max_binlog_size = 50M 
    max_binlog_cache_size = 100M 
    sync_binlog = 1 
    expire_logs_days = 1 
    log-slave-updates=true              --开启gtid这个必须打开
     
    slave:
    binlog_format = row
    gtid_mode = ON
    enforce-gtid-consistency = ON
    binlog_cache_size = 8M
    max_binlog_size = 50M
    max_binlog_cache_size = 100M
    sync_binlog = 1
    expire_logs_days = 1
    slave_parallel_workers=4
    max_relay_log_size = 50M
    relay_log_purge = 1
    relay_log_recovery = 1  
    master_verify_checksum = 1        --主事件校验
    slave_sql_verify_checksum = 1     --从事件校验
    slave_allow_batching = 1
    log-slave-updates=true
     
    2.重启数据库
    mysqladmin -uroot -hloalhost -p shutdown
    /usr/local/mysql/bin/mysqld_safe&
     
    3.在slave端change
    change master to master_host='192.168.10.100',
    master_port=3306,
    master_user='repl',
    master_password='123456',
    master_auto_position=1;
    4.查看
    show slave status G
     
               Retrieved_Gtid_Set: 43ea2a1b-5fcc-11e8-8e35-000c29d02a8e:4
                Executed_Gtid_Set: 43ea2a1b-5fcc-11e8-8e35-000c29d02a8e:1-4
  • 相关阅读:
    一个完整的Http请求
    struts2回显指定的错误信息
    Struts2中的OGNL通配符
    hibernate日常BUG总结
    Hibernate中的GetCurrentSession()方法
    hibernate query.list() 返回的数据类型
    xp远程桌面登陆需要身份验证问题解决
    spring和hibernate整合时无法自动建表
    Spring的scope="prototype"属性
    给程序员的九点建议
  • 原文地址:https://www.cnblogs.com/katec/p/9275186.html
Copyright © 2011-2022 走看看