JP2015153285A - Redundancy database system, database device, and master changing method - Google Patents
Redundancy database system, database device, and master changing method Download PDFInfo
- Publication number
- JP2015153285A JP2015153285A JP2014028352A JP2014028352A JP2015153285A JP 2015153285 A JP2015153285 A JP 2015153285A JP 2014028352 A JP2014028352 A JP 2014028352A JP 2014028352 A JP2014028352 A JP 2014028352A JP 2015153285 A JP2015153285 A JP 2015153285A
- Authority
- JP
- Japan
- Prior art keywords
- master
- data
- slave
- database
- completion flag
- Prior art date
- Legal status (The legal status 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 status listed.)
- Granted
Links
Images
Landscapes
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
Description
本発明は、複数のデータベースを有する冗長化データベースシステム、データベース装置及び冗長化データベースシステムでマスタを交代する際のマスタ交代方法に関する。 The present invention relates to a redundant database system having a plurality of databases, a database apparatus, and a master replacement method for replacing a master in a redundant database system.
複数のデータベース装置(DB装置)のうち1台をマスタとし、その他をスレーブとし、各DB装置間で同一のデータを記憶する冗長化データベースシステムがある。冗長化データベースシステムでは、いずれかのDB装置が故障した場合でも他のDB装置でデータが保存されるため、データ保存の信頼性が高い特徴がある。 There is a redundant database system in which one of a plurality of database devices (DB devices) is a master and the other is a slave, and the same data is stored between the DB devices. The redundant database system is characterized by high data storage reliability because data is stored in another DB device even if one of the DB devices fails.
このような冗長化データベースシステムでは、データ保存の信頼性を向上するため、データの同期方法が重要であり、様々な方法が提案されている(例えば、特許文献1参照)。特許文献1では、スレーブとマスタのDB装置が一時的に切断された場合に差分レプリケーションを利用してデータの同期のための時間を短縮する技術について提案されている。
In such a redundant database system, in order to improve the reliability of data storage, a data synchronization method is important, and various methods have been proposed (for example, see Patent Document 1).
冗長化データベースシステムでマスタとスレーブの間のデータ同期が失われる場合としては、特許文献1に記載されるようなスレーブとマスタのDB装置が切断する場合の他、マスタの故障等によりマスタの交代を行う場合とがある。マスタの故障等によりマスタの交代が生じた場合、旧スレーブのDB装置で記憶するデータが旧マスタのDB装置で記憶するデータと同期していることを保証することが困難となることがある。新マスタと旧マスタの間や、新マスタとスレーブの間のデータが同期する最も簡単な解決方法の一つは、新マスタのデータを全スレーブに全件レプリケーションすることである。
In the redundant database system, data synchronization between the master and the slave is lost. In addition to the case where the slave and the master DB device are disconnected as described in
上述したように、故障等の発生により、マスタが交代した際に、新マスタと他のスレーブとのデータ同期を行う最も簡単な方法としては、全スレーブへ全件レプリケーションする方法がある。しかし、各スレーブのDB装置で全件レプリケーションを実行する間、各スレーブのDB装置が記憶するデータは完成しておらず、これらのデータはレプリカではない。したがって、レプリケーションを実行の間、冗長性データベースシステムでは、冗長性が失われた状態にある。 As described above, when the master is changed due to the occurrence of a failure or the like, the simplest method for performing data synchronization between the new master and other slaves is a method of replicating all cases to all slaves. However, the data stored in each slave DB device is not completed while all slave replication is performed in each slave DB device, and these data are not replicas. Therefore, the redundancy database system is in a state where redundancy is lost during replication.
仮に、冗長性データベースシステムで冗長性が失われた状態でマスタのDB装置に故障が発生すると、冗長性データベースシステムでデータを全損するおそれがある。したがって、冗長性が失われた状態にある時間をできる限り短縮することが好ましい。 If a failure occurs in the master DB device in a state in which the redundancy is lost in the redundancy database system, there is a risk that data will be completely lost in the redundancy database system. Therefore, it is preferable to shorten the time in which the redundancy is lost as much as possible.
上記課題に鑑み、本発明では、冗長性データシステムで冗長性が失われるおそれを防止することを目的とする。 In view of the above problems, an object of the present invention is to prevent the possibility of loss of redundancy in a redundant data system.
上記目的を達成するために、本発明に係る冗長化データベースシステムは、複数のデータベース装置でデータを同期して記憶し、いずれか1台のデータベース装置がマスタとして設定され、他のデータベース装置がスレーブとして設定される冗長化データベースシステムであって、各データベース装置は、マスタであるとき、マスタを交代する際に旧マスタのデータベース装置におけるデータ更新処理とスレーブのデータベース装置へのレプリケーションの要求が全て完了したか否かを特定する完了フラグを記憶するフラグ記憶部と、マスタからスレーブに変更した際、完了フラグのデータを新たにマスタとなるデータベース装置に送信する送信手段と、スレーブからマスタに変更した際、旧マスタのデータベース装置から受信した完了フラグのデータに基づいて、スレーブのデータベース装置からのレプリケーションの開始要求に対し、自装置が記憶するデータを全件送信するかまたは一件も送信せずに同期完了とするかを判断する手段を備えることを特徴とする。 In order to achieve the above object, a redundant database system according to the present invention stores data synchronously in a plurality of database devices, and any one database device is set as a master, and other database devices are slaves. When each database device is a master, the data update process in the old master database device and the replication request to the slave database device are all completed when the master device is replaced. A flag storage unit that stores a completion flag that identifies whether or not the transmission has been performed, a transmission unit that newly transmits data of the completion flag to the database device that becomes the master when changing from the master to the slave, and a change from the slave to the master The completion flag received from the old master database device. In response to the replication start request from the slave database device, there is provided means for determining whether to transmit all data stored in the own device or to complete the synchronization without transmitting any data. It is characterized by that.
本発明によれば、冗長化データベースシステムにおいてマスタの交代後に不必要な全件レプリケーションを防止し、冗長性が失われるおそれを防止することができる。 According to the present invention, unnecessary all-case replication can be prevented after the master is changed in the redundant database system, and the possibility of loss of redundancy can be prevented.
以下に、図面を用いて本発明の各実施形態に係る冗長化データベースシステム、データベース装置及びマスタ交代方法について説明する。なお、以下の説明において、同一の構成については同一の符号を付して説明を省略する。 The redundant database system, database apparatus, and master replacement method according to each embodiment of the present invention will be described below with reference to the drawings. In the following description, the same components are denoted by the same reference numerals and description thereof is omitted.
図1(a)に示すように、実施形態に係る冗長化データベースシステム100は、同一のデータを管理する複数のデータベース装置(DB装置)1〜3が接続されるシステムである。この冗長化データベースシステム100では、1台のDB装置1がマスタとして設定され、他のDB装置2、3がスレーブとして設定される。各DB装置1〜3で記憶されるデータは、同期される。具体的には、マスタの第1DB装置1でデータが更新されると、レプリケーションにより同一のデータ(レプリカ)がスレーブの第2DB装置2及び第3DB装置3に記憶される。
As shown in FIG. 1A, a
また、冗長化データベースシステム100では、冗長化データベースシステム100の保守時や第1DB装置1で故障が発生した場合、マスタが交代される。ここで、故障とは、後述するレプリケーション要求完了通知の送受信が可能である程度のソフトウェア故障等のマスタの交代に影響を与えない故障であって、第1DB装置1の全損やネットワークの全断等の故障ではない。
In the
例えば、図1(b)に示すように、第1DB装置1をマスタからスレーブに変更し、第2DB装置2をスレーブからマスタに変更する。また、マスタに変更された第2DB装置2は、スレーブである他のDB装置1、3からレプリケーションが要求され、データが同期される。実施形態に係るマスタ交代方法は、このように、冗長化データベースシステム100においてマスタとスレーブを交代する際の方法である。
For example, as shown in FIG. 1B, the
図2のシーケンス図を用いて、正常時における処理について説明する。冗長化データベースシステム100では、例えば、マスタの第1DB装置1は、ホスト装置4から、記憶するデータの更新を要求する更新要求を受信すると(S1)、受信した更新要求にしたがって、データを更新する(S2)。
Processing in a normal state will be described with reference to the sequence diagram of FIG. In the
マスタの第1DB装置1は、スレーブの第2DB装置2に、データの更新に関するレプリケーション要求を送信する(S3)。第2DB装置2では、レプリケーション要求にしたがって、データを更新する(S4)。これにより、第2DB装置2では、第1DB装置1と同一のデータ(レプリカ)が記憶される。
The master
また、第2DB装置2では、更新が完了した完了通知をマスタの第1DB装置1に送信する(S5)。
In addition, the
ここで、マスタのDB装置は、接続される全てのスレーブのDB装置に対してレプリケーションの要求を送信する。したがって、図1に示すように冗長化データベースシステム100が2台のスレーブのDB装置を有する場合、ステップS3〜S5の処理は、第2DB装置2及び第3DB装置3の2台のDB装置との間でそれぞれ実行される。
Here, the master DB device transmits a replication request to all the slave DB devices to be connected. Therefore, when the
全てのスレーブのDB装置から完了通知を受信すると、マスタの第1DB装置1は、ホスト装置4に完了通知を送信する(S6)。
When the completion notification is received from all the slave DB devices, the master
次に、図3のシーケンス図を用いて、単純な冗長化データベースシステムで実行されるマスタの交代方法の例について説明する。例えば、マスタの第1DB装置1は、ホスト装置4から、記憶するデータの更新要求を受信すると(S11)、受信した更新要求にしたがって、データを更新する(S12)。
Next, an example of a master replacement method executed in a simple redundant database system will be described with reference to the sequence diagram of FIG. For example, when the master
ここで、第1DB装置1が故障の発生を検出すると、第1DB装置1は、マスタの交代処理を開始する(S13)。また、これにより、第1DB装置1では、掃き出しを開始する(S14)。
Here, when the
『掃き出し』は、マスタとスレーブの交代を実行する際、旧マスタのDB装置が実行の必要があるレプリケーションの処理があるとき、レプリケーション処理が完了するまでマスタとスレーブの交代を開始せず、また、ホスト装置4からの新規のデータの更新要求も受け付けないようにすることをいう。
“Sweeping” does not start the master-slave change until the replication process is completed, when there is a replication process that the old master DB device needs to execute when the master-slave change is executed. This means that a new data update request from the
また、第1DB装置1は、ステップS12で実行した更新処理に応じてデータを同期させるため、第2DB装置2にレプリケーション要求を送信する(S15)。このレプリケーション要求は、ステップS12で更新したデータの内容を含み、第1DB装置1が第2DB装置2にデータを同期させるものである。第2DB装置2では、レプリケーション要求にしたがって、データを更新する(S16)。
Further, the
旧マスタであった第1DB装置1は、上述したように掃き出しが継続する間、再びホスト装置4から更新要求を受信すると(S17)、ホスト装置4にエラー通知を送信する(S18)。
The
第2DB装置2は、レプリケーションの要求に応じたデータの更新処理が終了すると、更新が完了した完了通知を旧マスタの第1DB装置1に送信する(S19)。
When the data update process in response to the replication request is completed, the
その後、第1DB装置1はホスト装置4に、更新が完了した完了通知を送信し(S20)、掃き出し処理を終了する(S21)。
Thereafter, the
掃き出しが終了すると、中断していたマスタとスレーブとの処理を再開するため、第1DB装置1は、第2DB装置2にスレーブからマスタへ変更することを要求するマスタ化通知を送信する(S22)。また、第1DB装置1は、マスタ交代の処理を終了し(S23)、自装置のスレーブとしての処理を開始する(S24)。
When the sweeping is completed, the
一方、第1DB装置1からマスタ化通知を受信した第2DB装置2は、マスタとしての処理を開始する(S25)。
On the other hand, the
スレーブとなった第1DB装置1は、マスタである第2DB装置2とのデータの同期させるため、第2DB装置2にレプリケーション開始要求を送信する(S26)。このレプリケーション開始要求は、スレーブとなった第1DB装置1がマスタの第2DB装置2と同期するため、レプリケーションのためのデータの送信をリクエストするものである。また、レプリケーション開始要求を受信した第2DB装置2は、第2DB装置2が記憶するデータと第1DB装置1が記憶するデータとの差分が不明である。したがって、第2DB装置2は、全件レプリケーションを第1DB装置1に送信する。
The
これに対し、実施形態に係る冗長化データベースシステム100では、図4を用いて後述するように、マスタとなったDB装置では、フラグ記憶部11において、スレーブのDB装置とデータの同期が完了したか否かに関する『完了フラグ』を記憶し、これに応じて全件レプリケーションの実行の要否を判断する。
On the other hand, in the
具体的には、図4(a)に示すように、第1DB装置1は、冗長化データベースシステム100で管理するデータを記憶するデータ記憶部10と、マスタに設定されるとき、マスタとスレーブのDB装置の同期の完了に関する『完了フラグ』を記憶するフラグ記憶部11と、ホスト装置4から受信したデータで、データ記憶部10のデータの更新を実行する更新手段12と、マスタとスレーブのDB装置のデータの同期を実行するとともに、必要に応じてフラグ記憶部11の完了フラグを更新する同期手段13と、マスタからスレーブに交代した際、フラグ記憶部11のフラグを新たにマスタになったDB装置に送信する送信手段14を備えている。
Specifically, as shown in FIG. 4A, the
なお、第2DB装置2及び第3DB装置3も、第1DB装置1と同様に、データ記憶部10、フラグ記憶部11、更新手段12、同期手段13及び送信手段14を有し、スレーブに設定される際にはスレーブのDB装置として必要な処理を実行し、マスタに交代された際には、マスタのDB装置として必要な処理を実行する。
Similarly to the
マスタ交代を開始すると、マスタの第1DB装置1はデータ更新処理の『掃き出し』を行う。すなわち、ホストのDB装置からの新規のデータ更新要求の受け付けを止めた上で、処理中の更新処理が完了するまで、新マスタのDB装置に「マスタ化通知」を送信せずに待機する。データ更新処理の『掃き出し』が完了し、第2DB装置2へのレプリケーション要求が全て成功していたならば、図4(a)に示すように、フラグ記憶部11において、第2DB装置2への掃き出しの完了を表す「完了フラグ2」を「完了」に設定する。また、データ更新処理の『掃き出し』が完了し、第3DB装置3へのレプリケーション要求が全て成功していたならば、フラグ記憶部11において、第3DB装置3への掃き出しの完了を表す「完了フラグ3」を「完了」に設定する。
When the master change is started, the master
このように、「完了フラグ2」及び「完了フラグ3」が「完了」であれば、旧マスタであった第1DB装置1で記憶されていたデータは、旧スレーブであった第2DB装置2及び第3DB装置3と同一であることが分かるため、「完了フラグ2」と「完了フラグ3」を第2DB装置2へ伝達することにより、レプリケーションは不要とできる。
In this way, if the “
新たにスレーブとなった第1DB装置1の送信手段14は、図4(b)に示すように、「完了フラグ2」及び「完了フラグ3」である「完了」を新たにマスタとなった第2DB装置2に送信する。その後、第1DB装置1の同期手段13は、「完了フラグ2」及び「完了フラグ3」を「未完了」に更新する。
As shown in FIG. 4 (b), the
新たにマスタとなった第2DB装置2の同期手段13は、第1DB装置1におけるレプリケーションの完了を表す「完了フラグ1」及び第3DB装置3におけるレプリケーションの完了を表す「完了フラグ3」を、初期設定の「未完了」に設定する。
The synchronization means 13 of the
図5に示すシーケンス図を利用して、実施形態に係る冗長化データベースシステム100について具体的に説明する。図5に示すフローチャートでは、図3を用いて説明したステップS11〜S25の処理は、同一である。ただし、マスタの第1DB装置1では、始めに「完了フラグ」として、初期値の「未完了」を記憶している。
The
処理中のデータ更新処理が全て完了して掃き出しが終了し(S21)、かつ、それまでの第2DB装置2へのレプリケーション要求が全て成功していたならば、「完了フラグ2」を「完了」に更新する(S31)。これにより、第1DB装置1と第2DB装置2は、マスタ交代時にデータが同期状態であったことが分かる。
If all the data update processing being processed is completed and the sweeping is completed (S21), and all the replication requests to the
ステップS24で自装置のスレーブとしての処理を開始した第1DB装置1は、「完了フラグ2」のデータである「完了」を読み出し(S32)、読み出した完了フラグデータとともに、新たにマスタとなった第2DB装置2に、データの同期を要求するレプリケーション開始要求を送信する(S33)。
The
このレプリケーション開始要求及び完了フラグデータ(完了)を受信したマスタである第2DB装置2は、第1DB装置1と第2DB装置2とが同期していることがわかるため、レプリケーションは不要と判断する。したがって、第2DB装置2から第1DB装置1へのデータの送信は実行されない。
The
また、第1DB装置1は、レプリケーション開始要求及び完了フラグデータを送信すると、「完了フラグ2」を「完了」から「未完了」に更新する(S34)。
Further, when the
このように、冗長性データベースシステム100では、マスタのDB装置に完了フラグを設け、マスタは交代の際に、スレーブのDB装置へのレプリケーションの掃き出しが完了したか否かを記憶する。また、マスタの交代によりスレーブとなった旧マスタであるDB装置は、旧スレーブとのデータの掃き出しの完了を表す完了フラグのデータをレプリケーション開始要求の送信の際に新マスタであるDB装置に送信する。これにより、新マスタとなったDB装置は、旧マスタのDB装置から引き継いだ完了フラグのデータから、旧マスタのDB装置とのデータの同期を判断することができる。したがって、レプリケーションの要否を判断し、不要な全件レプリケーションの実行を防止し、冗長性が失われることを防ぐことができる。
As described above, in the
[スレーブが2台存在する場合]
図5では、スレーブが1台の場合で説明したが、図6に示すシーケンス図を利用して、スレーブが2台存在する場合の処理について説明する。図6では、第1DB装置1がマスタからスレーブに変更し、第2DB装置2がスレーブからマスタに変更し、第3DB装置3は、スレーブを継続する場合の一例である。図6では、ステップS11〜S14までの処理は図3及び図5と同一である。
[When there are two slaves]
Although FIG. 5 has been described in the case where there is one slave, the processing in the case where there are two slaves will be described using the sequence diagram shown in FIG. In FIG. 6, the
ステップS12で更新処理を実行すると、第1DB装置1は、第2DB装置2及び第3DB装置3のそれぞれにレプリケーション要求を送信する(S15−1、S15−2)。
When the update process is executed in step S12, the
レプリケーション要求を受信した第2DB装置2及び第3DB装置3は、それぞれ、レプリケーション要求にしたがって、データを更新する(S16−1、S16−2)。また、データの更新処理が終了した第2DB装置2及び第3DB装置3は、更新が完了した完了通知を旧マスタの第1DB装置1に送信する(S19−1、S19−2)。
The
第2DB装置2及び第3DB装置3から完了通知を受信した第1DB装置1は、ホスト装置4に完了通知を送信して(S20)、掃き出しが完了すると(S21)、第2DB装置2との同期に関する「完了フラグ2」及び第3DB装置3との同期に関する「完了フラグ3」を「未完了」から「完了」に更新する(S41)。
The
また、ステップS22〜S25の処理も、図3及び図5と同一である。 Moreover, the process of step S22-S25 is also the same as FIG.3 and FIG.5.
ステップS24で自装置のスレーブとしての処理を開始した第1DB装置1は、「完了フラグ2」のデータ(完了)及び「完了フラグ3」のデータ(完了)を読み出し(S42)、新たにマスタとなった第2DB装置2に、読み出した完了フラグデータとともに、データの同期を要求するレプリケーション開始要求を送信する(S43)。
The
また、完了フラグデータを新たにマスタとなった第2DB装置2に送信した第1DB装置1は、「完了フラグ2」及び「完了フラグ3」を「完了」から「未完了」に変更する(S44)。
Also, the
このレプリケーション開始要求及び完了フラグ2のデータ(完了)を受信したマスタである第2DB装置2は、第1DB装置1と第2DB装置2とが同期していることがわかる。そのため、第2DB装置2は、第1DB装置1とのレプリケーションは不要と判断する。したがって、第2DB装置2から第1DB装置1へのデータの送信は実行されない。
The
また、第2DB装置2は、完了フラグ3のデータから、第1DB装置1と第3DB装置3とが同期していることが分かるため、第2DB装置2と第3DB装置3とも同期していることが分かる。したがって、第2DB装置2は、自装置が記憶するデータと第3DB装置3が記憶するデータとが同期していることを表す「完了フラグ3」を「完了」に更新する(S45)。これにより、第2DB装置2は、第3DB装置3へのレプリケーションは不要と判断することができる。
In addition, since the
したがって、第2DB装置2は、第3DB装置3からレプリケーション要求を受信した場合にも(S46)、レプリケーションは実行されない。また、第2DB装置2は、第3DB装置3からレプリケーション要求を受信すると、第3完了フラグを「完了」から「未完了」に更新する(S47)。
Therefore, even when the
このように、冗長性データベースシステム100では、マスタのDB装置に完了フラグを設け、スレーブのDB装置とのデータの掃き出しが完了したかを記憶する。また、マスタの交代によりスレーブとなった旧マスタであるDB装置は、旧スレーブへのレプリ掃き出しの完了を表す完了フラグのデータをレプリケーション開始要求の送信の際に新マスタであるDB装置に送信する。これにより、新マスタとなったDB装置は、旧マスタのDB装置から引き継いだ完了フラグのデータから、旧マスタのDB装置と旧スレーブのDB装置とのデータの同期を判断することができる。したがって、レプリケーションの要否を判断し、不要な全件レプリケーションの実行を防止し、冗長性が失われることを防ぐことができる。
In this manner, in the
[2台目スレーブから先にレプリケーション開始要求を受信した場合]
また、図7は、新マスタとなった第2DB装置2が、旧マスタの第1DB装置1ではなく、第3DB装置3である2台目スレーブから先にレプリケーション開始要求を受信した例を説明するシーケンス図である。図7において、ステップS25までの処理は図6と同一であり、ステップS11〜S21については、図示を省略している。
[When a replication start request is received from the second slave first]
FIG. 7 illustrates an example in which the
図7に示すように、新マスタとなった第2DB装置2の同期手段13は、スレーブである第3DB装置3から、レプリケーション開始要求を受信したとき(S51)、旧マスタの第1DB装置1から完了フラグのデータを引き継いでいないとする。この場合、第2DB装置2は、レプリケーション開始要求に対して直に応答せず、旧マスタの第1DB装置1から完了フラグデータを受信するまで一定時間を上限として待機する。
As shown in FIG. 7, when the synchronization means 13 of the
第1DB装置1が「完了フラグ1」のデータ(完了)及び「完了フラグ2」のデータ(完了)を読み出し(S42)、完了フラグのデータを含むレプリケーション開始要求を第2DB装置2に送信する(S52)。また、レプリケーション開始要求を送信した第1DB装置1は、「完了フラグ2」及び「完了フラグ3」を「完了」から「未完了」に更新する(S53)。
The
完了フラグを受信した場合には、第1DB装置1からレプリケーション開始要求及び完了フラグのデータ(完了)を受信した第2DB装置2は、第1DB装置1と第2DB装置とが同期していることがわかる。そのため、第2DB装置2は第1DB装置1とのレプリケーションは不要と判断し、データは送信されない。
When the completion flag is received, the
その後、第2DB装置2は、第1DB装置1(旧マスタ)から受信した「完了フラグ3」が「完了」であることから、ステップS51で受信したレプリケーション開始要求に対して、送信の必要がないと判定する。したがって、第2DB装置2は、第1DB装置1へのデータの送信を実行しない。
Thereafter, since the “
このように、マスタの交代によって新マスタとなったDB装置は、旧マスタのDB装置から完了フラグのデータを引き継ぐ前に他のスレーブのDB装置からレプリケーションが要求されると、完了フラグのデータを引き継ぐまでレプリケーションの要否の判断を保留にすることにより、不要なレプリケーションの実行を防止し、冗長性が失われることを防止することができる。 In this way, the DB device that becomes the new master due to the change of the master, when replication is requested from another slave DB device before taking over the data of the completion flag from the DB device of the old master, By deferring the necessity of replication until it is taken over, unnecessary replication can be prevented and redundancy can be prevented from being lost.
以上、実施形態を用いて本発明を詳細に説明したが、本発明は本明細書中に説明した実施形態に限定されるものではない。本発明の範囲は、特許請求の範囲の記載及び特許請求の範囲の記載と均等の範囲により決定されるものである。 As mentioned above, although this invention was demonstrated in detail using embodiment, this invention is not limited to embodiment described in this specification. The scope of the present invention is determined by the description of the claims and the scope equivalent to the description of the claims.
100 冗長化データベースシステム
1〜3 データベース装置(DB装置)
10 データ記憶部
11 フラグ記憶部
12 更新手段
13 同期手段(判断する手段)
14 送信手段
4 ホスト装置
100 Redundant database system 1-3 Database device (DB device)
10
14 Transmitting means 4 Host device
Claims (5)
前記各データベース装置は、
マスタであるとき、マスタを交代する際に旧マスタのデータベース装置におけるデータ更新処理とスレーブのデータベース装置へのレプリケーションの要求が全て完了したか否かを特定する完了フラグを記憶するフラグ記憶部と、
マスタからスレーブに変更した際、前記完了フラグのデータを新たにマスタとなるデータベース装置に送信する送信手段と、
スレーブからマスタに変更した際、旧マスタのデータベース装置から受信した完了フラグのデータに基づいて、スレーブのデータベース装置からのレプリケーションの開始要求に対し、自装置が記憶するデータを全件送信するかまたは一件も送信せずに同期完了とするかを判断する手段と、
を備えることを特徴とする冗長化データベースシステム。 A redundant database system in which data is stored synchronously in a plurality of database devices, and any one database device is set as a master and another database device is set as a slave,
Each of the database devices is
A flag storage unit for storing a completion flag for specifying whether or not the data update processing in the database device of the old master and the replication request to the slave database device are all completed when the master is changed,
When changing from the master to the slave, the transmission means for transmitting the data of the completion flag to the database device as a new master,
When changing from the slave to the master, based on the completion flag data received from the old master database device, all data stored in the own device will be sent in response to the replication start request from the slave database device, or A means of determining whether to complete the synchronization without sending a single message,
A redundant database system comprising:
前記同期手段は、
スレーブからマスタに変更した際、旧マスタのデータベース装置から完了フラグのデータを受信する前に他のスレーブのデータベース装置からレプリケーションの要求を受信すると、前記旧マスタのデータベース装置から完了フラグのデータを受信するまで待機する
ことを特徴とする請求項1に記載の冗長化データベースシステム。 The flag storage unit stores completion flags for a plurality of slave database devices,
The synchronization means includes
When changing from a slave to a master, if a replication request is received from another slave database device before receiving the completion flag data from the old master database device, the completion flag data is received from the old master database device. 2. The redundant database system according to claim 1, wherein the database system waits until it is completed.
マスタであるとき、自装置で記憶するデータが更新されるとスレーブのデータベース装置とのデータの同期が完了したか否かを特定する完了フラグを記憶するフラグ記憶部と、
マスタからスレーブに変更した際、前記完了フラグのデータを新たにマスタとなるデータベース装置に送信する送信手段と、
スレーブからマスタに変更した際、旧マスタのデータベース装置から受信した完了フラグのデータに基づいて、データが同期されていないスレーブのデータベースに対し、自装置が記憶するデータを送信する同期手段と、
を備える
ことを特徴とするデータベース装置。 A database device used in a redundant database system in which data is stored synchronously in a plurality of database devices, any one database device is set as a master, and another database device is set as a slave,
A flag storage unit for storing a completion flag for specifying whether or not data synchronization with the slave database device is completed when the data stored in the own device is updated when the master is stored;
When changing from the master to the slave, the transmission means for transmitting the data of the completion flag to the database device as a new master,
When changing from the slave to the master, based on the data of the completion flag received from the database device of the old master, the synchronization means for transmitting the data stored in the own device to the database of the slave whose data is not synchronized,
A database apparatus comprising:
前記データベース装置において、マスタであるとき、自装置で記憶するデータが更新されるとスレーブのデータベース装置とのデータの同期が完了したか否かを特定する完了フラグをフラグ記憶部に記憶するステップと、
マスタからスレーブに変更するデータベース装置において、前記完了フラグのデータを新たにマスタとなるデータベース装置に送信するステップと、
スレーブからマスタに変更するデータベース装置において、旧マスタのデータベース装置から受信した完了フラグのデータに基づいて、データが同期されていないスレーブのデータベースに対し、自装置が記憶するデータを送信するステップと、
を有することを特徴とするマスタ交代方法。 A master replacement method executed in a redundant database system in which data is stored synchronously in a plurality of database devices, one of the database devices is set as a master, and the other database device is set as a slave. ,
In the database device, when the master device is the master, when the data stored in the own device is updated, a completion flag for specifying whether or not the synchronization of the data with the slave database device is completed is stored in the flag storage unit; ,
In the database device that changes from the master to the slave, the step of transmitting the data of the completion flag to the database device that becomes a new master;
In the database device to be changed from the slave to the master, based on the data of the completion flag received from the old master database device, the step of transmitting the data stored in the own device to the database of the slave whose data is not synchronized,
A master replacement method characterized by comprising:
スレーブからマスタに変更するデータベース装置は、旧マスタのデータベース装置から完了フラグのデータを受信する前に他のスレーブのデータベース装置からレプリケーションの要求を受信すると、前記旧マスタのデータベース装置から完了フラグのデータを受信するまで待機するステップ
を有することを特徴とする請求項4記載のマスタ交代方法。 The flag storage unit stores a completion flag for each of the plurality of slave database devices,
When the database device to be changed from the slave to the master receives a replication request from another slave database device before receiving the completion flag data from the old master database device, the completion flag data from the old master database device is received. 5. The master replacement method according to claim 4, further comprising a step of waiting until the signal is received.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2014028352A JP6088450B2 (en) | 2014-02-18 | 2014-02-18 | Redundant database system, database device, and master replacement method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2014028352A JP6088450B2 (en) | 2014-02-18 | 2014-02-18 | Redundant database system, database device, and master replacement method |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2015153285A true JP2015153285A (en) | 2015-08-24 |
JP6088450B2 JP6088450B2 (en) | 2017-03-01 |
Family
ID=53895421
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2014028352A Active JP6088450B2 (en) | 2014-02-18 | 2014-02-18 | Redundant database system, database device, and master replacement method |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP6088450B2 (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2017097791A (en) * | 2015-11-27 | 2017-06-01 | 株式会社三菱東京Ufj銀行 | Data processing device |
CN112327600A (en) * | 2020-10-28 | 2021-02-05 | 中国核动力研究设计院 | Data synchronization method of redundant controller, redundant controller and instrument control system |
Citations (12)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH04299435A (en) * | 1991-03-27 | 1992-10-22 | Nec Corp | Data base equivalent system |
JP2000035911A (en) * | 1998-07-21 | 2000-02-02 | Mitsubishi Electric Corp | Equalization method for data base |
JP2000082006A (en) * | 1998-09-07 | 2000-03-21 | Toshiba Corp | Information backup system |
JP2005242652A (en) * | 2004-02-26 | 2005-09-08 | Nec Corp | Computer backup system and computer backup method |
JP2005339411A (en) * | 2004-05-28 | 2005-12-08 | Toshiba Corp | Method, system and program for equalizing distributed data |
JP2006058960A (en) * | 2004-08-17 | 2006-03-02 | Nec Corp | Synchronization method and system in redundant configuration server system |
JP2006268740A (en) * | 2005-03-25 | 2006-10-05 | Nec Corp | Replication system and method |
JP2007328595A (en) * | 2006-06-08 | 2007-12-20 | Nec Corp | Server system, and synchronization method for the system |
JP2008276553A (en) * | 2007-04-27 | 2008-11-13 | Mitsubishi Electric Corp | Database equivalence system and database equivalence method |
US20090157766A1 (en) * | 2007-12-18 | 2009-06-18 | Jinmei Shen | Method, System, and Computer Program Product for Ensuring Data Consistency of Asynchronously Replicated Data Following a Master Transaction Server Failover Event |
JP2013171483A (en) * | 2012-02-22 | 2013-09-02 | Nippon Telegr & Teleph Corp <Ntt> | Difference replication system, master database device and slave database device |
JP2014016953A (en) * | 2012-07-11 | 2014-01-30 | Nippon Telegr & Teleph Corp <Ntt> | Unshared type database system, synchronizing device, database server, its synchronizing method, and synchronizing program |
-
2014
- 2014-02-18 JP JP2014028352A patent/JP6088450B2/en active Active
Patent Citations (12)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH04299435A (en) * | 1991-03-27 | 1992-10-22 | Nec Corp | Data base equivalent system |
JP2000035911A (en) * | 1998-07-21 | 2000-02-02 | Mitsubishi Electric Corp | Equalization method for data base |
JP2000082006A (en) * | 1998-09-07 | 2000-03-21 | Toshiba Corp | Information backup system |
JP2005242652A (en) * | 2004-02-26 | 2005-09-08 | Nec Corp | Computer backup system and computer backup method |
JP2005339411A (en) * | 2004-05-28 | 2005-12-08 | Toshiba Corp | Method, system and program for equalizing distributed data |
JP2006058960A (en) * | 2004-08-17 | 2006-03-02 | Nec Corp | Synchronization method and system in redundant configuration server system |
JP2006268740A (en) * | 2005-03-25 | 2006-10-05 | Nec Corp | Replication system and method |
JP2007328595A (en) * | 2006-06-08 | 2007-12-20 | Nec Corp | Server system, and synchronization method for the system |
JP2008276553A (en) * | 2007-04-27 | 2008-11-13 | Mitsubishi Electric Corp | Database equivalence system and database equivalence method |
US20090157766A1 (en) * | 2007-12-18 | 2009-06-18 | Jinmei Shen | Method, System, and Computer Program Product for Ensuring Data Consistency of Asynchronously Replicated Data Following a Master Transaction Server Failover Event |
JP2013171483A (en) * | 2012-02-22 | 2013-09-02 | Nippon Telegr & Teleph Corp <Ntt> | Difference replication system, master database device and slave database device |
JP2014016953A (en) * | 2012-07-11 | 2014-01-30 | Nippon Telegr & Teleph Corp <Ntt> | Unshared type database system, synchronizing device, database server, its synchronizing method, and synchronizing program |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2017097791A (en) * | 2015-11-27 | 2017-06-01 | 株式会社三菱東京Ufj銀行 | Data processing device |
CN112327600A (en) * | 2020-10-28 | 2021-02-05 | 中国核动力研究设计院 | Data synchronization method of redundant controller, redundant controller and instrument control system |
Also Published As
Publication number | Publication date |
---|---|
JP6088450B2 (en) | 2017-03-01 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP6556851B2 (en) | Database system, server device, program, and information processing method | |
US9235408B2 (en) | Non-disruptive software updates for servers processing network traffic | |
CN109951331B (en) | Method, device and computing cluster for sending information | |
CN104486319B (en) | Suitable for the configuration file real-time synchronization method and its system of high-availability system | |
JP2019526106A (en) | Data processing method and device | |
JP2009251786A (en) | Data processing method, storage apparatus, and storage system | |
US9043283B2 (en) | Opportunistic database duplex operations | |
JP6088450B2 (en) | Redundant database system, database device, and master replacement method | |
WO2011109049A1 (en) | Method and apparatus of backing-up subversion repository | |
JP5900094B2 (en) | Data alignment system, data alignment method, and data alignment program | |
CN114297296A (en) | Server active-standby switching system for broadcasting | |
CN111510327A (en) | Network connection method and device for training participants of co-training model | |
JP5685213B2 (en) | Differential replication system, master database device, and slave database device | |
JP5956940B2 (en) | Redundant system and working machine determination method | |
JP5716460B2 (en) | Cluster system and control method thereof | |
US10514850B2 (en) | Information processing system, server device, Information processing method, and computer program product | |
WO2016045374A1 (en) | Data synchronization method and apparatus | |
US8489773B1 (en) | System, method, and computer program for sending a response to a client based on a replication message received from a master server | |
EP2980707B1 (en) | Method for creating a database clone of a distributed database, system for creating a database clone of a distributed database, program and computer program product | |
CN113472891A (en) | SDN controller cluster data processing method, device and medium | |
US9489269B2 (en) | Global backup lock manager | |
US11269922B2 (en) | Database server, database management method, and storage medium | |
JP2013175079A (en) | Distributed data management system and operation method thereof | |
JP6434385B2 (en) | Update system, update method, and update program | |
CN116360920A (en) | Stream data management method, database cluster, device and equipment |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20160107 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20160929 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20161025 |
|
A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20161213 |
|
TRDD | Decision of grant or rejection written | ||
A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 Effective date: 20170131 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20170203 |
|
R150 | Certificate of patent or registration of utility model |
Ref document number: 6088450 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 |