CN112492030B - Data storage method, device, computer equipment and storage medium - Google Patents

Data storage method, device, computer equipment and storage medium Download PDF

Info

Publication number
CN112492030B
CN112492030B CN202011364752.8A CN202011364752A CN112492030B CN 112492030 B CN112492030 B CN 112492030B CN 202011364752 A CN202011364752 A CN 202011364752A CN 112492030 B CN112492030 B CN 112492030B
Authority
CN
China
Prior art keywords
node
data storage
node group
access control
group
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202011364752.8A
Other languages
Chinese (zh)
Other versions
CN112492030A (en
Inventor
牛佳宁
王煜
祁远志
何龙
李素香
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Qingyun Science And Technology Co ltd
Original Assignee
Beijing Qingyun Science And Technology Co ltd
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 Beijing Qingyun Science And Technology Co ltd filed Critical Beijing Qingyun Science And Technology Co ltd
Priority to CN202011364752.8A priority Critical patent/CN112492030B/en
Publication of CN112492030A publication Critical patent/CN112492030A/en
Application granted granted Critical
Publication of CN112492030B publication Critical patent/CN112492030B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/50Address allocation
    • H04L61/5007Internet protocol [IP] addresses
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/25Integrating or interfacing systems involving database management systems
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1001Protocols in which an application is distributed across nodes in the network for accessing one among a plurality of replicated servers
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1097Protocols in which an application is distributed across nodes in the network for distributed storage of data in networks, e.g. transport arrangements for network file system [NFS], storage area networks [SAN] or network attached storage [NAS]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/146Markers for unambiguous identification of a particular session, e.g. session cookie or URL-encoding

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The embodiment of the invention discloses a data storage method, a data storage device, computer equipment and a storage medium. The method comprises the following steps: when the node is a master node of the node group, a target communication address of the node group is acquired; setting the target communication address as a node communication address of the node; and receiving a data storage request sent to the node group by the client based on the target communication address through a small computer system interface, and storing data according to the data storage request. By adopting the technical scheme, the embodiment of the invention can avoid the switching of the client in different nodes of the same node group, further avoid the situation that the data written by one node is mistakenly covered by the data written by other nodes in the same node group, and ensure the integrity of the data stored in the data storage system.

Description

Data storage method, device, computer equipment and storage medium
Technical Field
The present invention relates to the field of data storage technologies, and in particular, to a data storage method, apparatus, computer device, and storage medium.
Background
Currently, the most common external interface for interfacing clients in the storage area is the small computer system interface (Internet Small Computer System Interface, iSCSI). iSCSI utilizes TCP/IP protocol as a communication channel and iSCSI protocol to exchange SCIC commands. When the storage device is used as a storage server to interface with the iSCSI client, the storage device generally adopts a multi-path redundancy (Multipath) mode to realize redundancy on the link, so as to ensure high availability of storage.
The Multipath data storage mode has a plurality of active service terminals, and an initiator (initiator) of the client terminal switches input/output (I/O) paths between targets (targets) of the active service terminals, so that the two service terminals together complete data storage. However, in this data storage manner, when the initiator is switched from the first target to the second target, if the time for the first target to write the data to be stored to the disk is later than the time for the second target to write the data to be stored to the disk, the data written to the disk by the second target will be covered by the data written to the disk by the first target.
Disclosure of Invention
In view of this, the embodiments of the present invention provide a data storage method, apparatus, computer device, and storage medium, so as to avoid the situation that data written to a disk is erroneously covered.
In a first aspect, an embodiment of the present invention provides a data storage method, including:
when the node is a master node of the node group, a target communication address of the node group is acquired;
setting the target communication address as a node communication address of the node;
receiving a data storage request sent by a client to the node group based on the target communication address through a small computer system interface, and storing data according to the data storage request
In a second aspect, an embodiment of the present invention provides a data storage device, including:
the address acquisition module is used for acquiring a target communication address of the node group when the node group becomes a master node of the node group;
an address setting module, configured to set the target communication address as a node communication address of the node;
and the data storage module is used for receiving a data storage request sent by the client based on the target communication address to the node group through a small computer system interface and storing data according to the data storage request.
In a third aspect, an embodiment of the present invention provides a computer apparatus, including:
one or more processors;
a memory for storing one or more programs,
the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the data storage methods described in embodiments of the present invention.
In a fourth aspect, embodiments of the present invention further provide a computer readable storage medium having stored thereon a computer program, which when executed by a processor, implements a data storage method according to embodiments of the present invention.
In the above technical solution for storing data, when a node in a node group becomes a master node of the node group, a target communication address of the node group is obtained, the target communication address is set as a node communication address of the node group, a data storage request sent by a client based on the target communication address to the node group is received through a small computer system interface, and data is stored according to the data storage request. By adopting the technical scheme, each node group in the data storage system only provides data storage service to the outside through the master node in the node group, the slave node in the node group is invisible relative to the client, the client can be prevented from being switched in different nodes of the same node group, the situation that data written by one node are mistakenly covered by data written by other nodes in the same node group is avoided, and the integrity of the data stored in the data storage system is ensured.
Drawings
Other features, objects and advantages of the present invention will become more apparent upon reading of the detailed description of non-limiting embodiments, made with reference to the accompanying drawings in which:
fig. 1 is a flow chart of a data storage method according to a first embodiment of the present invention;
fig. 2 is a flow chart of a data storage method according to a second embodiment of the present invention;
FIG. 3 is a block diagram illustrating a data storage device according to a third embodiment of the present invention;
fig. 4 is a schematic structural diagram of a computer device according to a fourth embodiment of the present invention.
Detailed Description
The invention is described in further detail below with reference to the drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting thereof. It should be further noted that, for convenience of description, only some, but not all of the matters related to the present invention are shown in the accompanying drawings. Furthermore, embodiments of the invention and features of the embodiments may be combined with each other without conflict.
Example 1
The embodiment of the invention provides a data storage method. The method may be performed by a data storage device, wherein the device may be implemented in software and/or hardware, may be integrated in each data storage node of a data storage system, and typically may be integrated in each data storage node of a distributed data storage system. Fig. 1 is a flowchart of a data storage method according to an embodiment of the present invention. As shown in fig. 1, the data storage method provided in this embodiment includes:
s110, when the node is a master node of the node group, a target communication address of the node group is acquired.
The target communication address may be understood as a communication address provided externally by a node group to which a master node executing the data storage method provided in this embodiment belongs. The data storage system can be provided with a plurality of node groups, each node group comprises a master node and a slave node, each node group only provides one communication address (such as a virtual IP address) for the outside, and the master node adopts the communication address to provide data storage service for the outside. The data storage method provided in this embodiment may be executed by a master node in each node group, and when a certain master node executes the data storage method provided in this embodiment, the node group may be understood as a node group to which the master node belongs, and the target communication address may be understood as a communication address provided outside the node group to which the master node belongs, where the communication address may be stored in each node of the node group, or may be stored in a master node of the data storage system. In an embodiment, storage devices or storage volumes corresponding to different node groups in a data storage system may be the same or different; the storage volumes corresponding to different nodes in the same node group may be different, so that when a storage volume corresponding to a certain node fails, storage volumes corresponding to other nodes in the node group may be used to store data, thereby further improving the availability of the data storage system.
Specifically, after any node in the node group is designated or elected by a worker to be a master node in the node group, that is, after any node in the node group monitors that the node group itself is the master node of the node group, the target communication address of the node group can be obtained locally, or a communication address obtaining request is sent to a master node of the data storage system, and the master node of the data storage system receives the target communication address of the node group returned based on the communication address obtaining request.
In one implementation manner, the data storage method provided in this embodiment may further include: before becoming a master node of the node group, the method receives a heartbeat packet sent by an original master node in the node group, and initiates election to elect to obtain a current master node of the node group when the heartbeat packet sent by the original master node is not received within a preset time length.
The preset time length may be set by a worker according to needs, for example, when an original master node in the node group periodically sends a heartbeat packet to each slave node in the node group according to a preset certain period length, the preset time length may be set to 2 times or 3 times of the period length, and the embodiment is not limited to this.
In the above embodiment, when the original master node in the node group cannot normally provide the storage service, for example, when the original master node in the node group fails or has higher delay, the slave node in the node group may determine the current master node in the node group again by electing, and replace the original master node in the node group with the current master node to provide the storage service to the outside. At this time, illustratively, the original master node in the node group may periodically send heartbeat packets to each slave node in the node group; correspondingly, each slave node in the node group receives the heartbeat packet sent by the original master node, monitors whether the time interval from the current time to the time when the node receives the heartbeat packet sent by the original master node last time reaches the preset time length in real time, initiates election when the time interval reaches the preset time length, acquires a target communication address in the node group when the node is elected to be the master node of the node group, and sets the target communication address as the node communication address of the node to replace the original master node in the node group to provide data storage service to the outside.
In this embodiment, after a certain slave node in the node group is elected as the current master node of the node group, the current master node may also periodically send a heartbeat packet to the slave nodes in the node group, so that when the slave nodes in the node group cannot normally provide storage service at the current master node, the master node of the node group is reselected. At this time, preferably, the data storage method provided in this embodiment may further include: and periodically sending heartbeat packets to the slave nodes in the node group so that the slave nodes in the node group determine the node state of the node.
S120, setting the target communication address as the node communication address of the node.
The node communication address is understood to be the communication address of a data storage node in the data storage system.
Specifically, when the current master node in the node group becomes the master node of the node group, that is, when the identity of the current master node in the node group is switched from the slave node to the master node, the target communication address in the node group can be acquired, and the target communication address is set as the node communication address of the current master node, so that the subsequent receiving client sends a data storage request to the node group according to the target communication address of the node group, and the data storage request is processed.
S130, receiving a data storage request sent to the node group by the client based on the target communication address through a small computer system interface, and storing data according to the data storage request.
In this embodiment, each node in the data storage system may be provided with a small computer system interface (Internet Small Computer System Interface, iSCSI) and may communicate with clients or other nodes in the data storage system through iSCSI.
When the client needs to store data through a certain node group, the client sends a data storage request to the node group according to the target communication address of the node group under the SCSI protocol and the TCP/IP protocol; because the current master node in the node group sets the target communication address of the node group as the node communication address of the current master node, when the client sends a data storage request to the node group according to the target communication address, the current master node in the node group can receive the data storage request sent by the client through the iSCSI of the current master node and store the data requested to be stored by the data storage request. In addition, after the current master node finishes storing the data requested to be stored by the data storage request, storage response information can be further returned to the client, and the client is reminded of successful data storage through the storage response information, so that the client can continue to execute subsequent data storage operation.
It may be understood that when the storage devices or storage volumes corresponding to different nodes in the same node group are different, the current master node may further synchronize the data requested to be stored by the data storage request to each slave node in the node group to store after storing the data requested to be stored by the data storage request in the storage device or storage volume corresponding to the current master node, so as to ensure that after a certain slave node in the master node is elected to be a new master node, the data requested to be stored by the data storage request can be read or updated based on the request of the client, where preferably, the storing the data according to the data storage request includes: and storing the target data requested to be stored by the data storage request, and sending a data storage instruction to other nodes in the node group so as to instruct the other nodes in the node group to store the target data through the data storage instruction.
The present embodiment provides a method for storing credit data, in which a node in a node group obtains a target communication address of the node group when the node becomes a master node of the node group, sets the target communication address as a node communication address of the node group, receives a data storage request sent by a client to the node group based on the target communication address through a small computer system interface, and stores data according to the data storage request. By adopting the technical scheme, each node group in the data storage system only provides data storage service to the outside through the master node in the node group, the slave node in the node group is invisible relative to the client, the client can be prevented from being switched in different nodes of the same node group, the situation that data written by one node are mistakenly covered by data written by other nodes in the same node group is avoided, and the integrity of the data stored in the data storage system is ensured.
Example two
Fig. 2 is a flow chart of a data storage method according to a second embodiment of the present invention. The data storage method provided by the embodiment may further include: the control client disconnects the communication with the original master node in the node group.
Further, before the obtaining the target communication address of the node group, the method further includes: deleting the access control identifier of the node from the access control list, and adding the access control identifier for the original master node in the node group in the access control list, wherein the access control identifier is used for prohibiting the node corresponding to the access control identifier from establishing communication connection with the node in the non-node group.
Accordingly, as shown in fig. 2, the data storage method provided in this embodiment includes:
and S210, when the client is used as the master node of the node group, the control client is disconnected from communication with the original master node in the node group.
The original master node may be understood as a master node in the node group to which the node performing this step belongs before becoming the master node of the node group to which the node performs this step.
In this embodiment, after the slave node in the node group replaces the original master node in the node group and becomes the master node in the node group, the client can be controlled to disconnect from the original master node, so as to avoid the situation that the client continues to communicate with the original master node, and ensure that after the new master node is selected, the client does not continue to send a data storage request to the original master node in the node group. In addition, after the slave node in the node group replaces the original master node in the node group to become the master node in the node group, the node which is not in the node group in the data storage system can be further controlled to be disconnected with the original master node in the node group, so that the situation that the node which is not in the node group continues to send communication information to the original master node in the node group based on the established communication connection is avoided, and the situation is described as an example.
For example, after a slave node in the node group becomes a master node in the node group, a disconnection instruction may be sent to other nodes in the data storage system except the node in the node group and a client that establishes a communication connection with the original master node, and the disconnection instruction instructs the other nodes in the data storage system except the node in the node group and the client that establishes a communication connection with the original master node to disconnect the communication connection with the original master node; correspondingly, after receiving the disconnection instruction sent by the master node, the corresponding node in the data storage system and the client establishing communication connection with the original master node can disconnect the communication connection between the corresponding node and the original master node in the node group to which the master node sending the disconnection instruction belongs based on the disconnection instruction.
In addition, the data storage method provided in this embodiment may further include: and sending a first connection establishment request to the master nodes of other node groups in the data storage system to establish communication connection with the master nodes of the other node groups.
The first connection establishment request may be understood as a communication connection establishment request sent by a master node in the node group to other nodes outside the node group.
In this embodiment, after replacing the original master node in the node group to which it belongs with a new master node in the node group to which it belongs, a certain slave node in the node group may establish a communication connection with a master node in another node group in the data storage system, so as to communicate with the master nodes in the other node groups later. At this time, for example, after replacing the original master node in the node group to which the slave node in the node group belongs with the new master node in the node group to which the slave node in the node group belongs, a first connection establishment request may be sent to the master node in the other node groups in the data storage system based on the communication address externally provided by the other node groups in the data storage system; correspondingly, after receiving the first connection establishment request, the master node in the other node groups can query the access control list to determine whether the node sending the first connection establishment request has an access control identifier, and if so, the first connection establishment request is refused; if not, establishing communication connection with the master node which sends the first connection establishment request based on the first connection establishment request.
It can be understood that after replacing the original master node in the node group to which the slave node in the node group belongs to become a new master node in the node group to which the slave node belongs, it can also be determined whether the slave node has a requirement of communicating with other nodes in the data storage system except for the node in the slave node group, if so, a first connection establishment request is sent to the other nodes with the communication requirement so as to establish communication connection with the other nodes; if not, the first connection establishment request may not be sent to other nodes except the node in the data storage system until the request for communication with some other node is met or the second connection establishment request sent by some other node is received.
S220, deleting the access control identifier of the node from the access control list, and adding the access control identifier for the original master node in the node group in the access control list, wherein the access control identifier is used for prohibiting the node corresponding to the access control identifier from establishing communication connection with the node in the non-node group.
The access control identifier may be understood as an identifier for indicating whether a node can access, and when a certain node has the access control identifier, it indicates that the node is in a non-accessible state, that is, a communication connection cannot be established with the node; an access control list may be understood as a form for recording whether each node in the data storage system is provided with an access control identification, which may be stored in a database configured by the data storage system.
In this embodiment, after a certain slave node in the node group replaces an original master node in the node group to become a master node in the node group, the access control identifier of the node recorded in the access control list may be deleted, and the access control identifier is added in the control list for the original master node in the node group, so as to adjust the node to an accessible state, and adjust the original master node in the node group to an inaccessible state, so that a situation that the original master node in the node group actively establishes communication connection with other nodes except for the node in the node group in the data storage system after the original master node in the node group is restored to normal is avoided.
In one implementation manner, the data storage method provided in this embodiment may further include: when a second connection establishment request sent by a node in other node groups is received, inquiring the access control list to determine whether the node sending the connection establishment request is provided with an access control identifier or not; if the node sending the connection establishment request is provided with an access control identifier, rejecting the second connection establishment request; and if the node sending the connection establishment request is not provided with the access control identification, establishing communication connection with the node sending the connection establishment request based on the second connection establishment request.
The second connection establishment request may be understood as a communication connection establishment request received by a master node in the node group and sent by other nodes except the node in the node group.
In the above embodiment, when a node in the data storage system needs to establish communication connection with a master node in a certain node group of the data storage system, a second connection establishment request may be sent to the master node in the node group based on a communication address provided by the node group; correspondingly, when receiving a second connection establishment request sent by a node in a node group, a master node in the node group can judge whether the node sending the second connection establishment request is provided with an access control identifier or not based on an access control list, if so, the operation of establishing communication connection is not executed, and rejection response information can be further returned to the node; if not, a communication connection can be established with the node that sent the second connection establishment request based on the second connection establishment request.
S230, the target communication address of the node group is obtained.
S240, setting the target communication address as the node communication address of the node.
S250, receiving a data storage request sent to the node group by the client based on the target communication address through a small computer system interface, storing target data requested to be stored by the data storage request, and sending a data storage instruction to other nodes in the node group so as to instruct the other nodes in the node group to store the target data through the data storage instruction.
In one implementation manner, the data storage method provided in this embodiment may further include: when a data storage instruction sent by a target node in the node group is received, inquiring the access control list to determine whether the target node is provided with an access control identifier; if the target node is provided with an access control identifier, rejecting the data storage instruction; and if the target node is not provided with the access control identification, storing data based on the data storage instruction.
The data storage instruction may be understood as an instruction received by the node and sent by other nodes in the node group to instruct the node to store data; the target node may be understood as the node that sent the data storage instruction.
In the above embodiment, when any node in the node group receives a data storage instruction sent by another node in the node group, it may be determined whether the node sending the data storage instruction is provided with an access control identifier, if yes, no response is made to the data storage instruction, that is, no data storage operation based on the data storage instruction is performed; if not, based on the data storage instruction, the data indicated and stored by the data storage instruction is stored, so that when the original master node in the node group continuously indicates the node in the node group to store the data by sending the data storage instruction based on the data storage request which is received in the task queue but not yet executed, the data storage instruction sent by the original master node is ensured not to be executed, further the data storage request in the task queue of the original master node fails to be executed, and the situation that the original master node continuously executes the data storage request sent by the client after the new master node is selected is avoided. According to the data storage method provided by the embodiment, when the data storage method becomes the master node of the node group, the control client is disconnected from the original master node in the node group, the access control identification of the node is deleted from the access control list, the access control identification is added to the original master node in the node group in the access control list, the node can be adjusted to be in an accessible state, the original master node in the node group can be also adjusted to be in an inaccessible state, the original master node in the node group is controlled to stop executing the data storage task which is not executed, the probability that the original master node in the node group is accessed by mistake is further reduced, and the integrity of data stored in the data storage system is further improved.
Example III
The third embodiment of the invention provides a data storage device. The apparatus may be implemented in software and/or hardware, may be integrated in each data storage node of a data storage system, typically may be integrated in each data storage node of a distributed data storage system, and may store data by performing a data storage method. Fig. 3 is a block diagram of a data storage device according to a third embodiment of the present invention. As shown in fig. 3, the data storage device provided in this embodiment may include: an address acquisition module 301, an address setting module 302, and a data storage module 303, wherein,
an address obtaining module 301, configured to obtain a target communication address of the node group when the node group is a master node of the node group;
an address setting module 302, configured to set the target communication address as a node communication address of the node;
and the data storage module 303 is configured to receive, through a small computer system interface, a data storage request sent by the client to the node group based on the target communication address, and store data according to the data storage request.
The present embodiment provides a credit data storage device, when a node in a node group becomes a master node of the node group, a target communication address of the node group is acquired through an address acquisition module, the target communication address is set to be a node communication address of the node through an address setting module, a data storage request sent by a client to the node group based on the target communication address is received through a small computer system interface through a data storage module, and data is stored according to the data storage request. By adopting the technical scheme, each node group in the data storage system only provides data storage service to the outside through the master node in the node group, the slave node in the node group is invisible relative to the client, the client can be prevented from being switched in different nodes of the same node group, the situation that data written by one node are mistakenly covered by data written by other nodes in the same node group is avoided, and the integrity of the data stored in the data storage system is ensured.
Further, the data storage device provided in this embodiment may further include: and the connection disconnection module is used for controlling the client to disconnect communication connection with the original main node in the node group.
Further, the data storage device provided in this embodiment may further include: the device comprises an identifier deleting module, a node group management module and a node group management module, wherein the identifier deleting module is used for deleting the access control identifier of the node from an access control list before the target communication address of the node group is acquired, and adding the access control identifier for an original main node in the node group in the access control list, wherein the access control identifier is used for prohibiting the node corresponding to the access control identifier from establishing communication connection with the node in the non-node group.
In the above solution, the data storage module 303 may be configured to: and receiving a data storage request sent to the node group by the client based on the target communication address through a small computer system interface, storing target data requested to be stored by the data storage request, and sending a data storage instruction to other nodes in the node group so as to instruct the other nodes in the node group to store the target data through the data storage instruction.
Further, the data storage device provided in this embodiment may further include: the instruction processing module is used for inquiring the access control list when receiving a data storage instruction sent by a target node in the node group so as to determine whether the target node is provided with an access control identifier; if the target node is provided with an access control identifier, rejecting the data storage instruction; and if the target node is not provided with the access control identification, storing data based on the data storage instruction.
Further, the data storage device provided in this embodiment may further include: and the election module is used for receiving the heartbeat packet sent by the original master node in the node group before becoming the master node of the node group, and initiating election to elect to obtain the current master node of the node group when the heartbeat packet sent by the original master node is not received within the preset time length.
Further, the data storage device provided in this embodiment may further include: and the heartbeat packet sending module is used for periodically sending heartbeat packets to the slave nodes in the node group so as to enable the slave nodes in the node group to determine the node state of the node.
The data storage device provided by the third embodiment of the invention can execute the data storage method provided by any embodiment of the invention, and has the corresponding functional modules and beneficial effects of executing the data storage method. Technical details not described in detail in this embodiment may be referred to the data storage method provided in any embodiment of the present invention.
Example IV
Fig. 4 is a schematic structural diagram of a computer device according to a fourth embodiment of the present invention, where, as shown in fig. 4, the computer device includes a processor 40 and a memory 41, and may further include an input device 42 and an output device 43; the number of processors 40 in the computer device may be one or more, one processor 40 being taken as an example in fig. 4; the processor 40, the memory 41, the input means 42 and the output means 43 in the computer device may be connected by a bus or by other means, in fig. 4 by way of example.
The memory 41 is a computer-readable storage medium that can be used to store software programs, computer-executable programs, and modules, such as program instructions/modules (e.g., an address acquisition module 301, an address setting module 302, and a data storage module 303 in a data storage device) corresponding to a data storage method in an embodiment of the present invention. The processor 40 executes various functional applications of the computer device and data processing, i.e., implements the data storage method described above, by running software programs, instructions and modules stored in the memory 41.
The memory 41 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, at least one application program required for functions; the storage data area may store data created according to the use of the terminal, etc. In addition, memory 41 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid-state storage device. In some examples, memory 41 may further comprise memory located remotely from processor 40, which may be connected to the computer device via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The input means 42 may be used to receive entered numeric or character information and to generate key signal inputs related to user settings and function control of the computer device. The output means 43 may comprise a display device such as a display screen.
A fourth embodiment of the present invention also provides a storage medium containing computer-executable instructions, which when executed by a computer processor, are for performing a data storage method comprising:
when the node is a master node of the node group, a target communication address of the node group is acquired;
setting the target communication address as a node communication address of the node;
and receiving a data storage request sent to the node group by the client based on the target communication address through a small computer system interface, and storing data according to the data storage request.
Of course, the storage medium containing computer executable instructions provided in the embodiments of the present invention is not limited to the method operations described above, and may also perform related operations in the data storage method provided in any embodiment of the present invention.
From the above description of embodiments, it will be clear to a person skilled in the art that the present invention may be implemented by means of software and necessary general purpose hardware, but of course also by means of hardware, although in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art in the form of a software product, which may be stored in a computer readable storage medium, such as a floppy disk, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), a FLASH Memory (FLASH), a hard disk or an optical disk of a computer, etc., and include several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the method according to the embodiments of the present invention.
It should be noted that, in the above embodiment of the data storage device, each unit and module included are only divided according to the functional logic, but not limited to the above division, so long as the corresponding functions can be implemented; in addition, the specific names of the functional units are also only for distinguishing from each other, and are not used to limit the protection scope of the present invention.
Note that the above is only a preferred embodiment of the present invention and the technical principle applied. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, while the invention has been described in connection with the above embodiments, the invention is not limited to the embodiments, but may be embodied in many other equivalent forms without departing from the spirit or scope of the invention, which is set forth in the following claims.

