WO2016095372A1 - 实现事务日志镜像备份的方法及装置 - Google Patents

实现事务日志镜像备份的方法及装置 Download PDF

Info

Publication number
WO2016095372A1
WO2016095372A1 PCT/CN2015/076211 CN2015076211W WO2016095372A1 WO 2016095372 A1 WO2016095372 A1 WO 2016095372A1 CN 2015076211 W CN2015076211 W CN 2015076211W WO 2016095372 A1 WO2016095372 A1 WO 2016095372A1
Authority
WO
WIPO (PCT)
Prior art keywords
transaction log
power
server
down protection
protection memory
Prior art date
Application number
PCT/CN2015/076211
Other languages
English (en)
French (fr)
Inventor
刘德清
杨长江
吴刚
Original Assignee
中兴通讯股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 中兴通讯股份有限公司 filed Critical 中兴通讯股份有限公司
Publication of WO2016095372A1 publication Critical patent/WO2016095372A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation

Definitions

  • the present invention relates to the field of data storage, and in particular, to a method and apparatus for implementing transaction log mirror backup.
  • Transaction log storage system means that system changes are recorded through logs. This is mainly a security policy. When the system is abnormal, the transaction data can be redoed through the logs recorded by the file system.
  • the open source file system (ZFS, Zettabyte File System) is a transaction log-based file system. Each change of the file system in memory is defined as a transaction.
  • the ZFS log stores the system call that causes the ZFS system to change in the memory. Transaction record.
  • the system can make the system redo these transactions through the log of the ZFS system, thereby ensuring that the data will not be lost.
  • the transaction log storage system When writing data to the transaction log storage system, and the requirement is to use synchronous write mode, the transaction log storage system only needs to record the log of the write transaction and write the log to the fixed storage medium, and then The write to the external return is successful, which is the synchronous write semantics of the transaction log storage system. Even if the data written to the memory is not synchronized to the disk in the event of a failure, because the log is recorded when the data is written, the system can also find the data in the log, which is the synchronization semantics of the transaction log storage system.
  • Synchronous writes are generally very low due to the loss of cache device acceleration. Synchronous writes usually mean that data must be written synchronously to a stable storage medium to return the user successfully. The fixed storage medium used to synchronize the data is determined. The performance of synchronous writes.
  • the file system interface or the volume-level block device interface under the portable operating system interface (posix, Portable Operating System Interface) standard is a file system or a volume-level block device interface that conforms to the posix standard interface; the system external access interface
  • the file system transaction log module is responsible for generating and recording the transaction log;
  • the data management unit is responsible for organizing the management system data structure; the storage pool, and managing all physical storage spaces.
  • the transaction log storage system when the synchronous write mode is used, two servers running the same transaction log storage system share the back-end disk, and the log generated during the transaction is saved in the storage pool data through the intent log module.
  • the disk is the back-end disk.
  • the server running the same transaction log storage system can be run.
  • the server running the same transaction log storage system can be run.
  • the transaction corresponding to the log can be recovered, but in this case, the performance of the log written to the backend disk determines the performance of the current system synchronous write. Saving the log to the back end of the disk affects the speed of the system.
  • the embodiment of the invention provides a method and device for implementing the transaction log mirror backup.
  • the embodiment of the present invention adopts the following technical solutions:
  • a method for implementing a transaction log mirror backup is provided, which is applied to a plurality of servers that can run the same transaction log storage system, the method comprising: running the first of the transaction log storage system a server, recording a first transaction log generated when the first transaction in the transaction log storage system is generated; the first server sending the first transaction log to a preset first power-down protection memory, where The first power-down protection memory is located in the first server; the first server backs up the first transaction log image saved in the first power-down protection memory to the second power-down protection memory, wherein the second The power-down protection memory is located on a second server that can run the same transaction log storage system.
  • the first power-down protection memory and the second power-down protection memory are both non-volatile random access memories.
  • the first power-down protection memory and the second power-down protection memory have the same size.
  • a method for implementing a transaction log mirror backup is provided, which is applied to a plurality of servers that can run the same transaction log storage system, the method comprising: operating the transaction log storage system a second server, configured to receive a first transaction log sent by a first server running the transaction log storage system, wherein the first transaction log is generated when the first transaction in the transaction log storage system is generated, and The first power-down protection memory stored in the first server.
  • the second server saves the first transaction log in the second power-down protection memory, where the second power-down protection memory is located in the second server; when the second server detects the first server failure, And recovering, according to the first transaction log saved in the second power-down protection memory, the memory data of the first server before the failure occurs, and running the transaction log storage system.
  • the first power-down protection memory and the second power-down protection memory are both non-volatile random access memories.
  • the first power-down protection memory and the second power-down protection memory have the same size.
  • an apparatus for implementing a transaction log mirror backup applied to a plurality of servers operable to run the same transaction log type storage system
  • the apparatus comprising: a log generation module configured to run the transaction a first server of the log storage system, recording a first transaction log generated when the first transaction in the transaction log storage system is generated; and a sending module, configured to send the first transaction log to the first server a first power-down protection memory, wherein the first power-down protection memory is located in the first server; and the mirroring module is configured to be the first transaction that the first server saves the first power-down protection memory The log mirror is backed up to the second power-down protection memory, wherein the second power-down protection memory is located in the second server that can run the same transaction log storage system.
  • the first power-down protection memory and the second power-down protection memory are both non-volatile random access memories.
  • the first power-down protection memory and the second power-down protection memory have the same size.
  • an apparatus for implementing a transaction log mirror backup for a plurality of servers operable to run the same transaction log type storage system, the apparatus comprising: a receiving module configured to run the transaction a second server of the log storage system, configured to receive a first transaction log sent by a first server running the transaction log storage system, wherein the first transaction log is generated by a first transaction in the transaction log storage system The first power-down protection memory that is generated and stored in the first server; the storage module is configured to save the first transaction log in the second power-down protection memory, wherein the second The power-down protection memory is located in the second server; the processing module is configured to: when the second server detects the first server failure, according to the first transaction log saved in the second power-down protection memory, locally recovering the location The memory data of the first server before the failure occurs, and the transaction log storage system is run.
  • the first power-down protection memory and the second power-down protection memory are both non-volatile random access memories.
  • the first power-down protection memory and the second power-down protection memory have the same size.
  • the beneficial effects of the embodiment of the present invention are: the present invention backs up the first transaction log image that can recover the first transaction to the second power-down protection memory, and when the first server fails, by switching to the second server, and according to the The first transaction log of the second power-down protection memory restores the first transaction.
  • the first power-down memory and the second power-down memory are respectively located at the first server and the second server, and the first transaction log is stored in the first power-down memory and the second power-down memory instead of the back-end disk, thereby improving system operation. speed.
  • FIG. 1 is a schematic diagram showing a server of a prior art transaction log storage system
  • FIG. 2 is a flowchart of a method for implementing a transaction log mirror backup according to an embodiment of the present invention
  • FIG. 3 is a second flowchart of a method for implementing a transaction log mirror backup according to an embodiment of the present invention
  • FIG. 4 is a schematic diagram of a method for implementing a transaction log mirror backup according to an embodiment of the present invention
  • FIG. 5 is a schematic diagram of an apparatus for implementing a transaction log mirror backup according to an embodiment of the present invention.
  • FIG. 6 is a second schematic diagram of an apparatus for implementing a transaction log mirror backup according to an embodiment of the present invention.
  • FIG. 2 is a flowchart of a method for implementing a transaction log mirror backup according to an embodiment of the present invention
  • an embodiment of the present invention is applied to multiple servers that can run the same transaction log storage system, where a transaction log storage system is used. It can be a ZFS system, and of course not limited to this.
  • This embodiment includes the following steps:
  • Step S100 The first server running the transaction log storage system records the first transaction log generated when the first transaction in the transaction log storage system is generated.
  • Step S200 The first server sends the first transaction log to the preset first power-down protection memory, where the first power-down protection memory is located at the first server.
  • the first server saves the first transaction log to the preset first power-down protection memory through the intent log module, instead of saving the first transaction log to the disk in the storage pool, thereby greatly improving the running speed of the system.
  • the first power-down protection memory has a power-off protection function.
  • the first transaction log is stored by the power supply of the system itself, and the first power-down protection memory may be a non-volatile random access memory (NVRAM, Non-Volatile Random Access Memory), can also back up the memory data to the SSD through the backup power supply when the power is off. The next time the system is powered on, the data from the SSD backup in the SSD will be read into the memory again.
  • NVRAM non-volatile random access memory
  • step S300 the first server backs up the first transaction log image saved in the first power-down protection memory to the second power-down protection memory, wherein the second power-down protection memory is located in the second server that can run the same transaction log storage system. server.
  • mirror backup uses prior art, such as remote procedure call technology.
  • the first power-down memory and the second power-down memory have the same size, ensuring that the second power-down memory can also completely store the first transaction log.
  • the embodiment of the present invention increases the speed of the system operation by adding NVRAM in the first server to store the first transaction log, and does not need to occupy the back-end disk.
  • FIG. 3 is a flowchart of a method for implementing a transaction log mirror backup according to an embodiment of the present invention
  • an embodiment of the present invention is applied to multiple servers that can run the same transaction log storage system, where a transaction log storage system is used. It can be a ZFS system, and of course not limited to this.
  • This embodiment includes the following steps:
  • Step S400 The second server that can run the transaction log storage system receives the first transaction log sent by the first server running the transaction log storage system, where the first transaction log is generated by the first transaction in the transaction log storage system. And generated in the first power-down protection memory of the first server.
  • Step S500 The second server saves the first transaction log in the second power-down protection memory, where the second power-down protection memory is located in the second server.
  • Step S600 When the second server detects the first server failure, according to the first transaction log saved in the second power-down protection memory, locally recovers the memory data of the first server before the failure occurs, and runs the transaction log storage. system.
  • the embodiment of the present invention backs up the first transaction log image that can recover the first transaction to the second power-down protection memory, and when the first server fails, by switching to the second server, and according to the second drop
  • the first transaction log of the electrical protection memory restores the first transaction, thereby also ensuring the reliability of data writing.
  • the switching between servers uses prior art, such as dual hot standby switching.
  • FIG. 4 it is a schematic diagram of a method for implementing a transaction log mirror backup according to an embodiment of the present invention; unlike FIG. 1, both server A and server B in FIG. 4 are provided with NVRAM, and the generated first transaction log is passed.
  • the intent log module is stored in NVRAM instead of the backend disk, greatly increasing the speed of the system.
  • FIG. 5 is a schematic diagram of an apparatus for implementing a transaction log mirror backup according to an embodiment of the present invention.
  • the embodiment of the present invention is applied to multiple servers that can run the same transaction log storage system, including: a log generation module 501, and a sending The module 502 and the mirroring module 503; wherein the log generating module 501 is configured to run a first server of the transaction log storage system, and record a first transaction log generated when the first transaction in the transaction log storage system is generated; and the sending module 502
  • the first server is configured to send the first transaction log to the preset first power-down protection memory, where the first power-down protection memory is located in the first server, and the mirror module 503 is configured to be the first server
  • the first transaction log mirror saved by the power-down protection memory is backed up to the second power-down protection memory, wherein the second power-down protection memory is located in the second server that can run the same transaction log storage system.
  • the embodiment of the present invention increases the speed of the system operation by adding the NVRAM in the first server to store the first transaction log, and does not need to occupy the back-end disk.
  • the first power-down protection memory has the function of power-off protection. When the system is powered off, the first transaction log is stored by the power supply of the system itself.
  • the first power-down protection memory can be NVRAM or software.
  • the embodiment of the present invention adopts NVRAM. Mirror backups use existing technologies such as remote procedure call technology.
  • the first power-down memory and the second power-down memory have the same size, ensuring that the second power-down memory can also completely store the first transaction log.
  • FIG. 6 is a schematic diagram of an apparatus for implementing a transaction log mirror backup according to an embodiment of the present invention
  • an embodiment of the present invention is applied to multiple servers that can run the same transaction log storage system, including: a receiving module 601 and a storage module.
  • the receiving module 601 is configured as a second server operable to run the transaction log type storage system, and receives a first transaction log sent by the first server running the transaction log type storage system, wherein the first transaction log The first power-down protection memory generated when the first transaction is generated in the transaction log storage system, and stored in the first power-down protection memory of the first server;
  • the storage module 602 is configured to save the first transaction log in the second server
  • the second protection server is located in the second power-down protection memory
  • the local server recovers the memory data before the failure of the first server and runs the transaction log storage system.
  • the embodiment of the present invention backs up the first transaction log image that can recover the first transaction to the second power-down protection memory, and when the first server fails, by switching to the second server, and according to the second drop
  • the first transaction log of the electrical protection memory restores the first transaction, thereby also ensuring the reliability of data writing.
  • the switching between servers uses prior art, such as dual hot standby switching.
  • the first transaction log image that can recover the first transaction is backed up to the second power-down protection memory, and when the first server fails, by switching to the second server, and according to the first
  • the first transaction log of the second power-down protection memory restores the first transaction.
  • the first power-down memory and the second power-down memory are respectively located at the first server and the second server, and the first transaction log is stored in the first power-down memory and the second power-down memory instead of the back-end disk, thereby improving system operation. speed.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

