zoukankan      html  css  js  c++  java
  • MGR

    单主模式 

    参数修改

    server_id=1

    gtid_mode=ON

    enforce_gtid_consistency=ON

    binlog_checksum=NONE

    log_bin=binlog

    log_slave_updates=ON

    binlog_format=ROW

    master_info_repository=TABLE

    relay_log_info_repository=TABLE

    transaction_write_set_extraction    =XXHASH64
    loose-group_replication_group_name='5f6268dc-b17f-11e8-abfa-c03fd530ffff'
    loose-group_replication_start_on _boot=off
    loose-group_replication_group_seeds="150.0.32.236:24901,150.0.32.236:24902,150.0.32.236:24903"
    loose-group_replication_ip_whitelist='150.0.32.236'
    loose-group_replication_local_address='150.0.32.236:24902'
    loose-group_replication_bootstrap_group=off

    配置主节点

    set sql_log_bin=0;
    create user 'repl'@'%' identified by 'repl';
    grant replication slave on *.* to 'repl'@'%';
    flush privileges;
    set sql_log_bin=1;
     
    change master to master_user='repl',master_password='repl' for channel 'group_replication_recovery';
    INSTALL PLUGIN group_replication SONAME 'group_replication.so';
    SET GLOBAL group_replication_bootstrap_group=ON;
    START GROUP_REPLICATION;
    SET GLOBAL group_replication_bootstrap_group=OFF;
     
    select * from performance_schema.replication_group_members;

    配置备节点

    set sql_log_bin=0;
    create user 'repl'@'%' identified by 'repl';
    grant replication slave on *.* to 'repl'@'%';
    flush privileges;
    set sql_log_bin=1;
     
    change master to master_user='repl',master_password='repl' for channel 'group_replication_recovery';
    INSTALL PLUGIN group_replication SONAME 'group_replication.so';
    START GROUP_REPLICATION;
     

    多主模式

    loose-group_replication_single_primary_mode=off
    loose-group_replication_enforce_update_everywhere_checks=on
     

    相关视图监控

    performance_schema.replication_group_member_stats

    performance_schema.replication_group_members

    performance_schema.replication_connection_status

    performance_schema.replication_applier_status

    其他

    流控
    开启 group_replication_flow_control_mode=quota
    group_replication_flow_control_applier_threshold=25000 (默认事务个数)
    group_replication_flow_control_certifier_threshold=25000(默认事务个数)
     
    关闭 group_replication_flow_control_mode='disabled'
    备份和加节点时  关闭流控,防止事务延迟过多。

  • 相关阅读:
    参数innodb_force_recovery影响了整个InnoDB存储引擎的恢复状况
    innodb_fast_shutdown的内幕
    MySQL关闭过程详解和安全关闭MySQL的方法
    MySQL优化之Explain命令解读,optimizer_trace
    使用Amanda ZRM备份远程MySQL数据库
    类Unix上5个最佳开源备份工具 Bacula/Amanda/Backupninja/Backuppc/UrBackup
    获取 MySQL 崩溃时的 core file
    使用mysqldump备份时为什么要加上 -q 参数(5.7默认为on)
    关联与下钻:快速定位MySQL性能瓶颈的制胜手段
    MySQL安全策略
  • 原文地址:https://www.cnblogs.com/emmm233/p/9640704.html
Copyright © 2011-2022 走看看