zoukankan      html  css  js  c++  java
  • MySQL半同步复制的安装和配置

    (1)检查master/slave是否支持动态加载插件

    > show variables like 'have_dynamic_loading';
    +----------------------+-------+
    | Variable_name        | Value |
    +----------------------+-------+
    | have_dynamic_loading | YES   |
    +----------------------+-------+
    

    (2)检查plugin_dir位置,插件的放置位置

    > show variables like '%plugin_dir%';
    +---------------+------------------------------+
    | Variable_name | Value                        |
    +---------------+------------------------------+
    | plugin_dir    | /usr/local/mysql/lib/plugin/ |
    +---------------+------------------------------+
    

    (3)在master端执行

    > install plugin rpl_semi_sync_master soname 'semisync_master.so';
    > show pluginsG
    *************************** 43. row ***************************
       Name: rpl_semi_sync_master
     Status: ACTIVE
       Type: REPLICATION
    Library: semisync_master.so
    License: GPL
    43 rows in set (0.00 sec)
    
    >select plugin_name,plugin_status from information_schema.plugins where plugin_name like '%semi%';
    +----------------------+---------------+
    | plugin_name          | plugin_status |
    +----------------------+---------------+
    | rpl_semi_sync_master | ACTIVE        |
    +----------------------+---------------+
    

    (4)在slave端执行

    > install plugin rpl_semi_sync_slave soname 'semisync_slave.so';
    > show pluginsG
    *************************** 43. row ***************************
       Name: rpl_semi_sync_master
     Status: ACTIVE
       Type: REPLICATION
    Library: semisync_master.so
    License: GPL
    43 rows in set (0.00 sec)
    
    >select plugin_name,plugin_status from information_schema.plugins where plugin_name like '%semi%';
    +----------------------+---------------+
    | plugin_name          | plugin_status |
    +----------------------+---------------+
    | rpl_semi_sync_master | ACTIVE        |
    +----------------------+---------------+
    

    (5)master开启半同步复制

    > set global rpl_semi_sync_master_enabled=1;
    > set global rpl_semi_sync_master_timeout=30;
    >show global variables like 'rpl_semi_sync_master_enabled';
    +------------------------------+-------+
    | Variable_name                | Value |
    +------------------------------+-------+
    | rpl_semi_sync_master_enabled | ON    |
    +------------------------------+-------+
    

    (6)slave开启半同步复制

    > set global rpl_semi_sync_slave_enabled=1;
    > show global variables like 'rpl_semi_sync_slave_enabled';
    +-----------------------------+-------+
    | Variable_name               | Value |
    +-----------------------------+-------+
    | rpl_semi_sync_slave_enabled | ON    |
    +-----------------------------+-------+
    

    (7)如果slave在运行状态,要重启io_thread

    > stop slave io_thread;
    > start slave io_thread;
    

    (8)把配置信息写入配置文件

    master端:
    [mysqld]
    rpl_semi_sync_master_enabled=1
    rpl_semi_sync_master_timeout=1000 # 1 second
    
    slave端: 
    [mysqld]
    rpl_semi_sync_slave_enabled=1
    
  • 相关阅读:
    欢迎访问我的快站clone-5483e9466f404.kuaizhan.com
    SWFUpload 2.5.0版 官方说明文档 中文翻译版
    http://demo.jb51.net/js/2011/artDialog/_doc/iframeTop.html
    使用jquery-qrcode生成二维码
    主流浏览器CSS3和HTML5兼容性详细清单
    js获取浏览器基本信息:document.body.clientWidth/clientHeight/scrollWidth/scrollTop。
    document.documentElement和document.body的区别
    CSS 的优先级机制
    css三列布局之双飞翼pk圣杯
    响应式web设计(一)
  • 原文地址:https://www.cnblogs.com/abclife/p/5646941.html
Copyright © 2011-2022 走看看