Claims (7)

1. A method of data storage, comprising:
when the node is a master node of the node group, a target communication address of the node group is acquired;
setting the target communication address as a node communication address of the node;
receiving a data storage request sent to the node group by the client based on the target communication address through a small computer system interface, and storing data according to the data storage request;
before the target communication address of the node group is acquired, the method further comprises:
deleting an access control identifier of the node from an access control list, and adding the access control identifier for an original master node in the node group in the access control list, wherein the access control identifier is used for prohibiting a node corresponding to the access control identifier from establishing communication connection with a node in a non-node group;
the storing data according to the data storage request comprises:
storing the target data requested to be stored by the data storage request, and sending a data storage instruction to other nodes in the node group so as to instruct the other nodes in the node group to store the target data through the data storage instruction; the data storage instruction is an instruction which is received by the node and sent by other nodes in the node group and indicates the node to store data;
when a data storage instruction sent by a target node in the node group is received, inquiring the access control list to determine whether the target node is provided with an access control identifier;
if the target node is provided with an access control identifier, rejecting the data storage instruction;
and if the target node is not provided with the access control identification, storing data based on the data storage instruction.
2. The method as recited in claim 1, further comprising:
the control client disconnects the communication with the original master node in the node group.
3. The method according to any one of claims 1-2, further comprising:
before becoming a master node of the node group, the method receives a heartbeat packet sent by an original master node in the node group, and initiates election to elect to obtain a current master node of the node group when the heartbeat packet sent by the original master node is not received within a preset time length.
4. A method according to claim 3, further comprising:
and periodically sending heartbeat packets to the slave nodes in the node group so that the slave nodes in the node group determine the node state of the node.
5. A data storage device, comprising:
the address acquisition module is used for acquiring a target communication address of the node group when the node group becomes a master node of the node group;
an address setting module, configured to set the target communication address as a node communication address of the node;
the data storage module is used for receiving a data storage request sent to the node group by the client based on the target communication address through a small computer system interface and storing data according to the data storage request;
the data storage device further includes:
the device comprises an identifier deleting module, a processing module and a processing module, wherein the identifier deleting module is used for deleting the access control identifier of the node from an access control list before the target communication address of the node group is acquired, and adding the access control identifier for an original main node in the node group in the access control list, wherein the access control identifier is used for prohibiting the node corresponding to the access control identifier from establishing communication connection with the node in the non-node group;
the data storage module is further configured to: storing the target data requested to be stored by the data storage request, and sending a data storage instruction to other nodes in the node group so as to instruct the other nodes in the node group to store the target data through the data storage instruction; the data storage instruction is an instruction which is received by the node and sent by other nodes in the node group and indicates the node to store data;
the instruction processing module is used for inquiring the access control list when receiving a data storage instruction sent by a target node in the node group so as to determine whether the target node is provided with an access control identifier; if the target node is provided with an access control identifier, rejecting the data storage instruction; and if the target node is not provided with the access control identification, storing data based on the data storage instruction.
6. A computer device, comprising:
one or more processors;
a memory for storing one or more programs,
when executed by the one or more processors, causes the one or more processors to implement the data storage method of any of claims 1-4.
7. A computer readable storage medium, on which a computer program is stored, characterized in that the program, when being executed by a processor, implements a data storage method according to any of claims 1-4.
CN202011364752.8A 2020-11-27 2020-11-27 Data storage method, device, computer equipment and storage medium Active CN112492030B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011364752.8A CN112492030B (en) 2020-11-27 2020-11-27 Data storage method, device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011364752.8A CN112492030B (en) 2020-11-27 2020-11-27 Data storage method, device, computer equipment and storage medium

