WO2023148977A1 - ノード装置、クラスタ管理方法、プログラム及びクラスタシステム - Google Patents

ノード装置、クラスタ管理方法、プログラム及びクラスタシステム Download PDF

Info

Publication number
WO2023148977A1
WO2023148977A1 PCT/JP2022/004715 JP2022004715W WO2023148977A1 WO 2023148977 A1 WO2023148977 A1 WO 2023148977A1 JP 2022004715 W JP2022004715 W JP 2022004715W WO 2023148977 A1 WO2023148977 A1 WO 2023148977A1
Authority
WO
WIPO (PCT)
Prior art keywords
cluster
node
group
node device
database
Prior art date
Application number
PCT/JP2022/004715
Other languages
English (en)
French (fr)
Inventor
雄大 朝井
Original Assignee
株式会社Pfu
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 株式会社Pfu filed Critical 株式会社Pfu
Priority to PCT/JP2022/004715 priority Critical patent/WO2023148977A1/ja
Publication of WO2023148977A1 publication Critical patent/WO2023148977A1/ja

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/16Error detection or correction of the data by redundancy in hardware
    • G06F11/20Error detection or correction of the data by redundancy in hardware using active fault-masking, e.g. by switching out faulty elements or by switching in spare elements

Definitions

  • the present disclosure relates to technology for managing clusters.
  • a first server transmits differential data updated by its own server to a second server while communication is interrupted, and the second server receives differential data and differential data updated by its own server while communication is interrupted. are merged to create transmission data to be transmitted to the first server and reflection data to be reflected on the own server, the second server transmits the transmission data to the first server, and the reflection data to the self server
  • the first server reflects the transmitted data on its own server, the first server transmits the difference data updated by its own server during the recovery process to the second server, and the read difference data is reflected on its own server
  • Patent Literature 1 A method has been proposed in which, when updated reflected data is included, the updated portion is reflected in the own server.
  • the method automatically initiates a failover processing sequence when detecting that the primary database is unavailable and determining that the standby database at the primary site is available, and performing failover processing.
  • the sequence automatically enables the standby database as readable and writable, assigns the standby database the role of primary database at the primary site to start replicating data to other standby databases, and after failover role transition , allowing the application server to read data from and write data to the standby database using a pre-established connection between the application server and the standby database, the standby database being the primary database at the primary site;
  • JP 2006-146299 A Japanese Patent Publication No. 2020-511708
  • a group that reconfigures the cluster from the plurality of node groups and a group that reconfigures the cluster.
  • a group that does not reconfigure a cluster is determined, and while the group that reconfigures the cluster can continue operation, the group that does not reconfigure the cluster cannot continue operation.
  • the present disclosure aims to provide data consistency in the cluster while providing database services even in nodes that do not belong to the group that reconfigures the cluster.
  • An example of the present disclosure is a node device among a plurality of node devices constituting a cluster with a multi-master configuration, wherein when the cluster is divided into a plurality of groups, the self-group including the self-node device Even if the group that reconfigures the cluster is not determined, the service providing means for providing the service of the database of the own node device, and the self node device is not the group that reconfigures the cluster, and the self node device synchronization means for synchronizing a database of the own node device with databases of other node devices belonging to the group for reconfiguring the cluster when the node device is in a state in which it can rejoin the cluster.
  • the present disclosure can be understood as an information processing device, a system, a method executed by a computer, or a program to be executed by a computer.
  • the present disclosure can also be understood as recording such a program in a recording medium readable by a computer, other device, machine, or the like.
  • a computer-readable recording medium is a recording medium that stores information such as data and programs by electrical, magnetic, optical, mechanical or chemical action and can be read by a computer. say.
  • FIG. 1 is a schematic diagram showing the configuration of a cluster system having clusters with a multi-master configuration according to a first embodiment
  • FIG. 3 is a diagram showing an outline of the functional configuration of a node according to the first embodiment
  • FIG. It is a figure which shows an example of the management information table (normal time) which concerns on 1st embodiment.
  • 1 is a diagram showing an example of a Grid quorum system according to a first embodiment
  • FIG. 4 is a diagram showing an example of a finite projective planar quorum according to the first embodiment
  • FIG. 4 is a diagram showing an example of a management information table (immediately after occurrence of an inter-site failure) according to the first embodiment
  • FIG. 4 is a diagram showing an example of a management information table (immediately after node failure occurs) according to the first embodiment
  • FIG. 7 is a diagram showing an example of a management information table (after updating evaluation values) according to the first embodiment
  • 4 is a flowchart showing an overview of the flow of evaluation value update processing (ordinary flow) according to the first embodiment
  • 4 is a flow chart showing an overview of the flow of group determination processing (failure occurrence flow) according to the first embodiment
  • 4 is a flowchart showing an overview of the flow of synchronization processing (failure recovery flow) according to the first embodiment
  • FIG. 10 is a schematic diagram showing the configuration of a cluster system comprising clusters with a multi-master configuration according to a second embodiment
  • FIG. 10 is a schematic diagram showing the configuration of a cluster system comprising clusters with a multi-master configuration according to a second embodiment
  • FIG. 12 is a diagram showing an outline of the functional configuration of a node according to the second embodiment; FIG. It is a figure which shows an example of the state (ordinary time) of the database which concerns on 2nd embodiment.
  • FIG. 10 is a diagram illustrating an example of the database state (after failure) according to the second embodiment;
  • FIG. 11 is a diagram illustrating an example of a database state (at the time of failure recovery (at the time of restoration)) according to the second embodiment;
  • FIG. 11 is a diagram illustrating an example of a database state (at the time of failure recovery (at the time of synchronization)) according to the second embodiment;
  • FIG. 11 is a flowchart showing an overview of the flow of backup processing (ordinary flow) according to the second embodiment;
  • FIG. 11 is a flowchart showing an overview of the flow of backup invalidation processing (failure occurrence flow) according to the second embodiment;
  • FIG. 11 is a flowchart showing an overview of the flow of synchronization processing (failure recovery flow) according to the second embodiment;
  • FIG. 13 is a diagram showing an outline of the functional configuration of a node according to the third embodiment;
  • the device, system, method, and program according to the present disclosure are implemented in a multi-master configuration cluster composed of nodes arranged at two bases. An embodiment when implemented will be described. However, the device, system, method, and program according to the present disclosure can be widely used for techniques for reconfiguring and managing a cluster with a multi-master configuration, and the application target of the present disclosure is shown in the embodiment Examples are not limiting.
  • each node that configures the cluster uses usage information obtained during normal times to automatically An embodiment for determining whether a group including a node is to be a group for reconfiguring the cluster will be described.
  • FIG. 1 is a schematic diagram showing the configuration of a cluster system having clusters with a multi-master configuration according to this embodiment.
  • a plurality of node devices (hereinafter referred to as "nodes") 1 constituting a multi-master cluster 3 are connected to each other via a network so as to be able to communicate with each other.
  • a node 1a (hereinafter referred to as "node A”) and a node 1b (hereinafter referred to as “node B”) are arranged at a base 1
  • a node 1c hereinafter referred to as "node B"
  • node C node 1d
  • node D node 1d
  • Each node 1 includes a CPU (Central Processing Unit) 11, ROM (Read Only Memory) 12, RAM (Random Access Memory) 13, EEPROM (Electrically Erasable and Programmable Read Only Memory) and HDD Storage device such as (Hard Disk Drive) 14 and a communication unit 15 such as a NIC (Network Interface Card).
  • a CPU Central Processing Unit
  • ROM Read Only Memory
  • RAM Random Access Memory
  • EEPROM Electrically Erasable and Programmable Read Only Memory
  • HDD Storage device such as (Hard Disk Drive) 14
  • NIC Network Interface Card
  • the specific hardware configuration of the node 1 can be appropriately omitted, replaced, or added according to the mode of implementation.
  • the node 1 is not limited to a device consisting of a single housing.
  • the node 1 may be realized by a plurality of devices using so-called cloud or distributed computing technology. Therefore, for example, the node 1 is a node device composed of a plurality of housings, and the functional unit and the database to be
  • a node is a computer (information processing device) or a server that constitutes a cluster 3 with a multi-master configuration.
  • each node 1 has (manages) an individual database.
  • the cluster 3 according to this embodiment is a database cluster with a multi-master configuration.
  • the database service can be continued by isolating (removing) the failed node.
  • the database to be synchronized between nodes is, for example, a relational database, but may be any other database such as a key-value database. Also, in each node, the database may be constructed (stored) in the storage device 14 or constructed in another storage device.
  • User terminals 8 are connected to the cluster system 9 according to the present embodiment, and the nodes 1 accept and execute processing requests (queries) for database read operations, write operations, etc., sent from the user terminals 8. It is possible to The user terminal 8 is a computer including a CPU, ROM, RAM, storage device, communication unit, and the like. However, the specific hardware configuration of the user terminal 8 can be appropriately omitted, replaced, or added according to the mode of implementation.
  • the cluster system 9 is not limited to the cluster system 9 having the configuration illustrated in FIG.
  • a cluster system in which a plurality of nodes 1 are arranged at only one location or a cluster system in which a plurality of nodes 1 are arranged at two or more locations may be used.
  • the number of nodes arranged at each base is not limited to a plurality, and a configuration in which only one node is arranged at each base may be employed.
  • the cluster system 9 (cluster 3) according to this embodiment comprises two or more nodes.
  • FIG. 2 is a diagram showing an outline of the functional configuration of a node according to this embodiment.
  • a program recorded in the storage device 14 is read out to the RAM 13 and executed by the CPU 11 to control each hardware provided in the node 1, so that the management information storage unit 21, Usage information acquisition unit 22, usage information transmission unit 23, evaluation value calculation unit 24, state detection unit 25, determination unit 26, failure detection unit 27, setting unit 28, service provision unit 29, reconnection unit 30, update information transmission/reception unit 31 , an update data identification unit 32 , an update data transmission/reception unit 33 and a synchronization unit 34 .
  • each function of the node 1 is executed by the CPU 11, which is a general-purpose processor, but some or all of these functions are executed by one or more dedicated processors. may be executed.
  • each functional unit included in the node 1 is not limited to being implemented in a device consisting of a single housing (one device), and is implemented remotely and/or distributed (for example, on the cloud). may be
  • the management information storage unit 21 stores management information regarding the self-node and the cluster to which the self-node belongs.
  • the management information includes information about the usage status of the own node, information about a group (cluster) composed of nodes that can communicate with the own node, and the own node.
  • a "group (cluster) composed of a node that can communicate with the self node and the self node” will be referred to as a "self group (self cluster)".
  • the management information is stored in a management information table, and the management information (management information table) is stored in the storage device 14 or another storage device.
  • FIG. 3 is a diagram showing an example of a management information table (normal time) according to this embodiment.
  • the management information table according to the present embodiment includes "cluster node”, “state”, “number of transactions (Tx count)", “evaluation value”, and “total evaluation value” as management information. ” information is stored.
  • Information for example, node names and node IDs
  • the own group is a primary cluster that operates as cluster 3 (a cluster capable of providing database services as cluster 3) and a cluster that does not operate as cluster 3.
  • the column of "Tx count” stores usage information (such as the number of transactions of the own node), which is information indicating the usage status of the own node.
  • the “evaluation value” column stores the evaluation value of the own node, which is the weight (importance) used in the weighted majority vote, which will be described later.
  • the “total evaluation value” column stores the total evaluation value of the constituent nodes of the primary cluster.
  • the evaluation value of the constituent nodes of the primary cluster to which the self-node last belonged is not the sum of the evaluation values of the constituent nodes of the current primary cluster to which the self-node does not belong. The sum of the values is held in the "total evaluation value".
  • the cluster 3 is not divided (normal state), and each node constituting the cluster 3 is in a communicable state. It belongs to the primary cluster. Therefore, as shown in FIG. 3, in the management information table provided for each node, "(node) A, B, C, D" is entered in the "cluster node” column, and "PRIMARY” is entered in the "state” column. , the sum of the evaluation values of the nodes A, B, C, and D is stored in the column of “total evaluation value”. Details of the "Tx count” and the "evaluation value” will be described later. Also, the management information shown in FIG. 3 is an example, and the management information may include information other than the information shown in FIG.
  • management information table shown in FIG. 3 is an example, and other formats may be used as long as the management information can be stored.
  • the management information table that stores management information is not limited to one table as shown in FIG. 3, and may be composed of a plurality of tables.
  • the usage information acquisition unit 22 acquires usage information indicating the usage status (load status) of each node 1 (including its own node) that configures the cluster 3 for each predetermined period.
  • usage information indicating the usage status of a node the number of transactions (read operation (read) and/or write operation (write)) of the node, which is an example of information indicating the frequency of access to the node. number of transactions).
  • the usage information acquired by the usage information acquisition unit 22 is not limited to the number of transactions as long as it is information indicating the usage status of the node. Besides, it may be a hardware load index, a CPU usage rate, a memory usage rate, or the like.
  • the acquired usage information is not limited to one type of information, and may include multiple types of information indicating the node usage status. For example, usage information may be the number of transactions and the number of packet transfers.
  • information indicating the usage status of each node near that point in time is acquired every predetermined period.
  • the usage status of a node in the vicinity of the time when the usage information is acquired is, for example, the usage status for a certain period before the time when the usage information is acquired.
  • the usage information acquisition unit 22 acquires information indicating the usage status of each node for a certain period of time before that point in time for each predetermined period.
  • the total value of the number of transactions for a predetermined period (for example, 3 hours) is calculated (acquired) every predetermined period (for example, 1 hour).
  • the predetermined period is 1 hour and the predetermined period is 3 hours
  • the usage information acquisition unit 22 of node A obtains the number of transactions of each node (nodes A, B, C, and D) that make up cluster 3.
  • An example is given for obtaining the
  • the cumulative value of the number of transactions (cumulative value for each node) from a certain point in time (starting point) is transmitted and received between nodes every predetermined period.
  • the cumulative value of the number of transactions of the node from the starting point will simply be referred to as "cumulative value”.
  • the usage information acquisition unit 22 of node A acquires a cumulative value for each node at that point in time every predetermined period of time (one hour) for a period exceeding at least a predetermined period of time (three hours). . For example, if you want to obtain the number of transactions for 3 hours every hour from 12:00, even at 12:00, you can obtain the total number of transactions for the previous 3 hours at 9:00. , 10:00 and 11:00 are acquired. For example, node A acquires "100" at 9:00, "200" at 10:00, and "300" at 11:00 as the cumulative value of node B.
  • the usage information acquiring unit 22 calculates the total number of transactions for a certain period of time for its own node
  • the total number of transactions for the certain period of its own node is added to the "Tx count" in the management information table. update the information in
  • the evaluation value is calculated based on the total value of the number of transactions for a certain period of time. It may be a representative value such as an average value (moving average value), median value (moving median value), maximum value, minimum value, or mode value of the number of transactions in a period. For example, instead of the number of transactions for 3 hours, the average value of the number of transactions for each hour out of 3 hours may be used to calculate the evaluation value.
  • the evaluation value calculated at 13:00 is calculated based only on the number of transactions for a certain period (for example, the total value "500” described above) calculated at 13:00. Also, in addition to the number of transactions "500" for a certain period at 13:00, it is calculated based on the number of transactions calculated (acquired) before that (for example, the above-mentioned total value "400" at 12:00). may be Also, the usage information used to calculate the evaluation value may be information (instantaneous value) indicating the usage status at the time when the usage information is acquired.
  • the usage information acquisition unit 22 acquires the cumulative value for each node from the corresponding node, and calculates the number of transactions for each node (nodes A, B, C, and D) during a certain period. is calculated, the method of obtaining the number of transactions for a certain period of time for each node is not limited to this example.
  • each node may calculate its own number of transactions for a certain period of time and transmit the calculated results between the nodes.
  • the usage information acquisition unit 22 can acquire the number of transactions of each node in a certain period from the corresponding node (for example, acquire the total value of the number of transactions in the certain period of Node B from Node B). is.
  • the usage information acquisition unit 22 of each node acquires usage information (access statistical information, etc.) of its own node and other nodes every time a predetermined period elapses (regularly).
  • the latest usage information (usage status) of each node can be shared among the nodes. In other words, it is possible to share the usage status of each node between nodes each time. For example, in the cluster 3 shown in FIG. It is possible to grasp the usage status of the node. In this embodiment, a case where usage information is acquired every time a predetermined period elapses will be described. May be irregular.
  • the usage information acquisition unit 22 acquires usage information only when its own node belongs to the primary cluster. In other words, the usage information acquiring unit 22 suspends the processing of acquiring usage information when its own node belongs to a non-primary cluster. As a result, in a node belonging to a non-primary cluster, usage information of each node is acquired and the evaluation value of each node is updated, thereby avoiding a situation in which the node is erroneously set as the primary cluster. Is possible.
  • the usage information acquiring unit 22 acquires the usage information of the other node by receiving the usage information transmitted by the usage information transmitting unit 23 of the other node, and acquires the usage information of the own node by receiving the usage information of the own node. or from a table (not shown) in which the usage status of the own node is sequentially updated, stored in the storage device 14 or another storage device.
  • the usage information acquisition unit 22 may acquire information on the number of transactions, for example, by referring to statistics in the MySQL host_summary sys table.
  • the usage information transmission unit 23 repeatedly transmits usage information indicating the usage status of its own node to the other nodes that make up the cluster 3 .
  • the usage information transmission unit 23 transmits the usage information (cumulative value) of its own node every predetermined period.
  • the evaluation value calculation unit 24 calculates the evaluation value (weight) of each node 1 that configures the cluster 3 based on the usage information (total value of the number of transactions during a certain period) acquired by the usage information acquisition unit 22 .
  • the usage information total value of the number of transactions during a certain period
  • a method of reconfiguring a cluster by performing a majority vote based on the number of nodes in each node group, a method of reconfiguring a cluster by manually setting the weight of each node, and the like have been used.
  • each node is automatically weighted according to the usage status of each node. 3 (the group that will become the new primary cluster) is determined.
  • a majority vote based on the evaluation values (weights) calculated by the evaluation value calculation unit 24 is performed to determine the group that reconstructs the cluster 3 .
  • the evaluation value calculation unit 24 calculates the evaluation value only when the own node belongs to the primary cluster for the same reason as the use information acquisition unit 22 described above.
  • the evaluation value calculation unit 24 calculates the evaluation value (weight) of each node according to the usage status of the corresponding node. That is, the evaluation value calculation unit 24 calculates evaluation values of a plurality of nodes (nodes forming the cluster 3) corresponding to usage information of the plurality of nodes. In this embodiment, the evaluation value of each node is calculated based on the usage information of a plurality of nodes (nodes forming the cluster 3) acquired by the usage information acquiring unit 22. FIG. Specifically, the evaluation value calculation unit 24 calculates the values of the usage information of the plurality of nodes so that the maximum value among the values of the usage information of the plurality of nodes matches the maximum value of the evaluation values that can be set.
  • the evaluation value calculation unit 24 calculates each of the evaluation values of the plurality of nodes based on the scaled results (hereinafter referred to as “adjusted values”) of the corresponding nodes. However, in this embodiment, if the adjustment value becomes less than 1 as a result of scaling, the adjustment value is updated to 1.
  • the evaluation values of a plurality of nodes are calculated so that the evaluation value of any node is less than a predetermined value.
  • the predetermined value is, for example, the sum of the evaluation values of the nodes other than the arbitrary node within the plurality of nodes. This means that even if some of the nodes (for example, node A) that make up the cluster 3 fail (disappear), the cluster can be reconfigured with a group (cluster) consisting of the surviving remaining nodes. (for example, to obtain a majority evaluation value).
  • the evaluation value of any node is set to be less than a predetermined value (the sum of the evaluation values of other nodes). to be adjusted.
  • the adjustment value of the node described above is used as the evaluation value of the node.
  • the evaluation value of the node associated with this maximum adjustment value is set to a value smaller than the maximum adjustment value.
  • an adjustment value that is significantly larger than other adjustment values is an adjustment value that is equal to or greater than the sum of other adjustment values. It may be an adjustment value or the like that is equal to or greater than the value of .
  • the evaluation value of the node related to the maximum adjustment value is set to a value smaller than the sum of other adjustment values (for example, a value 1 less than the sum, provided that the sum is 2 or more).
  • the condition for setting the value to be 1 less than the sum is ⁇ when the sum is 2 or more'' because if the sum is 1 and the value is 1 less than the sum, then the evaluation of the node related to the maximum adjustment value This is to avoid the value becoming 0.
  • an example is shown in which the evaluation value of the node related to the maximum adjustment value is set to a value smaller than the sum of the other adjustment values by 1.
  • the evaluation value of the node may be set to a value smaller by 2 or 3 than the sum of other adjustment values.
  • the evaluation values of the nodes other than the node related to the maximum adjustment value are the adjustment values calculated in the same manner as described above. Further, as described above, in the present embodiment, when the number of constituent nodes of the primary cluster is 3 or more, the adjustment described above is performed. number).
  • the number of transactions (total value) for each of the nodes A, B, C, and D acquired by the usage information acquisition unit 22 during a certain period is "400", "300", “100", and “200”.
  • the maximum evaluation value that can be set is "255”
  • the evaluation value calculation unit 24 sets the maximum number of transactions "400” to match the maximum evaluation value "255”. Scale the number of transactions on your node.
  • the adjustment values of nodes A, B, C, and D are calculated as "255,” “191,” “63,” and “127,” respectively (see FIG. 3). Since these adjustment values do not have extremely large adjustment values as described above, the adjustment values of each of these nodes are determined as the evaluation values of the corresponding nodes.
  • the evaluation values of nodes A, B, C, and D are determined to be "255,” “191,” “63,” and “127,” respectively.
  • the node evaluation value calculation unit 24 calculates the evaluation value of each node and the sum of the evaluation values of the nodes that make up the primary cluster, the calculated evaluation value of the own node and the sum of the evaluation values is used to store the " Update the information of "evaluation value” and "total evaluation value” respectively.
  • an example of calculating the evaluation value of each node based on the usage information of the plurality of nodes (all nodes) that make up the cluster 3, which is acquired by the usage information acquisition unit 22, will be shown.
  • the evaluation value of each node may be calculated (determined) based only on the usage information of the corresponding node. For example, this is the case where the value of the use information itself is simply used as the evaluation value, or the case where the value obtained by multiplying or adding the value of the use information by a predetermined coefficient is used as the evaluation value.
  • the usage information acquired by the usage information acquiring unit 22 may be used as it is for the process of determining the groups for reconstructing the cluster 3 .
  • the evaluation value of each node is calculated every predetermined period, that is, each time the usage information of each node (total number of transactions in a certain period) is acquired by the usage information acquisition unit 22.
  • An example will be given, but it is sufficient to calculate only the evaluation value used when determining the group for reconstructing the cluster 3 . Therefore, for example, an evaluation value may not be calculated during normal times, and an evaluation value may be calculated based on the last-acquired usage information during normal times when a failure occurs.
  • the evaluation value is calculated such that the node with the greater number of transactions, that is, the node that is used (higher access frequency), the higher the evaluation value.
  • the calculation method is not limited to this example, and may be calculated so that the more used the node, the lower the evaluation value. However, in this case, the group with the lowest evaluation value is determined as the group for reconstructing the cluster 3 .
  • the evaluation value is calculated by scaling as described above, but the evaluation value may be calculated by any method as long as it corresponds to the usage status (usage information) of the node.
  • the state detection unit 25 detects whether the node currently belongs to a primary cluster (group functioning as cluster 3) or a non-primary cluster (group not functioning as cluster 3). For example, the state detection unit 25 detects the current state of its own group by referring to the above-described management information (the “state” column of the management information table). Also, the state detection unit 25 detects that the self-group undergoes a state transition between the primary cluster and the non-primary cluster. For example, the state detection unit 25 detects state transition when the state of the own group is changed by the setting unit 28 . However, these detection methods are only examples, and other methods may be used to detect the state (state transition) of the own group.
  • the determination unit 26 corresponds to the usage information of the constituent nodes (a plurality of nodes) of the cluster 3 acquired before the cluster 3 was divided (normal time). , by using the evaluation values of the plurality of nodes, it is determined whether the self-group is to be the group (new primary cluster) for which the cluster 3 is to be reconfigured. In the present embodiment, determination is made using an evaluation value corresponding to the last usage information acquired during normal times. That is, in the present embodiment, determination processing is performed based on the last updated (calculated) evaluation value during normal times. However, as described above, an evaluation value based on the usage information last acquired during normal times and the usage information acquired before that may be used. In this embodiment, the cluster 3 is divided into a plurality of groups due to a failure. The case where the cluster 3 is divided due to a stop or the like is also covered.
  • quorum system which is a set of subsets of nodes such that any two elements (quorum) have a common part
  • a majority quorum majority vote
  • the sum of the evaluation values of the nodes that make up the self-group after cluster 3 is split is the sum of the evaluation values of the nodes that made up cluster 3 (primary cluster) before cluster 3 was split (the cluster was split).
  • the self-group is determined as the group to reconfigure the cluster 3 .
  • a specific example of determining a group for reconstructing the cluster 3 using weighted majority voting when a failure occurs will be described below.
  • the management information table at the time of occurrence of a failure is assumed to be the management information table shown in FIG. However, the "cluster node" of each node in the management information table is updated to the information at that time when a failure is detected.
  • ⁇ Specific example 1 Failure between bases>
  • a failure occurs in the network path connecting the base 1 and the base 2 in a normal state, and the network communication between the base 1 and the base 2 becomes impossible.
  • cluster 3 is divided into a group consisting of nodes A and B (group 1) and a group consisting of nodes C and D (group 2).
  • the determining unit 26 of node A refers to the management information table (FIG. 3), and evaluates the nodes belonging to its own group (group 1) after the failure (the last calculated value during normal times). evaluation value) and half of the sum total of the evaluation values (the last calculated evaluation values during normal times) of the nodes that constituted cluster 3 (primary cluster) immediately before the failure occurred (normal times).
  • group 1 nodes A and B
  • the evaluation of the nodes (nodes A, B, C, and D) that constituted cluster 3 during normal times Compare the sum of values "636" with half "318".
  • the determining unit 26 of node A selects its own group (group 1) and cluster 3 again. Decide which group to configure. Similarly, the determining unit 26 of the node B determines its own group as the group for reconfiguring the cluster 3 .
  • the determining unit 26 of node C refers to the management information table (FIG. 3), and sums the evaluation values of the nodes belonging to its own group (group 2) after the occurrence of the failure, and A half of the sum total of the evaluation values of the nodes forming the cluster 3 is compared.
  • the evaluation of the nodes that constituted cluster 3 during normal times Compare the sum of values "636" with half "318".
  • the determination unit 26 of node C determines its own group (group 2) and cluster 3 as Decide on a group that will not be reconfigured. Similarly, the determination unit 26 of node D determines its own group as a group that does not reconfigure cluster 3 .
  • ⁇ Specific example 2 failure of node A>
  • a failure occurs in the OS or the like of node A from a normal state, and node A disappears from the network.
  • cluster 3 is divided into a group consisting of node A (group 3) and a group consisting of nodes B, C, and D (group 4).
  • Group 3 is a group of nodes that have stopped operating
  • group 4 is a group of nodes that continue to operate. In this way, among a plurality of divided groups, there may be a group of nodes whose operation has stopped.
  • the node A suspends its activity due to, for example, an OS failure, so the determination process by the determination unit 26 is not executed in the node A.
  • FIG. Therefore, group 3 is not determined as a group for reconfiguring cluster 3 .
  • the determining unit 26 of the node B refers to the management information table (FIG. 3), and sums the evaluation values of the nodes belonging to its own group (group 4) after the failure, and A half of the sum total of the evaluation values of the nodes forming the cluster 3 is compared.
  • the nodes (nodes A, B, C, and D) that constituted cluster 3 during normal times is compared with half "318" of the total evaluation value "636".
  • the determining unit 26 of node B selects its own group (group 4) and cluster 3 again. Decide which group to configure. Similarly, the determination unit 26 of each of the nodes C and D determines its own group as the group for reconfiguring the cluster 3 .
  • the cluster 3 is divided into two groups is illustrated in the specific example 1 and the specific example 2, it is not limited to this example, and even when the cluster 3 is divided into three or more groups, It is possible to perform the determination process described above.
  • a majority quorum majority voting
  • other quorum systems such as a Grid quorum and a finite projective plane quorum may be used besides the majority quorum.
  • the nodes are arranged in a square on the premise that the number of nodes is a square number, and a group containing all the nodes in a certain row and one node from each row below it is the new primary cluster.
  • the nodes are arranged on the finite projective plane under the premise that the number of nodes is q 2 +q+1 (q is a prime number), and a group containing q+1 nodes on the same line becomes the new primary cluster. It is determined.
  • all nodes have the same weight, but by arranging a plurality of nodes with a large evaluation value (weight) according to the evaluation value, the importance of a specific node can be increased. is possible.
  • FIG. 4 is a diagram showing an example of a Grid quorum system according to this embodiment.
  • FIG. 4 shows a Grid quorum system with 25 nodes. For example, when the evaluation values (weights) of nodes A, B, and C are four times, three times, and two times that of other nodes, as shown in FIG. There are four nodes A (four times), three nodes B (three times), and two nodes C (two times). Thereby, the importance of nodes A, B, and C can be increased.
  • FIG. 5 is a diagram showing an example of a finite projective planar quorum according to this embodiment.
  • FIG. 5 shows a finite projective planar quorum system with seven nodes. For example, when the evaluation value (weight) of node A is three times that of other nodes, three (three times) nodes A are arranged on the finite projection plane as shown in FIG. Thereby, the importance of node A can be increased.
  • the failure detection unit 27 detects the occurrence of a failure in the cluster system 9 and the recovery from the failure by periodically performing communication with other nodes to confirm survival. Failures include, for example, node failures due to OS or hardware troubles or failures, network failures due to network switch or NIC troubles or failures, or the like. For example, the failure detection unit 27 determines (detects) that a failure has occurred in the other node when the communication for confirming survival with another node times out, and the communication for confirming survival is performed normally. Recovery from a failure is detected by detecting that the Note that various methods may be used to detect failure occurrence and failure recovery.
  • failure detection unit 27 updates the "cluster node" information in the management information table when there is a change in the nodes belonging to the own group when a failure occurs or is recovered from the failure.
  • the setting unit 28 sets (changes) the status of the self-group to the primary cluster (starts accepting Read requests and Write requests to the database). By setting (controlling) so as to allow the service providing unit 29 to start (continue) the database service.
  • the setting unit 28 sets (changes) the status of the self-group to non-primary cluster (sets not to accept Read requests and Write requests to the database). (controlling) causes the service providing unit 29 to suspend the activity of the node, such as suspending the provision of database services.
  • the setting unit 28 sets the state of the own group to the primary cluster when the synchronization with the database of the node of the primary cluster is completed after recovery from the failure.
  • the setting unit 28 updates the "state" information in the management information table when the state of its own group changes (changes) between the primary cluster and the non-primary cluster.
  • the present invention is not limited to this example, and the “status” information in the management information may be updated by the determination unit 26 when the determination unit 26 determines whether or not it is the primary cluster.
  • the service providing unit 29 provides database services of its own node when its own group is the primary cluster.
  • the service providing unit 29 provides database services of its own node, such as accepting and executing processing requests (queries) such as reading and writing operations for the database transmitted from the user terminal 8 .
  • the reconnection unit 30 reestablishes connections with nodes included in the primary cluster when the own group is a non-primary cluster. For example, the reconnection unit 30 starts establishing a connection between its own node and a node included in the primary cluster by issuing a connection request to a node included in the primary cluster.
  • the update information transmitting/receiving unit 31 transmits information (update information) indicating the update state of the database of its own node to other nodes. For example, the update information transmitting/receiving unit 31 transmits (notifies) the sequence number of the latest transaction (transaction related to write processing (transaction stored in the write cache)) of the database of its own node as update information to other nodes. . Also, the update information transmitting/receiving unit 31 receives update information of other nodes from the other nodes. In this embodiment, when a node belonging to a non-primary cluster recovers from a failure (when it is in a state where it can rejoin the cluster), it transmits update information of its own node to a predetermined node belonging to the primary cluster. In other words, the update information transmitting/receiving unit 31 requests the transaction difference between the own node and the node belonging to the primary cluster regarding the write process to the database.
  • the update data identification unit 32 identifies the difference (data that needs to be updated) between the database of its own node and the database of the other node based on the update information of the other node received from the other node. For example, in the present embodiment, a predetermined node belonging to the primary cluster that has received the sequence number of the node belonging to the non-primary cluster compares the sequence numbers of both nodes to compare the sequence numbers of the node belonging to the non-primary cluster with the database of the node. Identify the difference from the database of the node (determine the presence or absence of the difference).
  • the update data identifying unit 32 of the predetermined node belonging to the primary cluster determines the data (updated data) that needs to be updated in the other node. data (difference data)).
  • the update data transmission/reception unit 33 transmits and receives update data (difference data) used for synchronization between nodes.
  • update data transmission/reception unit 33 of a node belonging to a primary cluster transmits data (update data) that needs to be updated in a node belonging to a non-primary cluster to the node, and the update data is sent to the non-primary cluster. It is received by the update data transmitter/receiver 33 of the node to which it belongs.
  • the update data is differential data, but may be full data.
  • the synchronization unit 34 synchronizes the database of its own node with the databases of other nodes.
  • the synchronization unit 34 of the node belonging to the non-primary cluster uses the update data received by the update data transmission/reception unit 33 of the node to synchronize the database of its own node with the database of the node of the primary cluster.
  • the cluster 3 is a multi-master configuration cluster in which a plurality of master nodes, which are databases that can be updated (written) as well as referenced, exist (all the constituent nodes of the cluster function as master nodes). Therefore, database synchronization is appropriately performed between the nodes belonging to the primary cluster. Therefore, when the own group is the primary cluster, the synchronization unit 34 synchronizes the database with other nodes belonging to the primary cluster as needed.
  • a node belonging to a non-primary cluster re-establishes a connection with a node included in the primary cluster, synchronizes the database with the primary cluster, and then is set as the primary cluster is referred to as a process of rejoining the cluster.
  • FIG. 6 is a diagram showing an example of a management information table (immediately after occurrence of a fault between bases) according to this embodiment.
  • FIG. 6 exemplifies the case where a failure occurs in the specific example 1 described above.
  • each node determines whether its own group is to be used to reconfigure the cluster 3, and the setting is performed.
  • 4 shows the management information table after the As shown in FIGS. 3 and 6, immediately after the occurrence of a failure (FIG. 6), the number of transactions (Tx count) last obtained in normal times (FIG. 3) and the evaluation calculated and set based on the number of transactions The value is held in the management information table.
  • the cluster 3 is divided into Group 1 consisting of nodes A and B and Group 2 consisting of nodes C and D. Therefore, as shown in FIG. 6, in nodes A and B, nodes C and D are removed from their own groups, and "cluster nodes” are updated to "A, B". , nodes A and B have been removed and "Cluster Nodes” has been updated to "C, D”. Further, in specific example 1, since group 1 is determined as the group for reconfiguring cluster 3, as shown in FIG. At nodes C and D, the "status" has been updated to "NON-PRIMARY".
  • Group 1 is determined to be the group for reconfiguring Cluster 3
  • the sum of the evaluation values of the constituent nodes of the primary cluster is calculated by the evaluation value calculation unit 24 in the nodes A and B belonging to the new primary cluster.
  • the information of the "total evaluation value” is updated with the calculated sum "446". Since nodes C and D belong to a non-primary cluster, the information of "evaluation value total” includes the evaluation of the constituent nodes of the primary cluster when the own node last belonged to the primary cluster before the failure occurred.
  • the value sum "636" is retained.
  • group 1 determined as the group for reconfiguring cluster 3 includes node A, which had the maximum number of transactions in cluster 3 (primary cluster) during normal times. Therefore, each of the number of transactions of nodes A and B acquired by the usage information acquisition processing performed in the new primary cluster after the occurrence of the failure is equal to the number of transactions of nodes A and B acquired immediately before the occurrence of the failure, which is "400". If the evaluation values are the same as "300", the evaluation values of the nodes A and B immediately before and after the failure are "255" and "191", respectively.
  • FIG. 7 is a diagram showing an example of a management information table (immediately after a node failure) according to this embodiment.
  • FIG. 7 exemplifies the case where a failure occurs in the above-described specific example 2.
  • each node determines whether its own group is to be used to reconfigure the cluster 3, and the setting is performed.
  • 4 shows the management information table after the As shown in FIGS. 3 and 7, immediately after the occurrence of a failure (FIG. 7), the number of transactions (Tx count) last obtained in normal times (FIG. 3) and the evaluation calculated and set based on the number of transactions The value is held in the management information table.
  • cluster 3 is divided into group 3 consisting of node A and group 4 consisting of nodes B, C, and D. Therefore, as shown in FIG. 7, in nodes B, C, and D, node A is removed from the own group, and "cluster node” is updated to "B, C, D". Further, in specific example 2, since group 4 is determined as the group for reconfiguring cluster 3, as shown in FIG. It is Furthermore, since group 4 is determined to be the group for reconfiguring cluster 3, nodes B, C, and D belonging to the new primary cluster calculate the sum of the evaluation values of the constituent nodes of the primary cluster by the evaluation value calculation unit 24. is calculated, and the information of the "total evaluation value" is updated with the calculated total "381". Note that the management information table has not been updated in node A because node A temporarily suspends its activity due to the occurrence of a failure.
  • FIG. 8 is a diagram showing an example of the management information table (after updating the evaluation value) according to this embodiment.
  • FIG. 8 shows the management information table when the evaluation value is updated in normal processing that is executed every predetermined period of time after the failure of the above-described specific example 2 occurs. Even after a failure occurs, the nodes B, C, and D belonging to the primary cluster continue to perform usage information acquisition processing and evaluation value calculation (update) processing as normal processing. If the numbers of transactions of nodes B, C, and D obtained after the failure occurred are the same as the number of transactions of nodes B, C, and D immediately before the failure, "300", "100", and "200", node B number of transactions is the maximum value.
  • the evaluation value calculation unit 24 adjusts (scaling) the number of transactions of nodes B, C, and D so that the number of transactions of node B matches the maximum evaluation value (for example, 255) that can be set. ) is done.
  • the adjustment values of nodes B, C and D are "255", “85” and “170” respectively, but the adjustment value of node B is equal to the sum of the adjustment values of nodes C and D. . Therefore, the evaluation value of node B is determined to be "254", which is a value smaller by 1 than the sum, and the evaluation values of nodes C and D are determined to be "85” and "170", respectively.
  • the "evaluation value” information in the table is updated. In each node, the evaluation value calculation unit 24 calculates the total evaluation value of the constituent nodes of the primary cluster. Updated.
  • FIG. 9 is a flowchart showing an overview of the flow of evaluation value update processing (ordinary flow) according to this embodiment.
  • the processing shown in this flowchart is processing executed in each node 1.
  • the processing is started when the own node joins the cluster 3, and is repeatedly executed each time a predetermined period elapses.
  • all nodes (nodes A, B, C, and D) configuring the cluster 3 can communicate with each other. Therefore, in normal times, "A, B, C, D" and "PRIMARY" are respectively stored in the "cluster node” and "status" columns of each node in the management information table.
  • step S101 it is determined whether the current node belongs to the primary cluster.
  • the state detection unit 25 determines whether the node currently belongs to the primary cluster by referring to the management information table or the like. If the own node belongs to the primary cluster (YES in step S101), the process proceeds to step S102. On the other hand, if the own node does not belong to the primary cluster (NO in step S101), the process shown in this flowchart ends.
  • step S102 usage information of each node is acquired.
  • the usage information acquisition unit 22 acquires usage information of each of the constituent nodes of the cluster 3 (other nodes that can communicate with the self node and the self node).
  • each node acquires the number of transactions (total value) for a certain period of time for all nodes (nodes A, B, C, and D).
  • the usage information acquisition unit 22 acquires the number of transactions of its own node (node A is "400", node B is "300”, node C is "100”, node D is "200”), and the management information Update the "Tx Count" information in the table (see Figure 3). After that, the process proceeds to step S103.
  • step S103 the usage information of each node is adjusted.
  • the evaluation value calculation unit 24 calculates the adjusted number of transactions (adjustment value) for each node by scaling the number of transactions for each node acquired in step S102. After that, the process proceeds to step S104.
  • step S104 it is determined whether there is an adjustment value that is significantly larger than other adjustment values.
  • the evaluation value calculation unit 24 determines whether the adjustment value of each node calculated in step S103 includes an adjustment value (maximum adjustment value) that is extremely large compared to other adjustment values. If there is a maximum adjustment value (YES in step S104), the process proceeds to step S105. On the other hand, if the maximum adjustment value does not exist (NO in step S104), the process proceeds to step S106. Note that in this embodiment, the processing of step S105 is performed only when the number of nodes constituting the primary cluster is 3 (predetermined number) or more, so the number of nodes constituting the primary cluster is not 3 (predetermined number) or more. , the process proceeds to step S106 even if there is a maximum adjustment value.
  • step S105 the adjustment value of the corresponding node is updated with a value smaller than the sum S of the adjustment values of the other nodes.
  • the evaluation value calculation unit 24 updates the adjustment value of the node related to the adjustment value determined to be the maximum adjustment value in step S104 to a value smaller than the sum S of the adjustment values of the other nodes (for example, a value smaller than S by 1). . After that, the process proceeds to step S106.
  • step S106 the adjustment value of each node is determined (updated) as an evaluation value.
  • the evaluation value calculation unit 24 determines the evaluation value of the node associated with the adjustment value determined not to be the maximum adjustment value in step S104 as the adjustment value calculated in step S103. Also, the evaluation value calculation unit 24 determines the evaluation value of the node associated with the adjustment value determined to be the maximum adjustment value in step S104 as the adjustment value updated in step S105. However, if the number of constituent nodes of the primary cluster is not 3 or more, the evaluation value of the node related to the adjustment value, which is the maximum adjustment value, is determined as the adjustment value calculated in step S103.
  • the evaluation value calculation unit 24 calculates the total sum of the evaluation values of the nodes forming the primary cluster using the determined adjustment values of each node. Then, the evaluation value calculation unit 24 determines the evaluation value of the own node (node A is "255", node B is "191", node C is "63”, node D is "127") and the primary cluster's The “evaluation value” and “total evaluation value” information in the management information table are updated with the total evaluation value "636" of the constituent nodes (see FIG. 3). After that, the processing shown in this flowchart ends.
  • step S101 if the self-node does not belong to the primary cluster in step S101, the process described later is not executed, so that the node that does not belong to the primary cluster is mistakenly set as the primary cluster. It is possible to avoid the situation.
  • the method of avoiding such a situation is not limited to the examples described above. For example, even if the self-node does not belong to the primary cluster, while acquiring the usage information of the nodes that can communicate with the self-node, even if it prohibits determining and updating the evaluation value based on the acquired usage information good.
  • the usage information of the nodes that can communicate with the self-node is acquired, and the evaluation value is determined and updated based on the acquired usage information, while the group determination shown in FIG. Processing may be prohibited.
  • FIG. 10 is a flowchart showing an overview of the flow of group determination processing (failure occurrence flow) according to this embodiment.
  • the processing shown in this flowchart is processing executed in each node 1, and is executed when the fault detection unit 27 detects that a fault has occurred in the cluster system 9 or the like. It should be noted that this is not limited to the occurrence of a failure, and as described above, it may also be triggered by receiving a maintenance notice or the like.
  • step S201 nodes that cannot communicate with the own node are removed from the own group.
  • the failure detection unit 27 removes a node that has lost communication with its own node from its own group.
  • nodes A and B constitute the self-group of nodes A and B
  • nodes C and D constitute the self-group of nodes C and D, respectively. updates the "cluster node" information in the management information table (see FIG. 6). After that, the process proceeds to step S202.
  • step S202 the sum of the evaluation values of the own group is calculated.
  • the determination unit 26 obtains the updated evaluation values of the self-group constituent nodes (the last calculated (updated) values before the failure occurred). calculated evaluation value).
  • the total sum of "446" is calculated for nodes A and B, and the total sum of "190" is calculated for nodes C and D, respectively. After that, the process proceeds to step S203.
  • step S203 it is determined whether the sum of the evaluation values of the own group exceeds half of the sum of the evaluation values of the original primary cluster.
  • the determination unit 26 determines that the sum of the evaluation values of the own group calculated in step S202 is "636", the sum of the evaluation values of the constituent nodes (nodes A, B, C, and D) of the original primary cluster (cluster 3 during normal times). ” exceeds half “318”. If it exceeds half of the sum (YES in step S203), the process proceeds to step S204. On the other hand, if it does not exceed half of the sum (NO in step S203), the process proceeds to step S205. It should be noted that in step S203, it may also be determined whether the node currently belongs to the primary cluster. In this case, in step S203, it is determined whether both conditions (being the primary cluster and exceeding half of the sum total) are satisfied.
  • step S204 the own group is determined as the group for which clusters are to be reconfigured.
  • the determination unit 26 of each of nodes A and B determines its own group as a group for reconfiguring cluster 3 . After that, the process proceeds to step S206.
  • step S205 the own group is determined as a group that does not reconfigure clusters.
  • the determination unit 26 of each of the nodes C and D determines its own group as a group that does not reconfigure the cluster 3 . After that, the process proceeds to step S207.
  • step S206 the own group is set as the primary cluster.
  • the setting units 28 of the nodes A and B set their own groups as primary clusters, and cause the service providing units 29 to start (continue) the database service.
  • the evaluation value calculator 24 of each of the nodes A and B calculates the sum of the evaluation values of the constituent nodes of the new primary cluster.
  • the setting unit 28 updates the "state" information in the management information table, and the evaluation value calculation unit 24 updates the "evaluation value total" information (see FIG. 6). After that, the processing shown in this flowchart ends.
  • step S207 the own group is set as a non-primary cluster.
  • the setting units 28 of the nodes C and D set their own groups as non-primary clusters, and cause the service providing units 29 to stop providing database services.
  • the setting unit 28 updates the "state" information in the management information table in each of the nodes C and D (see FIG. 6). After that, the processing shown in this flowchart ends.
  • step S101 of the normal flow in FIG. 9 if it is determined in step S101 of the normal flow in FIG. 9 that the node belongs to the non-primary cluster, the processing subsequent to step S101 is not executed. Therefore, in the groups (nodes C and D) determined to be groups that do not reconfigure cluster 3 in step S205 of FIG.
  • the value calculation process (steps S102 to S106 in FIG. 9) is not executed. If these processes are executed in nodes C and D in spite of belonging to a non-primary cluster, the evaluation value of at least one of nodes C and D in step S103 becomes the maximum evaluation value that can be set. is set to Therefore, in step S203, there is a possibility that the sum 636 of the original primary cluster (the primary cluster to which the own node last belonged) exceeds half.
  • step S101 it is determined whether or not the own node belongs to the non-primary cluster.
  • FIG. 11 is a flowchart showing an overview of the flow of synchronization processing (failure recovery flow) according to this embodiment.
  • the processing shown in this flowchart is executed in each node 1, and is executed when the failure detection unit 27 detects that the failure in the cluster system 9 has been recovered. It should be noted that the process shown in this flowchart may be executed when the local node becomes able to participate in the cluster again, so the trigger for the process is not limited to detection of failure recovery.
  • step S301 it is determined whether the own group is a group determined as a group that does not reconfigure cluster 3, that is, whether the current own group is a non-primary cluster.
  • group 2 consisting of nodes C and D is determined as a group that does not reconfigure cluster 3
  • the state of the own group (group 2) in each of nodes C and D is a non-primary cluster.
  • the state detection unit 25 determines whether the current self-group is a non-primary cluster by referring to the management information table or the like. If the own group is a non-primary cluster (YES in step S301), the process proceeds to step S302, and the process of joining the cluster (primary cluster) again is executed. On the other hand, if the own group is not a non-primary cluster (NO in step S301), the processing shown in this flowchart ends.
  • step S302 the database of its own node is synchronized with the database of the primary cluster.
  • the synchronization unit 34 restores the database of the own node to a predetermined number belonging to the primary cluster. Synchronize with the database of the node (node A or node B). Specifically, the update information transmitting/receiving unit 31 transmits the latest sequence number of its own node to a predetermined node belonging to the primary cluster, and the update data identifying unit 32 of the predetermined node identifies the update data.
  • the synchronization unit 34 performs synchronization by using update data transmitted and received between the update data transmission/reception unit 33 of the predetermined node and the update data transmission/reception unit 33 of the own node. After that, the process proceeds to step S303.
  • step S303 the own group is set as the primary cluster.
  • the setting unit 28 sets its own group as the primary cluster, and causes the service providing unit 29 to start the database service.
  • each of the nodes C and D provides the database service as a node that performs the database service provided in the cluster 3 (functions as the cluster 3).
  • the own group is reconfigured into a cluster.
  • the number of nodes in any group is 2, so that the number of nodes does not exceed half of the original total number of nodes (4). Therefore, it is necessary to install an arbitration node or the like.
  • the cluster system according to the present embodiment, as described above, it is possible to determine the group to reconfigure the cluster in consideration of not only the number of available nodes but also the usage conditions such as access frequency. Therefore, even in the situation described above, it is possible to determine an appropriate group as the group for reconfiguring the cluster and continue the operation without installing an arbitration node. Furthermore, the series of processes for determining groups to reconfigure clusters can be automatically performed, eliminating the need for system administrators to intervene and designing complex system construction and operation methods. It is possible to provide an autonomous control device that is not required.
  • access statistical information to each node that constitutes the cluster is collected during normal times and shared among the nodes. , it is possible to determine (judgment) whether or not its own group is to be a group for which clusters are to be reconfigured. For example, after a failure occurs, it is possible to decide whether or not to reconfigure the cluster without sending and receiving information between nodes to decide which group to give priority to. is.
  • FIG. 12 is a schematic diagram showing the configuration of a cluster system comprising clusters with a multi-master configuration according to this embodiment.
  • a cluster system 9 according to this embodiment, a plurality of nodes 1 constituting a multi-master cluster 3 are connected to each other via a network so as to be able to communicate with each other.
  • nodes A and B are arranged at base 1 and node C is arranged at base 2 .
  • the configuration of the cluster system 9 (nodes 1, user terminals 8) according to this embodiment is the same as the configuration of the cluster system 9 according to the first embodiment described above, except that the number of nodes at the site 2 is different. Therefore, detailed description is omitted.
  • FIG. 13 is a diagram showing an outline of the functional configuration of a node according to this embodiment.
  • a program recorded in the storage device 14 is read out to the RAM 13 and executed by the CPU 11 to control each hardware provided in the node 1, so that the management information storage unit 21, state detection unit 25, determination unit 26, failure detection unit 27, setting unit 28, service provision unit 29, reconnection unit 30, update information transmission/reception unit 31, update data identification unit 32, update data transmission/reception unit 33, synchronization unit 34, It functions as a device including a backup unit 40 , a backup control unit 41 and a restore unit 42 .
  • the management information storage unit 21 stores management information regarding the self-node and the cluster to which the self-node belongs.
  • management information at least information indicating whether the own group belongs to a primary cluster or a non-primary cluster (status of the own group) is stored. Therefore, the management information table shown in the first embodiment does not necessarily have to be provided.
  • the management information storage unit 21 may store the status (enabled or disabled) of the database backup function of the own node as management information.
  • the state detection unit 25 detects the current state of its own node by referring to the management information (state of its own group) stored in the management information storage unit 21 .
  • the decision unit 26 decides whether or not at least its own group is to be the group for reconfiguring the cluster 3 . It should be noted that the method shown in the first embodiment or any other method may be used as the method of determining groups for reconfiguring the cluster 3 . In addition, in the present embodiment, each node is provided with the determination unit 26. However, only one node is provided with the determination unit 26, so that each group is determined whether or not to be a group for reconstructing the cluster 3. You may make it Further, the device that determines the group for reconfiguring the cluster 3 is not limited to the nodes that configure the cluster 3, and may be other information processing devices installed inside or outside the cluster system.
  • the details of the failure detection unit 27 are the same as those described in the first embodiment, so the description is omitted.
  • the backup unit 40 repeatedly backs up the database of its own node.
  • the backup unit 40 performs backup periodically (every predetermined period, for example, once a day). Further, in this embodiment, the backup unit 40 performs full backup, but may perform differential backup or incremental backup.
  • the backup unit 40 acquires backup data by performing backup, and stores the acquired backup data in the storage device 14 or another storage device. Note that the backup process may be executed irregularly instead of periodically.
  • FIG. 14 is a diagram showing an example of the database state (normal time) according to this embodiment. As shown in FIG. 14, during normal times, all nodes (nodes A, B, and C) belonging to the primary cluster hold (share) the same table. In addition, the backup unit 40 of each node performs backup every predetermined period, and acquires backup data of the database each time as shown in FIG. 14 .
  • the backup control unit 41 performs control to validate or invalidate the backup processing for the database of the own node performed by the backup unit 40 .
  • the backup control unit 41 disables the backup processing of the database of the own node, for example, when the state of the own group changes from the primary cluster to the non-primary cluster due to the occurrence of a failure. That is, the backup control unit 41 controls so that the backup processing by the backup unit 40 is not performed. Further, the backup control unit 41 activates backup processing of the database of the own node, for example, when the failure is recovered and the synchronization by the synchronization unit 34 of the own node is completed. In other words, the backup control unit 41 controls the backup unit 40 to start backup.
  • the details of the setting unit 28 are the same as those described in the first embodiment. However, this embodiment differs from the first embodiment in processing when the own group is a group that does not reconfigure the cluster 3 . Specifically, when the self-group is determined as a group that does not reconfigure the cluster 3, the setting unit 28 updates the state of the self-group included in the management information to "non-primary cluster". , start (continue) the service of the database of the own node. In other words, even if the self-group is not determined to be the group that reconfigures the cluster 3, the setting unit 28 sends a Read request and/or a Write request to the database so that the database service of the self-node can be provided. set so that the acceptance of is not rejected. Note that this setting may be performed in advance.
  • the self-node Provides database services.
  • the service providing unit 29 can provide the database service of its own node in a cluster (own group) different from the cluster 3 when its own group is not determined to be a group constituting the cluster 3. .
  • each node of a group determined to not reconfigure cluster 3 may provide services while synchronizing with other nodes belonging to its own group (own cluster). ), and the service may be provided independently without synchronizing with other nodes in its own group.
  • the service provided when the self-node belongs to a non-primary cluster is a service for write requests and/or read requests for the self-node's database. Also, when a write request is permitted when belonging to a non-primary cluster, only a partial write operation (for example, a write operation of user ID information or an access token) may be permitted.
  • FIG. 15 is a diagram showing an example of the database state (after failure) according to this embodiment.
  • FIG. 15 illustrates a case where a failure occurs in the network path connecting the sites 1 and 2, and network communication between the sites 1 and 2 becomes impossible.
  • cluster 3 is divided into a group consisting of nodes A and B (group 5) and a group consisting of node C (group 6).
  • the determining unit 26 determines group 5 as the group for reconstructing cluster 3 .
  • cluster 3 is divided into group 5 and group 6, database services are provided in each group.
  • separate update processing write processing
  • the restore unit 42 restores the database of its own node using the backup data. Specifically, when the self node belongs to a non-primary cluster, the restore unit 42 restores the failure (when it is possible to rejoin the cluster), and before the backup is invalidated.
  • the database of the own node is restored using the backup data obtained by the backup. In this embodiment, the backup data obtained by the last backup performed before the backup is invalidated is used. Obtained backup data or the like may be used.
  • FIG. 16 is a diagram showing an example of the database state (at the time of failure recovery (at the time of restoration)) according to this embodiment.
  • FIG. 16 shows the state of the database after restoration has been performed in node C belonging to the non-primary cluster after recovery from the failure.
  • the last backup data acquired before the backup was invalidated is the backup data shown in FIG.
  • the restore unit 42 of node C restores the database of its own node by using the backup data (FIGS. 14 and 16) obtained last.
  • "Age" of "Bob" in the database of node C is updated from "44" to "45".
  • the details of the reconnection unit 30 are the same as those described in the first embodiment, so the description is omitted.
  • the update information transmitting/receiving unit 31 of the node belonging to the non-primary cluster sends the update information (sequence number of the latest transaction) indicating the update state of the database of the restored node to the primary cluster. Send to a predetermined node to which it belongs.
  • the update information transmitting/receiving unit 31 requests the transaction difference related to the write processing between the restored database of the own node and the database of the node belonging to the primary cluster.
  • FIG. 17 is a diagram showing an example of the database state (at the time of failure recovery (at the time of synchronization)) according to this embodiment.
  • FIG. 17 exemplifies the state of the database when node C synchronizes the restored state with the states of node A and node B (primary cluster).
  • a node C belonging to a non-primary cluster requests a predetermined node (node A or node B) belonging to a primary cluster for difference data between the database of its own node and the database of the predetermined node.
  • the update information transmitting/receiving unit 31 of node C transmits update information (sequence number “41”) of the latest transaction (transaction related to write processing) of the database of its own node to the predetermined node. to request differential data.
  • the details of the update data specifying unit 32 are the same as those described in the first embodiment.
  • the difference between node C and the predetermined node, that is, the missing data in node C is identified.
  • the update data identification unit 32 of node A compares the sequence number of the latest transaction notified from node C with the sequence number of the latest transaction of node A, thereby Identify database deltas.
  • update data transmission/reception unit 33 The details of the update data transmission/reception unit 33 are the same as those described in the first embodiment.
  • the update data transmission/reception unit 33 of node A or node B transmits difference data (update data) to node C, and the update data transmission/reception unit 33 of node C receives the difference data.
  • the synchronizing unit 34 of node C synchronizes the database of its own node with the databases of the nodes belonging to the primary cluster, using the difference data received by the update data transmitting/receiving unit 33 of its own node. Specifically, the synchronization unit 34 of node C applies the received transaction corresponding to the sequence number "42" to the database of its own node. As a result, as shown in FIG. 17, the "Age" of "Bob" in the database is updated from "45" to "46".
  • the database of the self node is synchronized using the differential data after the restoration is performed, only the differential data related to the data changes made in the primary cluster after the cluster 3 was split is received, it is possible to ensure consistency of the data of the entire cluster 3 . Therefore, the amount of data received from other nodes for synchronization by the nodes belonging to the non-primary cluster is less than the full data, so it is possible to quickly synchronize with the database of the primary cluster node. Become.
  • the synchronization method is not limited to the above example. For example, if there is a significant change (update) in the primary cluster after a failure occurs, the full data of the database of the node belonging to the primary cluster will be It may be received as update data, and synchronization may be performed using the update data.
  • FIG. 18 is a flowchart showing an overview of the flow of backup processing (normal flow) according to this embodiment.
  • the processing shown in this flowchart is processing that is executed in each node 1. For example, it is started when the own node participates in the cluster system 9, and is repeatedly executed every time a predetermined period elapses. . In normal times, all nodes (nodes A, B, C, and C) forming the cluster 3 can communicate with each other, and each node provides services as a constituent node of the primary cluster.
  • step S401 it is determined whether backup processing is currently valid in the node itself.
  • the backup control unit 41 determines whether the backup function of its own node is valid or invalid, for example, by referring to the management information. If valid (YES in step S401), the process proceeds to step S402. On the other hand, if it is invalid (NO in step S401), the self-node belongs to a non-primary cluster, so the processing shown in this flowchart ends so that backup is not performed.
  • step S402 backup processing is performed.
  • the backup unit 40 executes backup processing of the database of its own node (see FIG. 14). After that, the processing shown in this flowchart ends.
  • FIG. 19 is a flowchart showing an overview of the flow of backup invalidation processing (failure occurrence flow) according to this embodiment.
  • the processing shown in this flowchart is processing executed in each node 1, and is executed when the fault detection unit 27 detects that a fault has occurred in the cluster system 9 or the like. It should be noted that this is not limited to the occurrence of a failure, and as described above, it may also be triggered by receiving a maintenance notice or the like.
  • step S501 it is determined whether the state of the self-group has changed from the primary cluster to the non-primary cluster.
  • the state detection unit 25 determines whether the state of the self-group has changed by detecting that the self-group has been set as a non-primary cluster by being determined as a group that does not reconfigure the cluster 3 .
  • the state detection unit 25 may detect the state transition of its own group by referring to the management information stored by the management information storage unit 21 . If it is determined that the cluster has transitioned to a non-primary cluster (YES in step S501), the process proceeds to step S502. If it is determined that the cluster has not transitioned to a non-primary cluster (NO in step S502), the processing shown in this flowchart ends.
  • step S502 backup processing is disabled.
  • the backup control unit 41 disables the database backup function of its own node.
  • backup processing is disabled in node C belonging to a non-primary cluster due to a network split.
  • the information indicating the state of the backup function in the management information becomes information indicating "disabled". Note that, in this embodiment, even if the self-node is determined to be a group that does not reconfigure the cluster 3, in order to continue providing services, even after the backup process is invalidated in step S502, the self-node continues to operate. Serving of the node continues. After that, the processing shown in this flowchart ends.
  • FIG. 20 is a flowchart showing an overview of the flow of synchronization processing (failure recovery flow) according to this embodiment.
  • the processing shown in this flowchart is executed in each node 1, and is executed when the failure detection unit 27 detects that the failure in the cluster system 9 has been recovered. It should be noted that the process shown in this flowchart may be executed when the local node becomes able to participate in the cluster again, so the trigger for the process is not limited to detection of failure recovery.
  • step S601 it is determined whether the own group is a group determined as a group that does not reconfigure cluster 3, that is, whether the current own group is a non-primary cluster.
  • the state detection unit 25 determines whether the current self-group is a non-primary cluster by referring to management information or the like. If the own group is a non-primary cluster (YES in step S601), the process proceeds to step S602, and the process of rejoining the cluster (primary cluster) is executed. On the other hand, if the own group is a non-primary cluster (NO in step S601), the processing shown in this flowchart ends.
  • step S602 restoration using the last acquired backup data is performed.
  • the restore unit 42 of node C belonging to the non-primary cluster restores the database of its own node by using the backup data obtained last.
  • the reconnection unit 30 of node C establishes connections between node C and each node of the primary cluster. After that, the process proceeds to step S603.
  • step S603 the database of its own node is synchronized with the database of the primary cluster.
  • the update information transmitting/receiving unit 31 of the node C transmits the latest sequence number of the node C at the time when the restoration is completed to the predetermined node of the primary cluster, and the update data specifying unit 32 of the predetermined node Differential data is identified.
  • the synchronizing unit 34 of the node C uses the difference data transmitted and received between the update data transmitting/receiving unit 33 of the predetermined node and the update data transmitting/receiving unit 33 of the node C to synchronize the database of the node C with that of the primary cluster. Synchronize with database. After that, the process proceeds to step S604.
  • step S604 the own group is set as the primary cluster.
  • the setting unit 28 of node C sets its own group as the primary cluster, and causes the service providing unit 29 to start the database service.
  • the node C provides the database service as a node that serves the database provided in the cluster 3 (functions as the cluster 3). After that, the process proceeds to step S605.
  • step S605 backup processing is enabled.
  • the backup control unit 41 of node C activates the backup function of its own node because the database of its own node is in the same state as the node that belonged to the primary cluster.
  • the information indicating the state of the backup function in the management information becomes information indicating "effective".
  • a node belonging to a non-primary cluster also provides a database service.
  • the contents written to the database will be discarded. Therefore, the node belonging to the non-primary cluster may notify the user terminal 8 that "even if a write operation is performed on the database, the contents will be discarded at the time of failure recovery".
  • the database service is provided even if the self-group is not determined to be the group to reconfigure the cluster, and when the failure is restored, the self-node database is transferred to the primary cluster. Synchronize with the database of nodes belonging to Therefore, it is possible to ensure data consistency in the cluster while providing database services even in nodes that do not belong to the group that reconfigures the cluster. Specifically, on the nodes belonging to the group that does not reconfigure the cluster, backup and restore the database at the appropriate timing to roll back the changes made in the node (non-primary cluster) during failure recovery. After that, by synchronizing necessary data from the primary cluster, it is possible to achieve consistency of data in the entire cluster.
  • the node that is determined to be a group that does not reconfigure the cluster 3 and cannot continue operation is temporarily extended, and then rejoins the cluster (primary cluster) when the failure is restored. It becomes possible to Thus, according to the cluster system according to this embodiment, it is possible to appropriately manage the cluster.
  • the number of nodes at base 1 is 2
  • the number of nodes at base 2 is 1
  • the number of nodes at base 1 is the original number. Since the total number of nodes in the primary cluster (Cluster 3) exceeds half of 3, each node in site 1 continues to operate as a node belonging to the primary cluster, and the node in site 2 continues to operate because it belongs to a non-primary cluster. Not possible. However, if the access to the database is mostly a read operation, it is desirable to be able to continue the operation even for the nodes of the group, such as base 2, which did not acquire a majority.
  • a process of determining whether the own group is to be a group for reconfiguring a cluster is performed, As exemplified in the second embodiment, the database service is provided even when the self-group is not determined to be the group to reconfigure the cluster, and when the failure is recovered, the process of synchronizing with the primary cluster is performed.
  • the database service is provided even when the self-group is not determined to be the group to reconfigure the cluster, and when the failure is recovered, the process of synchronizing with the primary cluster is performed.
  • the configuration of the system according to the present embodiment may be any one of the system configuration described in the first embodiment with reference to FIG. 1 and the system configuration described in the second embodiment with reference to FIG. good too.
  • the details of the system configuration are the same as those described in the first and second embodiments, so description thereof will be omitted.
  • the functional configuration of each node 1 according to this embodiment will be described below.
  • FIG. 21 is a diagram showing an outline of the functional configuration of a node according to this embodiment.
  • the program recorded in the storage device 14 is read out to the RAM 13 and executed by the CPU 11 so that each hardware provided in the node 1 is controlled.
  • the management information storage unit 21 stores management information including the information shown in the first embodiment and the second embodiment.
  • the details of the usage information acquisition unit 22, the usage information transmission unit 23, the evaluation value calculation unit 24, the state detection unit 25, the determination unit 26, the failure detection unit 27, and the reconnection unit 30 are described in the first embodiment. It is the same as a thing.
  • the setting unit 28, the service providing unit 29, the update information transmission/reception unit 31, the update data identification unit 32, the update data transmission/reception unit 33, the synchronization unit 34, the backup unit 40, the backup control unit 41, and the restore unit 42 are the second It is the same as the description in the embodiment.
  • evaluation value update processing and backup processing are performed in each node 1 during normal times.
  • the outline of the flow of the evaluation value update process is the same as the outline of the flow of the evaluation value update process (steps S101 to S106) described in the first embodiment with reference to FIG. omitted.
  • the outline of the backup processing flow is the same as the outline of the backup processing flow (steps S401 to S402) described in the second embodiment with reference to FIG. 18, so description of the processing will be omitted.
  • a process of determining a group for reconfiguring the cluster is first performed, and then a backup invalidation process is performed. done. That is, by the method shown in the first embodiment, it is determined whether the own group is to be the group for reconstructing the cluster 3 . If the self-group is not determined to reconfigure the cluster 3, the database service is provided (continued) by the method shown in the second embodiment, and restoration and synchronization are performed during failure recovery. done.
  • the outline of the flow of processing for determining whether the own group is to be the group for reconfiguring cluster 3 is the flow of the determination processing described in the first embodiment with reference to FIG. ), the description of the processing is omitted. Also, since the overview of the flow of backup invalidation processing is the same as the overview of the flow of backup invalidation processing (steps S501 and S502) described in the second embodiment with reference to FIG. omitted.
  • the group to which the self-node belongs is the group for reconfiguring the cluster, and the self-group is determined as the group for reconfiguring the cluster. Even if there is no cluster, the consistency of the data in the cluster can be ensured while providing the database service.

