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的坐标:的更多相关文章

  1. 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 ...

  2. 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: 最简单和最直接方式是设置复制使用新的 ...

  3. 17.1.1.1 Setting the Replication Master Configuration 设置复制的master 配置:

    17.1.1.1 Setting the Replication Master Configuration 设置复制的master 配置: 在一个复制master,你必须启用binary loggin ...

  4. 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: 最简单和最直接的方法是设置复制用于使 ...

  5. 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 ...

  6. 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 基于语句和行的复制的优势和劣势 每 ...

  7. 17.1.1.2 Setting the Replication Slave Configuration

    17.1.1.2 Setting the Replication Slave Configuration 在一个复制slave, 你必须创建一个唯一的server ID,如果这个没有做,slave设置 ...

  8. 17.1.1.8?Setting Up Replication with Existing Data设置复制使用存在的数据

    17.1.1.8?Setting Up Replication with Existing Data设置复制使用存在的数据 当设置复制使用存在的数据,你需要确定如何最好的从master 得到数据到sl ...

  9. RocketMQ初探(五)之RocketMQ4.2.6集群部署(单Master+双Master+2m+2s+async异步复制)

    以下部署方式结合众多博友的博客,经过自己一步一步实际搭建,如有雷同,侵权行为,请见谅...其中遇到不少的坑,希望能帮到更多的人,现在很少能找到一份完整版4.2.6版本的搭建教程了,如果你有幸遇见,那么 ...

随机推荐

  1. QT实现,通过URL下载文件的接口实现

    今天来把坑填上. 具体就是提供一个URL,并通过这个URL下载文件. MyDownloader.h: #ifndef MYDOWNLOADER_H #define MYDOWNLOADER_H cla ...

  2. PHP glob() 函数用法

    glob() 函数返回匹配指定模式的文件名或目录. 该函数返回一个包含有匹配文件 / 目录的数组.如果出错返回 false. 语法 array glob ( string $pattern [, in ...

  3. Java中volatile的作用以及用法

    volatile让变量每次在使用的时候,都从主存中取.而不是从各个线程的“工作内存”. volatile具有synchronized关键字的“可见性”,但是没有synchronized关键字的“并发正 ...

  4. Effective C++ 第二版 10) 写operator delete

    条款10 写了operator new就要同时写operator delete 写operator new和operator delete是为了提高效率; default的operator new和o ...

  5. nginx-lua实现简单权限控制

    1,依赖软件:nginx(openresty) mysql(存储用户表)redis(存储用户登录token,有效期1周) create table account( uid integer not n ...

  6. Failed to upgrade Oracle Cluster Registry configuration(root.sh)

        近期在给客户基于Suse 11 sp3安装Oracle 10g RAC,在安装完clusterware运行/u01/app/crs/root.sh时收到错误提示.Failed to upgra ...

  7. Bitmap recycle()

    Bitmap调用recycle? When? Bitmap有一个recycle方法,意思非常easy,回收Bitmap的空间. Q 1: Bitmap是否有调用recycle方法的必要性? A: 嵌入 ...

  8. HA for openstack

    mysql ha instance ha openstack博客:http://blog.csdn.net/tantexian/article/list/2 使用eclipse远程调试openstac ...

  9. Compare the value of entity field.

    public class Program { static void Main(string[] args) { Program p = new Program(); p.Test(); Consol ...

  10. 在CheckBox中,仅仅允许选择一项

    作用相当于RadioButonList <html xmlns="http://www.w3.org/1999/xhtml"> <head runat=" ...