zoukankan      html  css  js  c++  java
  • CDH-mysql 开启关闭 gtid

    在线开启步骤:

    首先查询gtid状态

    mysql> show variables like '%gtid%';
    +----------------------------------+-----------+
    | Variable_name | Value |
    +----------------------------------+-----------+
    | binlog_gtid_simple_recovery | ON |
    | enforce_gtid_consistency | ON |
    | gtid_executed_compression_period | 1000 |
    | gtid_mode | OFF |
    | gtid_next | AUTOMATIC |
    | gtid_owned | |
    | gtid_purged | |
    | session_track_gtids | OFF |
    +----------------------------------+-----------+
    8 rows in set (0.01 sec)

    1、要求:

    (1)必须是5.7.6版本以上的mysql

    (2)GTID状态为OFF

    2、开启步骤:

    (1):SET GLOBAL ENFORCE_GTID_CONSISTENCY = 'WARN';

    (2):SET GLOBAL ENFORCE_GTID_CONSISTENCY = 'ON';

    (3):SET GLOBAL GTID_MODE = 'OFF_PERMISSIVE';

    (4):SET GLOBAL GTID_MODE = 'ON_PERMISSIVE';

    (5):SET GLOBAL GTID_MODE = 'ON';

     3、要永久启用,在my.cnf配置文件中添加参数:

    gtid-mode=ON

    enforce-gtid-consistency

    mysql> show variables like '%gtid%';
    +----------------------------------+-----------+
    | Variable_name | Value |
    +----------------------------------+-----------+
    | binlog_gtid_simple_recovery | ON |
    | enforce_gtid_consistency | ON |
    | gtid_executed_compression_period | 1000 |
    | gtid_mode | ON |
    | gtid_next | AUTOMATIC |
    | gtid_owned | |
    | gtid_purged | |
    | session_track_gtids | OFF |
    +----------------------------------+-----------+

    在线关闭步骤:

    1、要求:

    (1)必须是5.7.6版本以上的mysql

    (2)GTID状态为OFF

    2、关闭步骤:

    (1):stop slave;

    (2):SET GLOBAL GTID_MODE = 'ON_PERMISSIVE';

    (3):SET GLOBAL GTID_MODE = 'OFF_PERMISSIVE';

    (4):SET GLOBAL GTID_MODE = 'OFF';

    mysql> show variables like '%gtid%';
    +----------------------------------+-----------+
    | Variable_name | Value |
    +----------------------------------+-----------+
    | binlog_gtid_simple_recovery | ON |
    | enforce_gtid_consistency | ON |
    | gtid_executed_compression_period | 1000 |
    | gtid_mode | OFF |
    | gtid_next | AUTOMATIC |
    | gtid_owned | |
    | gtid_purged | |
    | session_track_gtids | OFF |
    +----------------------------------+-----------+
    8 rows in set (0.01 sec)

    注:

    每次开启和关闭时,都是这样一个过程:

    打开-->过度模式-->完全打开

    停止-->过度模式-->完全关闭

  • 相关阅读:
    ActiveMQ 即时通讯服务 浅析
    Asp.net Mvc (Filter及其执行顺序)
    ActiveMQ基本介绍
    ActiveMQ持久化消息的三种方式
    Windows Azure Virtual Machine (27) 使用psping工具,测试Azure VM网络连通性
    Azure China (10) 使用Azure China SAS Token
    Windows Azure Affinity Groups (3) 修改虚拟网络地缘组(Affinity Group)的配置
    Windows Azure Storage (22) Azure Storage如何支持多级目录
    Windows Azure Virtual Machine (26) 使用高级存储(SSD)和DS系列VM
    Azure Redis Cache (2) 创建和使用Azure Redis Cache
  • 原文地址:https://www.cnblogs.com/pythonx/p/12056027.html
Copyright © 2011-2022 走看看