Publications (2)

Publication Number Publication Date
CN112492030A CN112492030A (en) 2021-03-12
CN112492030B true CN112492030B (en) 2024-03-15

Family

ID=74936780

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011364752.8A Active CN112492030B (en) 2020-11-27 2020-11-27 Data storage method, device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN112492030B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114189702B (en) * 2021-12-07 2023-09-26 广州市百果园网络科技有限公司 Resource object allocation method, device, equipment and storage medium based on live broadcast room

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8554867B1 (en) * 2010-01-27 2013-10-08 Netapp Inc. Efficient data access in clustered storage system
WO2018036148A1 (en) * 2016-08-23 2018-03-01 东方网力科技股份有限公司 Server cluster system
CN108829787A (en) * 2018-05-31 2018-11-16 郑州云海信息技术有限公司 A kind of meta-data distribution formula system
CN110287151A (en) * 2019-05-20 2019-09-27 平安科技(深圳)有限公司 Distributed memory system, method for writing data, device and storage medium
CN110908723A (en) * 2019-11-29 2020-03-24 新华三大数据技术有限公司 Main/standby switching method and device of operating system and related equipment

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106254100B (en) * 2016-07-27 2019-04-16 腾讯科技(深圳)有限公司 A kind of data disaster tolerance methods, devices and systems

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8554867B1 (en) * 2010-01-27 2013-10-08 Netapp Inc. Efficient data access in clustered storage system
WO2018036148A1 (en) * 2016-08-23 2018-03-01 东方网力科技股份有限公司 Server cluster system
CN108829787A (en) * 2018-05-31 2018-11-16 郑州云海信息技术有限公司 A kind of meta-data distribution formula system
CN110287151A (en) * 2019-05-20 2019-09-27 平安科技(深圳)有限公司 Distributed memory system, method for writing data, device and storage medium
CN110908723A (en) * 2019-11-29 2020-03-24 新华三大数据技术有限公司 Main/standby switching method and device of operating system and related equipment

