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来启动复制进程在合适的点上 如果你有存在的数据在master上,你需要同步到你的slaves在开始复制进程前, 你必须停止处理语句在master上, 然后得到它的准备的binary log 坐标然后dump 它的数据, 在允许Master继续执行语句前,如果你不停止执行语句,数据dump和master 状态信息你使用的不会匹配 在你结束不一致的或者冲突的数据库 在slaves上。 要获得 master binary log 坐标,按照下面的步骤: 1. 开始一个session 在master上通过连接到它在命令行客户端,flush all tables和block 写操作通过执行 FLUSH TABLES WITH READ LOCK statement: 2.对于InnoDB 表,FLUSH TABLES WITH READ LOCK 也堵塞 COMMIT操作 警告: 留着客户端 你执行FLUSH TABLES 语句 运行,这样read lock 仍旧有效,如果你退出客户端,lock被释放。 2. 在一个不同的session在Master上,执行 SHOW MASTER STATUS 语句来确定当前的binary log 文件名和位置; mysql > SHOW MASTER STATUS;
+------------------+----------+--------------+------------------+
| File | Position | Binlog_Do_DB | Binlog_Ignore_DB |
+------------------+----------+--------------+------------------+
| mysql-bin.000003 | 73 | test | manual,mysql |
+------------------+----------+--------------+------------------+ 文件列显示 log file的名字,Position 显示文件的位置。 在这个例子中,binary log 文件是mysql-bin.000003 和 位置是73. 记录这些值,你需要随后当你设置复制的时候使用。它们代表复制坐标 slave应该开始处理新的更新从master server. 如果master 已经之前运行了没有启动binary logging , log 文件名字和位置值是通过SHOW MASTER STATUS or mysqldump --master-data 会显示为空。 在那种情况下, 你需要使用的值 当指定slave的log 文件和位置是空的字符串 你现在有需要的信息老让slave 开始从binary log 读取 在正确的位置开始复制 如果你已经存在数据 需要同步到slave 在开始复制前, 如果你设置一个新的master 和slave 复制组,你可以退出第一个session 窗口来释放read lock.
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版本的搭建教程了,如果你有幸遇见,那么 ...
随机推荐
- elk 分布式数据同步
zjtest7-redis:/elk/elasticsearch/data/es_cluster/nodes/0/indices/library# strings ./1/index/_3.cfs | ...
- c++ cout 保留小数点位
需要头文件 <iomanip> 输出时需要用 fixed 和 setprecision() fixed代表输出浮点数,setprecision()设置精度. #include <io ...
- poj 2051 Argus(优先队列)
题目链接: http://poj.org/problem?id=2051 思路分析: 优先级问题,使用优先队列求解:当执行某个任务后,再增加一个任务到队列中, 该任务的优先级为执行任务的时间加上其时间 ...
- Android JNI入门第二篇——Java参数类型与本地参数类型对照
前面一篇通过简单的例子介绍了android中JNI的使用.这一篇从基础上了解一些Java参数类型与本地参数类型区别. 1) java中的返回值void和JNI中的void是完全对应的哦! ...
- 转载 js判断浏览器
$scope.identifyBrowser= function () { var userAgent = navigator.userAgent, rMsie = /(msie\s|trident. ...
- Jmeter 发送json{Jfinal 接口req rsp均为json}
链接地址:http://yangyoupeng-cn-fujitsu-com.iteye.com/blog/2013649 使用jmeter发送json数据.方法有三种 原创,转载请注明出处 1.利用 ...
- Flask中全局变量的实现
我们都知道在Flask中g,request,session和request是作为全局对象来提供信息的,既然是全局的又如何保持线程安全呢,接下来我们就看看flask是如何做到这点的.在源码中的ctx.p ...
- poj 2309
http://poj.org/problem?id=2309//找规律 可以看到每个根节点都可以将其在同一层的最左边的根节点整除,并且最大值为该节点加上最左边的节点值-1,最小值为////为该节点减去 ...
- 数据切分——Mysql分区表的建立及性能分析
Mysql的安装方法可以参考: http://blog.csdn.net/jhq0113/article/details/43812895 Mysql分区表的介绍可以参考: http://blog.c ...
- A. Liserious战队
Liserious战队是一支活跃在京沪地区的著名密室逃脱战队,在优秀的队长Liserious和芳姐的带领下,打遍天下大大小小的密室逃脱,攻无不克,战无不胜,上天入地无所不能. 世界密室逃脱委员会以IS ...