Landscapes

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

Abstract

クラスタを再構成するグループに属さないノードにおいてもデータベースのサービスを提供しつつ、当該クラスタにおけるデータの整合性を図ることを可能とする。 マルチマスタ構成のクラスタを構成する複数のノード装置のうちのノード装置に、当該クラスタが複数のグループに分割された際に、自ノード装置を含む自グループが、当該クラスタを再構成するグループに決定されなかった場合であっても、自ノード装置のデータベースのサービスを提供するサービス提供部と、自グループが当該クラスタを再構成するグループではなく、自ノード装置が当該クラスタに再度参加可能な状態である場合、自ノード装置のデータベースを、当該クラスタを再構成するグループに属する他のノード装置のデータベースに同期させる同期部とを備えた。

Description

ノード装置、クラスタ管理方法、プログラム及びクラスタシステム
 本開示は、クラスタを管理するための技術に関する。
 従来、第一のサーバは通信断絶中に自サーバで更新された差分データを第二のサーバに送信し、第二のサーバは受信した差分データと通信断絶中に自サーバで更新された差分データとをマージして、第一のサーバに送信する送信データと自サーバに反映させる反映データとを作成し、第二のサーバは送信データを第一のサーバに送信し、反映データを自サーバに反映させ、第一のサーバは送信データを自サーバに反映させ、第一のサーバは復旧処理中に自サーバで更新された差分データを第二のサーバに送信し、読み出した差分データが自サーバ反映ずみデータのアップデートを含んでいる場合はアップデート分を自サーバに反映させる方法が提案されている(特許文献1を参照)。
 また、プライマリサイトを含むデータベースシステムにおける方法であって、プライマリデータベースが利用不能であると検出し、プライマリサイトのスタンバイデータベースが利用可能であると決定したとき、フェイルオーバ処理シーケンスを自動的にし、フェイルオーバ処理シーケンスは、スタンバイデータベースを読み取り可能及び書き込み可能として自動的に有効にし、スタンバイデータベースに、他のスタンバイデータベースへのデータの複製を開始するようプライマリサイトにおけるプライマリデータベースのロールを割り当て、フェイルオーバロール移行の後、アプリケーションサーバとスタンバイデータベースとの間の予め確立された接続を使用して、アプリケーションサーバがスタンバイデータベースからデータを読み取り且つスタンバイデータベースにデータを書き込むことを可能にし、スタンバイデータベースがプライマリサイトにおけるプライマリデータベースのロールを引き受けることを結果としてもたらす方法が提案されている(特許文献2を参照)。
