17.1.1.4 Obtaining the Replication Master Binary Log Coordinates 得到复制master binary log 位置:
17.1.1.4 Obtaining the Replication Master Binary Log Coordinates 得到复制master binary log 位置: 你需要master的当前坐标在他的Binary log 为了配置slave slave开始复制处理在合适的点: 如果你已经有存在的数据在你的master上,你需要同步你的slaves 在开始复制过程前, 你必须停止处理语句在master上,然后得到他的当前的binary log 位置和dump 它的数据, 在运行master 继续执行语句前。 如果你不停止语句的执行,data dump和master status信息你使用的不会匹配 你会借宿不一致性或者冲突的数据库在slave上 要获得master binary log 位置信息,遵循下面的步骤: 1.开始一个session 在master 上通过连接它,flush 所有的表和block 写语句通过执行FLUSH TABLES WITH READ LOCK statement: mysql> FLUSH TABLES WITH READ LOCK; 对于InnoDB 表, FLUSH TABLES WITH READ LOCK 也堵塞COMMIT 操作 警告: 留着客户端 你执行e FLUSH TABLES statement 运行这样 read lock仍然有效,如果你退出client,lock是被释放: 2.在master 的另外一个session,使用SHOW MASTER STATUS 语句来得到当前的binary log 文件名字和位置: mysql> SHOW MASTER STATUS;
+------------------+-----------+--------------+------------------+-------------------+
| File | Position | Binlog_Do_DB | Binlog_Ignore_DB | Executed_Gtid_Set |
+------------------+-----------+--------------+------------------+-------------------+
| mysql-bin.000016 | 399962594 | | | |
+------------------+-----------+--------------+------------------+-------------------+
1 row in set (0.00 sec) mysql > SHOW MASTER STATUS;
+------------------+----------+--------------+------------------+
| File | Position | Binlog_Do_DB | Binlog_Ignore_DB |
+------------------+----------+--------------+------------------+
| mysql-bin.000003 | 73 | test | manual,mysql |
+------------------+----------+--------------+------------------+ 文件列显示 log file 的名字 Position 显示file 的位置。 在这个例子中,binary log 文件是mysql-bin.000003 和 position 是73. 记录那些值, 你随后需要它们当你设置slave的时候。 它们代表复制坐标 slave 应该开始处理新的更新从master 如果master 先前运行没有启用 binary logging, log file name 和position 通过SHOW MASTER STATUS 显示 或者mysqldump --master-data 会是空的。 你现在有信息你需要让slave开始读取从binary log 在正确的位置开始复制
17.1.1.4 Obtaining the Replication Master Binary Log Coordinates 得到复制master binary log 位置:的更多相关文章
- 17.1.1.4 Obtaining the Replication Master Binary Log Coordinates 获取复制Master Binary Log的坐标:
17.1.1.4 Obtaining the Replication Master Binary Log Coordinates 获取复制Master Binary Log的坐标: 你需要master ...
- 17.1.1.7 Setting Up Replication with New Master and Slaves 设置复制使用新的master和slaves:
17.1.1.7 Setting Up Replication with New Master and Slaves 设置复制使用新的master和slaves: 最简单和最直接方式是设置复制使用新的 ...
- 17.1.1.1 Setting the Replication Master Configuration 设置复制的master 配置:
17.1.1.1 Setting the Replication Master Configuration 设置复制的master 配置: 在一个复制master,你必须启用binary loggin ...
- 17.1.1.7 Setting Up Replication with New Master and Slaves 设置复制对于新的Master和Slaves:
17.1.1.7 Setting Up Replication with New Master and Slaves 设置复制对于新的Master和Slaves: 最简单和最直接的方法是设置复制用于使 ...
- 17.1.4 Replication and Binary Logging Options and Variables 复制和Binary logging 选项和变量
17.1.4 Replication and Binary Logging Options and Variables 复制和Binary logging 选项和变量 下面的章节包含信息关于mysql ...
- 17.1.2.1 Advantages and Disadvantages of Statement-Based and Row-Based Replication 基于语句和行的复制的优势和劣势
17.1.2.1 Advantages and Disadvantages of Statement-Based and Row-Based Replication 基于语句和行的复制的优势和劣势 每 ...
- 17.1.1.2 Setting the Replication Slave Configuration
17.1.1.2 Setting the Replication Slave Configuration 在一个复制slave, 你必须创建一个唯一的server ID,如果这个没有做,slave设置 ...
- 17.1.1.8?Setting Up Replication with Existing Data设置复制使用存在的数据
17.1.1.8?Setting Up Replication with Existing Data设置复制使用存在的数据 当设置复制使用存在的数据,你需要确定如何最好的从master 得到数据到sl ...
- RocketMQ初探(五)之RocketMQ4.2.6集群部署(单Master+双Master+2m+2s+async异步复制)
以下部署方式结合众多博友的博客,经过自己一步一步实际搭建,如有雷同,侵权行为,请见谅...其中遇到不少的坑,希望能帮到更多的人,现在很少能找到一份完整版4.2.6版本的搭建教程了,如果你有幸遇见,那么 ...
随机推荐
- java Spring 生命周期
1.初始化回调 <bean name="userService" class="com.sun.service.UserService" init-met ...
- 20151205 jquery 学习笔记--Ajax
Ajax全称为:“Asynchronous JavaScript and XML”(异步 JavaScript 和 XML), 它并不是 JavaScript 的一种单一技术,而是利用了一系列交互式网 ...
- 格式太旧或是类型库无效。 (Exception from HRESULT: 0x80028019 (TYPE_E_UNSUPFORMAT))
错误提示信息 格式太旧或是类型库无效. (Exception from HRESULT: 0x80028019 (TYPE_E_UNSUPFORMAT)) . Old format or invali ...
- 仿主题广告轮播js
function SlideShow(c) { var a = document.getElementById("slide"); var f = document.getElem ...
- u盘的超级用法
转自360 U盘是大家最常用的移动存储设备,不过它的即插即用特性在给我们带来方便同时,也带来了极大的安全隐患.一款没有加密功能的U盘,在借给他人使用或不慎丢失时,其中所保存的资料将很容 ...
- xfire构建webservice项目步骤以及使用
简单搭建xfire开源软件的webservice开发及其步骤: 1.创建好一个web工程,引入xfire下的jar包,注意lib下的和xfire-all.jar 2.定义接口: package com ...
- Codevs 1800 假面舞会 2008年NOI全国竞赛
1800 假面舞会 2008年NOI全国竞赛 时间限制: 1 s 空间限制: 128000 KB 题目等级 : 大师 Master 题目描述 Description 一年一度的假面舞会又开始了,栋栋也 ...
- eclipse下使用java调用weka(转)
原文链接:http://blog.csdn.net/felomeng/article/details/4688257 weka是很好用的机器学习库,这里就不详细介绍了. 言归正传,要使用程序方式使用w ...
- .net日志专用
一个简单的.net写日志方法 - 可能的改进点 昨天有个朋友在评论的时候问我如下代码在web开发中有什么问题 public void Log(string msg) { System.IO.File. ...
- struts导包
我用的是struts-2.2.3,开始把全部的jar包都放进去了,可是一直报 信息: Parsing configuration file [struts-plugin.xml]2011-6-11 8 ...