一种实现事务日志镜像备份的方法及装置,应用于可运行同一事务日志型存储系统的多个服务器,该方法包括:运行事务日志型存储系统的第一服务器,记录事务日志型存储系统中的第一事务产生时生成的第一事务日志(S100);该第一服务器将第一事务日志发送至预设的第一掉电保护内存,第一掉电保护内存位于该第一服务器(S200);该第一服务器将第一掉电保护内存保存的第一事务日志镜像备份至第二掉电保护内存,第二掉电保护内存位于可运行同一事务日志型存储系统的第二服务器(S300)。该方法可恢复第一事务的第一事务日志镜像备份至第二掉电保护内存,当第一服务器故障时,通过切换至第二服务器,并根据位于第二掉电保护内存的第一事务日志恢复第一事务。

Description

实现事务日志镜像备份的方法及装置 技术领域
本发明涉及数据存储领域,尤其涉及一种实现事务日志镜像备份的方法及装置。
背景技术
事务日志型存储系统是指系统的变更都通过日志记录下来,这主要是一种出于安全策略的做法;当系统异常时可以通过文件系统记录的日志来重做事务恢复数据。
开源的文件系统(ZFS,Zettabyte File System)是基于事务日志型的文件系统,文件系统在内存中的每次变更定义为一个事务,ZFS日志在内存中保存了导致ZFS系统发生变更的系统调用的事务记录。当系统异常时,如果变更ZFS系统的事务没有及时同步到永久存储介质时,系统可以通过ZFS系统的日志使得系统可以重做这些事务,从而保证了数据不会出现丢失的情况。
当往事务日志型存储系统中写入数据,并且要求是采用同步写的方式时,事务日志型存储系统只需要将这次写事务的日志记录下来,并且将日志写到固定存储介质上去,然后给外部返回写入成功,这就是事务日志型存储系统的同步写语义。即使写到内存中的数据在出现故障时没有被同步到磁盘,因为数据写入时记录了日志,系统还可以在日志中将数据找到,这是事务日志型存储系统的同步语义。
对于一个文件系统来说,如果应用于高数据可靠性的场景下时,通常写入的数据都是采用同步写的方式。而同步写因为失去了高速缓存装置的加速作用性能一般非常低,同步写通常意味着数据必须同步写到稳定的存储介质上才给用户返回成功,同步写入数据时所使用的固定存储介质决定了同步写的性能。
如图1所示,可移植操作系统接口(posix,Portable Operating System Interface)标准下的文件系统接口或者卷级块设备接口即符合posix标准接口的文件系统或者卷级块设备接口;系统外部访问接口,外部请求每次对文件系统的更改都会产生一个事务;文件系统事务日志模块,负责产生并记录事务日志;数据管理单元,负责组织管理系统数据结构;存储池,管理所有物理存储空间。事务日志型存储系统中,采用同步写的方式时,两个可运行同一事务日志型存储系统的服务器之间共享后端的磁盘,产生事务时生成的日志通过意图日志模块被保存在存储池的数据盘即后端磁盘,当运行事务日志型存储系统的服务器A故障时,可运行同一事务日志型存储系统的服务器 B根据存储在后端的磁盘中的日志,可恢复该日志对应的事务,但是这种情况下日志写到后端的磁盘的性能,决定了当前系统同步写的性能。将日志保存在后端的磁盘影响了系统的运行速度。
发明内容
为了克服将日志保存到后端的磁盘影响系统的运行速度的问题,本发明实施例提供了一种实现事务日志镜像备份的方法及装置。
为了解决上述技术问题,本发明实施例采用如下技术方案:
依据本发明的一个实施例,提供了一种实现事务日志镜像备份的方法,应用于可运行同一事务日志型存储系统的多个服务器,该方法包括:运行所述事务日志型存储系统的第一服务器,记录所述事务日志型存储系统中的第一事务产生时生成的第一事务日志;该第一服务器将所述第一事务日志发送至预设的第一掉电保护内存,其中,所述第一掉电保护内存位于该第一服务器;该第一服务器将所述第一掉电保护内存保存的所述第一事务日志镜像备份至第二掉电保护内存,其中,所述第二掉电保护内存位于可运行同一事务日志型存储系统的第二服务器。
在本实施例中,所述第一掉电保护内存和第二掉电保护内存均为非易失性随机访问存储器。
在本实施例中,所述第一掉电保护内存和所述第二掉电保护内存的大小相同。
依据本发明的又一个实施例,提供了一种实现事务日志镜像备份的方法,应用于可运行同一事务日志型存储系统的多个服务器,该方法包括:可运行所述事务日志型存储系统的第二服务器,接收运行所述事务日志型存储系统的第一服务器发送的第一事务日志,其中,所述第一事务日志为所述事务日志型存储系统中第一事务产生时生成的,并且存储于该第一服务器的第一掉电保护内存。该第二服务器将所述第一事务日志保存在第二掉电保护内存,其中,所述第二掉电保护内存位于该第二服务器;该第二服务器检测到所述第一服务器故障时,根据所述第二掉电保护内存中保存的第一事务日志,在本地恢复所述第一服务器在发生故障前的内存数据,并运行所述事务日志型存储系统。
在本实施例中,所述第一掉电保护内存和第二掉电保护内存均为非易失性随机访问存储器。
在本实施例中,所述第一掉电保护内存和所述第二掉电保护内存的大小相同。
依据本发明的又一个实施例,提供了一种实现事务日志镜像备份的装置,应用于可运行同一事务日志型存储系统的多个服务器,该装置包括:日志生成模块,设置为运行所述事务日志型存储系统的第一服务器,记录所述事务日志型存储系统中的第一事务产生时生成的第一事务日志;发送模块,设置为该第一服务器将所述第一事务日志发送至预设的第一掉电保护内存,其中,所述第一掉电保护内存位于该第一服务器;镜像模块,设置为该第一服务器将所述第一掉电保护内存保存的所述第一事务日志镜像备份至第二掉电保护内存,其中,所述第二掉电保护内存位于可运行同一事务日志型存储系统的第二服务器。
在本实施例中,所述第一掉电保护内存和第二掉电保护内存均为非易失性随机访问存储器。
在本实施例中,所述第一掉电保护内存和所述第二掉电保护内存的大小相同。
依据本发明的又一个实施例,提供了一种实现事务日志镜像备份的装置,应用于可运行同一事务日志型存储系统的多个服务器,该装置包括:接收模块,设置为可运行所述事务日志型存储系统的第二服务器,接收运行所述事务日志型存储系统的第一服务器发送的第一事务日志,其中,所述第一事务日志为所述事务日志型存储系统中第一事务产生时生成的,并且存储于该第一服务器的第一掉电保护内存;存储模块,设置为该第二服务器将所述第一事务日志保存在第二掉电保护内存,其中,所述第二掉电保护内存位于该第二服务器;处理模块,设置为该第二服务器检测到所述第一服务器故障时,根据所述第二掉电保护内存中保存的第一事务日志,在本地恢复所述第一服务器在发生故障前的内存数据,并运行所述事务日志型存储系统。
在本实施例中,所述第一掉电保护内存和第二掉电保护内存均为非易失性随机访问存储器。
在本实施例中,所述第一掉电保护内存和所述第二掉电保护内存的大小相同。
本发明实施例的有益效果是:本发明将可恢复第一事务的第一事务日志镜像备份至第二掉电保护内存,当第一服务器故障时,通过切换至第二服务器,并根据位于第二掉电保护内存的第一事务日志恢复第一事务。第一掉电内存和第二掉电内存分别位于第一服务器和第二服务器,将第一事务日志存储于第一掉电内存和第二掉电内存而非后端磁盘,提高了系统运行的速度。
附图说明
图1表示现有技术中可运行事务日志型存储系统的服务器的示意图;
图2表示本发明实施例实现事务日志镜像备份的方法的流程图之一;
图3表示本发明实施例实现事务日志镜像备份的方法的流程图之二;
图4表示本发明实施例实现事务日志镜像备份的方法的示意图;
图5表示本发明实施例实现事务日志镜像备份的装置的示意图之一;
图6表示本发明实施例实现事务日志镜像备份的装置的示意图之二。
具体实施方式
为使本发明的目的、技术方案和优点更加清楚,下面将结合附图及具体实施例对本发明进行详细描述。
如图2所示,为本发明实施例实现事务日志镜像备份的方法的流程图之一,本发明实施例应用于可运行同一事务日志型存储系统的多个服务器,这里,事务日志型存储系统可以是ZFS系统,当然也不仅限于此。该实施例包括以下步骤:
步骤S100、运行事务日志型存储系统的第一服务器,记录事务日志型存储系统中的第一事务产生时生成的第一事务日志。
步骤S200、该第一服务器将第一事务日志发送至预设的第一掉电保护内存,其中,第一掉电保护内存位于该第一服务器。这里,第一服务器通过意图日志模块将第一事务日志保存至预设的第一掉电保护内存,而非将第一事务日志保存保存至存储池中的磁盘中,大大提高了系统的运行速度。第一掉电保护内存有断电保护的功能,当系统断电时,通过系统自身所带电源来完成第一事务日志的存储,该第一掉电保护内存可以是非易失性随机访问存储器(NVRAM,Non-Volatile Random Access Memory),也可以是掉电时通过备用电源将内存数据备份到固态硬盘中,系统下次上电是再将之前掉电备份在固态硬盘中的数据再次读入内存当中,本发明实施例采用的为NVRAM。
步骤S300、该第一服务器将第一掉电保护内存保存的第一事务日志镜像备份至第二掉电保护内存,其中,第二掉电保护内存位于可运行同一事务日志型存储系统的第二服务器。这里,镜像备份采用的是现有技术,例如远程过程调用技术。第一掉电内存和第二掉电内存的大小相同,保证了第二掉电内存也可以完全存储第一事务日志。
应当说明的是,本发明实施例通过在第一服务器中增加NVRAM,用以存储第一事务日志,提高了系统运行的速度,而且不需要占用后端磁盘。
如图3所示,为本发明实施例实现事务日志镜像备份的方法的流程图之二,本发明实施例应用于可运行同一事务日志型存储系统的多个服务器,这里,事务日志型存储系统可以是ZFS系统,当然也不仅限于此。该实施例包括以下步骤:
步骤S400、可运行事务日志型存储系统的第二服务器,接收运行事务日志型存储系统的第一服务器发送的第一事务日志,其中,第一事务日志为事务日志型存储系统中第一事务产生时生成的,并且存储于该第一服务器的第一掉电保护内存。
步骤S500、该第二服务器将第一事务日志保存在第二掉电保护内存,其中,第二掉电保护内存位于该第二服务器。
步骤S600、该第二服务器检测到第一服务器故障时,根据第二掉电保护内存中保存的第一事务日志,在本地恢复第一服务器在发生故障前的内存数据,并运行事务日志型存储系统。
应当说明的是,本发明实施例将可恢复第一事务的第一事务日志镜像备份至第二掉电保护内存,当第一服务器故障时,通过切换至第二服务器,并根据位于第二掉电保护内存的第一事务日志可恢复第一事务,从而也保证了数据写入的可靠性。这里,服务器之间的切换采用现有技术,例如双机热备切换。
如图4所示,为本发明实施例实现事务日志镜像备份的方法的示意图;与图1不同的是,图4中的服务器A和服务器B中均设置有NVRAM,生成的第一事务日志通过意图日志模块被保存在NVRAM,而非后端磁盘中,大大提高了系统运行的速度。
如图5所示,为本发明实施例实现事务日志镜像备份的装置的示意图之一,本发明实施例应用于可运行同一事务日志型存储系统的多个服务器,包括:日志生成模块501、发送模块502和镜像模块503;其中,日志生成模块501,设置为运行事务日志型存储系统的第一服务器,记录事务日志型存储系统中的第一事务产生时生成的第一事务日志;发送模块502,设置为该第一服务器将第一事务日志发送至预设的第一掉电保护内存,其中,第一掉电保护内存位于该第一服务器;镜像模块503,设置为该第一服务器将第一掉电保护内存保存的第一事务日志镜像备份至第二掉电保护内存,其中,第二掉电保护内存位于可运行同一事务日志型存储系统的第二服务器。
这里,本发明实施例通过在第一服务器中增加NVRAM,用以存储第一事务日志,提高了系统运行的速度,而且不需要占用后端磁盘。第一掉电保护内存有断电保护的功能,当系统断电时,通过系统自身所带电源来完成第一事务日志的存储,该第一掉电保护内存可以是NVRAM,也可以是由软件实现的,本发明实施例采用的为NVRAM。镜像备份采用的是现有技术,例如远程过程调用技术。第一掉电内存和第二掉电内存的大小相同,保证了第二掉电内存也可以完全存储第一事务日志。
如图6所示,为本发明实施例实现事务日志镜像备份的装置的示意图之二,本发明实施例应用于可运行同一事务日志型存储系统的多个服务器,包括:接收模块601、存储模块602和处理模块603;其中,接收模块601,设置为可运行事务日志型存储系统的第二服务器,接收运行事务日志型存储系统的第一服务器发送的第一事务日志,其中,第一事务日志为事务日志型存储系统中第一事务产生时生成的,并且存储于该第一服务器的第一掉电保护内存;存储模块602,设置为该第二服务器将第一事务日志保存在第二掉电保护内存,其中,第二掉电保护内存位于该第二服务器;处理模块603,设置为该第二服务器检测到第一服务器故障时,根据第二掉电保护内存中保存的第一事务日志,在本地恢复第一服务器在发生故障前的内存数据,并运行事务日志型存储系统。
应当说明的是,本发明实施例将可恢复第一事务的第一事务日志镜像备份至第二掉电保护内存,当第一服务器故障时,通过切换至第二服务器,并根据位于第二掉电保护内存的第一事务日志可恢复第一事务,从而也保证了数据写入的可靠性。这里,服务器之间的切换采用现有技术,例如双机热备切换。
以上所述的是本发明的优选实施方式,应当指出对于本技术领域的普通人员来说,在不脱离本发明所述的原理前提下还可以作出若干改进和润饰,这些改进和润饰也在本发明的保护范围内。
工业实用性
基于本发明实施例提供的上述技术方案,将可恢复第一事务的第一事务日志镜像备份至第二掉电保护内存,当第一服务器故障时,通过切换至第二服务器,并根据位于第二掉电保护内存的第一事务日志恢复第一事务。第一掉电内存和第二掉电内存分别位于第一服务器和第二服务器,将第一事务日志存储于第一掉电内存和第二掉电内存而非后端磁盘,提高了系统运行的速度。

