17.1.1.4 Obtaining the Replication Master Binary Log Coordinate
来源:互联网 发布:山西网络教育 编辑:程序博客网 时间:2024/06/07 03:38
17.1.1.4 Obtaining the Replication Master Binary Log Coordinate 得到复制master binary log的坐标
你需要master的当前的坐标 在binary log 为了配置slave来开始复制在正确的点上。
如果你master上已经存在数据,你需要同步到你的slave上在你开始复制前,你必须停止处理语句在master上,
得到一个当前binary log 坐标和dump 它的数据,在允许master继续执行语句前。
如果你不停止执行语句,数据dump和master 状态信息,你使用会不匹配,最终是不一致的或者损坏数据在slave上。
获得master 上的binary log 坐标,遵循以下步骤:
1.开始一个session 在master上通过命令行,flush 所有的表和block 写语句通过执行
FLUSH TABLES WITH READ LOCK语句:
mysql> FLUSH TABLES WITH READ LOCK;
对于InnoDB 表,FLUSH TABLES WITH READ LOCK 也堵塞COMMIT 操作
警告:
保留你执行FLUSH TABLES语句的客户端 运行,因为read lock 仍旧生效,如果退出客户端,lock 会被释放。
在Master上的另一个会话,使用SHOW MASTER STATUS 语句来确定当前log file name和position。
mysql > SHOW MASTER STATUS;
+——————+———-+————–+——————+
| File | Position | Binlog_Do_DB | Binlog_Ignore_DB |
+——————+———-+————–+——————+
| mysql-bin.000003 | 73 | test | manual,mysql |
+——————+———-+————–+——————+
File 列显示了log file 的名字和Position 显示文件的位置。在这个例子中,binary log 文件是mysql-bin.000003 and the
position is 73.
记录这些值,你需要它们在后面当你设置slave的时候,它们代表复制的坐标,slave开始处理新的update 从master接收。
如果master 已经运行以前没有binary log启用,log file name 和position 值 通过SHOW MASTER STATUS
或者mysqldump –master-data 会变空,在这种情况下,
现在你有你需要的信息,slave开始从binary log 在正确的位置开始复制。
如果你有存在的数据,需要被同步到slave在你开始复制前,让客户端保持运行,因为lock仍旧in place
- 17.1.1.4 Obtaining the Replication Master Binary Log Coordinate
- 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.1 Setting the Replication Master Configuration
- error 1236 from master when reading data from binary log: 'Slave can not handle replication events w
- The incident LOST_EVENTS occured on the master. Message: error writing to the binary log, Error_code
- The incident LOST_EVENTS occured on the master. Message: error writing to the binary log, Error_code
- 17.1.1.1 Setting the Replication Master Configuration 设置复制的master 配置:
- Last_Errno: 1594 the master's binary log is corrupted Last_SQL_Errno: 1062
- master to master replication
- Obtaining the Current Location
- Obtaining the event object
- 17.1.4.2 Replication Master Options and Variables
- Got fatal error 1236 from master when reading data from binary log: 'A slave with the same server_uu
- using INSTR function for obtaining data from a table, based on a selection from the master table (FK relation)
- 转 master to master replication
- MySQL Master-Master Replication Manager
- Mysql Master-Master Replication Manager
- hehe
- Android常见崩溃或闪退的问题描述及原因总结
- 文章标题
- 第四周--项目2 建设“单链表”算法库
- Linux grep命令全析
- 17.1.1.4 Obtaining the Replication Master Binary Log Coordinate
- codeforces 577A Multiplication Table
- mysql group_concat合并行用法和问题
- API Hooking with MS Detours-http://www.codeproject.com/Articles/30140/API-Hooking-with-MS-Detours
- android图片文件的路径地址与Uri的相互转换
- AndroidStudio无法更新代码
- citrix协议ICA技术原理
- Serif和Sans-serif字体的区别
- 大众化的登录界面的一种完美简单的实现方法(验证码+自带一键删除+用户名密码为空时抖动提示)