特開2006-146299号公報 特表2020-511708号公報
 マルチマスタ構成のクラスタにおいてノード間を接続するネットワークの一部が遮断される等の障害が発生した場合に、そのまま動作を継続してしまうと、分離された各ノードグループ(サブクラスタ)に対して別々の書き込み(更新)動作が実行されるため、クラスタ内のデータの一貫性(整合性)が失われてしまうおそれがある。
 そのため、従来、マルチマスタ構成のクラスタでは、ネットワーク遮断などの障害が発生し、クラスタが複数のノードグループに分割された場合は、当該複数のノードグループから、当該クラスタを再構成するグループと、当該クラスタを再構成しないグループが決定され、当該クラスタを再構成するグループでは動作継続が可能である一方、当該クラスタを再構成しないグループでは動作継続が不可となる。
 上述した従来の方法では、クラスタ(システム)全体としてデータの一貫性が保たれる一方、クラスタを再構成しないグループに属するノードのデータベースを利用することが困難となる。しかし、利用形態によっては、クラスタを再構成しないグループにおいても、データベースのサービスが提供されることが望ましい場合もある。しかし、クラスタを再構成しないグループにおいてもデータベースのサービスを提供すると、クラスタ内のデータに不整合が生じる等の問題がある。
 本開示は、上記した問題に鑑み、クラスタを再構成するグループに属さないノードにおいてもデータベースのサービスを提供しつつ、当該クラスタにおけるデータの整合性を図ることを課題とする。
 本開示の一例は、マルチマスタ構成のクラスタを構成する複数のノード装置のうちのノード装置であって、前記クラスタが複数のグループに分割された際に、自ノード装置を含む自グループが、前記クラスタを再構成するグループに決定されなかった場合であっても、自ノード装置のデータベースのサービスを提供するサービス提供手段と、前記自グループが前記クラスタを再構成するグループではなく、自ノード装置が前記クラスタに再度参加可能な状態である場合、自ノード装置のデータベースを、前記クラスタを再構成するグループに属する他のノード装置のデータベースに同期させる同期手段と、を備えるノード装置である。
 本開示は、情報処理装置、システム、コンピュータによって実行される方法またはコンピュータに実行させるプログラムとして把握することが可能である。また、本開示は、そのようなプログラムをコンピュータその他の装置、機械等が読み取り可能な記録媒体に記録したものとしても把握できる。ここで、コンピュータ等が読み取り可能な記録媒体とは、データやプログラム等の情報を電気的、磁気的、光学的、機械的又は化学的作用によって蓄積し、コンピュータ等から読み取ることができる記録媒体をいう。
 本開示によれば、クラスタを再構成するグループに属さないノードにおいてもデータベースのサービスを提供しつつ、当該クラスタにおけるデータの整合性を図ることが可能となる。
