博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
mysql并行复制
阅读量:5976 次
发布时间:2019-06-20

本文共 3929 字,大约阅读时间需要 13 分钟。

  • 并行复制

    • 社区版5.6中新增
    • 并行是指从库多线程apply binlog
    • 库级别并行应用binlog,同一个库数据更改还是串行的(5.7版并行复制基于事务组)

    设置

set global slave_parallel_workers=10;设置sql线程数为10

步骤:

#从库mysql> show variables like '%slave_par%';+------------------------+-------+| Variable_name          | Value |+------------------------+-------+| slave_parallel_workers | 0     |#关闭状态+------------------------+-------+1 row in set (0.00 sec)mysql> set global slave_parallel_workers=10;Query OK, 0 rows affected (0.00 sec)#查看线程,SQL线程数量并没有改变,因为没有重新启动slavemysql> show processlist\G*************************** 1. row ***************************     Id: 15   User: system user   Host:      db: NULLCommand: Connect   Time: 59458  State: Waiting for master to send event   Info: NULL*************************** 2. row ***************************     Id: 16   User: system user   Host:      db: NULLCommand: Connect   Time: 59550  State: Slave has read all relay log; waiting for the slave I/O thread to update it   Info: NULL*************************** 3. row ***************************     Id: 17   User: root   Host: localhost     db: NULLCommand: Query   Time: 0  State: init   Info: show processlist3 rows in set (0.00 sec)mysql> stop slave;Query OK, 0 rows affected (0.00 sec)mysql> start slave;Query OK, 0 rows affected, 1 warning (0.02 sec)mysql> show processlist;+----+-------------+-----------+------+---------+------+-----------------------------------------------------------------------------+------------------+| Id | User        | Host      | db   | Command | Time | State                                                                       | Info             |+----+-------------+-----------+------+---------+------+-----------------------------------------------------------------------------+------------------+| 17 | root        | localhost | NULL | Query   |    0 | init                                                                        | show processlist || 18 | system user |           | NULL | Connect |    8 | Waiting for master to send event                                            | NULL             || 19 | system user |           | NULL | Connect |    8 | Slave has read all relay log; waiting for the slave I/O thread to update it | NULL             || 20 | system user |           | NULL | Connect |    8 | Waiting for an event from Coordinator                                       | NULL             || 21 | system user |           | NULL | Connect |    8 | Waiting for an event from Coordinator                                       | NULL             || 22 | system user |           | NULL | Connect |    8 | Waiting for an event from Coordinator                                       | NULL             || 23 | system user |           | NULL | Connect |    8 | Waiting for an event from Coordinator                                       | NULL             || 24 | system user |           | NULL | Connect |    8 | Waiting for an event from Coordinator                                       | NULL             || 25 | system user |           | NULL | Connect |    8 | Waiting for an event from Coordinator                                       | NULL             || 26 | system user |           | NULL | Connect |    8 | Waiting for an event from Coordinator                                       | NULL             || 27 | system user |           | NULL | Connect |    8 | Waiting for an event from Coordinator                                       | NULL             || 28 | system user |           | NULL | Connect |    8 | Waiting for an event from Coordinator                                       | NULL             || 29 | system user |           | NULL | Connect |    8 | Waiting for an event from Coordinator                                       | NULL             |+----+-------------+-----------+------+---------+------+-----------------------------------------------------------------------------+------------------+13 rows in set (0.00 sec)

转载地址:http://aopox.baihongyu.com/

你可能感兴趣的文章
移动web开发之像素和DPR
查看>>
Android Service详解(二)第一个Service
查看>>
nginx 301重定向带www的https链接配置方法
查看>>
VBS汇总
查看>>
英文系统支持中文
查看>>
mysql 非交互查询 存入execl
查看>>
PortSentry
查看>>
这一年,我们毕业了
查看>>
MySQL 语句
查看>>
Oracle PL/SQL匿名块
查看>>
python处理时间加减
查看>>
php7的redis和yaf的扩展安装
查看>>
centos7双网卡,一个连公网,一个连内网
查看>>
我的友情链接
查看>>
模拟实现strcat
查看>>
Android的一个关于Activity和UI的小程序
查看>>
Python31 Socket2
查看>>
mysql 自动补齐 表名,列名 方法, 重启mysql方法
查看>>
基于HAproxy的web动静分离及输出状态检测页面
查看>>
Highlight – 代码高亮html输出软件
查看>>