Claims (12)

  1. 一种实现事务日志镜像备份的方法,应用于可运行同一事务日志型存储系统的多个服务器,包括:
    运行所述事务日志型存储系统的第一服务器,记录所述事务日志型存储系统中的第一事务产生时生成的第一事务日志;
    该第一服务器将所述第一事务日志发送至预设的第一掉电保护内存,其中,所述第一掉电保护内存位于该第一服务器;
    该第一服务器将所述第一掉电保护内存保存的所述第一事务日志镜像备份至第二掉电保护内存,其中,所述第二掉电保护内存位于可运行同一事务日志型存储系统的第二服务器。
  2. 如权利要求1所述的方法,其中,所述第一掉电保护内存和所述第二掉电保护内存均为非易失性随机访问存储器。
  3. 如权利要求1所述的方法,其中,所述第一掉电保护内存和所述第二掉电保护内存的大小相同。
  4. 一种实现事务日志镜像备份的方法,应用于可运行同一事务日志型存储系统的多个服务器,包括:
    可运行所述事务日志型存储系统的第二服务器,接收运行所述事务日志型存储系统的第一服务器发送的第一事务日志,其中,所述第一事务日志为所述事务日志型存储系统中第一事务产生时生成的,并且存储于该第一服务器的第一掉电保护内存;
    该第二服务器将所述第一事务日志保存在第二掉电保护内存,其中,所述第二掉电保护内存位于该第二服务器;
    该第二服务器检测到所述第一服务器故障时,根据所述第二掉电保护内存中保存的第一事务日志,在本地恢复所述第一服务器在发生故障前的内存数据,并运行所述事务日志型存储系统。
  5. 如权利要求4所述的方法,其中,所述第一掉电保护内存和所述第二掉电保护内存均为非易失性随机访问存储器。
  6. 如权利要求4所述的方法,其中,所述第一掉电保护内存和所述第二掉电保护内存的大小相同。
  7. 一种实现事务日志镜像备份的装置,应用于可运行同一事务日志型存储系统的多个服务器,包括:
    日志生成模块,设置为运行所述事务日志型存储系统的第一服务器,记录所述事务日志型存储系统中的第一事务产生时生成的第一事务日志;
    发送模块,设置为该第一服务器将所述第一事务日志发送至预设的第一掉电保护内存,其中,所述第一掉电保护内存位于该第一服务器;
    镜像模块,设置为该第一服务器将所述第一掉电保护内存保存的所述第一事务日志镜像备份至第二掉电保护内存,其中,所述第二掉电保护内存位于所述可运行同一事务日志型存储系统的第二服务器。
  8. 如权利要求7所述的装置,其中,所述第一掉电保护内存和所述第二掉电保护内存均为非易失性随机访问存储器。
  9. 如权利要求7所述的装置,其中,所述第一掉电保护内存和所述第二掉电保护内存的大小相同。
  10. 一种实现事务日志镜像备份的装置,应用于可运行同一事务日志型存储系统的多个服务器,包括:
    接收模块,设置为可运行所述事务日志型存储系统的第二服务器,接收运行所述事务日志型存储系统的第一服务器发送的第一事务日志,其中,所述第一事务日志为所述事务日志型存储系统中第一事务产生时生成的,并且存储于该第一服务器的第一掉电保护内存;
    存储模块,设置为该第二服务器将所述第一事务日志保存在第二掉电保护内存,其中,所述第二掉电保护内存位于该第二服务器;
    处理模块,设置为该第二服务器检测到所述第一服务器故障时,根据所述第二掉电保护内存中保存的第一事务日志,在本地恢复所述第一服务器在发生故障前的内存数据,并运行所述事务日志型存储系统。
  11. 如权利要求10所述的装置,其中,所述第一掉电保护内存和所述第二掉电保护内存均为非易失性随机访问存储器。
  12. 如权利要求10所述的装置,其中,所述第一掉电保护内存和所述第二掉电保护内存的大小相同。