第一の実施形態に係るマルチマスタ構成のクラスタを備えるクラスタシステムの構成を示す概略図である。 第一の実施形態に係るノードの機能構成の概略を示す図である。 第一の実施形態に係る管理情報テーブル(平時)の一例を示す図である。 第一の実施形態に係るGridクォーラムシステムの一例を示す図である。 第一の実施形態に係る有限射影平面クォーラムの一例を示す図である。 第一の実施形態に係る管理情報テーブル(拠点間障害発生直後)の一例を示す図である。 第一の実施形態に係る管理情報テーブル(ノード障害発生直後)の一例を示す図である。 第一の実施形態に係る管理情報テーブル(評価値更新後)の一例を示す図である。 第一の実施形態に係る評価値更新処理(平時フロー)の流れの概要を示すフローチャートである。 第一の実施形態に係るグループ決定処理(障害発生時フロー)の流れの概要を示すフローチャートである。 第一の実施形態に係る同期処理(障害復旧時フロー)の流れの概要を示すフローチャートである。 第二の実施形態に係るマルチマスタ構成のクラスタを備えるクラスタシステムの構成を示す概略図である。 第二の実施形態に係るノードの機能構成の概略を示す図である。 第二の実施形態に係るデータベースの状態(平時)の一例を示す図である。 第二の実施形態に係るデータベースの状態(障害発生後)の一例を示す図である。 第二の実施形態に係るデータベースの状態(障害復旧時(リストア時))の一例を示す図である。 第二の実施形態に係るデータベースの状態(障害復旧時(同期時))の一例を示す図である。 第二の実施形態に係るバックアップ処理(平時フロー)の流れの概要を示すフローチャートである。 第二の実施形態に係るバックアップ無効化処理(障害発生時フロー)の流れの概要を示すフローチャートである。 第二の実施形態に係る同期処理(障害復旧時フロー)の流れの概要を示すフローチャートである。 第三の実施形態に係るノードの機能構成の概略を示す図である。
 以下、本開示に係る装置、システム、方法及びプログラムの実施の形態を、図面に基づいて説明する。但し、以下に説明する実施の形態は、実施形態を例示するものであって、本開示に係る装置、システム、方法及びプログラムを以下に説明する具体的構成に限定するものではない。実施にあたっては、実施の態様に応じた具体的構成が適宜採用され、また、種々の改良や変形が行われてよい。
 第一の実施形態、第二の実施形態及び第三の実施形態では、本開示に係る装置、システム、方法及びプログラムを、二拠点に配置されたノード群から構成されたマルチマスタ構成のクラスタにおいて実施した場合の実施の形態について説明する。但し、本開示に係る装置、システム、方法及びプログラムは、マルチマスタ構成のクラスタを再構成及び管理するための技術について広く用いることが可能であり、本開示の適用対象は、実施形態において示した例に限定されない。
 [第一の実施形態]
 第一の実施形態では、障害発生等によりマルチマスタ構成のクラスタが複数のノードグループに分割された場合に、当該クラスタを構成する各ノードにおいて、平時に取得された使用情報を用いることにより、自ノードを含むグループを、当該クラスタを再構成するグループとするかを決定する実施形態について説明する。
 <システムの構成>
 図1は、本実施形態に係るマルチマスタ構成のクラスタを備えるクラスタシステムの構成を示す概略図である。本実施形態に係るクラスタシステム9では、マルチマスタ構成のクラスタ3を構成する複数のノード装置(以下、「ノード」と称する)1が、ネットワークを介して互いに通信可能に接続されている。本実施形態に係るクラスタシステム9では、拠点1にノード1a(以下、「ノードA」と称する)及びノード1b(以下、「ノードB」と称する)が配置され、拠点2にノード1c(以下、「ノードC」と称する)及びノード1d(以下、「ノードD」と称する)が配置されている。
 各ノード1は、CPU(Central Processing Unit)11、ROM(Read Only Memory)12、RAM(Random Access Memory)13、EEPROM(Electrically Erasable and Programmable Read Only Memory)やHDD(Hard Disk Drive)等の記憶装置14、及びNIC(Network Interface Card)等の通信ユニット15を備えるコンピュータである。但し、ノード1の具体的なハードウェア構成に関しては、実施の態様に応じて適宜省略や置換、追加が可能である。また、ノード1は、単一の筐体からなる装置に限定されない。ノード1は、所謂クラウドや分散コンピューティングの技術等を用いた、複数の装置によって実現されてよい。そのため、例えば、ノード1は、複数の筐体からなるノード装置であり、以下で詳述する機能部と同期対象のデータベースとは、別筐体に備えられていてもよい。
 ノードは、マルチマスタ構成のクラスタ3を構成するコンピューター(情報処理装置)やサーバーであり、本実施形態では、各ノード1は夫々、個別のデータベースを備える(管理する)。即ち、本実施形態に係るクラスタ3は、マルチマスタ構成のデータベースクラスタである。マルチマスタ構成のクラスタでは、当該クラスタを構成する複数のノード夫々のデータベースに対して、データ参照だけでなく更新(書き込み)が可能であり、データベースを更新した結果がノード間で相互に同期されることで、データの一貫性(整合性)が保たれる。そして、マルチマスタ構成のクラスタでは、障害が発生した際に、例えば、障害が発生したノードを切り離す(取り除く)ことで、データベースのサービスを継続することが可能である。なお、本実施形態においてノード間での同期の対象となるデータベースは、例えば、リレーショナルデータベース(関係データベース)であるが、キー・バリュー型データベース等の他の任意のデータベースであってよい。また、各ノードにおいて、データベースは、記憶装置14に構築(記憶)されてもよいし、その他の記憶装置に構築されてもよい。
 また、本実施形態に係るクラスタシステム9では、ユーザー端末8が接続されており、ノード1は、ユーザー端末8から送信された、データベースに対する読み込み動作や書き込み動作等の処理要求(クエリ)を受け付け実行することが可能である。なお、ユーザー端末8は、CPU、ROM、RAM、記憶装置及び通信ユニット等を備えるコンピュータである。但し、ユーザー端末8の具体的なハードウェア構成に関しては、実施の態様に応じて適宜省略や置換、追加が可能である。
 なお、本開示に係るクラスタシステム9は、図1に例示された構成のクラスタシステム9に限定されない。例えば、一拠点のみに複数のノード1が配置されたクラスタシステムや、二拠点以上の拠点に複数ノード1が配置されたクラスタシステムであってもよい。また、各拠点に配置されるノードの数は複数に限定されず、拠点に1ノードのみが配置される構成であってもよい。何れにしても、本実施形態に係るクラスタシステム9(クラスタ3)は、二以上のノードを備える。
 図2は、本実施形態に係るノードの機能構成の概略を示す図である。各ノード1は、記憶装置14に記録されているプログラムが、RAM13に読み出され、CPU11によって実行されて、ノード1に備えられた各ハードウェアが制御されることで、管理情報記憶部21、使用情報取得部22、使用情報送信部23、評価値算出部24、状態検知部25、決定部26、障害検知部27、設定部28、サービス提供部29、再接続部30、更新情報送受信部31、更新データ特定部32、更新データ送受信部33及び同期部34を備える装置として機能する。なお、本実施形態及び後述する他の実施形態では、ノード1の備える各機能は、汎用プロセッサであるCPU11によって実行されるが、これらの機能の一部又は全部は、1又は複数の専用プロセッサによって実行されてもよい。また、ノード1が備える各機能部は、単一の筐体からなる装置(1の装置)に実装されるものに限定されず、遠隔に及び/又は分散して(例えば、クラウド上に)実装されてもよい。
 管理情報記憶部21は、自ノード及び自ノードが属するクラスタに関する管理情報を記憶する。管理情報は、自ノードの使用状況に関する情報と、自ノードと通信可能なノードと自ノードとで構成されるグループ(クラスタ)に関する情報等を含む。以下、「自ノードと通信可能なノードと、自ノードとで構成されるグループ(クラスタ)」を「自グループ(自クラスタ)」と称する。なお、本実施形態では、管理情報は管理情報テーブルに格納され、管理情報(管理情報テーブル)は、記憶装置14や他の記憶装置等に記憶される。
 図3は、本実施形態に係る管理情報テーブル(平時)の一例を示す図である。図3に示すように、本実施形態に係る管理情報テーブルには、管理情報として、「クラスタノード」、「状態」、「トランザクション数(Txカウント)」、「評価値」、及び「評価値合計」の情報が格納される。「クラスタノード」の欄には、自グループ(自クラスタ)の構成ノードの情報(例えば、ノード名やノードID)が格納される。「状態」の欄には、自グループ(自クラスタ)が、クラスタ3として動作するクラスタ(クラスタ3としてデータベースのサービスの提供が可能なクラスタ)であるプライマリクラスタと、クラスタ3として動作しないクラスタであるノンプライマリクラスタの何れであるか(自グループの状態)を示す情報(例えば、「PRIMARY」又は「NON-PRIMARY」)が格納される。「Txカウント」の欄には、自ノードの使用状況を示す情報である使用情報(自ノードのトランザクション数等)が格納される。「評価値」の欄には、後述する重み付け多数決投票に用いられる重み(重要度)である、自ノードの評価値が格納される。「評価値合計」の欄には、プライマリクラスタの構成ノードの評価値の総和が格納される。但し、自グループがノンプライマリクラスタに属した時点で、自ノードが属してない現在のプライマリクラスタの構成ノードの評価値の総和ではなく、自ノードが最後に属していたプライマリクラスタの構成ノードの評価値の総和が、「評価値合計」に保持される。
 図3の例では、障害等が発生しておらず、クラスタ3が分割されていない状態(平時の状態)であり、クラスタ3を構成する各ノードが通信可能な状態であるため、各ノードはプライマリクラスタに属している状態である。そのため、図3に示すように、各ノードが備える管理情報テーブルには、「クラスタノード」の欄に「(ノード)A、B、C、D」が、「状態」の欄に「PRIMARY」が、「評価値合計」の欄にノードA、B、C、Dの評価値の総和「636」が格納されている。なお、「Txカウント」及び「評価値」については、詳細を後述する。また、図3に示された管理情報は一例であり、管理情報は、図3に示された情報以外の情報を含んでもよい。更に、図3に示された管理情報テーブルは一例であり、管理情報を格納することが可能であれば他の形式であってもよい。また、管理情報を格納する管理情報テーブルは、図3に示すような一つのテーブルに限定されず、複数のテーブルにより構成されてもよい。
 使用情報取得部22は、所定期間毎に、クラスタ3を構成する各ノード1(自ノードを含む)について、ノードの使用状況(負荷状況)を示す使用情報を取得する。本実施形態では、ノードの使用状況を示す使用情報として、当該ノードに対するアクセスの頻度を示す情報の一例である、当該ノードのトランザクション数(読み込み動作(read)及び/又は書き込み動作(write)に係るトランザクションの数)を例示する。但し、使用情報取得部22により取得される使用情報は、ノードの使用状況を示す情報であればトランザクション数に限定されるものではなく、アクセスの頻度を示す情報の他の例であるパケット伝送数の他、ハードウェア負荷指標、CPU使用率、又はメモリ使用率等であってもよい。また、取得される使用情報は、一種類の情報に限定されるものではなく、ノードの使用状況を示す複数種類の情報を含んでもよい。例えば、使用情報は、トランザクション数及びパケット伝送数であってよい。
 本実施形態では、所定期間毎に、その時点(使用情報を取得する時刻)近傍における各ノードの使用状況を示す情報が取得される。使用情報を取得する時刻近傍におけるノードの使用状況とは、例えば、使用情報を取得する時点以前一定期間の使用状況であるが、その他、使用情報を取得する時刻における使用状況を示す情報(瞬間値)であってもよい。本実施形態では、使用情報取得部22は、各ノードについて、所定期間毎に、その時点以前一定期間のノードの使用状況を示す情報を取得する。本実施形態では、各ノードについて、所定期間(例えば、1時間)毎に、その時点以前一定期間(例えば、3時間)のトランザクション数の合計値が算出(取得)される。本実施形態において、所定期間が経過する毎に一定期間のトランザクション数の合計値を算出(取得)する方法を以下で説明する。なお、以下の説明では、所定期間を1時間、一定期間を3時間とし、ノードAの使用情報取得部22が、クラスタ3を構成する各ノード(ノードA、B、C、D)のトランザクション数を取得する場合について例示する。また、以下に示す例では、所定期間毎に、その時点での、ある時点(始点)からのトランザクション数の累計値(ノード毎の累計値)が、ノード間で送受信されることとする。以下、始点からのノードのトランザクション数の累計値を、単に「累計値」と称する。
 まず、ノードAの使用情報取得部22は、予め、少なくとも一定期間(3時間)を超える期間において、所定期間(1時間)毎に、その時点での各ノードについての累計値を取得しておく。例えば、12時から1時間おきに、3時間分のトランザクション数を取得したい場合、12時の時点においても、その時点以前3時間分のトランザクション数の合計値を取得可能とするために、9時、10時、11時の時点での各ノードの累計値を取得しておく。例えば、ノードAは、ノードBの累計値として、9時に「100」、10時に「200」、11時に「300」を取得しておく。そして、ノードAは、12時にノードBの累計値「500」を取得すると、その時点以前3時間分(9時~12時)のノードBのトランザクション数を、12時の累計値「500」と9時の累計値「100」との差分である「400」と算出することが可能である。その後、ノードAは、13時にノードBの累計値「700」を取得すると、その時点以前3時間分(10時~13時)のノードBのトランザクション数を、13時の累計値「700」と10時の累計値「200」との差分である「500」と算出することが可能である。後述する評価値算出部24では、この算出された一定期間のトランザクション数の合計値に基づき評価値が算出される。
 また、使用情報取得部22は、自ノードについて、一定期間のトランザクション数の合計値を算出する毎に、当該自ノードの一定期間のトランザクション数の合計値で、管理情報テーブル内の「Txカウント」の情報を更新する。なお、本実施形態では、一定期間のトランザクション数の合計値に基づき評価値が算出されるが、評価値の算出に用いられる一定期間のトランザクション数は、一定期間の合計値に限定されず、一定期間のトランザクション数の平均値(移動平均値)や中央値(移動中央値)、最大値、最小値、最頻値等の代表値であってもよい。例えば、3時間分のトランザクション数ではなく、3時間のうちの各1時間のトランザクション数の平均値等が評価値の算出に用いられてよい。また、上述の例では、13時の時点で算出される評価値は、13時の時点で算出された一定期間のトランザクション数(例えば、上述した合計値「500」)にのみ基づき算出される以外にも、13時の時点の一定期間のトランザクション数「500」に加え、その前に算出(取得)されたトランザクション数(例えば、上述した、12時の時点の合計値「400」)に基づき算出されてもよい。また、評価値の算出に用いられる使用情報は、使用情報を取得する時刻における使用状況を示す情報(瞬間値)であってもよい。
 なお、本実施形態では、使用情報取得部22は、各ノードについての累積値を、対応するノードから取得し、自ノードにおいて各ノード(ノードA、B、C、D)の一定期間のトランザクション数を算出することとしたが、各ノードの一定期間のトランザクション数を取得する方法はこの例に限定されない。例えば、各ノードが、所定期間毎に、自身の一定期間のトランザクション数を算出し、算出された結果をノード間で送り合うようにしてもよい。この場合、使用情報取得部22は、各ノードの一定期間のトランザクション数を、対応するノードから取得する(例えば、ノードBの一定期間のトランザクション数の合計値をノードBから取得する)ことが可能である。
 以上の通り、各ノードの使用情報取得部22が、所定の期間が経過する毎(定期的)に、自ノード及び他ノードの使用情報(アクセス統計情報等)を取得することで、平時において、各ノードの最新の使用情報(使用状態)をノード間で共有することが可能となる。つまり、平時より、各ノードの使用状況を都度ノード間で共有することが可能である。例えば、図1に示されたクラスタ3では、各ノードは、定期的に、クラスタ3を構成する全ノード(ノードA、B、C、D)の使用情報を取得することで、クラスタ3の構成ノードの使用状況を把握することが可能である。なお、本実施形態では、所定期間が経過する毎に使用情報が取得される場合について説明するが、平時において各ノードの使用情報が繰り返し取得されればよいため、使用情報が取得されるタイミングは不定期であってよい。
 また、本実施形態では、使用情報取得部22は、自ノードがプライマリクラスタに属する場合にのみ、使用情報を取得することとする。つまり、使用情報取得部22は、自ノードがノンプラマリクラスタに属する場合は、使用情報を取得する処理を一時停止する。これより、ノンプライマリクラスタに属しているノードにおいて、各ノードの使用情報が取得され各ノードの評価値が更新されてしまうことで、誤って自ノードをプライマリクラスタに設定してしまう事態を回避することが可能である。
 なお、使用情報取得部22は、他ノードの使用情報については、当該他ノードの使用情報送信部23により送信された使用情報を受信することで取得し、自ノードの使用情報については、自ノードの記憶装置14又はその他の記憶装置等に記憶されている、自ノードの使用状況が逐次更新されるテーブル(図示を省略)等から取得する。使用情報取得部22は、例えば、MySQLのhost_summary sysテーブルの統計値を参照することでトランザクション数の情報を取得するようにしてよい。
 使用情報送信部23は、クラスタ3を構成する他ノードに対して、自ノードの使用状況を示す使用情報を繰り返し送信する。本実施形態では、使用情報送信部23は、所定期間毎に、自ノードの使用情報(累計値)を送信する。
 評価値算出部24は、使用情報取得部22によって取得された使用情報(一定期間のトランザクション数の合計値)に基づき、クラスタ3を構成する各ノード1の評価値(重み)を算出する。従来は、上述の通り、各ノードグループのノード数による多数決投票を行うことでクラスタを再構成する方法や、各ノードの重みを手動で設定することによりクラスタを再構成する方法等が用いられている。これら従来の方法に対し、本実施形態では、平時に、ノードの使用状況に応じて自動的に各ノードに対する重み付けが行われ、障害等が発生すると、重み付けの値である評価値に基づき、クラスタ3を再構成するグループ(新たなプライマリクラスタとなるグループ)が決定される。本実施形態では、評価値算出部24により算出される評価値(重み)に基づく多数決投票が行われることで、クラスタ3を再構成するグループが決定される。なお、評価値算出部24は、上述した使用情報取得部22と同様の理由で、自ノードがプライマリクラスタに属する場合にのみ、評価値の算出を行う。
 評価値算出部24は、各ノードの評価値(重み)を、対応するノードの使用状況に応じて算出する。つまり、評価値算出部24は、複数のノード(クラスタ3を構成するノード)の使用情報に夫々対応する、当該複数のノードの評価値を算出する。本実施形態では、使用情報取得部22によって取得された、複数のノード(クラスタ3を構成するノード)の使用情報に基づき、各ノードの評価値を算出する。具体的には、評価値算出部24は、当該複数のノードの使用情報の値のうちの最大値が、設定可能な評価値の最大値と一致するよう、当該複数のノードの使用情報の値をスケーリング(調整)する。そして、評価値算出部24は、当該複数のノードの評価値の夫々を、対応するノードのスケーリングされた結果(以下、「調整値」と称する)に基づき算出する。但し、本実施形態では、スケーリングを行った結果、調整値が1未満となった場合は、当該調整値を1に更新する。
 なお、本実施形態では、複数のノード(クラスタ3を構成するノード)の評価値のうち、任意のノードの評価値が、所定の値未満となるよう、複数のノードの評価値を算出する。ここで、所定の値とは、例えば、複数のノード内の前記任意のノード以外の他のノードの評価値の総和である。これは、クラスタ3を構成する一部のノード(例えば、ノードA)が故障(消失)した場合にも、生存している残りのノードからなるグループ(クラスタ)でクラスタを再構成することができる(例えば、過半数の評価値を獲得する)ようにするものである。但し、本実施形態では、プライマリクラスタ(クラスタ3)の構成ノード数が3以上である場合にのみ、任意のノードの評価値が所定の値(他のノードの評価値の総和)未満となるよう調整することとする。本実施形態では、上述したノードの調整値を当該ノードの評価値とするが、複数のノードの調整値の中に、他の調整値と比べて極めて大きい調整値(以下、「極大調整値」と称する)がある場合、この極大調整値に係るノードの評価値を、当該極大調整値より小さい値とする。ここで、本実施形態では、他の調整値と比べて極めて大きい調整値は、他の調整値の総和以上である調整値であるが、その他、当該総和の二倍以上である調整値や所定の値以上である調整値等であってもよい。
 具体的には、極大調整値に係るノードの評価値を、当該調整値以外の他の調整値の総和より小さい値(例えば、総和より1小さい値。但し、総和が2以上の場合)とする。ここで、総和より1小さい値とする場合の条件を「総和が2以上の場合」とするのは、総和が1である場合に総和より1小さい値とすると、極大調整値に係るノードの評価値が0となってしまうことを回避するためである。なお、本実施形態では、極大調整値に係るノードの評価値を他の調整値の総和より1小さい値とする例を示すが、極大調整値に係るノードの重要度を下げたい場合等には、当該ノードの評価値を、他の調整値の総和より2又は3小さい値等にしてもよい。なお、この場合、極大調整値に係るノード以外のノードの評価値は、上記と同様に、算出された調整値とする。また、上述の通り、本実施形態では、プライマリクラスタの構成ノード数が3以上である場合に、上述した調整を行うが、当該調整を行う対象となるクラスタの構成ノード数は任意の数(所定の数)に設定されてよい。
 例えば、使用情報取得部22により取得された、ノードA、B、C、D夫々の一定期間のトランザクション数(合計値)が、「400」、「300」、「100」、「200」であり、設定可能な評価値の最大値が「255」である場合、評価値算出部24は、最大トランザクション数である「400」が、評価値の最大値である「255」と一致するよう、各ノードのトランザクション数をスケーリングする。これにより、ノードA、B、C、Dの調整値が夫々、「255」、「191」、「63」、「127」と算出される(図3参照)。これらの調整値には、上述したような極めて大きい調整値は存在しないため、これら各ノードの調整値が夫々、対応するノードの評価値として決定される。つまり、ノードA、B、C、Dの評価値は夫々、「255」、「191」、「63」、「127」と決定される。評価値算出部24は、各ノードの評価値を決定(算出)すると、プライマリクラスタを構成するノードの評価値の総和を算出する。図3の例では、プライマリクラスタを構成するノードの評価値の総和が、ノードA、B、C、Dの評価値の総和である「636」(=255+191+63+127)と算出される。ノード評価値算出部24は、各ノードの評価値及びプライマリクラスタを構成するノードの評価値の総和を算出すると、算出された自ノードの評価値及び評価値の総和で、管理情報テーブル内の「評価値」及び「評価値合計」の情報を夫々更新する。
 なお、上述の通り、本実施形態では、使用情報取得部22によって取得された、クラスタ3を構成する複数のノード(全ノード)の使用情報に基づき、各ノードの評価値を算出する例を示すが、この例に限定されるものではなく、各ノードの評価値は、対応するノードの使用情報のみに基づき算出(決定)されてもよい。例えば、単に使用情報の値自体を評価値として採用する場合や、使用情報の値に所定の係数を乗算又は加算した値を評価値とする場合等がこれに該当する。使用情報の値自体を評価値とする場合、使用情報取得部22により取得された使用情報がそのまま、クラスタ3を再構成するグループを決定する処理に用いられてよい。また、本実施形態では、所定期間毎に、即ち、使用情報取得部22により各ノードの使用情報(一定期間のトランザクション数の合計値)が取得される度に、各ノードの評価値を算出する例を示すが、クラスタ3を再構成するグループを決定する際に用いられる評価値のみが算出されれば足りる。そのため、例えば、平時には評価値が算出されず、障害発生時に、平時に最後に取得された使用情報に基づく評価値が算出されるようにしてもよい。
 本実施形態では、上述したように、トランザクション数が多いノードほど、即ち、使用されている(アクセス頻度の高い)ノードほどその評価値が高くなるように評価値が算出されるが、評価値の算出方法はこの例に限定されるものではなく、使用されているノードほどその評価値が低くなるよう算出されてもよい。但し、この場合は、評価値の低いグループがクラスタ3を再構成するグループとして決定されることとなる。また、本実施形態では、上述したスケーリングにより評価値を算出することとしたが、評価値はノードの使用状況(使用情報)に応じたものであれば、任意の方法により算出されてよい。
 状態検知部25は、自ノードが現在プライマリクラスタ(クラスタ3として機能するグループ)及びノンプライマリクラスタ(クラスタ3として機能しないグループ)の何れに属するかを検知する。例えば、状態検知部25は、上述した管理情報(管理情報テーブルの「状態」の欄)を参照することで、現在の自グループの状態を検知する。また、状態検知部25は、自グループがプライマリクラスタとノンプライマリクラスタとの間で状態遷移したことを検知する。例えば、状態検知部25は、設定部28により自グループの状態が変更されたことにより、状態遷移を検知する。但し、これらの検知方法は一例であり、他の方法により自グループの状態(状態遷移)を検知してもよい。
 決定部26は、クラスタ3が複数のノードグループに分割されると、クラスタ3が分割される前(平時)に取得された、クラスタ3の構成ノード(複数のノード)の使用情報に夫々対応する、当該複数のノードの評価値を用いることで、自グループを、クラスタ3を再構成するグループ(新たなプラマリクラスタ)とするかを決定する。本実施形態では、平時に最後に取得された使用情報に対応する評価値を用いて決定する。つまり、本実施形態では、平時に最後に更新(算出)された評価値に基づき、決定処理が行われる。但し、上述したように、平時に最後に取得された使用情報及びそれ以前に取得された使用情報に基づく評価値が用いられてもよい。なお、本実施形態では、障害が発生したことによりクラスタ3が複数のグループに分割される場合を例示するが、この例に限定されるものではなく、メンテナンス等により一部のノードの動作を一時停止していること等によりクラスタ3が分割される場合も対象とする。
 平時に取得された各ノードの評価値に基づき、自グループを、クラスタ3を再構成するグループとして決定する方法としては、種々の方法を用いることが可能である。例えば、どの2要素(クォーラム)をとっても共通部分が存在するようなノードの部分集合の集合であるクォーラムシステムを用いる方法を採用することが可能であり、本実施形態では、過半数クォーラム(多数決投票)を用いる。具体的には、クラスタ3が分割された後に自グループを構成するノードの評価値の総和が、クラスタ3が分割される前にクラスタ3(プライマリクラスタ)を構成していたノード(クラスタが分割される前に最後に自ノードが属していたプライマリクラスタの構成ノード)の評価値の総和の半数を超える場合に、当該自グループを、クラスタ3を再構成するグループと決定する。以下、障害が発生した場合に重み付け多数決投票を用いてクラスタ3を再構成するグループを決定する具体例を示す。なお、以下の具体例において、障害が発生した時点での管理情報テーブルを、図3に示された管理情報テーブルとする。但し、管理情報テーブル内の各ノードの「クラスタノード」については、障害が検知された時点で、その時点での情報に更新される。
 <具体例1:拠点間の障害>
 本具体例では、平時の状態から、拠点1と拠点2とを結ぶネットワーク経路に障害が発生し、拠点1と拠点2との間のネットワーク通信が不可となった場合を例示する。拠点1と拠点2とを結ぶネットワーク経路の障害が発生すると、クラスタ3は、ノードA、Bからなるグループ(グループ1)と、ノードC、Dからなるグループ(グループ2)とに分割される。
 この場合、例えば、ノードAの決定部26は、管理情報テーブル(図3)を参照し、障害が発生した後に自グループ(グループ1)に属しているノードの評価値(平時に最後に算出された評価値)の総和と、障害発生直前(平時)にクラスタ3(プライマリクラスタ)を構成していたノードの評価値(平時に最後に算出された評価値)の総和の半数とを比較する。図3の例では、グループ1(ノードA、B)の評価値の総和「446」(=255+191)と、平時にクラスタ3を構成していたノード(ノードA、B、C、D)の評価値の総和「636」の半数「318」とを比較する。この場合、グループ1の評価値の総和が、平時におけるクラスタ3の構成ノードの評価値の総和の半数を超えるため、ノードAの決定部26は、自グループ(グループ1)を、クラスタ3を再構成するグループと決定する。同様に、ノードBの決定部26は、自グループを、クラスタ3を再構成するグループと決定する。
 一方、例えば、ノードCの決定部26は、管理情報テーブル(図3)を参照し、障害が発生した後に自グループ(グループ2)に属しているノードの評価値の総和と、障害発生直前にクラスタ3を構成していたノードの評価値の総和の半数とを比較する。図3の例では、グループ2(ノードC、D)の評価値の総和「190」(=63+127)と、平時にクラスタ3を構成していたノード(ノードA、B、C、D)の評価値の総和「636」の半数「318」とを比較する。この場合、グループ2の評価値の総和が、平時におけるクラスタ3の構成ノードの評価値の総和の半数以下であるため、ノードCの決定部26は、自グループ(グループ2)を、クラスタ3を再構成しないグループと決定する。同様に、ノードDの決定部26は、自グループを、クラスタ3を再構成しないグループと決定する。
 <具体例2:ノードAの障害>
 本具体例では、平時の状態から、ノードAのOS等に障害が発生し、ネットワーク上からノードAが消失した場合を例示する。ノードAの障害が発生すると、クラスタ3は、ノードAからなるグループ(グループ3)と、ノードB、C、Dからなるグループ(グループ4)とに分割される。グループ3は、稼働が停止したノードのグループであり、グループ4は、稼働が継続しているノードのグループである。このように、分割された複数のグループの中には、稼働が停止しているノードのグループが存在していてもよい。この場合、ノードAは、例えばOS障害等により活動を一時停止するため、ノードAにおいて決定部26による決定処理は実行されない。そのため、グループ3は、クラスタ3を再構成するグループと決定されない。
 一方、例えば、ノードBの決定部26は、管理情報テーブル(図3)を参照し、障害が発生した後に自グループ(グループ4)に属しているノードの評価値の総和と、障害発生直前にクラスタ3を構成していたノードの評価値の総和の半数とを比較する。図3の例では、グループ4(ノードB、C、D)の評価値の総和「381」(=191+63+127)と、平時にクラスタ3を構成していたノード(ノードA、B、C、D)の評価値の総和「636」の半数「318」とを比較する。この場合、グループ4の評価値の総和が、平時におけるクラスタ3の構成ノードの評価値の総和の半数を超えるため、ノードBの決定部26は、自グループ(グループ4)を、クラスタ3を再構成するグループと決定する。同様に、ノードC、D夫々の決定部26は、自グループを、クラスタ3を再構成するグループと決定する。
 なお、具体例1及び具体例2では、クラスタ3が2つのグループに分割される場合を例示したが、この例に限定されず、クラスタ3が3つ以上のグループに分割される場合にも、上述した決定処理を行うことが可能である。また、本実施形態では、クォーラムシステムとして過半数クォーラム(多数決投票)を用いるが、過半数クォーラム以外に、Gridクォーラムや有限射影平面クォーラムなどの他のクォーラムシステムが用いられてよい。Gridクォーラムの場合、ノード数が平方数である前提のもとノードを正方形状に配置して、ある行の全てのノードとそれより下の各行から1ノードずつを含むグループが新たなプライマリクラスタと決定される。有限射影平面クォーラムの場合、ノード数がq+q+1(qは素数)である前提のもとノードを有限射影平面上に配置して、同一線上のq+1ノードを含むグループが、新たなプライマリクラスタと決定される。Gridクォーラム及び有限射影平面クォーラムはいずれも全ノードの重みを同じものとしているが、評価値(重み)の大きいノードを評価値に応じて複数配置することにより、特定のノードの重要度を高めることが可能である。
 図4は、本実施形態に係るGridクォーラムシステムの一例を示す図である。図4には、ノード数25のGridクォーラムシステムを示す。例えば、ノードA、B、Cの評価値(重み)が、その他のノードの4倍、3倍、2倍である場合には、図4に示すように、5×5のマス目に、ノードAが4つ(4倍)、ノードBが3つ(3倍)、ノードCがノード2つ(2倍)配置される。これにより、ノードA、B、Cの重要度を高めることが可能である。
 図5は、本実施形態に係る有限射影平面クォーラムの一例を示す図である。図5には、ノード数7の有限射影平面クォーラムシステムを示す。例えば、ノードAの評価値(重み)が他のノードの3倍である場合には、図5に示すように、ノードAが有限射影平面上に3つ(3倍)配置される。これにより、ノードAの重要度を高めることが可能である。
 障害検知部27は、他ノードとの間で生存確認のための通信を定期的に行うことにより、クラスタシステム9内の障害の発生と障害からの復旧を検知する。障害は、例えば、OSやハードウェアのトラブル、故障等によるノード障害や、ネットワークスイッチやNICのトラブル、故障等によるネットワーク障害等である。例えば、障害検知部27は、他ノードとの生存確認のための通信がタイムアウトすることで、当該他ノードに障害が発生したと判断(検知)し、生存確認のための通信が正常に行われるようになったことを検知することで、障害からの復旧を検知する。なお、障害発生及び障害復旧の検知方法については、種々の方法が用いられてよい。例えば、他ノードや障害検知装置等から、障害が発生したことを知らせる通知や障害発生ノードにおいて障害が復旧したことを知らせる通知を受信したこと、障害発生ノードから復旧したことの通知を受信したこと、又は、管理者ユーザーから障害発生及び障害復旧についての入力を受け付けたこと等の方法により、障害発生及び障害復旧が検知されてよい。また、障害検知部27は、障害が発生又は障害が復旧した際に、自グループに属するノードに変更があるときは、管理情報テーブル内の「クラスタノード」の情報を更新する。
 設定部28は、決定部26により自グループがクラスタ3を再構成するグループと決定された場合、自グループの状態をプライマリクラスタに設定(変更)する(データベースに対するReadリクエスト及びWriteリクエストの受付を開始するよう設定(制御)する)ことで、サービス提供部29に、データベースのサービスを開始(継続)させる。一方、設定部28は、自グループがクラスタ3を再構成しないグループと決定された場合、自グループの状態をノンプライマリクラスタに設定(変更)する(データベースに対するReadリクエスト及びWriteリクエストを受け付けないよう設定(制御)する)ことで、サービス提供部29に、データベースのサービスの提供を一時停止する等ノードの活動を停止させる。また、設定部28は、自ノードがノンプライマリクラスタに属する場合、障害復旧後に、プライマリクラスタのノードのデータベースとの同期が終了すると、自グループの状態をプライマリクラスタに設定する。なお、設定部28は、自グループの状態がプライマリクラスタとノンプライマリクラスタとの間で遷移(変更)するときは、管理情報テーブル内の「状態」の情報を更新する。但し、この例に限定されず、決定部26によりプライマリクラスタか否かが決定された際に、決定部26により管理情報内の「状態」の情報が更新されるようにしてもよい。
 サービス提供部29は、自グループがプライマリクラスタである場合、自ノードのデータベースのサービスを提供する。例えば、サービス提供部29は、ユーザー端末8から送信されたデータベースに対する読み込み動作及び書き込み動作等の処理要求(クエリ)を受け付け実行する等の、自ノードのデータベースのサービスを提供する。
 再接続部30は、自グループがノンプライマリクラスタである場合に、プライマリクラスタに含まれるノードとの接続を再度確立する。例えば、再接続部30は、プライマリクラスタに含まれるノードに対して接続要求を行うことにより、自ノードと当該プライマリクラスタに含まれるノードとの接続の確立を開始する。
 更新情報送受信部31は、他のノードに対して、自ノードのデータベースの更新状態を示す情報(更新情報)を送信する。例えば、更新情報送受信部31は、更新情報として、自ノードのデータベースの最新のトランザクション(書き込み処理に係るトランザクション(writeキャッシュに記憶されたトランザクション))のシーケンス番号を他のノードに送信(通知)する。また、更新情報送受信部31は、他のノードから、当該他のノードの更新情報を受信する。本実施形態では、ノンプライマリクラスタに属するノードは、障害が復旧すると(クラスタに再度参加可能な状態である場合)、プライマリクラスタに属する所定ノードに対して、自ノードの更新情報を送信する。つまり、更新情報送受信部31は、自ノードとプライマリクラスタに属するノードとの間の、データベースに対する書き込み処理に係るトランザクションの差分を要求する。
 更新データ特定部32は、他ノードから受信した当該他ノードの更新情報に基づき、自ノードのデータベースと当該他ノードのデータベースとの差分(更新が必要なデータ)を特定する。例えば、本実施形態では、ノンプライマリクラスタに属するノードのシーケンス番号を受信したプライマリクラスタに属する所定ノードにおいて、両ノードのシーケンス番号を比較することにより、自ノードのデータベースと、当該ノンプライマリクラスタに属するノードのデータベースとの差分を特定する(差分の有無を判定する)。例えば、プライマリクラスタに属する所定ノードの更新データ特定部32は、他ノードのデータベースが自ノードのデータベースよりも古い(更新されていない)状態である場合、当該他ノードにおいて更新が必要なデータ(更新データ(差分データ))を特定する。
 更新データ送受信部33は、ノード間で同期を行うために用いられる更新データ(差分データ)を送受信する。例えば、プライマリクラスタに属するノードの更新データ送受信部33は、ノンプライマリクラスタに属するノードにおいて更新が必要なデータ(更新データ)を当該ノードに対して送信し、当該更新データが、当該ノンプライマリクラスタに属するノードの更新データ送受信部33により受信される。なお、本実施形態では、更新データを差分データとするが、フルデータであってもよい。
 同期部34は、自ノードのデータベースを、他ノードのデータベースに同期させる。例えば、本実施形態では、ノンプライマリクラスタに属するノードの同期部34は、当該ノードの更新データ送受信部33により受信された更新データを用いて、自ノードのデータベースをプライマリクラスタのノードのデータベースに同期させる。なお、クラスタ3は、データ参照だけではなく更新(書き込み)可能なデータベースであるマスタノードが複数存在する(クラスタの構成ノードが全てマスタノードとして機能する)マルチマスタ構成のクラスタである。そのため、プライマリクラスタに属するノード間では、適宜、データベースの同期が行われる。そのため、同期部34は、自グループがプライマリクラスタである場合、プライマリクラスタに属する他ノードとデータベースの同期を随時行う。
 なお、本実施形態及び後述する他の実施形態では、ノンプライマリクラスタに属するノードにおいて、プライマリクラスタに含まれるノードとの接続を再度確立し、プライマリクラスタとのデータベースの同期を行った後、自ノードをプライマリクラスタに設定する一連の処理を、クラスタに再度参加する処理と称する。
 図6は、本実施形態に係る管理情報テーブル(拠点間障害発生直後)の一例を示す図である。図6は、上述した具体例1の障害が発生した場合を例示しており、当該障害発生直後に各ノードにおいて自グループを、クラスタ3を再構成するグループとするかが判定され、設定が行われた後の管理情報テーブルを示す。図3及び図6に示すように、障害発生直後(図6)は、平時(図3)に最後に取得されたトランザクション数(Txカウント)、及び、当該トランザクション数に基づき算出、設定された評価値が管理情報テーブルに保持された状態である。
 具体例1で説明したように、この場合、クラスタ3は、ノードA、Bからなるグループ1と、ノードC、Dからなるグループ2に分割される。そのため、図6に示すように、ノードA、Bにおいては、自グループからノードC、Dが取り除かれ、「クラスタノード」が「A、B」に更新され、ノードC、Dにおいては、自グループからノードA、Bが取り除かれ、「クラスタノード」が「C、D」に更新されている。また具体例1では、グループ1がクラスタ3を再構成するグループとして決定されるため、図6に示すように、ノードA、Bにおいては、「状態」が「PRIMARY」に更新(継続)され、ノードC、Dにおいては、「状態」が「NON-PRIMARY」に更新されている。更に、グループ1がクラスタ3を再構成するグループと決定されたことで、新たなプライマリクラスタに属するノードA、Bでは、評価値算出部24により、プライマリクラスタの構成ノードの評価値の総和が算出され、算出された総和「446」で、「評価値合計」の情報が更新されている。なお、ノードC、Dはノンプライマリクラスタに属すため、「評価値合計」の情報には、自ノードが障害発生前に最後にプライマリクラスタに属していた際の、当該プライマリクラスタの構成ノードの評価値総和「636」が保持される。
 なお、障害発生後(クラスタ3が分割された後)も、新たなプライマリクラスタに属するノードでは、平時の処理として、使用情報取得処理及び評価値算出(更新)処理が行われる。ここで、クラスタ3を再構成するグループとして決定されたグループ1には、平時にクラスタ3(プライマリクラスタ)において最大トランザクション数を有していたノードAが含まれている。そのため、障害発生後に新たなプライマリクラスタにおいて行われた使用情報取得処理により取得されたノードA、Bのトランザクション数の夫々が、障害発生直前に取得されたノードA、Bのトランザクション数「400」、「300」と同値である場合は、障害発生直前と障害発生後のノードA、B夫々の評価値は、「255」、「191」で同値となる。
 図7は、本実施形態に係る管理情報テーブル(ノード障害発生直後)の一例を示す図である。図7は、上述した具体例2の障害が発生した場合を例示しており、当該障害発生直後に各ノードにおいて自グループを、クラスタ3を再構成するグループとするかが判定され、設定が行われた後の管理情報テーブルを示す。図3及び図7に示すように、障害発生直後(図7)は、平時(図3)に最後に取得されたトランザクション数(Txカウント)、及び、当該トランザクション数に基づき算出、設定された評価値が管理情報テーブルに保持された状態である。
 具体例2で説明したように、この場合、クラスタ3は、ノードAからなるグループ3と、ノードB、C、Dからなるグループ4に分割される。そのため、図7に示すように、ノードB、C、Dにおいては、自グループからノードAが取り除かれ、「クラスタノード」が「B、C、D」に更新されている。また具体例2では、グループ4がクラスタ3を再構成するグループとして決定されるため、図7に示すように、ノードB、C、Dにおいては、「状態」が「PRIMARY」に更新(継続)されている。更に、グループ4がクラスタ3を再構成するグループと決定されたことで、新たなプライマリクラスタに属するノードB、C、Dでは、評価値算出部24により、プライマリクラスタの構成ノードの評価値の総和が算出され、算出された総和「381」で、「評価値合計」の情報が更新されている。なお、ノードAは、障害発生により活動を一時停止するため、ノードAにおいて管理情報テーブルは更新されていない。
 図8は、本実施形態に係る管理情報テーブル(評価値更新後)の一例を示す図である。図8は、上述した具体例2の障害が発生した後、所定期間経過毎に実行される平時の処理において評価値が更新された場合の管理情報テーブルを示す。障害発生後も、プライマリクラスタに属するノードB、C、Dでは、平時の処理として、使用情報取得処理及び評価値算出(更新)処理が行われる。障害発生後に取得されたノードB、C、Dのトランザクション数が夫々、障害発生直前のノードB、C、Dのトランザクション数「300」、「100」、「200」と同値である場合、ノードBのトランザクション数が最大値となる。そのため、各ノードにおいて、評価値算出部24により、ノードBのトランザクション数を設定可能な評価値の最大値(例えば、255)と一致するよう、ノードB、C、Dのトランザクション数が調整(スケーリング)される。その結果、ノードB、C、Dの調整値は夫々、「255」、「85」、「170」となるが、ノードBの調整値がノードC、Dの調整値の総和と等しくなっている。そのため、ノードBの評価値は、当該総和より1小さい値である「254」と決定され、ノードC、Dの評価値は夫々、「85」、「170」と決定され、各ノードの管理情報テーブルの「評価値」の情報が更新される。また、各ノードでは、評価値算出部24により、プライマリクラスタの構成ノードの評価値総和が算出され、算出された評価値総和「509」(=254+85+170)で管理情報テーブルの「評価値合計」が更新されている。
 <処理の流れ>
 次に、本実施形態に係る各ノードによって実行される処理の流れを説明する。なお、以下に説明する処理の具体的な内容及び処理順序は、本開示を実施するための一例である。具体的な処理内容及び処理順序は、本開示の実施の態様に応じて適宜選択されてよい。
 図9は、本実施形態に係る評価値更新処理(平時フロー)の流れの概要を示すフローチャートである。本フローチャートに示された処理は、各ノード1において実行される処理であり、例えば、自ノードがクラスタ3に参加したこと等を契機として開始され、所定期間が経過する毎に繰り返し実行される。なお、平時では、クラスタ3を構成する全ノード(ノードA、B、C、D)が互いに通信可能である。そのため、平時においては、管理情報テーブル内の各ノードの「クラスタノード」及び「状態」の欄に夫々、「A、B、C、D」及び「PRIMARY」が格納されている。
 ステップS101では、現在自ノードがプラマリクラスタに属するかが判定される。状態検知部25は、管理情報テーブル等を参照することで、現在自ノードがプライマリクラスタに属するかを判定する。自ノードがプライマリクラスタに属する場合(ステップS101のYES)、処理はステップS102へ進む。一方、自ノードがプライマリクラスタに属さない場合(ステップS101のNO)、本フローチャートに示された処理は終了する。
 ステップS102では、各ノードの使用情報が取得される。使用情報取得部22は、クラスタ3の構成ノード(自ノードと通信可能な他ノードと自ノード)夫々の使用情報を取得する。本実施形態では、各ノードにおいて、全ノード(ノードA、B、C、D)についての一定期間のトランザクション数(合計値)が取得される。また、使用情報取得部22は、取得された自ノードのトランザクション数(ノードAは「400」、ノードBは「300」、ノードCは「100」、ノードDは「200」)で、管理情報テーブルの「Txカウント」の情報を更新する(図3参照)。その後、処理はステップS103へ進む。
 ステップS103では、各ノードの使用情報が調整される。評価値算出部24は、ステップS102で取得された各ノードのトランザクション数に対してスケーリングを行うことにより、各ノードについての調整されたトランザクション数(調整値)を算出する。その後、処理はステップS104へ進む。
 ステップS104では、他の調整値と比べて極めて大きい調整値が存在するか判定される。評価値算出部24は、ステップS103で算出された各ノードの調整値の中に、他の調整値と比べて極めて大きい調整値(極大調整値)が含まれるかを判定する。極大調整値が存在する場合(ステップS104のYES)、処理はステップS105へ進む。一方、極大調整値が存在しない場合(ステップS104のNO)、処理はステップS106へ進む。なお、本実施形態では、プライマリクラスタの構成ノード数が3(所定の数)以上である場合にのみ、ステップS105の処理を行うため、プライマリクラスタの構成ノード数が3(所定の数)以上でない場合は、極大調整値が存在する場合であっても、ステップS106へ進む。
 ステップS105では、該当するノードの調整値が、他ノードの調整値の総和Sより小さい値で更新される。評価値算出部24は、ステップS104において極大調整値と判定された調整値に係るノードの調整値を、他ノードの調整値の総和Sより小さい値(例えば、Sより1小さい値)に更新する。その後、処理はステップS106へ進む。
 ステップS106では、各ノードの調整値が評価値として決定(更新)される。評価値算出部24は、ステップS104において極大調整値でないと判定された調整値に係るノードの評価値を、ステップS103で算出された調整値と決定する。また、評価値算出部24は、ステップS104において極大調整値であると判定された調整値に係るノードの評価値を、ステップS105で更新された調整値と決定する。但し、プライマリクラスタの構成ノード数が3以上でない場合、極大調整値である調整値に係るノードの評価値は、ステップS103で算出された調整値と決定する。また、評価値算出部24は、決定した各ノードの調整値により、プライマリクラスタを構成するノードの評価値の総和を算出する。そして、評価値算出部24は、決定された自ノードの評価値(ノードAは「255」、ノードBは「191」、ノードCは「63」、ノードDは「127」)及びプライマリクラスタの構成ノードの評価値の総和「636」で、管理情報テーブルの「評価値」及び「評価値合計」の情報を夫々更新する(図3参照)。その後、本フローチャートに示された処理は終了する。
 なお、本実施形態では、ステップS101において自ノードがプライマリクラスタに属さない場合には、後述する処理が実行されないようにすることで、プライマリクラスタに属さないノードが誤ってプライマリクラスタに設定されてしまう事態を回避することが可能である。しかし、このような事態を回避する方法は上述した例に限定されるものではない。例えば、自ノードがプライマリクラスタに属さない場合も、自ノードと通信可能なノードの使用情報を取得する一方、取得した使用情報に基づき、評価値を決定、更新することを禁止するようにしてもよい。また、自ノードがプライマリクラスタに属さない場合も、自ノードと通信可能なノードの使用情報を取得し、取得した使用情報に基づき、評価値を決定、更新する一方、図10に示したグループ決定処理を禁止するようにしてもよい。
 図10は、本実施形態に係るグループ決定処理(障害発生時フロー)の流れの概要を示すフローチャートである。本フローチャートに示された処理は、各ノード1において実行される処理であり、クラスタシステム9内で障害が発生したことを障害検知部27により検知されたこと等を契機として実行される。なお、障害発生に限定されず、上述の通り、メンテナンスの通知を受けたこと等を契機として実行されてもよい。
 ステップS201では、自ノードと通信不能なノードが自グループから取り除かれる。障害検知部27は、障害を検知すると、自ノードと通信が途絶えたノードを自グループから取り除く。上述した具体例1では、ノードA、B夫々において自グループの構成ノードがノードA、Bに、ノードC、D夫々において自グループの構成ノードがノードC、Dとなり、各ノードにおける障害検知部27は、管理情報テーブルの「クラスタノード」の情報を更新する(図6参照)。その後、処理はステップS202へ進む。
 ステップS202では、自グループの評価値の総和が算出される。決定部26は、ステップS201で通信不能なノードが排除され、自グループを構成するノードが更新されると、更新された自グループの構成ノードの評価値(障害発生前に最後に算出(更新)された評価値)の総和を算出する。具体例1では、ノードA、Bでは総和「446」が、ノードC、Dでは総和「190」が夫々算出される。その後、処理はステップS203へ進む。
 ステップS203では、自グループの評価値の総和が、元のプライマリクラスタの評価値の総和の半数を超えるかが判定される。決定部26は、ステップS202で算出された自グループの評価値の総和が、元のプライマリクラスタ(平時のクラスタ3)の構成ノード(ノードA、B、C、D)の評価値の総和「636」の半数「318」を超えるかを判定する。総和の半数を超える場合(ステップS203のYES)、処理はステップS204へ進む。一方、総和の半数を超えない場合(ステップS203のNO)、処理はステップS205へ進む。なお、ステップS203において、現在自ノードがプライマリクラスタに属するかについて併せて判定するようにしてもよい。この場合、ステップS203では、両者の条件(プライマリクラスタであること、総和の半数を超えること)を満たすかが判定される。
 ステップS204では、自グループが、クラスタを再構成するグループと決定される。具体例1の場合、ノードA、B夫々の決定部26は、自グループを、クラスタ3を再構成するグループに決定する。その後、処理はステップS206へ進む。
 ステップS205では、自グループが、クラスタを再構成しないグループと決定される。具体例1の場合、ノードC、D夫々の決定部26は、自グループを、クラスタ3を再構成しないグループに決定する。その後、処理はステップS207へ進む。
 ステップS206では、自グループがプライマリクラスタに設定される。具体例1の場合、ノードA、B夫々の設定部28は、自グループをプライマリクラスタとして設定し、サービス提供部29に、データベースのサービスを開始(継続)させる。そして、ノードA、B夫々の評価値算出部24は、新たなプライマリクラスタの構成ノードの評価値の総和を算出する。これより、ノードA、B夫々において、設定部28により管理情報テーブル内の「状態」の情報が、評価値算出部24により「評価値合計」の情報が更新される(図6参照)。その後、本フローチャートに示された処理は終了する。
 ステップS207では、自グループがノンプライマリクラスタに設定される。具体例1の場合、ノードC、D夫々の設定部28は、自グループをノンプライマリクラスタとして設定し、サービス提供部29に、データベースのサービスの提供を停止させる。これより、ノードC、D夫々において、設定部28により管理情報テーブル内の「状態」の情報が更新される(図6参照)。その後、本フローチャートに示された処理は終了する。
 本実施形態では、図9の平時フローのステップS101において自ノードがノンプライマリクラスタに属すると判定された場合は、ステップS101に後続する処理は実行されない。よって、図10のステップS205でクラスタ3を再構成しないグループと決定されたグループ(ノードC、D)では、ノンプライマリクラスタに属して以降、再度プライマリクラスタに属するまでは、使用情報取得処理及び評価値算出処理(図9のステップS102~ステップS106)は実行されない。ノンプライマリクラスタに属しているにも関わらずノードC、Dにおいてこれらの処理が実行されてしまうと、ステップS103においてノードC、Dの少なくともどちらかの評価値が、設定可能な評価値の最大値に設定されてしまう。そのため、ステップS203において元のプライマリクラスタ(自ノードが最後に属していたプライマリクラスタ)の総和636の半数を超える可能性がある。その場合、ノンプライマリクラスタに属するにもかかわらず、誤ってプライマリクラスタに設定されてしまう事態が発生する。よって、本実施形態では、このような事態を回避するため、ステップS101において自ノードがノンプライマリクラスタに属するか否かを判定する。
 なお、図10のステップS206において新たなプライマリクラスタに設定されたグループ(ノードA、Bからなるグループ1)内において新たな障害が発生し、当該グループが複数のグループに分割された場合は、図10に示されたフローを実行することにより、当該複数のグループの中から、新たなプライマリクラスタ(グループ1)を再構成するグループを決定することが可能である。つまり、本実施形態では、図1に示されたクラスタ3が分割された場合の例を示すが、障害発生後に新たなプライマリクラスタとなったグループ1に対しても、クラスタ3と同様に、本実施形態で説明した決定処理を適用することが可能である。
 図11は、本実施形態に係る同期処理(障害復旧時フロー)の流れの概要を示すフローチャートである。本フローチャートに示された処理は、各ノード1において実行される処理であり、クラスタシステム9内の障害が復旧したことを障害検知部27により検知されたこと等を契機として実行される。なお、自ノードが再度クラスタに参加可能な状態になれば、本フローチャートに示された処理が実行されてよいため、処理の契機は、障害復旧の検知に限定されない。
 ステップS301では、自グループが、クラスタ3を再構成しないグループとして決定されたグループであるか、つまり、現在自グループがノンプライマリクラスタであるかが判定される。具体例1の場合、ノードC、Dからなるグループ2は、クラスタ3を再構成しないグループと決定されているため、ノードC、D夫々において自グループ(グループ2)の状態はノンプライマリクラスタである。状態検知部25は、管理情報テーブル等を参照することで、現在自グループがノンプライマリクラスタであるかを判定する。自グループがノンプライマリクラスタである場合(ステップS301のYES)、処理はステップS302へ進み、クラスタ(プライマリクラスタ)に再度参加する処理が実行される。一方、自グループがノンプライマリクラスタでない場合(ステップS301のNO)、本フローチャートに示された処理は終了する。
 ステップS302では、自ノードのデータベースがプライマリクラスタのデータベースに同期される。具体例1の場合、ノードC、D夫々において、再接続部30がプライマリクラスタに属するノードA及びノードBとの接続を再度確立すると、同期部34は、自ノードのデータベースをプライマリクラスタに属する所定ノード(ノードA又はノードB)のデータベースに同期させる。具体的には、更新情報送受信部31により自ノードの最新のシーケンス番号がプライマリクラスタに属する所定ノードに送信され、当該所定ノードの更新データ特定部32により更新データが特定される。そして、同期部34は、当該所定ノードの更新データ送受信部33と自ノードの更新データ送受信部33との間で送受信された更新データを用いることで、同期を行う。その後、処理はステップS303へ進む。
 ステップS303では、自グループがプライマリクラスタに設定される。具体例1の場合、ノードC、D夫々において、設定部28は、自グループをプライマリクラスタとして設定し、サービス提供部29にデータベースのサービスを開始させる。これより、ノードC、Dは夫々、クラスタ3において提供されているデータベースのサービスを行う(クラスタ3として機能する)ノードとして、データベースのサービスを提供する。その後、本フローチャートに示された処理は終了する。
 上述の通り、本実施形態に係るクラスタシステムによれば、障害発生前に取得された、ノードの使用状況を示す情報に基づく評価値(重み)を用いて、自グループを、クラスタを再構成するグループとするかを決定するため、クラスタを再構成するグループを、ノードの使用状況に応じて適切に選択することが可能である。具体的には、平時のノードの使用状況に応じた評価値を設定することで、ネットワーク遮断等の障害が発生した際にも、最近のアクセス頻度が高いノードによって構成されるグループを新たなプライマリクラスタとして動作を継続させることが可能となる。つまり、利用可能なノード数だけでなく、アクセス頻度を同時に考慮することで、適切なグループを、クラスタを再構成するグループとして選択することが可能である。また、本実施形態に係るクラスタシステムによれば、ノードに対する重み設定を、ノードの使用状況に応じて自動的に行うこと(動的な重み付け)が可能である。
 従来のノード数による多数決投票では、ノード数による過半数という判断基準により、クラスタ3の構成ノード数が2である場合、ネットワーク遮断が発生するといずれのグループもノード数が1となり動作継続不可となるため、推奨される最小構成ノード数が3である他、2拠点に同数のノードを配置した場合などにノード数調整のための調停ノード(実際のデータを格納しないダミーノード)を設置するなど、導入先のネットワーク環境に合わせて、システムの構築・運用方法の設計を人が行うことが求められる。例えば、上述した具体例1の障害が発生した場合、従来の方法では、いずれのグループもノード数が2となることから元の総ノード数(4)の半数を超えないために、いずれのグループも動作継続不可となるため、調停ノードの設置等が必要とされる。
 しかし、本実施形態に係るクラスタシステムによれば、上述の通り、利用可能なノード数だけでなく、アクセス頻度等の使用状況を考慮して、クラスタを再構成するグループを決定することが可能であるため、上記のような状況であっても調停ノードを設置することなく、適切なグループを、クラスタを再構成するグループと決定し動作継続させることが可能となる。更に、クラスタを再構成するグループを決定するための一連の処理は、自動的に行うことが可能であるため、システム管理者が介在する必要がなく、複雑なシステムの構築・運用方法の設計を必要としない自律制御デバイスを提供することが可能となる。
 また、本実施形態に係るクラスタシステムによれば、平時にクラスタを構成する各ノードへのアクセス統計情報を収集しノード間で共有することにより、ネットワーク障害等が発生した後、各ノードにおいて速やかに、自グループを、クラスタを再構成するグループとするか否かを決定(判定)することが可能である。例えば、障害が発生した後に、どのグループを優先させるかを決定するための情報をノード間で送受信しなくとも、自グループを、クラスタを再構成するグループとするか否かを決定することが可能である。
 [第二の実施形態]
 次に、第二の実施形態を説明する。第二の実施形態では、上記第一の実施形態で説明した内容と重複する項目については、同一の符号を付して説明を省略するが、第一の実施形態で説明した内容と異なる内容については、以下で説明する。第二の実施形態では、障害等が発生した際に、クラスタ3を再構成しないグループと決定されたグループのノードにおいても、データベースのサービスを提供し、障害が復旧した際には、クラスタに再度参加する実施形態について説明する。
 <システムの構成>
 図12は、本実施形態に係るマルチマスタ構成のクラスタを備えるクラスタシステムの構成を示す概略図である。本実施形態に係るクラスタシステム9では、マルチマスタ構成のクラスタ3を構成する複数のノード1がネットワークを介して互いに通信可能に接続されている。本実施形態に係るクラスタシステム9では、拠点1にノードA、Bが配置され、拠点2にノードCが配置されている。なお、本実施形態に係るクラスタシステム9(ノード1、ユーザー端末8)の構成は、上述した第一の実施形態に係るクラスタシステム9の構成と、拠点2におけるノード数が異なること以外は同様であるため、詳細の説明を省略する。
 図13は、本実施形態に係るノードの機能構成の概略を示す図である。各ノード1は、記憶装置14に記録されているプログラムが、RAM13に読み出され、CPU11によって実行されて、ノード1に備えられた各ハードウェアが制御されることで、管理情報記憶部21、状態検知部25、決定部26、障害検知部27、設定部28、サービス提供部29、再接続部30、更新情報送受信部31、更新データ特定部32、更新データ送受信部33、同期部34、バックアップ部40、バックアップ制御部41及びリストア部42を備える装置として機能する。
 管理情報記憶部21は、自ノード及び自ノードが属するクラスタに関する管理情報を記憶する。本実施形態では、管理情報として、少なくとも、自グループがプライマリクラスタとノンプライマリクラスタの何れに属するか(自グループの状態)を示す情報を記憶する。そのため、第一の実施形態で示した管理情報テーブルを必ずしも備えなくてよい。また、管理情報記憶部21は、管理情報として、自ノードのデータベースのバックアップ機能の状態(有効又は無効)を記憶してよい。
 状態検知部25の詳細は、第一の実施形態で説明した内容と同様である。但し、本実施形態では、状態検知部25は、管理情報記憶部21により記憶されている管理情報(自グループの状態)を参照することで、現在の自ノードの状態を検知する。
 決定部26は、クラスタ3が複数のノードグループに分割されると、少なくとも自グループを、クラスタ3を再構成するグループとするか否かを決定する。なお、クラスタ3を再構成するグループを決定する方法には、第一の実施形態に示された方法や、その他の任意の方法が用いられてよい。また、本実施形態では、各ノードにおいて決定部26を備えるようにしたが、1つのノードのみが決定部26を備えることで各グループを、クラスタ3を再構成するグループとするか否かを決定するようにしてもよい。また、クラスタ3を再構成するグループを決定する装置は、クラスタ3を構成するノードに限定されず、クラスタシステム内外に設置された他の情報処理装置であってもよい。
 障害検知部27の詳細は、第一の実施形態で説明した内容と同様であるため説明を省略する。
 バックアップ部40は、自ノードのデータベースのバックアップを繰り返し行う。本実施形態では、バックアップ部40は、定期的(所定期間毎、例えば1日に1回)にバックアップを行う。また、本実施形態では、バックアップ部40は、フルバックアップを行うが、差分バックアップや増分バックアップを行うようにしてもよい。バックアップ部40は、バックアップを行うことにより、バックアップデータを取得し、取得されたバックアップデータを記憶装置14又はその他の記憶装置に記憶する。なお、バックアップ処理は、定期的ではなく、不定期に実行されてもよい。
 図14は、本実施形態に係るデータベースの状態(平時)の一例を示す図である。図14に示すように、平時では、プライマリクラスタに属する全ノード(ノードA、B、C)で同じ内容のテーブルを保持(共有)している。また、各ノードのバックアップ部40は、所定期間毎にバックアップを行い、その都度、図14に示したようにデータベースのバックアップデータを取得する。
 バックアップ制御部41は、バックアップ部40により行われる自ノードのデータベースに対するバックアップ処理を有効化又は無効化する制御を行う。バックアップ制御部41は、例えば、障害が発生したことで、自グループがプライマリクラスタからノンプライマリクラスタに状態遷移した場合、自ノードのデータベースのバックアップ処理を無効化する。つまり、バックアップ制御部41は、バックアップ部40によるバックアップ処理が行われないよう制御する。また、バックアップ制御部41は、例えば障害が復旧し、自ノードの同期部34による同期が終了すると、自ノードのデータベースのバックアップ処理を有効化する。つまり、バックアップ制御部41は、バックアップ部40によるバックアップが開始されるよう制御する。
 設定部28の詳細は、第一の実施形態で説明した内容と同様である。但し、本実施形態では、自グループがクラスタ3を再構成しないグループである場合の処理が、第一の実施形態と異なる。具体的には、設定部28は、自グループがクラスタ3を再構成しないグループと決定された場合、管理情報に含まれる自グループの状態を「ノンプライマリクラスタ」に更新する一方、サービス提供部29に、自ノードのデータベースのサービスを開始(継続)させる。つまり、設定部28は、自グループがクラスタ3を再構成するグループに決定されなかった場合であっても、自ノードのデータベースのサービス提供が可能となるよう、データベースに対するReadリクエスト及び/又はWriteリクエストの受付が拒否されないよう設定する。なおこの設定は、予め行われるようにしてよい。
 サービス提供部29の詳細は、第一の実施形態で説明した内容と同様である。但し、上述したように、本実施形態では、クラスタ3が複数のノードグループに分割された際に、自グループがクラスタ3を再構成するグループに決定されなかった場合であっても、自ノードのデータベースのサービスを提供する。例えば、サービス提供部29は、自グループがクラスタ3を構成するグループに決定されなかった場合、クラスタ3とは異なるクラスタ(自グループ)において、自ノードのデータベースのサービス提供を行うことが可能である。なお、クラスタ3を再構成しないグループと決定されたグループの各ノードは、自グループ(自クラスタ)に属する他のノードと同期を行いながらサービスを提供してもよい(自クラスタにおいてはプライマリクラスタである)し、自グループの他のノードと同期を行うことなく、単独でサービスを提供するようにしてもよい。
 なお、自ノードがノンプライマリクラスタに属する場合に提供するサービスは、自ノードのデータベースに対する書き込みリクエスト及び/又は読み込みリクエストに対するサービスである。また、ノンプライマリクラスタに属する場合に書き込みリクエストを許可する場合は、一部の書き込み動作(例えば、利用者のID情報やアクセストークンの書き込み動作)のみを許可するようにしてもよい。
 図15は、本実施形態に係るデータベースの状態(障害発生後)の一例を示す図である。図15では、拠点1と拠点2を結ぶネットワーク経路に障害が発生し、拠点1と拠点2との間のネットワーク通信が不可となった場合を例示する。この場合、拠点1と拠点2の間で障害が発生したことにより、クラスタ3が、ノードA、Bからなるグループ(グループ5)と、ノードCからなるグループ(グループ6)に分割される。また、図15の例では、決定部26により、グループ5がクラスタ3を再構成するグループとして決定された場合を想定する。クラスタ3がグループ5とグループ6とに分割されると、夫々のグループにおいて、データベースのサービスが提供される。その結果、グループ5とグループ6とで別々の更新処理(書き込み処理)が行われ、図15に示すように、グループ5とグループ6とでは、データベース中の「Bob」の「Age(年齢)」が「46」と「44」とで異なっている。
 リストア部42は、バックアップデータを用いて自ノードのデータベースのリストアを行う。具体的には、リストア部42は、自ノードがノンプライマリクラスタに属するノードである場合に、障害が復旧すると(クラスタに再度参加可能な状態である場合)、バックアップが無効化される前に行われたバックアップにより得られたバックアップデータにより、自ノードのデータベースのリストアを行う。本実施形態では、バックアップが無効化される前に最後に行われたバックアップにより得られたバックアップデータを用いるが、状況に応じて、最後に行われたバックアップの1つ前に行われたバックアップにより得られたバックアップデータ等を用いてもよい。
 図16は、本実施形態に係るデータベースの状態(障害復旧時(リストア時))の一例を示す図である。図16には、障害が復旧した後、ノンプライマリクラスタに属するノードCにおいてリストアが行われた後のデータベースの状態が示されている。なお、図16の例では、バックアップが無効化される前に最後に取得されたバックアップデータを、図14に示されたバックアップデータとする。ノードCのリストア部42は、最後に取得されたバックアップデータ(図14、図16)を用いることで、自ノードのデータベースのリストアを行う。その結果、図16に示すように、ノードCのデータベース中の「Bob」の「Age(年齢)」が、「44」から「45」に更新される。このようにリストアが行われることで、障害発生後(クラスタ3が分割した後)にノードCで行われた変更内容、つまり、ノードCが属するグループがノンプリマリクラスタとなっていた間のノードC(ノードCが属するクラスタ)内での変更内容がロールバックされる。
 再接続部30の詳細は、第一の実施形態で説明した内容と同様であるため説明を省略する。
 更新情報送受信部31の詳細は、第一の実施形態で説明した内容と同様である。但し、本実施形態では、ノンプライマリクラスタに属するノードの更新情報送受信部31は、リストアが行われた自ノードのデータベースの更新状態を示す更新情報(最新のトランザクションのシーケンス番号)を、プライマリクラスタに属する所定ノードに送信する。つまり、更新情報送受信部31は、リストアが完了した自ノードのデータベースと、プライマリクラスタに属するノードのデータベースとの、書き込み処理に係るトランザクションの差分を要求する。
 図17は、本実施形態に係るデータベースの状態(障害復旧時(同期時))の一例を示す図である。図17は、ノードCにおいて、リストアを行った状態からノードA及びノードB(プライマリクラスタ)の状態との同期処理が行われた場合のデータベースの状態を例示する。ノンプライマリクラスタに属するノードCは、プライマリクラスタに属する所定ノード(ノードA又はノードB)に対して、自ノードのデータベースと当該所定ノードのデータベースとの差分データを要求する。例えば、図17に示すように、ノードCの更新情報送受信部31は、自ノードのデータベースの最新のトランザクション(書き込み処理に係るトランザクション)の更新情報(シーケンス番号「41」)を当該所定ノードに送信することで、差分データを要求する。
 更新データ特定部32の詳細は、第一の実施形態で説明した内容と同様である。図17の例では、ノンプライマリクラスタに属するノードCからの更新情報を受信した、プライマリクラスタに属する所定ノードにおいて、ノードCと当該所定ノードとの差分、即ち、ノードCに不足しているデータが特定される。本実施形態では、例えば、ノードAの更新データ特定部32は、ノードCから通知された最新のトランザクションのシーケンス番号と、ノードAの最新のトランザクションのシーケンス番号とを比較することで、両ノードのデータベースの差分を特定する。
 図17の例では、ノードA又はノードBにおいて、ノードCから通知されたノードCの最新のシーケンス番号「41」と、ノードA及びノードBの最新のシーケンス番号「42」とが比較される。そして、ノードCに送信される差分データ(トランザクション)の範囲が、シーケンス番号「41」に該当するトランザクションに後続するトランザクション、即ち、シーケンス番号「42」に該当するトランザクション「update table Age=46 where Name=“Bob”」と特定される。
 更新データ送受信部33の詳細は、第一の実施形態で説明した内容と同様である。図17の例では、ノードA又はノードBの更新データ送受信部33により差分データ(更新データ)がノードCに送信され、ノードCの更新データ送受信部33により、当該差分データが受信される。
 同期部34の詳細は、第一の実施形態で説明した内容と同様である。但し、本実施形態では、リストアが行われた自ノードのデータベースを、プライマリクラスタに属するノードのデータベースに同期させる。図17の例では、ノードCの同期部34は、自ノードの更新データ送受信部33により受信された差分データを用いて、自ノードのデータベースをプライマリクラスタに属するノードのデータベースに同期させる。具体的には、ノードCの同期部34は、受信した、シーケンス番号「42」に該当するトランザクションを自ノードのデータベースに適用する。その結果、図17に示すように、データベース中の「Bob」の「Age(年齢)」が、「45」から「46」に更新される。つまり、ノードCがノンプライマリクラスタに属していた間にプライマリクラスタ内で行われた変更による差分が、ノードCのデータベースに反映される。なお、受信された差分データに複数のトランザクションが含まれる場合は、最後に受信したトランザクションが適用されることで、データベースの同期が完了する。
 このように、本実施形態では、リストアを行った上で差分データを用いて自ノードのデータベースを同期するため、クラスタ3が分割された後にプライマリクラスタ内で行われたデータ変更に係る差分データのみを受信することで、クラスタ3全体のデータの整合性を図ることが可能である。そのため、ノンプライマリクラスタに属するノードが同期を行うめに他ノードから受信するデータの量は、フルデータと比較して少ないため、速やかにプライマリクラスタのノードのデータベースとの同期を行うことが可能となる。但し、同期の方法は上記の例に限定されるものではなく、例えば、障害発生後にプライマリクラスタ内で大幅な変更(更新)があった場合などは、プライマリクラスタに属するノードのデータベースのフルデータを更新データとして受信し、当該更新データにより同期を行うようにしてもよい。
 <処理の流れ>
 図18は、本実施形態に係るバックアップ処理(平時フロー)の流れの概要を示すフローチャートである。本フローチャートに示された処理は、各ノード1において実行される処理であり、例えば、自ノードがクラスタシステム9に参加したこと等を契機として開始され、所定期間が経過する毎に繰り返し実行される。なお、平時では、クラスタ3を構成する全ノード(ノードA、B、C、C)が互いに通信可能であり、各ノードがプライマリクラスタの構成ノードとしてサービスを提供している。
 ステップS401では、現在自ノードにおいて、バックアップ処理が有効であるかが判定される。バックアップ制御部41は、例えば、管理情報を参照することにより、自ノードのバックアップ機能が有効であるか又は無効であるかを判定する。有効である場合(ステップS401のYES)、処理はステップS402へ進む。一方、無効である場合(ステップS401のNO)、自ノードはノンプライマリクラスタに属する状態であるため、バックアップを行わないよう、本フローチャートに示された処理は終了する。
 ステップS402では、バックアップ処理が行われる。バックアップ部40は、自ノードのデータベースのバックアップ処理を実行する(図14参照)。その後、本フローチャートに示された処理は終了する。
 図19は、本実施形態に係るバックアップ無効化処理(障害発生時フロー)の流れの概要を示すフローチャートである。本フローチャートに示された処理は、各ノード1において実行される処理であり、クラスタシステム9内で障害が発生したことを障害検知部27により検知されたこと等を契機として実行される。なお、障害発生に限定されず、上述の通り、メンテナンスの通知を受けたこと等を契機として実行されてもよい。
 ステップS501では、自グループの状態がプライマリクラスタからノンプライマリクラスタに遷移したかが判定される。状態検知部25は、例えば、自グループが、クラスタ3を再構成しないグループと決定されたことでノンプライマリクラスタに設定されたことを検知することで、自グループが状態遷移したかを判定する。なお、状態検知部25は、管理情報記憶部21により記憶される管理情報を参照することで自グループの状態遷移を検知してもよい。ノンプライマリクラスタに遷移したと判定された場合(ステップS501のYES)、処理はステップS502へ進む。ノンプライマリクラスタに遷移していないと判定された場合(ステップS502のNO)、本フローチャートに示された処理は終了する。
 ステップS502では、バックアップ処理が無効化される。バックアップ制御部41は、自ノードのデータベースのバックアップ機能を無効化する。図15の例では、ネットワークスプリットによりノンプライマリクラスタに属したノードCにおいてバックアップ処理が無効化される。これにより、管理情報中のバックアップ機能の状態を示す情報は、「無効」を示す情報となる。なお、本実施形態では、自ノードがクラスタ3を再構成しないグループと決定された場合であっても、サービスの提供を継続するため、ステップS502においてバックアップ処理が無効化された後も引き続き、自ノードのサービスの提供が継続される。その後、本フローチャートに示された処理は終了する。
 図20は、本実施形態に係る同期処理(障害復旧時フロー)の流れの概要を示すフローチャートである。本フローチャートに示された処理は、各ノード1において実行される処理であり、クラスタシステム9内の障害が復旧したことを障害検知部27により検知されたこと等を契機として実行される。なお、自ノードが再度クラスタに参加可能な状態になれば、本フローチャートに示された処理が実行されてよいため、処理の契機は、障害復旧の検知に限定されない。
 ステップS601では、自グループが、クラスタ3を再構成しないグループとして決定されたグループであるか、つまり、現在自グループがノンプライマリクラスタであるかが判定される。状態検知部25は、管理情報等を参照することで、現在自グループがノンプライマリクラスタであるかを判定する。自グループがノンプライマリクラスタである場合(ステップS601のYES)、処理はステップS602へ進み、クラスタ(プライマリクラスタ)に再度参加する処理が実行される。一方、自グループがノンプライマリクラスタである場合(ステップS601のNO)、本フローチャートに示された処理は終了する。
 ステップS602では、最後に取得されたバックアップデータを用いたリストアが行われる。図16の例では、ノンプライマリクラスタに属するノードCのリストア部42は、最後に取得されたバックアップデータを用いることで、自ノードのデータベースのリストアを行う。そして、リストアが完了した後、ノードCの再接続部30は、ノードCとプライマリクラスタの各ノードとの接続を確立する。その後、処理はステップS603へ進む。
 ステップS603では、自ノードのデータベースがプライマリクラスタのデータベースに同期される。図17の例では、ノードCの更新情報送受信部31により、リストアが完了した時点でのノードCの最新のシーケンス番号がプライマリクラスタの所定ノードに送信され、当該所定ノードの更新データ特定部32により差分データが特定される。そして、ノードCの同期部34は、当該所定ノードの更新データ送受信部33とノードCの更新データ送受信部33との間で送受信された差分データを用いることで、ノードCのデータベースをプライマリクラスタのデータベースに同期させる。その後、処理はステップS604へ進む。
 ステップS604では、自グループがプライマリクラスタに設定される。図17の例では、ノードCの設定部28は、自グループをプライマリクラスタとして設定し、サービス提供部29に、データベースのサービスを開始させる。これより、ノードCは、クラスタ3において提供されているデータベースのサービスを行う(クラスタ3として機能する)ノードとして、データベースのサービスを提供する。その後、処理はステップS605へ進む。
 ステップS605では、バックアップ処理が有効化される。図17の例では、ノードCのバックアップ制御部41は、自ノードのデータベースがプライマリクラスタに属していたノードと同等の状態となったことから、自ノードのバックアップ機能を有効化する。これにより、管理情報中のバックアップ機能の状態を示す情報は、「有効」を示す情報となる。その後、本フローチャートに示された処理は終了する。
 なお、本実施形態では、ノンプライマリクラスタに属したノードにおいてもデータベースのサービスを提供する一方、障害復旧時には、当該ノードにおいてロールバックが行われるため、ノンプライマリクラスタに属していた間に当該ノードのデータベースに対して書き込まれた内容は破棄されることとなる。そのため、ノンプライマリクラスタに属したノードは、「データベースに対する書き込み動作を行ったとしても、障害復旧時にその内容が破棄される」旨の通知を、ユーザー端末8に行うようにしてもよい。
 上述の通り、本実施形態に係るクラスタシステムによれば、自グループがクラスタを再構成するグループに決定されなかった場合でもデータベースのサービスを提供し、障害が復旧すると、自ノードのデータベースをプライマリクラスタに属するノードのデータベースに同期させる。そのため、クラスタを再構成するグループに属さないノードにおいてもデータベースのサービスを提供しつつ、クラスタにおけるデータの整合性を図ることが可能となる。具体的には、クラスタを再構成しないグループに属するノードにおいて、データベースのバックアップ及びリストアを適切なタイミングで実施することにより、障害復旧時に当該ノード(ノンプライマリクラスタ)で行われた変更をロールバックし、その後、プライマリクラスタから必要なデータを同期することで、クラスタ全体のデータの整合性を図ることが可能となる。つまり、障害が発生した際に、本来はクラスタ3を再構成しないグループと判定されて動作継続不可となるノードを一旦延命した上で、障害が復旧した際にはクラスタ(プライマリクラスタ)へ再度参加することが可能となる。このように、本実施形態に係るクラスタシステムによれば、クラスタを適切に管理することが可能である。
 また、図15の例では、従来の多数決機構によりクラスタ3を再構成するグループを決定する場合、拠点1のノード数は2、拠点2のノード数は1となり、拠点1のノード数が元のプライマリクラスタ(クラスタ3)の総ノード数3の半数を超えるため、拠点1の各ノードはプライマリクラスタに属するノードとして動作を継続し、拠点2のノードはノンプライマリクラスタに属するノードであるため動作継続不可となる。しかし、データベースに対して行われるアクセスが概ね読み込み動作(Read動作)である場合等は、拠点2のように過半数を獲得できなかったグループのノードについても動作を継続できることが望ましい。対して、本実施形態に係るクラスタシステムによれば、クラスタ3を再構成しないグループと決定されたグループに属するノードにおいても、一時的な(書き込まれた内容は後に破棄される)データベースとして動作を継続させ、障害が復旧した後には速やかにクラスタ(プライマリクラスタ)に参加させることが可能となる。
 また、ノードにおいて、定期的にデータベースのバックアップを取得する場合、クラスタ内で不整合が生じているデータのバックアップを取得してしまうことは不適切であるが、本実施形態によれば、ノンプライマリクラスタに属する間はバックアップ処理を無効化するため、不適切なバックアップデータの取得を回避することが可能である。
 [第三の実施形態]
 次に、第三の実施形態を説明する。第三の実施形態では、上記第一の実施形態及び第二の実施形態で説明した内容と重複する項目については、同一の符号を付して説明を省略する。本実施形態では、第一の実施形態で例示されたクラスタシステムと、第二の実施形態で例示されたクラスタシステムとを組み合わせた実施態様について説明する。具体的には、第一の実施形態で例示された、平時に取得した各ノードの使用情報を用いることで、自グループを、クラスタを再構成するグループとするかを決定する処理が行われ、第二の実施形態で例示された、自グループが前記クラスタを再構成するグループと決定されなかった場合にもデータベースのサービスを提供し、障害が復旧すると、プライマリクラスタとの同期を行う処理が行われる実施態様を説明する。
 本実施形態に係るシステムの構成は、図1を参照して第一の実施形態で説明したシステム構成及び図12を参照して第二の実施形態で説明したシステム構成の何れの構成であってもよい。なお、システム構成の詳細は、第一の実施形態及び第二の実施形態で説明した詳細と同様であるため、その説明を省略する。以下、本実施形態に係る各ノード1の機能構成について説明する。
 図21は、本実施形態に係るノードの機能構成の概略を示す図である。ノード1は、記憶装置14に記録されているプログラムが、RAM13に読み出され、CPU11によって実行されて、ノード1に備えられた各ハードウェアが制御されることで、管理情報記憶部21、使用情報取得部22、使用情報送信部23、評価値算出部24、状態検知部25、決定部26、障害検知部27、設定部28、サービス提供部29、再接続部30、更新情報送受信部31、更新データ特定部32、更新データ送受信部33、同期部34、バックアップ部40、バックアップ制御部41及びリストア部42を備える装置として機能する。
 なお、上述した各機能部についての詳細は、第一の実施形態及び第二の実施形態で説明したものと同様であるため、その説明を省略する。例えば、管理情報記憶部21は、第一の実施形態及び第二の実施形態で示した情報を含む管理情報を記憶する。また、使用情報取得部22、使用情報送信部23、評価値算出部24、状態検知部25、決定部26、障害検知部27及び再接続部30の詳細は、第一の実施形態で説明したものと同様である。また、設定部28、サービス提供部29、更新情報送受信部31、更新データ特定部32、更新データ送受信部33、同期部34、バックアップ部40、バックアップ制御部41及びリストア部42は、第二の実施形態における説明と同様である。
 次に、本実施形態に係る処理の流れについて説明する。まず、本実施形態では、各ノード1において、平時に、評価値更新処理とバックアップ処理とが行われる。なお、評価値更新処理の流れの概要は、図9を参照して第一の実施形態で説明した評価値更新処理の流れ(ステップS101~ステップS106)の概要と同様であるため、処理の説明を省略する。また、バックアップ処理の流れの概要は、図18を参照して第二の実施形態で説明したバックアップ処理の流れ(ステップS401~ステップS402)の概要と同様であるため、処理の説明を省略する。
 そして、本実施形態では、障害発生が検知されると(クラスタ3が複数のグループに分割されると)、まずクラスタを再構成するグループを決定する処理が行われ、その後、バックアップ無効化処理が行われる。つまり、第一の実施形態に示された方法により、自グループを、クラスタ3を再構成するグループとするかが決定される。そして、自グループがクラスタ3を再構成するグループと決定されなかった場合は、第二の実施形態に示された方法により、データベースのサービスを提供(継続)し、障害復旧時には、リストア及び同期が行われる。なお、自グループを、クラスタ3を再構成するグループとするかを決定する処理の流れの概要は、図10を参照して第一の実施形態で説明した決定処理の流れ(ステップS201~ステップS207)の概要と同様であるため、処理の説明を省略する。また、バックアップ無効化処理の流れの概要は、図19を参照して第二の実施形態で説明したバックアップ無効化処理の流れ(ステップS501~ステップS502)の概要と同様であるため、処理の説明を省略する。
 そして、本実施形態では、障害が復旧すると(自ノードが再度クラスタに参加可能な状態であると)、リストア及び同期が行われる。なお、これらの処理の流れの概要は、図20を参照して第二の実施形態で説明した同期処理の流れ(ステップS601~ステップS605)の概要と同様であるため、処理の説明を省略する。
 以上より、平時に取得した各ノードの使用情報を用いることで、自ノードが属するグループを、クラスタを再構成するグループとするかを決定し、自グループが前記クラスタを再構成するグループと決定されなかった場合にもデータベースのサービスを提供しつつ、クラスタ内のデータの整合性を図ることが可能となる。
   1(1a、1b、1c、1d) ノード装置(ノード)
   3 クラスタ
   8 ユーザー端末
   9 クラスタシステム

 

