启停主从复制
2015-11-03 13:46
288 查看
17.1.5.2 Pausing Replication on the Slave
You can stop and start the replication of statements on the slave using theSTOP SLAVEand
START SLAVEstatements.
To stop processing of the binary log from the master, use
STOP SLAVE:
mysql> [code]STOP SLAVE;
[/code]
When replication is stopped, the slave I/O thread stops reading events from the master binary log and writing them to the relay log, and the SQL thread stops reading events from the relay log and executing them. You can pause the I/O or SQL thread individually
by specifying the thread type:
mysql> [code]STOP SLAVE IO_THREAD;
mysql>
STOP SLAVE SQL_THREAD;
[/code]
To start execution again, use the
START SLAVEstatement:
mysql> [code]START SLAVE;
[/code]
To start a particular thread, specify the thread type:
mysql> [code]START SLAVE IO_THREAD;
mysql>
START SLAVE SQL_THREAD;
[/code]
For a slave that performs updates only by processing events from the master, stopping only the SQL thread can be useful if you want to perform a backup or other task. The I/O thread will continue to read events from the master but they are not executed. This
makes it easier for the slave to catch up when you restart the SQL thread.
Stopping only the I/O thread enables the events in the relay log to be executed by the SQL thread up to the point where the relay log ends. This can be useful when you want to pause execution to catch up with events already received from the master, when you
want to perform administration on the slave but also ensure that it has processed all updates to a specific point. This method can also be used to pause event receipt on the slave while you conduct administration on the master. Stopping the I/O thread but
permitting the SQL thread to run helps ensure that there is not a massive backlog of events to be executed when replication is started again.
相关文章推荐
- 【吐槽】关于VNCViewer的使用
- python3死活安装不了pil怎么办?
- AndroidTestCase单元测试框架用法
- U-boot中怎么添加配置菜单选项
- Bokeh快速入门(1)
- 基于DDD的开发框架Apworks
- intent.putExtra()方法参数详解
- Quick reference to HTTP headers
- 夺命雷公狗jquery---61Ajax跨域请求之方法2
- 20135302、20135315、20135323----缓冲区溢出漏洞实验(修改版)
- 3d游戏的总体设计框架
- LeetCode--Binary Tree Preorder Traversal
- P53 T5
- node express
- mysql创建和删除用户
- Mysql pid 文件
- 深刻理解C#中资源释放
- spring框架
- C 语言进阶有哪些优秀的代码可以阅读?
- 跨越千年的RSA算法