PCT/CN2015/076211 2014-12-19 2015-04-09 实现事务日志镜像备份的方法及装置 WO2016095372A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201410799217.3 2014-12-19
CN201410799217.3A CN105760252A (zh) 2014-12-19 2014-12-19 实现事务日志镜像备份的方法及装置

Publications (1)

Publication Number Publication Date
WO2016095372A1 true WO2016095372A1 (zh) 2016-06-23

Family

ID=56125741

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2015/076211 WO2016095372A1 (zh) 2014-12-19 2015-04-09 实现事务日志镜像备份的方法及装置

Country Status (2)

Country Link
CN (1) CN105760252A (zh)
WO (1) WO2016095372A1 (zh)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113434338A (zh) * 2021-06-25 2021-09-24 苏州伟创电气科技股份有限公司 数据存储的容错方法、装置、设备及存储介质
CN113849440A (zh) * 2021-09-30 2021-12-28 北京金山云网络技术有限公司 日志的访问方法、装置及服务器

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10387275B2 (en) * 2016-07-26 2019-08-20 Hewlett Packard Enterprise Development Lp Resume host access based on transaction logs
CN107797849B (zh) * 2016-08-30 2021-06-08 阿里巴巴集团控股有限公司 分布式事务处理的方法、装置与系统
CN108255879B (zh) * 2016-12-29 2021-10-08 北京国双科技有限公司 网页浏览流量作弊的检测方法及装置
CN108021443B (zh) * 2017-01-20 2020-04-07 腾讯科技(深圳)有限公司 事件处理方法和装置
CN109992448B (zh) * 2017-12-31 2021-08-06 中国移动通信集团山西有限公司 文件变化增量备份方法、装置、设备及介质
CN108595119B (zh) * 2018-03-30 2021-04-16 浙江大华技术股份有限公司 一种数据同步方法及分布式系统
CN113742166B (zh) * 2021-07-29 2023-07-18 苏州浪潮智能科技有限公司 一种服务器系统器件日志记录方法、装置及系统
CN113849126A (zh) * 2021-09-01 2021-12-28 北京腾凌科技有限公司 一种日志存储方法及装置

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080177962A1 (en) * 2007-01-24 2008-07-24 Akram Bitar Data Storage Resynchronization Using Application Features
CN101699439A (zh) * 2009-11-16 2010-04-28 中兴通讯股份有限公司 一种数据库的事务提交方法和装置
CN101714169A (zh) * 2009-12-01 2010-05-26 广州从兴电子开发有限公司 一种在多节点上传递数据方法及系统
CN103885854A (zh) * 2012-12-19 2014-06-25 华为技术有限公司 一种数据备份方法、装置及系统
US8825601B2 (en) * 2010-02-01 2014-09-02 Microsoft Corporation Logical data backup and rollback using incremental capture in a distributed database

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7188273B2 (en) * 2003-11-24 2007-03-06 Tsx Inc. System and method for failover
US8364923B2 (en) * 2009-03-30 2013-01-29 Oracle America, Inc. Data storage system manager and method for managing a data storage system
US9164689B2 (en) * 2009-03-30 2015-10-20 Oracle America, Inc. Data storage system and method of processing a data access request
US8225138B2 (en) * 2009-03-31 2012-07-17 Lenovo (Singapore) Pte. Ltd. High-speed recovery for computing systems

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080177962A1 (en) * 2007-01-24 2008-07-24 Akram Bitar Data Storage Resynchronization Using Application Features
CN101699439A (zh) * 2009-11-16 2010-04-28 中兴通讯股份有限公司 一种数据库的事务提交方法和装置
CN101714169A (zh) * 2009-12-01 2010-05-26 广州从兴电子开发有限公司 一种在多节点上传递数据方法及系统
US8825601B2 (en) * 2010-02-01 2014-09-02 Microsoft Corporation Logical data backup and rollback using incremental capture in a distributed database
CN103885854A (zh) * 2012-12-19 2014-06-25 华为技术有限公司 一种数据备份方法、装置及系统

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113434338A (zh) * 2021-06-25 2021-09-24 苏州伟创电气科技股份有限公司 数据存储的容错方法、装置、设备及存储介质
CN113849440A (zh) * 2021-09-30 2021-12-28 北京金山云网络技术有限公司 日志的访问方法、装置及服务器
CN113849440B (zh) * 2021-09-30 2024-04-26 北京金山云网络技术有限公司 日志的访问方法、装置及服务器