Claims (15)

  1.  マルチマスタ構成のクラスタを構成する複数のノード装置のうちのノード装置であって、
     前記クラスタが複数のグループに分割された際に、自ノード装置を含む自グループが、前記クラスタを再構成するグループに決定されなかった場合であっても、自ノード装置のデータベースのサービスを提供するサービス提供手段と、
     前記自グループが前記クラスタを再構成するグループではなく、自ノード装置が前記クラスタに再度参加可能な状態である場合、自ノード装置のデータベースを、前記クラスタを再構成するグループに属する他のノード装置のデータベースに同期させる同期手段と、
     を備えるノード装置。
  2.  自ノード装置のデータベースのバックアップを繰り返し行うバックアップ手段と、
     前記クラスタが複数のグループに分割された際に、前記自グループが前記クラスタを再構成するグループに決定されなかった場合、前記バックアップを行う処理を無効化するバックアップ制御手段と、を更に備える、
     請求項1に記載のノード装置。
  3.  前記自グループが前記クラスタを再構成するグループでなく、自ノード装置が前記クラスタに再度参加可能な状態である場合、前記無効化の前に行われた前記バックアップにより得られたバックアップデータにより、自ノード装置のデータベースのリストアを行うリストア手段を更に備え、
     前記同期手段は、前記リストアが行われた後に、自ノード装置のデータベースを同期させる、
     請求項2に記載のノード装置。
  4.  前記無効化の前に行われた前記バックアップは、前記無効化の前に最後に行われた前記バックアップである、
     請求項3に記載のノード装置。
  5.  前記クラスタを再構成するグループに属する他のノード装置のデータベースに含まれるデータを受信する更新データ送受信手段を更に備え、
     前記同期手段は、受信された前記データを用いて、自ノード装置のデータベースを同期させる、
     請求項3又は4に記載のノード装置。
  6.  前記クラスタを再構成するグループに属する他のノード装置のデータベースに含まれるデータは、該他のノード装置のデータベースと、前記リストアが行われた自ノード装置のデータベースとの差分データである、
     請求項5に記載のノード装置。
  7.  前記クラスタを再構成するグループに属する他のノード装置のデータベースに含まれるデータは、該他のノード装置のデータベースのフルデータである、
     請求項5に記載のノード装置。
  8.  前記バックアップ制御手段は、前記同期が終了すると、前記バックアップを行う処理を有効化する、
     請求項2~7の何れか一項に記載のノード装置。
  9.  前記バックアップ手段は、所定期間毎に前記バックアップを行う、
     請求項2~8の何れか一項に記載のノード装置。
  10.  前記データベースのサービスは、該データベースに対する書き込みリクエスト及び/又は読み込みリクエストに対するサービスである、
     請求項1~9の何れか一項に記載のノード装置。
  11.  前記自グループは、自ノード装置と通信可能なノード装置と、自ノード装置とで構成されるグループである、
     請求項1~10の何れか一項に記載のノード装置。
  12.  夫々が前記複数のノード装置夫々についての使用状況を示す、該複数のノード装置の使用情報を繰り返し取得する使用情報取得手段と、
     前記クラスタが複数のグループに分割されると、該クラスタが分割される前に取得された前記複数のノード装置の使用情報に夫々対応する、前記複数のノード装置の評価値を用いることで、自ノード装置を含む自グループを、前記クラスタを再構成するグループとするかを決定する決定手段と、を更に備え、
     前記サービス提供手段は、前記複数のノード装置の評価値を用いることで前記自グループが前記クラスタを再構成するグループに決定されなかった場合であっても、自ノード装置のデータベースのサービスを提供する、
     請求項1~11の何れか一項に記載のノード装置。
  13.  マルチマスタ構成のクラスタを構成する複数のノード装置のうちのノード装置が、
     前記クラスタが複数のグループに分割された際に、自ノード装置を含む自グループが、前記クラスタを再構成するグループに決定されなかった場合であっても、自ノード装置のデータベースのサービスを提供するステップと、
     前記自グループが前記クラスタを再構成するグループではなく、自ノード装置が前記クラスタに再度参加可能な状態である場合、自ノード装置のデータベースを、前記クラスタを再構成するグループに属する他のノード装置のデータベースに同期させるステップと、を実行する、
     クラスタ管理方法。
  14.  マルチマスタ構成の第一のクラスタを構成する複数のノード装置のうちのノード装置を、
     前記クラスタが複数のグループに分割された際に、自ノード装置を含む自グループが、前記クラスタを再構成するグループに決定されなかった場合であっても、自ノード装置のデータベースのサービスを提供するサービス提供手段と、
     前記自グループが前記クラスタを再構成するグループではなく、自ノード装置が前記クラスタに再度参加可能な状態である場合、自ノード装置のデータベースを、前記クラスタを再構成するグループに属する他のノード装置のデータベースに同期させるとして機能させる、
     プログラム。
  15.  複数のノード装置で構成されるマルチマスタ構成の第一のクラスタを備えるクラスタシステムであって、
     前記複数のノード装置は、夫々、
     前記クラスタが複数のグループに分割された際に、自ノード装置を含む自グループが、前記クラスタを再構成するグループに決定されなかった場合であっても、自ノード装置のデータベースのサービスを提供するサービス提供手段と、
     前記自グループが前記クラスタを再構成するグループではなく、自ノード装置が前記クラスタに再度参加可能な状態である場合、自ノード装置のデータベースを、前記クラスタを再構成するグループに属する他のノード装置のデータベースに同期させる同期手段と、
     を備えるクラスタシステム。
