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版本的搭建教程了,如果你有幸遇见,那么 ...
随机推荐
- 怎么理解angularjs中的服务?
AngularJS中的服务其实就是提供一种方式抽取共用类库 比如说一些工具类方法,我们传统的做法就是自己写个 utility 类,把相关的工具方法填充到utility里面去,最后把utility类放到 ...
- FormView分页显示数据的例子
%@ Page Language="C#" AutoEventWireup="true" CodeBehind="FormView控件.aspx.cs ...
- perl lwp 超时问题
lwp 超时问题: jrhmpt01:/root/async# cat a1.pl use LWP::UserAgent; use utf8; use DBI; use POSIX; use Data ...
- HDU 1848 Fibonacci again and again
题解:尼姆博弈,对于1至1000计算SG函数,每次取最小的前继值,SG值异或为0则为P-position. #include <cstdio> #include <cstring&g ...
- OFbiz--HelloWorld
上篇博客<OFbiz--简单介绍>我们介绍了OFbiz是什么,以下我们就開始用OFbiz开发我们的第一个程序--HelloWorld. 过程例如以下: 首先在hot-deploy下新建文件 ...
- js 特效 手风琴效果
$(document).ready(function(){ //定义展开的块 var lastBlock = $('#a1'); //展开的块的宽度 var maxWidth = 406; //折叠的 ...
- python中decorator
先讲一下python中的@符号 看下面代码 @f @f2 def fun(args, args2, args3, args4, ……): pass 上面代码相当于 def fun(args, args ...
- POJ 2250 Compromise(LCS)
POJ 2250 Compromise(LCS)解题报告 题目链接:http://acm.hust.edu.cn/vjudge/contest/view.action?cid=87125#proble ...
- 比赛F-F Perpetuum Mobile
比赛F-F Perpetuum Mobile 题目链接:http://acm.hust.edu.cn/vjudge/contest/view.action?cid=86640#problem/ ...
- 字节流复制mp3文件(带缓冲区)
//自定义的缓冲区 import java.io.*; class MyBufferedInputStream{ private byte[] buf = new byte[1024]; pr ...