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)

    注:

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

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

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

  • 相关阅读:
    python冲刺(5)列表声称式
    python冲刺(4)切片 等
    python冲刺(3)函数 等
    python冲刺(2)
    python冲刺(1)
    redis初步(1)
    php连接Oracle的时候遇到的编码集问题
    redis初步
    php 命名空间
    指向字符数组的指针与指向整型数组的指针
  • 原文地址:https://www.cnblogs.com/pythonx/p/12056027.html
Copyright © 2011-2022 走看看