Data writing method and device, distributed cluster system, equipment and medium
By setting up a cache unit on each cluster node of the distributed cluster system and realizing synchronous writing of data between nodes, the problem of low write operation performance of the cluster shared file system is solved and the overall write performance of the system is improved.
Patent Information
- Application Number
- CN202411369849.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-27
- Publication Date
- 2025-01-24
AI Technical Summary
In distributed cluster systems, the write operation performance of the cluster shared file system is limited by the cluster interconnect network bandwidth and the backend shared block storage performance, resulting in inefficient write performance.
Set the cache unit on each cluster node, and when the data is written, the data to be written into the target cluster node will be written to the cache unit of the target cluster node, and then synchronized to the cache unit of other cluster nodes. Finally, the cache data is written into the cluster sharing Storage unit.
Through the acceleration of data through the cache unit, direct access to low -speed shared storage has been reduced, the efficiency and performance of data writing are improved, and data synchronization delay and conflict are reduced.
Smart Images

Figure CN119356599A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of distributed cluster technology, and in particular to a data writing method, device, distributed cluster system, equipment and medium. Background Art
[0002] In a distributed cluster system architecture, storage resources are generally provided for the cluster through cluster shared storage. Virtualized images or various App applications run in each cluster node in the distributed cluster, and the operation of these virtualized images or various App applications depends on cluster shared storage resources.
[0003] In the cluster shared file storage architecture, the shared block storage device maps the block storage space to all nodes in the cluster at the same time as the block storage device of each node in the cluster, so that each node in the cluster can have read and write access. At this time, the block storage devices of each node in the cluster can build a cluster shared file system, realizing the sharing of data in the block storage devices of each node. At this time, the App or virtual machine VM image of each node in the cluster can normally access the cluster shared file storage system, and can ensure mutually exclusive data read and write access between nodes.
[0004] However, in the above solution, when performing write operations on the cluster shared file system, the overall storage performance is constrained by the cluster interconnection network bandwidth and the backend shared block storage performance, resulting in low write performance efficiency. Summary of the invention
[0005] In view of this, the present application provides a data writing method, apparatus, distributed cluster system, device and medium, which improve the data writing efficiency of the distributed cluster. The technical solution is as follows.
[0006] In a first aspect, a data writing method is provided, the method being applied to a distributed cluster system; the distributed cluster system comprises a cluster shared storage unit and at least one cluster node; each cluster node is provided with a cache unit;
[0007] The method comprises:
[0008] When the data to be written of the target cluster node is obtained, the data to be written is written into the cache unit of the target cluster node, and the data to be written is synchronized to the cache units of other cluster nodes through the cache unit of the target cluster node;
[0009] The cache data stored in the cache unit of the target cluster node is written into the cluster shared storage unit.
[0010] In a possible implementation, when the data to be written of the target cluster node is acquired, writing the data to be written into the cache unit of the target cluster node includes:
[0011] When the data to be written of the target cluster node is obtained, in the cache unit of the target node, it is determined whether the target cache area corresponding to the data to be written is locked by other cluster nodes;
[0012] If the target cache area corresponding to the data to be written is not locked, the data to be written is written into the target cache area.
[0013] In a possible implementation manner, the target cache area is locked by a target cluster node until the data to be written is written into the target cache area.
[0014] In a possible implementation, writing the cache data stored in the cache unit of the target cluster node into the cluster shared storage unit includes:
[0015] When it is detected that new cache data is written into the cache unit of the target cluster node, writing the new cache data into the cluster shared storage unit; or
[0016] The cache data in the cache unit of the target cluster node is written in batches to the cluster shared storage unit according to a specified period.
[0017] In a possible implementation, when the data to be written of the target cluster node is acquired, writing the data to be written into the cache unit of the target cluster node includes:
[0018] When the data to be written of the target cluster node is obtained, the priority of the data to be written is obtained;
[0019] When the priority of the data to be written meets the high priority condition, the data to be written is written into the cache unit of the target cluster node.
[0020] In a possible implementation, the method further includes:
[0021] When the priority of the data to be written does not meet the high priority condition, the data to be written is directly written into the cluster shared storage unit.
[0022] In a second aspect, a data writing device is provided, the device being applied to a distributed cluster system; the distributed cluster system comprising a cluster shared storage unit and at least one cluster node; each cluster node being provided with a cache unit, the device comprising:
[0023] A cache writing module is used to write the data to be written into the cache unit of the target cluster node when the data to be written of the target cluster node is obtained, and synchronize the data to be written to the cache units of other cluster nodes through the cache unit of the target cluster node;
[0024] The cluster synchronous writing module is used to write the cache data stored in the cache unit of the target cluster node into the cluster shared storage unit.
[0025] In a third aspect, a distributed cluster system is provided, wherein the distributed cluster system comprises a cluster shared storage unit and at least one cluster node; each cluster node is provided with a cache unit;
[0026] Whenever there is data to be written to the cache unit on any cluster node, the cache unit of the cluster node is used to synchronize the data to be written to the cache units of other cluster nodes, and write the data to be written to the cluster shared storage unit.
[0027] In a fourth aspect, a computer device is provided, the computer device comprising a processor and a memory, the memory storing at least one instruction, the at least one instruction being loaded and executed by the processor to implement the above-mentioned data writing method.
[0028] In a fifth aspect, a computer-readable storage medium is provided, wherein at least one instruction is stored in the storage medium, and the at least one instruction is loaded and executed by a processor to implement the above-mentioned data writing method.
[0029] In a sixth aspect, a computer program product or a computer program is provided, wherein the computer program product or the computer program comprises computer instructions, and the computer instructions are stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the data writing method.
[0030] The technical solution provided by this application may have the following beneficial effects:
[0031] The present application sets a cache unit on each cluster node in the distributed cluster system. During the data writing process of the distributed cluster system, when the target cluster node generates data to be written that needs to be written to the cluster shared storage unit, it will first be written into the cache unit of the target cluster node. At this time, the cache unit of the target cluster node will synchronize the data to be written to the cache units of other cluster nodes to ensure the consistency of the cached data. The cache unit of the target cluster node will also write its own data to be written to the cluster shared storage unit to achieve data sharing between the cluster nodes. The above scheme, by setting a cache unit on the local node and synchronizing the data between the cache units, the cache of each node in the distributed cluster is always in a synchronized state, reducing the data synchronization delay and conflict problems in the distributed cluster system, and the writing speed of writing the data to be written to the cluster shared storage unit through the cache unit is higher, thereby improving the overall writing performance of the system. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0033] Figure 1 The diagram is a schematic diagram of the structure of a distributed cluster system according to an exemplary embodiment.
[0034] Figure 2 is a method flow chart showing a data writing method according to an exemplary embodiment.
[0035] Figure 3 is a method flow chart showing a data writing method according to an exemplary embodiment.
[0036] Figure 4 A schematic diagram of the structure of a data writing device provided in an embodiment of the present application.
[0037] Figure 5 It is a structural schematic diagram of a computer device provided by an optional embodiment of the present invention. DETAILED DESCRIPTION
[0038] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0039] In the description of the embodiments of the present application, the term "corresponding" may indicate a direct or indirect correspondence between two items, or an association relationship between the two items, or a relationship between indication and being indicated, configuration and being configured, and the like.
[0040] Figure 1 The structure diagram of a distributed cluster system according to an exemplary embodiment is shown. The distributed cluster system includes a cluster shared storage unit and at least one cluster node; each cluster node is provided with a cache unit;
[0041] Whenever there is data to be written to the cache unit on any cluster node, the cache unit of the cluster node is used to synchronize the data to be written to the cache units of other cluster nodes, and write the data to be written to the cluster shared storage unit.
[0042] In the above-mentioned distributed cluster system, each cluster node is provided with a cache unit, and the cache unit can quickly respond to read and write requests, reducing direct access to the cluster shared storage unit. Optionally, in an embodiment of the present application, an NVMe or SSD disk can be used as a cache unit for each cluster node. In frequent random write operation scenarios, the performance of writing directly to a low-speed device (such as an HDD) is poor because the hard disk has a large seek time and write delay. By introducing a high-speed cache unit, data can be written to the cache unit (NVMe or SSD) first, and then the cache unit writes the data in batches or step by step to the low-speed device. In this way, the cache acceleration module can absorb a large number of random write operations, thereby improving overall performance.
[0043] With low-latency, high-throughput local high-speed block storage devices, read and write operations for low-speed block devices can be significantly accelerated, thereby alleviating the performance bottleneck problem of low-speed block devices. Especially when dealing with frequent random write operations, the cache unit can play a very high efficiency. However, using the cache unit alone can only solve the performance problem of local low-speed block storage, but cannot accelerate the performance of cluster storage devices.
[0044] Therefore, in the embodiment of the present application, the distributed cluster system also needs to allow data synchronization and mirroring between different nodes. When the cache unit of a cluster node updates data, it is necessary to ensure that these changes are also synchronized in the cache units of other nodes, thereby ensuring the consistency of data between different cluster nodes. At this time, the caches of all cluster nodes can work together to achieve real-time sharing and consistency of data. This allows the read and write operations of each node to efficiently utilize their own caches and accelerate access to shared storage devices.
[0045] Optionally, in an embodiment of the present application, each cluster node in the distributed cluster can construct a cache unit on each cluster node as a real-time synchronization block storage device for data between cluster nodes based on DRBD (distributed replication block device). DRBD is a software-based network distributed replication block device solution that mirrors data blocks between multiple physical nodes through a real-time data synchronization mechanism between multiple nodes, thereby providing high availability and data fault tolerance.
[0046] In an embodiment of the present application, each cluster node can synchronize data blocks between cache units of each cluster node based on the DRDB function. In an embodiment of the present application, the data writing mode adopted by the distributed cluster is a multi-node parallel write operation mode. In this mode, if a cluster node writes data to a cache unit, a write mutual exclusion operation on the cache unit can be implemented through a lock, that is, when the cluster node writes data to the cache unit, the resources in the cache unit that the cluster node needs to occupy (i.e., part of the cache area in the cache unit) are locked. At this time, only the cluster node can access the part of the cache area. When the write operation of the cluster node is completed, the lock is released. At this time, other cluster nodes are allowed to access the resource, thereby ensuring the integrity of the data.
[0047] Figure 2 is a method flow chart of a data writing method according to an exemplary embodiment. The method is executed by a computer device, which may be as follows Figure 1 The cluster nodes in the distributed cluster system shown in FIG. Figure 2 As shown, the data writing method may include the following steps:
[0048] Step 201 : when the data to be written of the target cluster node is obtained, the data to be written is written into the cache unit of the target cluster node, and the data to be written is synchronized to the cache units of other cluster nodes through the cache unit of the target cluster node.
[0049] In the embodiment of the present application, when the target cluster node receives the data to be written, the data is first written into its local cache unit. Then, the cache unit of the target cluster node synchronizes the data to be written to the cache units of all other cluster nodes (according to the DRBD function), ensuring that the cache units of all nodes obtain the latest data, thereby ensuring the consistency of data between each cluster node.
[0050] Step 202: write the cache data stored in the cache unit of the target cluster node into the cluster shared storage unit.
[0051] Since there are node storage areas mapped to each cluster node in the cluster shared storage unit in the distributed cluster system, that is, the cluster shared storage unit can be considered to store the data of each cluster node. At this time, the cluster node can access the cluster shared storage unit to obtain the data of any cluster node in the distributed cluster. The node storage areas mapped to each cluster node in the cluster shared storage unit constitute a cluster shared file system.
[0052] And as Figure 1 The architecture of the distributed cluster shown in the figure binds the cluster shared storage unit (node storage area in) to the cache unit in each cluster node. If the target cluster node needs to write data to the cluster shared storage unit, it can first write to the cache unit to write the data to the cluster shared storage unit through the cache unit. And in the above process, the target cluster node will also synchronize data between its own cache unit and the cache units of other cluster nodes (for example, through the DRBD function). Therefore, in the above scheme, the data to be written will be written to the cache unit first, and the writing performance is greatly improved. In addition, the above scheme also implements a redundant protection mechanism, which can realize redundant protection of cached write data. When a single node in the multiple nodes of the mirrored data fails, other nodes can take over seamlessly to achieve business continuity and provide effective cross-node HA protection for write data.
[0053] In summary, the present application sets a cache unit on each cluster node in a distributed cluster system. During the data writing process of the distributed cluster system, when the target cluster node generates data to be written that needs to be written to the cluster shared storage unit, it will first be written into the cache unit of the target cluster node. At this time, the cache unit of the target cluster node will synchronize the data to be written to the cache units of other cluster nodes to ensure the consistency of the cached data. The cache unit of the target cluster node will also write its own data to be written to the cluster shared storage unit to achieve data sharing between cluster nodes. The above scheme, by setting a cache unit on the local node and synchronizing the data between the cache units, the cache of each node in the distributed cluster is always in a synchronized state, reducing the data synchronization delay and conflict problems in the distributed cluster system, and the writing speed of writing the data to be written to the cluster shared storage unit through the cache unit is higher, thereby improving the overall writing performance of the system.
[0054] Figure 3 is a method flow chart of a data writing method according to an exemplary embodiment. The method is executed by a computer device, which may be as follows Figure 1 The cluster nodes in the distributed cluster system shown in FIG. Figure 3 As shown, the data writing method may include the following steps:
[0055] Step 301: When the data to be written of the target cluster node is obtained, the data to be written is written into the cache unit of the target cluster node, and the data to be written is synchronized to the cache units of other cluster nodes through the cache unit of the target cluster node.
[0056] Optionally, in an embodiment of the present application, when the data to be written of the target cluster node is obtained, the priority of the data to be written is obtained; when the priority of the data to be written meets the high priority condition, the data to be written is written into the cache unit of the target cluster node.
[0057] That is, Figure 1 In the distributed cluster system shown, even if a cache unit is set up to accelerate data writing, not all data needs to use the cache unit for accelerated writing. If the amount of data generated by the APP or VM in each cluster node is large, using the cache unit to accelerate the writing of all data will increase the load of the cache unit or shared cache unit in the distributed cluster system. Therefore, in an embodiment of the present application, the priority of the data to be written can be judged. Only when the priority of the data to be written meets the high priority condition, it means that the data to be written has high latency requirements and needs to be written to the cluster shared storage unit first. At this time, the high-priority data to be written is written to the cache unit of the target cluster node, so as to perform write acceleration processing through the cache unit.
[0058] Correspondingly, when the priority of the data to be written does not meet the high priority condition, the data to be written is directly written to the cluster shared storage unit. If the priority of the data to be written does not meet the high priority condition, the data to be written is directly written to the cluster shared storage unit through an IO request, thereby reducing the load of the cache unit.
[0059] In a possible implementation, the cluster node can determine the priority of the data to be written according to the application that generates the data to be written. At this time, the APP or VM in the cluster node also has a priority. For example, communication applications have very high requirements for timeliness. At this time, the application (such as APP) can be set as a high-priority APP, and the data to be written corresponding to the APP can be determined to meet the high-priority conditions.
[0060] In another possible implementation, the cluster node may determine the priority of the data to be written according to the type identifier of the data to be written. For example, if the data to be written is alarm data, system data, or other preset types of data, this means that the type of data to be written may affect the normal operation of the application in the cluster and needs to be transmitted to the cluster shared storage unit in priority so that other cluster nodes can quickly obtain important information.
[0061] Step 302: When the data to be written of the target cluster node is obtained, in the cache unit of the target node, it is determined whether the target cache area corresponding to the data to be written is locked by other cluster nodes.
[0062] Since the cache units on each cluster node are data synchronized, each cluster node may write data to a cache area at the same time, which may easily cause data competition and write errors. Therefore, in order to avoid the above situation, after obtaining the data to be written from the target cluster node, it is necessary to first determine the target cache area of the target unit to which the data to be written needs to be written, and determine whether the target cache area is locked by other cluster nodes. If it is locked by other cluster nodes, it means that the target cache area is being occupied by other cluster nodes and performing write operations. At this time, it is necessary to wait for the write operations of other cluster nodes to complete.
[0063] Step 303: If the target cache area corresponding to the data to be written is not locked, the data to be written is written into the target cache area.
[0064] Correspondingly, if the target cache area is not locked, it means that the target cache area is not occupied by other cluster nodes at this time, and the target cluster node can directly write the data to be written into the target cache area.
[0065] Furthermore, when the target cluster node writes the data to be written into the target cache area, it is necessary to lock the target cache area through the target cluster node until the data to be written is written into the target cache area, thereby ensuring that the data to be written will not be interfered with by other cluster nodes when being written into the target cache area, thereby ensuring the integrity of the data.
[0066] Step 304: write the cache data stored in the cache unit of the target cluster node into the cluster shared storage unit.
[0067] Optionally, when it is detected that new cache data is written into the cache unit of the target cluster node, the new cache data is written into the cluster shared storage unit.
[0068] Optionally, the cache data in the cache unit of the target cluster node is written in batches to the cluster shared storage unit according to a specified period.
[0069] That is, in an embodiment of the present application, the cache unit of the target cluster node can be set to write new cache data to the cluster shared storage unit whenever new cache data is detected, or it can be set to periodically batch write the cache data in the cache unit of the target cluster node to the cluster shared storage unit.
[0070] In a possible implementation, in an embodiment of the present application, the target cluster node specifically writes the cache data stored in the cache unit of the target cluster node into the target node storage area in the cluster shared storage unit mapped to the target cluster node.
[0071] In an embodiment of the present application, the cache unit of each cluster node can use nvme or SSD disk, and the cache unit of each cluster node can build a real-time synchronization block storage device / dev / drbd between cluster nodes based on DRBD (distributed replication block device) and ensure strong consistency of multiple copies of data.
[0072] Specifically, in order to implement the above steps, in the actual application process, a synchronous block storage device / dev / drbd is constructed on the cache unit in each cluster node (at this time, the data in the synchronous block storage device / dev / drbd on each cache unit is synchronized), and the formed synchronous block storage device / dev / drbd and the shared block device of each node are bound to a cache acceleration relationship.
[0073] At this point, you only need to use the block device / dev / cachedev for cache acceleration of each node in the cluster to build a cluster shared file system, and then you can implement the various functions in the above steps.
[0074] Specifically, the App or virtual machine VM of each node in the cluster can access the cluster shared file system normally, and data write IO will be written to the synchronous block storage device / dev / drbd built based on DRBD first. Then the synchronous block storage device can write its own cached data to the cluster shared storage unit, that is, to the cluster shared file system.
[0075] Therefore, in the system of distributed cluster shared storage architecture, the present application adds a write cache acceleration solution of DRBD and cache acceleration unit, so that the App or virtual machine VM of each node in the cluster can normally have mutually exclusive read and write access to the cluster shared file system, and data write IO will be written to the DRBD cache write acceleration layer first, thereby greatly improving the performance; and the present invention also utilizes DRBD's redundant protection mechanism to realize redundant protection of cache write data, and provide effective cross-node HA protection for write data; finally, due to the configuration of the local high-speed cache acceleration module, the user can reasonably use the cache optimization configuration items to perform customized acceleration for specific IO types, so as to better meet the storage performance acceleration requirements of specific scenarios.
[0076] In summary, the present application sets a cache unit on each cluster node in a distributed cluster system. During the data writing process of the distributed cluster system, when the target cluster node generates data to be written that needs to be written to the cluster shared storage unit, it will first be written into the cache unit of the target cluster node. At this time, the cache unit of the target cluster node will synchronize the data to be written to the cache units of other cluster nodes to ensure the consistency of the cached data. The cache unit of the target cluster node will also write its own data to be written to the cluster shared storage unit to achieve data sharing between cluster nodes. The above scheme, by setting a cache unit on the local node and synchronizing the data between the cache units, the cache of each node in the distributed cluster is always in a synchronized state, reducing the data synchronization delay and conflict problems in the distributed cluster system, and the writing speed of writing the data to be written to the cluster shared storage unit through the cache unit is higher, thereby improving the overall writing performance of the system.
[0077] In the embodiments of the present application, a data writing device is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware is also possible and conceived.
[0078] The present application provides a data writing device. Figure 4 : is a structural schematic diagram of a data writing device provided in an embodiment of the present application, the device comprising:
[0079] The cache writing module 401 is used to write the data to be written into the cache unit of the target cluster node when the data to be written of the target cluster node is obtained, and synchronize the data to be written to the cache units of other cluster nodes through the cache unit of the target cluster node;
[0080] The cluster synchronization writing module 402 is used to write the cache data stored in the cache unit of the target cluster node into the cluster shared storage unit.
[0081] The further functional description of each of the above modules and units is the same as that of the above corresponding embodiments and will not be repeated here.
[0082] The system upgrade device in this embodiment is presented in the form of a functional unit, where the unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that executes one or more software or fixed programs, and / or other devices that can provide the above functions.
[0083] The embodiment of the present invention also provides a computer device having the above Figure 4 The data is written to the device shown.
[0084] See also Figure 5 , Figure 5 is a schematic diagram of the structure of a computer device provided by an optional embodiment of the present invention, such as Figure 5 As shown, the computer device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. Various components are connected to each other using different buses for communication, and can be installed on a common mainboard or installed in other ways as needed. The processor can process instructions executed in the computer device, including instructions stored in or on the memory to display graphic information in a graphical user interface on an external input / output device (such as a display device coupled to an interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple computer devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Figure 5 A processor 10 is taken as an example.
[0085] The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic or any combination thereof.
[0086] The memory 20 stores instructions executable by at least one processor 10, so that the at least one processor 10 executes the method shown in the above embodiment.
[0087] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0088] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 20 may also include a combination of the above types of memory.
[0089] The computer device further comprises a communication interface 30 for the computer device to communicate with other devices or a communication network.
[0090] The embodiment of the present invention also provides a computer-readable storage medium. The method according to the embodiment of the present invention can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium through a network download, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state hard disk, etc.; further, the storage medium can also include a combination of the above types of memories. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.
[0091] A part of the present invention may be applied as a computer program product, such as a computer program instruction, which, when executed by a computer, can call or provide the method and / or technical solution according to the present invention through the operation of the computer. Those skilled in the art should understand that the existence of the computer program instruction in a computer-readable medium includes, but is not limited to, a source file, an executable file, an installation package file, etc., and accordingly, the way in which the computer program instruction is executed by the computer includes, but is not limited to: the computer directly executes the instruction, or the computer compiles the instruction and then executes the corresponding compiled program, or the computer reads and executes the instruction, or the computer reads and installs the instruction and then executes the corresponding installed program. Here, the computer-readable medium may be any available computer-readable storage medium or communication medium accessible to the computer.
[0092] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations are all within the scope defined by the appended claims.
Claims
1. A data writing method, characterized in that: The method is applied to a distributed cluster system; the distributed cluster system comprises a cluster shared storage unit and at least one cluster node; A cache unit is provided on each cluster node; The method comprises: When the data to be written of the target cluster node is obtained, the data to be written is written into the cache unit of the target cluster node, and the data to be written is synchronized to the cache units of other cluster nodes through the cache unit of the target cluster node; The cache data stored in the cache unit of the target cluster node is written into the cluster shared storage unit.
2. The method according to claim 1, characterized in that When the data to be written of the target cluster node is acquired, writing the data to be written into the cache unit of the target cluster node includes: When the data to be written of the target cluster node is obtained, in the cache unit of the target node, it is determined whether the target cache area corresponding to the data to be written is locked by other cluster nodes; If the target cache area corresponding to the data to be written is not locked, the data to be written is written into the target cache area.
3. The method according to claim 2, characterized in that Before writing the data to be written into the target cache area, the method further includes: The target cache area is locked through the target cluster node until the data to be written is written into the target cache area.
4. The method according to claim 2, characterized in that: The step of writing the cache data stored in the cache unit of the target cluster node into the cluster shared storage unit includes: When it is detected that the cache unit of the target cluster node writes new cache data, the new cache data is written into the cluster shared storage unit; or, The cache data in the cache unit of the target cluster node is written in batches to the cluster shared storage unit according to a specified period.
5. The method according to any one of claims 1 to 4, characterized in that: When the data to be written of the target cluster node is obtained, writing the data to be written into the cache unit of the target cluster node includes: When the data to be written of the target cluster node is obtained, the priority of the data to be written is obtained; When the priority of the data to be written meets the high priority condition, the data to be written is written into the cache unit of the target cluster node.
6. The method according to claim 5, characterized in that The method further comprises: When the priority of the data to be written does not meet the high priority condition, the data to be written is directly written into the cluster shared storage unit.
7. A data writing device, characterized in that: The device is applied to a distributed cluster system; the distributed cluster system comprises a cluster shared storage unit and at least one cluster node; A cache unit is provided on each cluster node; The device comprises: A cache writing module is used to write the data to be written into the cache unit of the target cluster node when the data to be written of the target cluster node is obtained, and synchronize the data to be written to the cache units of other cluster nodes through the cache unit of the target cluster node; The cluster synchronous writing module is used to write the cache data stored in the cache unit of the target cluster node into the cluster shared storage unit.
8. A distributed cluster system, characterized in that: The distributed cluster system includes a cluster shared storage unit and at least one cluster node; each cluster node is provided with a cache unit; Whenever there is data to be written to the cache unit on any cluster node, the cache unit of the cluster node is used to synchronize the data to be written to the cache units of other cluster nodes, and write the data to be written to the cluster shared storage unit.
9. A computer device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the data writing method according to any one of claims 1 to 6 by executing the computer instructions.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the data writing method according to any one of claims 1 to 6.
11. A computer program product, characterized in that The method comprises computer instructions, wherein the computer instructions are used to enable a computer to execute the data writing method according to any one of claims 1 to 6.