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
  • 相关阅读:
    angularjs 输入框智能提示typeahead
    angularjs学习笔记--组件、$http、$q、module
    angularjs学习笔记--服务
    angularjs 学习笔记---小乱乱
    openURL调用其他程序(转)
    iOS6 中 Smart App Banners介绍和使用(转自COCOACHINA.COM)
    iOS 应用中打开其他应用 (转)
    IOS端的摇一摇功能
    IOS 应用官方接口地址
    本地推送UILocalNotification(转)
  • 原文地址:https://www.cnblogs.com/katec/p/9275186.html
Copyright © 2011-2022 走看看