PCT/JP2022/004715 2022-02-07 2022-02-07 ノード装置、クラスタ管理方法、プログラム及びクラスタシステム WO2023148977A1 (ja)

Priority Applications (1)

Application Number Priority Date Filing Date Title
PCT/JP2022/004715 WO2023148977A1 (ja) 2022-02-07 2022-02-07 ノード装置、クラスタ管理方法、プログラム及びクラスタシステム

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/JP2022/004715 WO2023148977A1 (ja) 2022-02-07 2022-02-07 ノード装置、クラスタ管理方法、プログラム及びクラスタシステム

Publications (1)

Publication Number Publication Date
WO2023148977A1 true WO2023148977A1 (ja) 2023-08-10

Family

ID=87553284

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2022/004715 WO2023148977A1 (ja) 2022-02-07 2022-02-07 ノード装置、クラスタ管理方法、プログラム及びクラスタシステム

Country Status (1)

Country Link
WO (1) WO2023148977A1 (ja)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2004342079A (ja) * 2003-02-13 2004-12-02 Internatl Business Mach Corp <Ibm> コンピュータ・クラスタを操作するための方法
JP2010186472A (ja) * 2009-02-12 2010-08-26 Nhn Corp スプリットブレイン状況におけるメジャーグループを決定するための方法、システム、及びコンピュータ読み取り可能な記録媒体
JP2012173996A (ja) * 2011-02-22 2012-09-10 Nec Corp クラスタシステム、クラスタ管理方法、およびクラスタ管理プログラム

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2004342079A (ja) * 2003-02-13 2004-12-02 Internatl Business Mach Corp <Ibm> コンピュータ・クラスタを操作するための方法
JP2010186472A (ja) * 2009-02-12 2010-08-26 Nhn Corp スプリットブレイン状況におけるメジャーグループを決定するための方法、システム、及びコンピュータ読み取り可能な記録媒体
JP2012173996A (ja) * 2011-02-22 2012-09-10 Nec Corp クラスタシステム、クラスタ管理方法、およびクラスタ管理プログラム

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
NTOREG: "Why do you need 3 nodes in your cluster?", QIITA.COM, 1 December 2016 (2016-12-01), JP, XP009548398, Retrieved from the Internet <URL:https://qiita.com/ntoreg/items/ec6f1eca87ba5c5c0399> *