Also Published As

Publication number Publication date
CN112492030A (en) 2021-03-12

Similar Documents

Publication Publication Date Title
WO2016150066A1 (en) Master node election method and apparatus, and storage system
CN111338806B (en) Service control method and device
CN111200622B (en) Resource transmission method and device and storage medium
EP2597818A1 (en) Cluster management system and method
CN107529229B (en) Data transmission method, device and system
CN113169895A (en) N +1 redundancy for virtualization services with low latency failover
CN112600693A (en) Service request processing method, system, electronic equipment and computer storage medium
CN112492030B (en) Data storage method, device, computer equipment and storage medium
CN109947081B (en) Internet vehicle control method and device
JP5039975B2 (en) Gateway device
CN108234358B (en) Multicast message transmission method, device and machine readable storage medium
CN112260928B (en) Node switching method and device, electronic equipment and readable storage medium
US10637748B2 (en) Method and apparatus for establishing interface between VNFMS, and system
JP5509564B2 (en) Message transmission method and program
CN113810216A (en) Cluster fault switching method and device and electronic equipment
CN110661836B (en) Message routing method, device and system, and storage medium
CN112491951A (en) Request processing method, server and storage medium in peer-to-peer network
US9967163B2 (en) Message system for avoiding processing-performance decline
CN111385324A (en) Data communication method, device, equipment and storage medium
CA2960184C (en) Systems and methods for centrally-assisted distributed hash table
CN109347966B (en) Server cluster communication method, terminal equipment and communication server
CN110890989A (en) Channel connection method and device
CN115643237B (en) Data processing system for conference
CN115277114B (en) Distributed lock processing method and device, electronic equipment and storage medium
CN113535464B (en) Disaster recovery backup method, server, cluster system and storage device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information

Address after: 100000 Unit 501A, Floor 5, 101, Building 1, Yard 5, Laiguangying West Road, Chaoyang District, Beijing

Applicant after: Beijing Qingyun Science and Technology Co.,Ltd.

Address before: 100020 601, 6 floor, 16 building, No. 36 Chuang Yuan Road, Chaoyang District, Beijing.

Applicant before: Beijing Qingyun Science and Technology Co.,Ltd.

CB02 Change of applicant information
GR01 Patent grant
GR01 Patent grant