Data storage method and server applicable to distributed server cluster
AssigneeBeijing Baidu Netcom Science Technology Co., Ltd.
InventorTianyu Wang
Life of this patent
Estimating the term…
Abstract
Data may be stored in a distributed server cluster which includes a plurality of nodes. A specific implementation of a method for storing data in the distributed server cluster comprises: receiving a data write request, the data write request comprising to-be-written data; broadcasting the data write request to each of groups in the server cluster, the each of the groups comprising at least one node, and at least one of the groups comprising at least two nodes; and sending a notification message of successful writing to a client sending the data write request, in response to receiving a confirmation message fed back from more than a half of the groups.
Claims8
A data storage method applicable to a distributed server cluster, the distributed server cluster comprising a plurality of nodes, including a master node and a plurality of slave nodes, and the method comprising:
- forming a plurality of groups according to a deployed physical location of each of the plurality of nodes that are included in the distributed server cluster such that nodes of the plurality of nodes deployed in a same physical location belong to a same group, wherein the plurality of groups comprises a first group comprising at least said master node, a plurality of second groups each comprising at least two slave nodes but not comprising said master node, and a third group comprising at least one slave node but not comprising said master node;
- receiving, by the master node in the distributed server cluster, a data write request, the data write request comprising to-be-written data;
- broadcasting, by the master node, the data write request to each of the plurality of groups in the distributed server cluster;
- and
- sending, by the master node, a notification message of successful writing to a client sending the data write request, in response to receiving confirmation messages of successfully writing the to-be-written data in memory fed back from more than a half of the plurality of groups;
- wherein, for the first group comprising the master node, the group feeds back the confirmation message to the master node in response to the master node writing the to-be-written data to a memory successfully;
- wherein, each of the plurality of second groups not comprising said master node and the third group not comprising said master node feeds back the confirmation message to the master node in response to at least one node in respective group writing the to-be-written data to a memory successfully.
A data storage server applicable to a distributed server cluster comprising a plurality of nodes, including a master node and a plurality of slave nodes, comprising:
- at least one processor;
- and
- a memory storing instructions, which when executed by the at least one processor, cause the at least one processor to perform operations, the operations comprising:
- forming a plurality of groups according to a deployed physical location of each of the plurality of nodes that are included in the distributed server cluster such that nodes of the plurality of nodes deployed in a same physical location belong to a same group, wherein the plurality of groups comprises a first group comprising at least said master node, a plurality of second groups each comprising at least two slave nodes but not comprising said master node, and a third group comprising at least one slave node but not comprising said master node;
- receiving a data write request, the data write request comprising to-be-written data;
- broadcasting the data write request to each of the plurality of groups in the distributed server cluster;
- and
- sending a notification message of successful writing to a client sending the data write request, in response to receiving confirmation messages of successfully writing the to-be-written data in memory fed back from more than a half of the plurality of groups;
- wherein, for the first group comprising the master node, the group feeds back the confirmation message to the master node in response to the master node writing the to-be-written data to a memory successfully;
- wherein, each of the plurality of second groups not comprising said master node and the third group not comprising a master node in the distributed server cluster feeds back the confirmation message to the master node in response to at least one node in respective group writing the to-be-written data to a memory successfully.
A non-transitory computer-readable storage medium, storing a computer program thereon, wherein the program, when executed by a processor, causes the processor to perform operations, the operations comprising:
- forming a plurality of groups according to a deployed physical location of each of a plurality of nodes including a master node and a plurality of slave nodes that are included in a distributed server cluster such that nodes of the plurality of nodes deployed in a same physical location belong to a same group, wherein the plurality of groups comprises a first group comprising at least said master node, a plurality of second groups each comprising at least two of the plurality of slave nodes but not comprising said master node, and a third group comprising at least one of the plurality of slave nodes but not comprising said master node;
- receiving, by the master node in the distributed server cluster, a data write request, the data write request comprising to-be-written data;
- broadcasting, by the master node, the data write request to each of the plurality of groups in the distributed server cluster;
- and
- sending, by the master node, a notification message of successful writing to a client sending the data write request, in response to receiving confirmation messages of successfully writing the to-b-written data in memory fed back from more than a half of the plurality of groups;
- wherein, for the first group comprising the master node, the group feeds back the confirmation message to the master node in response to the master node writing the to-be-written data to a memory successfully;
- wherein, each of the plurality of second groups not comprising said master node and the third group not comprising said master node feeds back the confirmation message to the master node in response to at least one node in respective group writing the to-be-written data to a memory successfully.
Dependencies are inferred from the claim text.