1. Field of the Invention
The present invention relates to a data backup method for a server, and more particularly, to a storage service device with a dual controller and a backup method thereof.
2. Related Art
In order to enhance the access performance of a storage device, a storage service device with a dual controller has been proposed. Compared with the configuration of a single controller, the dual controller can provide the same service to a plurality of clients at the same time.
In the past, in order to ensure that a plurality of clients has the same operation environment, the dual-controller storage service device employs the same view function. The same view function mainly aims at preventing the clients from having different operation environments and services due to the different controllers adopted for the provided services when the clients are connected to the storage device. For example, when the system has created a virtual disk in a first controller, if another client is connected to the storage service device through a second controller, the client can also see the virtual disk.
In addition to the same view function, a “mirror cache” function is also proposed, so as to enable the dual controller to ensure the data synchronization in the dual controller when accessing data. The mirror cache means to configure a respective cache in each controller. Thus, when a first controller receives/retrieves data, it may copy the data stored temporarily in the cache thereof into a cache of a second controller, thereby ensuring that the two controllers have consistent data. Moreover, when an error occurs to one of the two controllers, the storage service device can recover the lost data from the cache of the other controller.
In order to maintain the consistency between the index pages of the two controllers, configuration files and login files are stored in a flash memory or a hard disk in the prior art. Although the storage purpose can be effectively achieved, it takes risks in terms of the storage security. Taking the flash memory for example, due to the limited accessing times for the flash memory, once the flash memory is damaged, the entire system may be crashed due to the loss of relevant data. Taking the hard disk for example, because the hard disk belongs to a mechanical access mode, the hard disk cannot be moved while performing motions; otherwise, the hard disk is easily destroyed.
In view of the above problems, the present invention is mainly a storage service device with a dual controller, which is applicable to provide the same view service to an event-login log and a configuration file of a server.
To achieve the above objective, a storage service device with a dual controller is provided in the present invention, which comprises a first control module, a second control module, a battery unit, a basic input/output system (BIOS), and a backup procedure. The first control module comprises a first memory module and a first flash memory. The first control module further comprises an index page used for recording an access address of a virtual disk in the storage device. The second control module is electrically connected to the first control module. The second control module comprises a second memory module and a second flash memory, and stores another index page. The battery unit is electrically connected to the first memory module and the second memory module. The BIOS is electrically connected to the battery unit, the first control module, and the second control module. The BIOS further comprises the backup procedure. When a power failure occurs to a server, the BIOS executes the backup procedure, that is, sending a hardware interrupt signal to the battery unit, so as to provide an operation power to the first memory module and the second memory module; synchronizing the index page of the first memory module with that of the second memory module; and recording updated index pages into the first flash memory and the second flash memory respectively.
From another aspect, the present invention is a backup method for a storage service device with a dual-controller, in which the dual controller has a first controller and a second controller communicating with each other, the first controller is configured with a first memory module and a first flash memory, and the second controller is configured with a second memory module and a second flash memory.
To achieve the above objective, a backup method for a dual-controller storage service device is provided in the present invention, which comprises the following steps. When a power failure occurs to a server, a hardware interrupt signal is sent to a battery unit, so as to provide an operation power to the first memory module and the second memory module; an index page of the first memory module is synchronized with that of the second memory module; and updated index pages are recorded into the first flash memory and the second flash memory respectively.
The present invention provides a backup method combining battery backup with remote direct memory access (RDMA), which is applicable to achieve data backup and synchronization for a multi-controller server. In addition to periodically back up a configuration file for each controller, the present invention further achieves the backup and synchronization of the above configuration files in the case of a power failure. Thus, the same view performance of the server can be effectively improved.
The present invention will become more fully understood from the detailed description given herein below for illustration only, and thus is not limitative of the present invention, and wherein:
In order to improve the data storage reliability of a multi-controller storage system, remote direct memory access (RDMA) and battery backup are adopted here. The RDMA is a mapping means for remote memories, which can map the memories of the multiple controllers synchronously through internet or another connection mode. When the file of one controller is modified, the files of the other controllers can also be updated. The battery backup assures that the storage system can save the files of the controllers even when a power failure occurs to the storage system.
Once a power failure occurs to the storage service device, the BIOS 140 may execute the backup procedure 150 for synchronizing and backing up the configuration files and login files of the controllers.
In Step S210, an index page checking procedure is executed after a storage service device is started.
In Step S220, a periodic backup procedure is executed to synchronize and back up the index page of each controller periodically.
In Step S230, when a power failure occurs to a server, a backup procedure is executed to send a hardware interrupt signal to a battery unit, so as to provide an operation power to a first memory module and a second memory module.
In Step S240, the index page of the first memory module is synchronized with that of the second memory module.
In Step S250, updated index pages are recorded into a first flash memory 112 and a second flash memory respectively.
After the server is started, each controller begins to execute the index page checking procedure.
In Step S211, after the storage service device is started, it is checked whether the index page of the first memory module and the index page of the second memory module exist or not.
In Step S212, when neither the index page of the first memory module nor the index page of the second memory module exists, an index page of the first memory module and an index page of the second memory module are re-established.
In Step S213, when only one of the index page of the first memory module and the index page of the second memory module exists, the existed index page is synchronized to the other memory module.
In the present invention, the way of establishing an index page can be adjusted adaptively according to different operating system. For Linux operating system, the index page is established by means of retaining the address of the index page at a lower position of the memory through the kernel of Linux. In this way, it can be assured that the index page is established at the same physical address each time when the server is started. The index page contains configuration files, login files, addresses of memory pages used by virtual disks, locks of the memory pages, and updating time of the memory pages.
After completing the above steps, the server executes the backup procedure 150 periodically. The backup procedure 150 updates the configuration files of the controllers synchronously.
In Step S221, the index page of the first memory module is synchronized with that of the second memory module when a pre-defined time is reached.
In Step S222, the updated index pages are recorded into the first flash memory and the second flash memory respectively.
In the present invention, the first control module 110 and the second control module 120 are connected through SAS or Ethernet. When executing the periodic backup procedure 150, each controller is further monitored in real time to see whether each controller is active. If only one controller is active, the server synchronizes the older configuration files by using the latest configuration files for updating.
The process of updating the configuration files of multiple controllers further comprises the following steps, which are illustrated with reference to
In Step S223, a controller is selected, and according to a written address of the memory page, a lock of the memory page with the desired written address is acquired.
In Step S224, if the lock of the memory page cannot be acquired, the time for writing is delayed.
In Step S225, if the lock of the memory page is acquired, another controller is locked.
In Step S226, relevant data and updating time are written to the memory page of the selected controller.
In Step S227, the memory page of the selected controller is synchronized to another controller.
In Step S228, the synchronization is repeated for the other controllers, and after all the controllers are completed, all the controllers are unlocked.
The present invention provides a backup method combining battery backup with remote direct memory access (RDMA), which is applicable to achieve data backup and synchronization for a multi-controller server. In addition to periodically back up a configuration file for each controller, the present invention further achieves the backup and synchronization of the above configuration files in the case of a power failure. Thus, the same view performance of the server can be effectively improved.
Number | Name | Date | Kind |
---|---|---|---|
20030074535 | Owhadi | Apr 2003 | A1 |
20090132760 | Flynn et al. | May 2009 | A1 |
Number | Date | Country | |
---|---|---|---|
20100250832 A1 | Sep 2010 | US |