`
eyesmore
  • 浏览: 367509 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

数据库同步

阅读更多

6.2. Replication Implementation Overview

6.2. Replication Implementation Overview

MySQL replication is based on the master server keeping track of all changes to your databases (updates, deletes, and so on) in its binary logs . Therefore, to use replication , you must enable binary logging on the master server. See Section 5.12.3, “The Binary Log” .(打开日志开关)

 

Each slave server receives from the master the saved updates(in binary log) that the master has recorded in its binary log, so that the slave can execute the same updates on its copy of the data.

 

It is extremely important to realize that the binary log is simply a record starting from the fixed point in time at which you enable binary logging. Any slaves that you set up need copies of the databases on your master as they existed at the moment you enabled binary logging on the master . If you start your slaves with databases that are not in the same state as those on the master when the binary log was started, your slaves are quite likely to fail.

 

【The Limitations about   'Load Data From Master'】

One way to copy the master's data to the slave is to use the LOAD DATA FROM MASTER statement. However, LOAD DATA FROM MASTER works only if all the tables on the master use the MyISAM storage engine. In addition, this statement acquires a global read lock, so no updates on the master are possible while the tables are being transferred to the slave. (当执行load data from master时,不允许多master进行更新操作。)   When we implement lock-free hot table backup (允许源表边更新,边同步的热备份好像是件挺棘手的工作) , this global read lock will no longer be necessary.

 

Due to these limitations , we recommend that at this point you use LOAD DATA FROM MASTER only if the dataset on the master is relatively small , or if a prolonged read lock on the master is acceptable .

(由于这些诸多限制(limitations),建议您在使用Load Data From Master时,master上的数据集相对较小,或者master库上可以容忍长时间的Read Lock。)

 

(一秒钟能够同步1M的数据,环境是CPU-700MHz,网络是100M)

Although the actual speed of LOAD DATA FROM MASTER may vary from system to system, a good rule of thumb for how long it takes is 1 second per 1MB of data. This is a rough estimate (大概的估计), but you should find it fairly accurate (相当精确) if both master and slave are equivalent to 700MHz Pentium CPUs in performance and are connected through a 100Mbps network.

 

 

After the slave has been set up with a copy of the master's data , it connects to the master(capture program) and waits for updates to process.(同步程序分两步:1、load data from master; 2、capture updates happened on  the master and apply to the slave)

If the master fails, or the slave loses connectivity with your master, the slave keeps trying to connect periodically until it is able to resume listening for updates. The --master-connect-retry option controls the retry interval. The default is 60 seconds.(断开重连机制,重连间隔是可配的,默认是60s。)

 

Each slave keeps track of where it left off when it last read from its master server.(slave都会记录上一次读的"断点" 。)   The master has no knowledge of how many slaves it has or which ones are up to date at any given time.

 

 

 

分享到:
评论

相关推荐

    数据库同步软件DBSync V1.9 免费版

    DBSync是一款通用型的数据库同步软件,能侦测数据库之间的差异,能实时同步差异数据,从而使双方始终保持一致。支持各种数据库,支持异构同步、增量同步。 主要特点: ● 非侵入式,独立运行 ● 支持各种数据库 ● ...

    基于Java的数据库同步工具设计源码

    数据库同步工具:基于Java开发,包含22个文件,包括9个Java类文件、2个Markdown文档、2个JAR包文件、2个XML配置文件、2个Properties配置文件、1个.gitignore文件、1个LICENSE文件、1个PNG图像文件、1个GIF图像文件、...

    在VS2008下,利用c#在SQLSERVER2005实现两个数据库同步

    在这里,我们将创建一个Windows Forms应用,通过图形用户界面(GUI)触发数据库同步操作。 1. **创建Windows Forms项目** 在VS2008中,选择“文件”->“新建”->“项目”,然后选择“Windows Forms应用程序”。为...

    Canal 是一款优秀的数据库同步工具,可以帮助用户实现数据库的实时同步

    Canal 是一款优秀的数据库同步工具,可以帮助用户实现数据库的实时同步。当一个数据库中的数据发生更改时,Canal 可以实时捕获这些更改并将其同步到其他数据库中。这使得数据可以在不同的系统之间保持同步,从而提高...

    C# Access数据库同步 服务端

    在IT行业中,数据库同步是一个重要的任务,特别是在分布式系统或者有多处数据存储的需求时。本项目聚焦于使用C#实现Access数据库的同步,特别是在服务端环境下。Access数据库由于其易用性和轻量级特性,常被用于小型...

    SQL Server 2008数据库同步

    SQL Server 2008 数据库同步 SQL Server 2008 数据库同步是指在两个数据库之间实现数据的自动同步,以便进行数据备份和达到主子数据库自动更新的效果。本文将详细介绍 SQL Server 2008 数据库同步的实现过程。 ...

    WinCC_SQL数据库实现数据库同步

    WinCC_SQL_SERVER_数据库实现数据库同步

    数据库同步 数据库同步

    数据库同步是IT领域中一个关键的概念,特别是在分布式系统和数据备份与恢复的场景下。它涉及到如何保持多个数据库实例间的数据一致性,确保在任何给定时间,这些数据库都具有相同或近乎相同的数据状态。让我们深入...

    互联网数据库同步程序 delphi7

    标题“互联网数据库同步程序 Delphi7”涉及到的是一个利用Delphi7编程环境开发的数据库同步解决方案,主要用于在互联网上的两台计算机之间实现SQL Server 2000数据库的数据同步。这个程序的重要性和价值在于它能确保...

    开源免费数据库同步工具SQL-DBDiff_V0.4

    开源免费数据库同步工具SQL-DBDiff_V0.4 可用于两个数据库之间的比较,也可以做同步迁移用 全英文界面,配置选项比较多,适合英文还可以的朋友使用

    数据库同步工具(跨平台)

    数据库同步工具,支持各种数据库类型跨平台性良好! 数据库同步工具,支持各种数据库类型跨平台性良好!

    Oracle10G 数据库同步

    Oracle10G数据库同步是IT领域中一个关键的议题,特别是在多数据中心或灾备环境的管理中。Oracle10G是Oracle数据库的一个重要版本,它引入了许多增强功能,旨在提高性能、安全性和可用性。本方案针对Oracle10G数据库...

    数据库同步工具

    数据库同步工具,需稍作修改.支持增量同步和更新同步。

    同步数据,数据库同步,sql数据库同步

    同步当前数据库和服务器数据库的数据,使得两个数据库的数据一致,这个属于sql的高级应用,相信对你们都很有用处,也可以对你们的数据库能用有所提示,是一篇比较好的资料,由于该资料是本人开发的,所以希望尊重...

    数据库同步软件,可实时同步Mysql,Sqlserver数据库,支持异构数据库

    SyncNavigator是一款功能强大的数据库同步软件,适用于SQL SERVER, MySQL,具有自动/定时同步数据、无人值守、故障自动恢复、同构/异构数据库同步、断点续传和增量同步等功能,支持Windows xp以上所有操作系统,适用...

    数据同步技术数据库同步,SQL2000同步,2000,同步,备份

    数据库同步技术,数据库同步,SQL2000同步,2000,同步,备份

    易语言源码数据库同步易语言源码.rar

    易语言源码数据库同步易语言源码.rar 易语言源码数据库同步易语言源码.rar 易语言源码数据库同步易语言源码.rar 易语言源码数据库同步易语言源码.rar 易语言源码数据库同步易语言源码.rar 易语言源码数据库同步...

    数据库同步的操作步骤

    数据库同步的操作步骤

    MySql数据库同步复制

    该功能可以实现两个数据库同步,主从模式,互相备份模式的功能。 数据库同步复制功能的设置都在mysql的设置文件中体现。mysql的配置文件(windows下为my.ini,Unix/Linux下为my.cnf)

    跨数据库同步数据

    使用TJS跨数据库同步数据,真实项目源代码

Global site tag (gtag.js) - Google Analytics