Also Published As

Publication number Publication date
CN105760252A (zh) 2016-07-13

Similar Documents

Publication Publication Date Title
WO2016095372A1 (zh) 实现事务日志镜像备份的方法及装置
US8286030B1 (en) Information lifecycle management assisted asynchronous replication
US8874508B1 (en) Systems and methods for enabling database disaster recovery using replicated volumes
US9740573B1 (en) Dynamic LUN resizing in a replication environment
US9003118B2 (en) Systems and methods for non-volatile cache control
US8954645B2 (en) Storage writes in a mirrored virtual machine system
CA2896809C (en) Data processing device and data processing method
US9619172B1 (en) Method and system for managing changed block tracking and continuous data protection replication
US20140129765A1 (en) Method to improve data reliability in dram ssd using asynchronous logging and incremental backup
CN103077242A (zh) 一种实现数据库服务器双机热备的方法
WO2016078202A1 (zh) 一种掉电保护方法及固态硬盘
CN103516736A (zh) 分布式缓存系统的数据恢复方法及装置
JP2004038290A (ja) 情報処理システムおよび同システムで用いられるディスク制御方法
WO2015054897A1 (zh) 数据存储方法、数据存储装置和存储设备
JP2012507788A (ja) ストレージ・エリア・ネットワークを使用してコンピュータシステムを復旧するための方法およびシステム
WO2021088367A1 (zh) 数据恢复方法及相关设备
JP6540202B2 (ja) 情報処理システム、制御装置および制御プログラム
WO2020133473A1 (zh) 一种备份数据的方法、装置和系统
WO2016101225A1 (zh) 一种数据备份的方法、装置及系统
WO2023169503A1 (en) Failure hinting for site preparation in multi-site data replication environment
JP5817296B2 (ja) 制御装置、制御方法およびストレージ装置
US11042451B2 (en) Restoring data lost from battery-backed cache
KR102049417B1 (ko) Nvdimm을 이용한 인-메모리 데이터베이스 기반의 데이터 저장 및 복원 방법
US10528275B2 (en) Storage system, storage control device, and method of controlling a storage system
US20150019822A1 (en) System for Maintaining Dirty Cache Coherency Across Reboot of a Node

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 15868889

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 15868889

Country of ref document: EP

Kind code of ref document: A1