Similar Documents

Publication Publication Date Title
CA2853465C (en) Split brain resistant failover in high availability clusters
CN106341454B (zh) 跨机房多活分布式数据库管理系统和方法
US9916113B2 (en) System and method for mirroring data
US9983957B2 (en) Failover mechanism in a distributed computing system
EP3694148A1 (en) Configuration modification method for storage cluster, storage cluster and computer system
US7437598B2 (en) System, method and circuit for mirroring data
US5129080A (en) Method and system increasing the operational availability of a system of computer programs operating in a distributed system of computers
CN101136728A (zh) 群集系统和用于备份群集系统中的副本的方法
JP2019219954A (ja) クラスタストレージシステム、データ管理制御方法、データ管理制御プログラム
EP1316885A2 (en) Remote mirroring with sequence consistency
EP3319258B1 (en) Service take-over method and storage device, and service take-over apparatus
US7797571B2 (en) System, method and circuit for mirroring data
JP2012173996A (ja) クラスタシステム、クラスタ管理方法、およびクラスタ管理プログラム
CN110209526A (zh) 一种存储层同步系统、及存储介质
WO2021115043A1 (zh) 分布式数据库系统和数据灾备演练方法
CN110377487A (zh) 一种处理高可用集群脑裂的方法及装置
CN114020279A (zh) 应用软件分布式部署方法、系统、终端及存储介质
WO2023148977A1 (ja) ノード装置、クラスタ管理方法、プログラム及びクラスタシステム
WO2023148976A1 (ja) ノード装置、クラスタ再構成方法、プログラム及びクラスタシステム
CN112231399A (zh) 一种应用于图数据库的方法和装置
WO2023151443A1 (zh) 同步主备数据库
JP2009151677A (ja) ストレージ制御装置、ストレージ制御プログラムおよびストレージ制御方法
US20230019241A1 (en) Selecting surviving storage node based on environmental conditions
CN114706714A (zh) 一种同步计算机内存分割快照的方法
KR20100061983A (ko) 실시간 복제 환경의 데이터베이스 운용 관리 방법 및 시스템

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: 22924886

Country of ref document: EP

Kind code of ref document: A1