Online upgrade method, device, storage node and distributed cluster
By deploying virtual services in a distributed storage system, client request processing is not interrupted during storage node upgrade, solving the problem of data write performance loss and version inconsistency caused by storage node upgrade, ensuring smooth data writing and parse.
Patent Information
- Application Number
- CN202210095050.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-26
- Publication Date
- 2024-11-19
- Estimated Expiration
- 2042-01-26
AI Technical Summary
During the online upgrade of existing distributed storage systems, the storage node upgrade restart caused the client to fail to respond in time, resulting in data writing performance loss, and the storage node version inconsistently lead to data resolving and accessing data cannot be resolved normally.
Deploy virtual services in the storage node of a distributed cluster. When the upgrade is triggered, the client is notified to switch the service interface to the virtual interface, receive client request messages through the virtual interface, write data to temporary files, and restore the original interface after completing the storage service upgrade. , ensure that data write performance is not affected and resolve version inconsistency issues.
It realizes the upgrade of the storage node without affecting the client request processing, avoids data parsing problems caused by data write performance loss and inconsistency in versions, and ensures the continuity of business processing and data integrity.
Smart Images

Figure CN114428627B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of distributed storage technology, and in particular to an online upgrade method, device, storage node and distributed cluster. Background Art
[0002] In order to meet the diverse needs of customers and ensure the stability of storage software, the delivered storage software is also constantly updated and iterated. Sometimes, in order to optimize and solve problems in the on-site environment and improve the high availability of the deployed software, it is necessary to upgrade the storage cluster environment appropriately. In the security industry, distributed storage systems are mainly used to save real-time image and video streaming data. The upgrade operation will restart the service program, which will affect the writing of real-time data and cause the loss of user data. For some special business scenarios, users do not allow the deployed business to be interrupted, so the above upgrade process cannot satisfy users.
[0003] In a distributed erasure storage system, it is generally composed of storage service nodes and metadata management service nodes. Client data writing will divide the data into multiple stripes and write them concurrently to N+M data nodes. Based on the online upgrade of this storage model, the industry mainly ensures that each storage node is upgraded in turn and in turn when erasure is satisfied, to ensure that there are always N storage nodes to receive business data streams and to ensure the normal writing of data. However, this solution does not consider the problem that the write message just requested by the client is not responded to in time due to the upgrade and restart of the storage node, and the blocking timeout causes the loss of the overall data writing performance of the client. In addition, during the upgrade process, there is a serious problem that the data cannot be parsed and accessed normally due to inconsistencies in the software versions of the upgraded and non-upgraded nodes, the storage data structure, and the private communication messages between the client and the server. Summary of the invention
[0004] The purpose of the present application includes, for example, providing an online upgrade method, device, storage node and distributed cluster, which can complete the upgrade without affecting the normal processing of client requests.
[0005] The embodiments of the present application can be implemented as follows:
[0006] In a first aspect, the present application provides an online upgrade method, which is applied to any storage node among a plurality of storage nodes included in a distributed cluster, wherein a virtual service corresponding to a storage service is deployed in the storage node, and the method comprises:
[0007] When the upgrade process is triggered, a notification message is sent to the client, so that the client switches the service interface for interacting with the storage node to a virtual interface, the service interface corresponds to the storage service, and the virtual interface corresponds to the virtual service;
[0008] Execute an upgrade operation of the storage service, and receive a request message sent by the client through the virtual interface, switch the write operation from the storage file created under the pointed storage service to the temporary file created under the virtual service, so as to write the data in the request message into the temporary file;
[0009] After completing the upgrade of the storage services of all storage nodes, a notification message is sent to the client so that the client can restore the interface for interacting with the storage nodes.
[0010] In an optional implementation manner, before the step of triggering the upgrade process, the method further includes:
[0011] A request message from a client is received through the service interface, and data in the request message is written into the storage file.
[0012] In an optional implementation, update storage software is installed in the virtual service;
[0013] The step of writing the data in the request message into the temporary file comprises:
[0014] Detecting whether the version information of the request message matches the version information of the installed update storage software;
[0015] If there is a match, the request message is parsed based on the parsing method corresponding to the update storage software, and the parsed data is written into the temporary file;
[0016] If there is no match, the request message is parsed using a parsing method corresponding to the version of the request message, and the parsed data is written into the temporary file.
[0017] In an optional embodiment, the method further comprises:
[0018] When switching the write operation from the storage file to the temporary file, obtaining the offset position of the storage file currently being written;
[0019] After the upgrade is completed, a query is periodically performed to determine whether a temporary file exists. If a temporary file exists, the data in the temporary file is merged into the storage file based on the offset position of the storage file mapped by the temporary file, and the temporary file is cleared.
[0020] In an optional embodiment, the method further comprises:
[0021] After receiving a message from all clients communicating with the storage node to stop interacting with the virtual service, the deployed virtual service is destroyed.
[0022] In an optional implementation manner, the step of sending a notification message to the client so that the client switches the service interface for interacting with the storage node to a virtual interface includes:
[0023] Obtain the IP information of the client currently communicating with the storage node, the created virtual interface information, and the IP information of the virtual service;
[0024] Based on the IP information of the client, the virtual interface information and the IP information of the virtual service are sent to the corresponding client, so that the client switches the service interface for interacting with the storage node to the virtual interface.
[0025] In an optional implementation manner, the step of writing the data in the request message into the temporary file includes:
[0026] Splitting the data in the request message according to the number of storage nodes in the distributed cluster;
[0027] The split data are written into temporary files in each storage node.
[0028] In a second aspect, the present application provides an online upgrade device, which is applied to any storage node among a plurality of storage nodes included in a distributed cluster, wherein a virtual service corresponding to a storage service is deployed in the storage node, and the device comprises:
[0029] A first sending module is used to send a notification message to the client when the upgrade process is triggered, so that the client switches the service interface for interacting with the storage node to a virtual interface, the service interface corresponds to the storage service, and the virtual interface corresponds to the virtual service;
[0030] A writing module, used to perform an upgrade operation of the storage service, and receive a request message sent by the client through the virtual interface, and switch the write operation from the storage file created under the pointed storage service to a temporary file created under the virtual service, so as to write the data in the request message into the temporary file;
[0031] The second sending module is used to send a notification message to the client after completing the upgrade of the storage services of all storage nodes, so that the client can restore the interface for interacting with the storage nodes.
[0032] In a third aspect, the present application provides a storage node, comprising one or more storage media and one or more processors communicating with the storage media, wherein the one or more storage media store machine executable instructions executable by the processor, and when the electronic device is running, the processor executes the machine executable instructions to perform the method steps described in any one of the aforementioned embodiments.
[0033] In a fourth aspect, the present application provides a distributed cluster, comprising a plurality of storage nodes, each of which is deployed with a virtual service corresponding to a storage service;
[0034] One of the multiple storage nodes is used to send a notification message to the client when triggering an upgrade, so that the client switches the service interface for interacting with each storage node to a virtual interface, the service interface corresponds to the storage service, and the virtual interface corresponds to the virtual service;
[0035] Each of the storage nodes is used to perform an upgrade operation of the storage service, and receive a request message sent by the client through the virtual interface, and switch a write operation from a storage file created under the pointed storage service to a temporary file created under the virtual service, so as to write data in the request message into the temporary file;
[0036] Each of the storage nodes is used to send a notification message to the client after completing the upgrade of the storage services of all storage nodes, so that the client will restore the interface for interacting with the storage node.
[0037] The beneficial effects of the embodiments of the present application include, for example:
[0038] The present application provides an online upgrade method, device, storage node and distributed cluster. Virtual services corresponding to storage services are deployed in each storage node of the distributed cluster to form a virtual cluster. When the upgrade process is triggered, a notification message is sent to the client to switch the client from the original service interface to the virtual interface. The storage node receives the request message sent by the client through the virtual interface, and changes the write operation from the original storage file to the temporary file to write the data of the request message into the temporary file. After the storage service upgrade of all storage nodes is completed, a notification message is sent to the client to restore the interface for interacting with the storage node. In this solution, a virtual cluster is deployed. When the original storage cluster is upgraded, the processing of client access requests is realized through the virtual cluster. While not affecting the normal processing of the client's request, it can avoid the defect that the data cannot be parsed normally when there are inconsistent versions of each storage node. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0040] Figure 1 A schematic diagram of an application scenario of the online upgrade method provided in an embodiment of the present application;
[0041] Figure 2 A flowchart of an online upgrade method provided in an embodiment of the present application;
[0042] Figure 3 for Figure 2 Flowchart of sub-steps included in S101 after the headquarters;
[0043] Figure 4 for Figure 2 One of the flowcharts of the sub-steps included in step S102;
[0044] Figure 5 for Figure 2 Flowchart 2 of the sub-steps included in step S102;
[0045] Figure 6 A schematic diagram of an online upgrade method according to an embodiment of the present invention;
[0046] Figure 7 A schematic diagram of the structure of a storage node provided in an embodiment of the present application;
[0047] Figure 8 This is a functional module block diagram of the online upgrade device provided in an embodiment of the present application.
[0048] Icons: 110 - storage medium; 120 - processor; 130 - online upgrade device; 131 - first sending module; 132 - writing module; 133 - second sending module; 140 - communication interface. DETAILED DESCRIPTION
[0049] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. The components of the embodiments of the present application described and shown in the drawings here can be arranged and designed in various different configurations.
[0050] Therefore, the following detailed description of the embodiments of the present application provided in the accompanying drawings is not intended to limit the scope of the present application for which protection is sought, but merely represents selected embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without creative work are within the scope of protection of the present application.
[0051] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, further definition and explanation thereof is not required in subsequent drawings.
[0052] In the description of the present application, it should be noted that the terms "first", "second", etc., if used, are only used to distinguish the description and cannot be understood as indicating or implying relative importance.
[0053] It should be noted that, in the absence of conflict, the features in the embodiments of the present application may be combined with each other.
[0054] See also Figure 1 , is a schematic diagram of an application scenario of the online upgrade method provided in an embodiment of the present application, wherein the application scenario includes a distributed cluster, wherein the distributed cluster includes multiple storage nodes, and further includes multiple clients communicating with the distributed cluster. Each client can communicate with each storage node in the distributed cluster to realize data and information interaction.
[0055] In this embodiment, the distributed cluster may be a distributed storage cluster in the security field, which is used to store real-time image and video stream data. The client may be a terminal device for collecting images and videos, or a terminal device held by a user that can communicate with a collection device and obtain images or videos collected by the collection device. Each client may send the obtained images and videos to the distributed cluster, and multiple storage nodes in the distributed cluster may realize distributed storage.
[0056] See also Figure 2 , which is a flow chart of an online upgrade method provided in an embodiment of the present application, the method steps defined in the process related to the online upgrade method can be represented by Figure 1 It is implemented by any storage node shown in .
[0057] In this embodiment, each storage node has a storage service, and the storage services in multiple storage nodes constitute a storage service cluster. Each storage node also pre-deploys a virtual service corresponding to the storage service to form a virtual service cluster. The virtual service can be deployed in the form of a Docker container. Figure 2 The specific process shown is described in detail.
[0058] S101, when the upgrade process is triggered, sending a notification message to the client, so that the client switches the service interface for interacting with the storage node to a virtual interface, the service interface corresponds to the storage service, and the virtual interface corresponds to the virtual service.
[0059] S102, execute the upgrade operation of the storage service, and receive the request message sent by the client through the virtual interface, switch the write operation from the storage file created under the storage service to the temporary file created under the virtual service, so as to write the data in the request message into the temporary file.
[0060] S103, after completing the upgrade of the storage services of all storage nodes, sending a notification message to the client, so that the client can restore the interface for interacting with the storage nodes.
[0061] In this embodiment, when the distributed cluster is not upgraded, each client will interact with the service interface of the storage node corresponding to the storage service, so that the storage node can write and store data in the client's access request based on the storage service.
[0062] When it is necessary to perform an upgrade of the distributed cluster, after the upgrade preparation work is completed, any storage node in the distributed cluster can send a notification message to each client. Among them, any storage node can be a storage node deployed with a service upgrade module. The deployed service upgrade module can deploy a Docker container on each storage node in the distributed cluster.
[0063] Each client is deployed with an upgrade awareness module. After receiving a notification message through the upgrade awareness module, the service interface for interacting with the storage node can be switched to a virtual interface, which is an interface corresponding to the virtual service deployed on the storage node. That is, the storage node can receive the request message sent by the client through the virtual interface, and then write the data in the request message into the virtual cluster.
[0064] In this embodiment, before the upgrade, when each client writes data to the distributed cluster, it needs to apply to the distributed cluster for a storage file File for writing data. Therefore, before the upgrade process is triggered, the storage node will receive the client's request message through the service interface and write the data in the request message into the storage file.
[0065] After the upgrade process is triggered, the client needs to apply to the distributed cluster for a temporary file U-File used to write data during the upgrade process after receiving the notification message sent by the upgrade service module. This temporary file is created under the virtual service and is used to store data obtained by operations under the virtual service.
[0066] Therefore, after the upgrade process is triggered, the storage node will receive the message sent by the client through the virtual interface and write the data in the request message initiated by the client into a temporary file.
[0067] In this embodiment, after each client switches the service interface originally interacting with the storage node to a virtual interface, and the storage node switches the storage file pointed to by the write operation to a temporary file, the upgrade of the storage service in the distributed cluster can be performed. During the upgrade process of the storage service, the virtual cluster composed of virtual services can respond to the client's request, so the business processing can be guaranteed to be uninterrupted and the response to the user request will not be affected.
[0068] In this embodiment, after completing the storage service upgrade of all storage nodes in the distributed cluster, a notification message is sent to each client. After receiving the notification message, the client can restore the virtual interface currently interacting with the storage node to the original service interface, and restore the temporary file pointed to by the current write operation to the original storage file.
[0069] In this way, after completing the upgrade of the storage service in the distributed cluster, you can switch to the original service cluster to perform subsequent client business processing. During the upgrade of the storage service, since the response to the client's access request can be achieved through the virtual cluster, the client's business processing will not be affected by the upgrade and restart of the storage service. The solution provided by this embodiment can ensure the uninterrupted business processing of the client on the basis of successfully completing the storage service upgrade, and avoid the problem of affecting the client's data processing.
[0070] Furthermore, each storage node in each distributed cluster can be upgraded synchronously, thus avoiding the defect that during the upgrade process of the existing technology in which each storage node is upgraded one by one, there are inconsistencies in software versions, storage data structures, and private communication messages between upgraded and non-upgraded nodes, which results in the inability to properly parse and access data.
[0071] In this embodiment, the distributed cluster will provide a unified MIP address in advance, and each client can establish a connection with the metadata management service Meta Serve in the distributed cluster through the unified MIP address before writing data to the distributed cluster. The metadata management service can be deployed in any storage node in the distributed cluster.
[0072] When each client obtains data, such as image data, video stream data, etc., and writes data to the distributed cluster, it can first apply for storage files from the metadata management service in a pre-allocated manner. The storage file can be divided into multiple groups of Object objects, each group of Objects consists of N+M Blocks, and each Block corresponds to a storage node. Finally, the data is divided into multiple groups of stripes and written into the Block files of each storage node.
[0073] Each client can obtain the address and interface information of each storage node in the distributed cluster based on the information of the created storage file. The interface information is the service interface created under the storage service. That is, based on the service interface, it can interact with the storage service to write the data sent by the client into the storage file through the storage service.
[0074] When the upgrade process is triggered, the service upgrade module can be deployed on any storage node in the distributed cluster. In addition, the virtual services pre-deployed on each storage node constitute a virtual cluster. The virtual service of each storage node is pre-installed with updated storage software, which is the storage software version to which the current storage service is to be upgraded.
[0075] After the virtualized storage cluster is deployed, the service upgrade module can notify the metadata management service upgrade is ready and send a notification message to each client. Figure 3 In this embodiment, when the service upgrade module sends a notification message to each client, the following sub-steps may be included:
[0076] S1011, obtaining IP information of a client currently communicating with the storage node, information of a created virtual interface, and IP information of a virtual service.
[0077] S1012: Based on the IP information of the client, the virtual interface information and the IP information of the virtual service are sent to the corresponding client, so that the client switches the service interface for interacting with the storage node to the virtual interface.
[0078] In this embodiment, when deploying a virtual cluster, the IP information of the virtual service in the storage node can also be determined. In addition, a temporary virtual interface can be used to access the virtual service. In order to send a notification message to a client that currently establishes communication with the distributed cluster, the IP information of the client that currently communicates with the storage node can also be obtained.
[0079] On this basis, when sending a notification message to a client, the above virtual interface information and IP information of the virtual service may be sent to the corresponding client based on the IP information of the client.
[0080] In this embodiment, when the storage service needs to be upgraded, the client can also apply for a temporary file from the distributed cluster in advance. If the client has applied for a storage file from the distributed cluster in advance, a temporary file for transitional upgrade will be created in the virtual cluster mapping. If the client has not applied for a storage file in advance, a new temporary file will be created in the virtual cluster for data writing.
[0081] After the upgrade process is triggered and the deployment required for the upgrade is completed, the upgrade service module can combine the cluster upgrade readiness status and the above-mentioned information into a notification message and notify each connected client in the form of an event.
[0082] After the client obtains the virtual interface information, the IP information of the virtual service, etc., when sending a request message to the distributed cluster, the virtual interface information and the IP information of the virtual service are carried in the request message. The storage nodes in the distributed cluster write the data in the client's access request to their respective temporary files through the virtual interface. In this embodiment, the virtual cluster and the original service cluster share the same disk space, so the data written to the temporary file can be saved normally.
[0083] See also Figure 4 In this embodiment, the step of writing the data in the request message into a temporary file at the storage node can be implemented in the following manner:
[0084] S1021A detects whether the version information of the request message matches the version information of the installed update storage software. If so, execute the following step S1022; if not, execute the following step S1023.
[0085] S1022A parses the request message based on the parsing method corresponding to the update storage software, and writes the parsed data into the temporary file.
[0086] S1023A parses the request message using a parsing method corresponding to the version of the request message, and writes the parsed data into the temporary file.
[0087] In this embodiment, it is considered that when the new version storage service program receives the request message of the old version client program, there may be a new version change that causes the message to be unable to be correctly parsed. Considering the compatibility of the message data structure modification, in this embodiment, a private protocol compatibility module is configured in the storage node. This module can first parse the version information of the client's request message after the storage node obtains the client's request message to see if it matches the version information of the updated storage software of the virtual service.
[0088] If the version number of the virtual service's update storage software is consistent with the version number of the request message, it can be directly parsed according to the parsing method corresponding to the update storage software. However, if the version number of the virtual service's update storage software is higher than the version number of the request message, it is necessary to parse it according to the parsing method corresponding to the version of the client's request message. After correct parsing, the virtual service program then calls the write interface on the storage side to write the parsed data to a temporary file and save it to the hard disk.
[0089] The above is the execution method when responding to client request messages based on virtual services during the upgrade process. Similarly, when responding to client request messages based on the original storage service before or after the upgrade, the request message can be parsed and written into the storage file in a similar manner.
[0090] As can be seen from the above, when the upgrade is not triggered, the data sent by the client is written to the storage file, and the data will be divided into multiple stripes and written to each storage node. Figure 5 , when the upgrade is triggered, the data sent by the client is written to a temporary file, which can be achieved based on the following methods:
[0091] S1021B, split the data in the request message according to the number of storage nodes in the distributed cluster.
[0092] S1022B, writing the split data into temporary files in each of the storage nodes respectively.
[0093] In this embodiment, when the data sent by the client is written into the temporary file of the virtual cluster, the temporary file is also divided into multiple groups of objects, each group of objects is composed of N+M data blocks, and each data block corresponds to a storage node (specifically corresponding to the virtual service in the storage node). The data sent by the client is divided into multiple groups of stripes and written into the divided temporary files (divided data blocks) of each storage node.
[0094] In this embodiment, after the storage service of each storage node in the distributed cluster is upgraded, the service upgrade module will send a notification message to each client. After the client receives the notification message, the subsequent request message sent by the client will point to the upgraded storage service, that is, the request message is received through the service interface corresponding to the storage service, and the data of the request message is written into the storage file.
[0095] After the service upgrade module receives the message from all clients communicating with the storage node to stop interacting with the virtual service, the deployed virtual service will be destroyed. In this way, a smooth upgrade operation can be completed, and the user side will not be aware of the upgrade process, which will not affect the business response to the client.
[0096] In this embodiment, the data being written by the client is split during the upgrade process and transferred to the virtual cluster in the form of temporary file storage. Therefore, after the upgrade is completed, the client's data will be stored in two files respectively. In order to ensure the uniqueness of data access and avoid the consumption of performance by multiple file retrievals. In this embodiment, after the upgrade is completed, the temporary file and the storage file can be merged.
[0097] Based on this, in this embodiment, when switching from the original storage service cluster to the virtual cluster, that is, when switching the write operation from the storage file to the temporary file, the offset position of the current write of the storage file is obtained and the obtained offset position is recorded.
[0098] After the upgrade is completed, a query is periodically performed to determine whether a temporary file exists. If a temporary file exists, the data in the temporary file is merged into the storage file based on the offset position of the storage file mapped by the temporary file, and the temporary file is cleared.
[0099] In this embodiment, a file merging function can be configured in the metadata management service, and a patrol thread can be added. In order to distinguish temporary files from original storage files, temporary files and storage files can be distinguished and set based on the file name, for example, the storage file is named File and the temporary file is named U-File. The data records in the storage file and the temporary file are persistently saved in the metadata information database.
[0100] Taking into account the impact of file merging operations on bandwidth and performance, according to the characteristics of security storage, inspection operations can be performed during business idle time periods and time periods with less business traffic, such as 2 a.m.
[0101] The inspection thread may query the metadata information database within the above time period to check whether there is a key with the character "U-". If there is, query the storage file File mapped by the temporary file and the offset position WOffSet recorded.
[0102] The inspection thread can obtain the data written in the U-File queried above, and append the data to the specified position of the File according to the offset position WOffSet, and re-update the file size and the last write modification time recorded in the temporary file.
[0103] The online upgrade method provided in this embodiment uses virtualization technology to create a virtual cluster in a distributed cluster, and simultaneously maintains the original storage service cluster and the virtual cluster. After the upgrade process is triggered, a notification message can be sent to the client to enable the client to switch the original service interface to the virtual interface. Using virtualization technology, the Docker container is pre-installed with an updated version of storage software to form a virtual cluster, and the original storage file pointed to by the write operation is switched to a temporary file to write the data of the client's access request to the temporary file. It ensures that the write performance is not affected, avoids the performance loss and failure risk caused by the client write timeout due to restarting the storage service program during the upgrade process, and ensures smooth data writing. In addition, it solves the problem of inconsistent service versions caused by inconsistent upgrade times of various storage service nodes in the original upgrade process, which affects the normal parsing and access of data.
[0104] In addition, a private protocol compatibility module is added on the distributed cluster side to avoid the interruption of business caused by the inability to parse the message format normally due to version mismatch, and to ensure to the greatest extent that the upgrade has no impact on business writing.
[0105] Please refer to Figure 6 As shown, the following will be combined Figure 6 The system architecture shown in the figure illustrates the overall process of the online upgrade method of this embodiment. The system architecture includes a client Client and a distributed cluster. There can be multiple clients (only one is shown in the figure), and each client can establish communication with the distributed cluster. The distributed cluster includes multiple storage nodes (only three are shown in the figure). Each storage node includes a storage service program. In addition, each storage node is also deployed with a virtual service program through a Docker container to form a virtual cluster.
[0106] In addition, the distributed cluster also includes a service upgrade module and a metadata management service MetaServer module, which can be deployed in any storage node. The distributed cluster can provide a unified MIP for storage services. In addition, the distributed cluster can also provide a unified VMIP for virtual services.
[0107] Storage node 1, storage node 2, storage node 3 may respectively have service interfaces IP1-PORT, IP2-PORT, IP3-PORT for interacting with the client. In addition, in the deployed virtual cluster, a virtual interface is also constructed, and storage node 1, storage node 2, storage node 3 may be distributed with virtual interfaces VPORT, VPORT2, VPORT3.
[0108] ① When the upgrade process is not triggered, the client Client can establish a connection with the metadata management service MetaServer through the external unified MIP of the storage service of the distributed cluster when obtaining the data stream, and apply for storage files.
[0109] ②The read-write module of the Client obtains the address and service interface information IP1-PORT, IP2-PORT, and IP3-PORT of each storage node based on the information of the created storage file. Then, the data to be written is split and written to the storage nodes DN1, DN2, and DN3 through the address and service interface of each storage node, and specifically written to the storage files of the three storage nodes.
[0110] ③ When the storage service program needs to be upgraded, deploy the service upgrade module on any storage node. The service upgrade module can deploy Docker containers on each storage node and pre-install the updated version of the storage software.
[0111] ④ After the virtualized storage cluster is deployed, the service upgrade module can notify the metadata management service MetaServer that the upgrade is ready and obtain the IP information of all clients connected to the metadata management service.
[0112] ⑤ The service upgrade module obtains the IP information of the online client and notifies each connected client of the cluster upgrade readiness status and the virtual cluster's external unified VMIP in the form of an event through the client's upgrade perception module.
[0113] ⑥After receiving the notification message through the upgrade perception module, the Client controls the switching of the file being written, establishes a connection with the virtual cluster metadata management service MetaServer through VMIP, informs the virtual MetaServer of the write offset information of the original storage file, and re-applies for a temporary file.
[0114] ⑦ During the switch, the Client obtains the address information of the virtual service based on the newly obtained temporary file information. The IP address to which the client's access request data is written remains unchanged, and the client's data is saved in the virtual cluster using virtual interfaces VPORT1, VPORT2, and VPORT3. The virtual cluster shares the same disk space with the original storage service cluster, and the data can be saved normally.
[0115] ⑧ After all the clients have switched the files they are writing to the virtual cluster, they will proactively inform the service upgrade module of the switch completion status. When the service upgrade module receives the switch completion message from all clients, it will notify each storage node to upgrade the original storage service program to a new version. After the upgrade is successful, each client will be notified of the program upgrade completion status. After the client switches, the newly initiated data will be written to the upgraded storage service cluster, and the virtual cluster will no longer provide write operations. After the upgrade is completed, the virtual cluster can be automatically destroyed.
[0116] On the basis of the above, during the service idle period, based on the write offset position of the storage file when switching the recorded files, the data in the temporary files in the virtual cluster can be merged into the storage file.
[0117] See also Figure 7 , is an exemplary component diagram of a storage node provided in an embodiment of the present application, and the storage node may include a storage medium 110, a processor 120, an online upgrade device 130 and a communication interface 140. In the present embodiment, the storage medium 110 and the processor 120 are both located in the electronic device and the two are separately arranged. However, it should be understood that the storage medium 110 may also be independent of the electronic device and may be accessed by the processor 120 through a bus interface. Alternatively, the storage medium 110 may also be integrated into the processor 120, for example, it may be a cache and / or a general register.
[0118] The online upgrade device 130 can be understood as the above-mentioned electronic device, or the processor 120 of the electronic device, or can be understood as a software function module independent of the above-mentioned electronic device or processor 120 that implements the above-mentioned online upgrade method under the control of the electronic device.
[0119] like Figure 8 As shown, the online upgrade device 130 may include a first sending module 131, a writing module 132, and a second sending module 133. The functions of each functional module of the online upgrade device 130 are described in detail below.
[0120] The first sending module 131 is used to send a notification message to the client when the upgrade process is triggered, so that the client switches the service interface for interacting with the storage node to a virtual interface, wherein the service interface corresponds to the storage service, and the virtual interface corresponds to the virtual service.
[0121] It can be understood that the first sending module 131 can be used to execute the above step S101. The detailed implementation of the first sending module 131 can refer to the above content related to step S101.
[0122] The write module 132 is used to execute the upgrade operation of the storage service, and receive the request message sent by the client through the virtual interface, switch the write operation from the storage file created under the storage service to the temporary file created under the virtual service, so as to write the data in the request message into the temporary file.
[0123] It can be understood that the writing module 132 can be used to execute the above step S102. The detailed implementation of the writing module 132 can refer to the above content related to step S102.
[0124] The second sending module 133 is used to send a notification message to the client after completing the upgrade of the storage services of all storage nodes, so that the client can restore the interface for interacting with the storage nodes.
[0125] It can be understood that the second sending module 133 can be used to execute the above step S103. The detailed implementation of the second sending module 133 can refer to the above content related to step S103.
[0126] In a possible implementation manner, the online upgrade device 130 further includes a receiving module, which is used to:
[0127] A request message from a client is received through the service interface, and data in the request message is written into the storage file.
[0128] In a possible implementation, the virtual service is installed with update storage software, and the writing module 132 is used to:
[0129] Detecting whether the version information of the request message matches the version information of the installed update storage software;
[0130] If there is a match, the request message is parsed based on the parsing method corresponding to the update storage software, and the parsed data is written into the temporary file;
[0131] If there is no match, the request message is parsed using a parsing method corresponding to the version of the request message, and the parsed data is written into the temporary file.
[0132] In a possible implementation manner, the online upgrade device 130 further includes a merging module, which is used to:
[0133] When the write operation is switched from the storage file to the temporary file, the offset position of the current write of the storage file is obtained. After the upgrade is completed, it is periodically queried whether there is a temporary file. When a temporary file exists, based on the offset position of the storage file mapped by the temporary file, the data in the temporary file is merged into the storage file, and the temporary file is cleared.
[0134] In a possible implementation manner, the online upgrade device further includes a destruction module, and the destruction module is used to:
[0135] After receiving a message from all clients communicating with the storage node to stop interacting with the virtual service, the deployed virtual service is destroyed.
[0136] In a possible implementation manner, the first sending module 131 is used to:
[0137] Obtain the IP information of the client currently communicating with the storage node, the created virtual interface information, and the IP information of the virtual service;
[0138] Based on the IP information of the client, the virtual interface information and the IP information of the virtual service are sent to the corresponding client, so that the client switches the service interface for interacting with the storage node to the virtual interface.
[0139] In a possible implementation manner, the writing module 132 is used to:
[0140] Splitting the data in the request message according to the number of storage nodes in the distributed cluster;
[0141] The split data are written into temporary files in each storage node.
[0142] For descriptions of the processing flow of each module in the device and the interaction flow between each module, reference may be made to the relevant descriptions in the above method embodiment, which will not be described in detail here.
[0143] Based on the above, an embodiment of the present application further provides a distributed cluster, which includes multiple storage nodes, and a virtual service corresponding to the storage service is deployed in each of the storage nodes.
[0144] One of the multiple storage nodes is used to send a notification message to the client when an upgrade is triggered, so that the client switches the service interface for interacting with each storage node to a virtual interface, the service interface corresponds to the storage service, and the virtual interface corresponds to the virtual service.
[0145] Each of the storage nodes is used to execute the upgrade operation of the storage service, and receive the request message sent by the client through the virtual interface, switch the write operation from the storage file created under the storage service to the temporary file created under the virtual service, so as to write the data in the request message into the temporary file.
[0146] Each of the storage nodes is used to send a notification message to the client after completing the upgrade of the storage services of all storage nodes, so that the client will restore the interface for interacting with the storage node.
[0147] The distributed cluster provided in this embodiment can deploy virtual services through virtualization technology, so that when implementing the upgrade of the storage service, the virtual service responds to the client's request, so that the upgrade and restart of the storage service does not affect the client's request response, avoiding the impact on the client's business. It also avoids the defects of the prior art that the upgrade is carried out in turn, the upgrade time of each storage node is inconsistent, and the service version is inconsistent, which affects the normal parsing and access of data.
[0148] In summary, the online upgrade method, device, storage node and distributed cluster provided by the embodiments of the present application deploy virtual services corresponding to the storage service in each storage node of the distributed cluster to form a virtual cluster. When the upgrade process is triggered, a notification message is sent to the client to switch the client from the original service interface to the virtual interface. The storage node receives the request message sent by the client through the virtual interface, and writes the data of the request message from the original storage file to the temporary file to write the data of the request message to the temporary file. After the storage service upgrade of all storage nodes is completed, a notification message is sent to the client again to enable the client to restore the interface for interacting with the storage node. In this solution, a virtual cluster is deployed. When the original storage cluster is upgraded, the processing of the client access request is realized through the virtual cluster. While not affecting the normal processing of the client's request, it can avoid the defect that the data cannot be parsed normally when there are inconsistent versions of each storage node.
[0149] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed in the present application should be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be based on the protection scope of the claims.
Claims
1. An online upgrade method, It is characterized in that Applied to any storage node among a plurality of storage nodes included in a distributed cluster, wherein a virtual service corresponding to a storage service is deployed in the storage node, the method comprising: When the upgrade process is triggered, a notification message is sent to the client, so that the client switches the service interface for interacting with the storage node to a virtual interface, the service interface corresponds to the storage service, and the virtual interface corresponds to the virtual service; Execute an upgrade operation of the storage service, and receive a request message sent by the client through the virtual interface, switch the write operation from the storage file created under the pointed storage service to the temporary file created under the virtual service, so as to write the data in the request message into the temporary file; After completing the upgrade of the storage services of all storage nodes, sending a notification message to the client so that the client can restore the interface for interacting with the storage node; The virtual service is installed with update storage software, and the step of writing the data in the request message into the temporary file comprises: Detect whether the version information of the request message matches the version information of the installed update storage software; if so, parse the request message based on the parsing method corresponding to the update storage software, and write the parsed data into the temporary file; if not, parse the request message using the parsing method corresponding to the version of the request message, and write the parsed data into the temporary file; The method further comprises: When the write operation is switched from the storage file to the temporary file, the offset position of the current write of the storage file is obtained; after the upgrade is completed, a periodic query is made to see whether there is a temporary file. When a temporary file exists, based on the offset position of the storage file mapped by the temporary file, the data in the temporary file is merged into the storage file, and the temporary file is cleared.
2. The online upgrade method according to claim 1, It is characterized in that Before the step of triggering the upgrade process, the method further includes: A request message from a client is received through the service interface, and data in the request message is written into the storage file.
3. The online upgrade method according to claim 1, It is characterized in that The method further comprises: After receiving a message from all clients communicating with the storage node to stop interacting with the virtual service, the deployed virtual service is destroyed.
4. The online upgrade method according to claim 1, It is characterized in that The step of sending a notification message to the client so that the client switches the service interface for interacting with the storage node to a virtual interface includes: Obtain the IP information of the client currently communicating with the storage node, the created virtual interface information, and the IP information of the virtual service; Based on the IP information of the client, the virtual interface information and the IP information of the virtual service are sent to the corresponding client, so that the client switches the service interface for interacting with the storage node to the virtual interface.
5. The online upgrade method according to claim 1, It is characterized in that The step of writing the data in the request message into the temporary file comprises: Splitting the data in the request message according to the number of storage nodes in the distributed cluster; The split data are written into temporary files in each storage node.
6. An online upgrade device, It is characterized in that The method for implementing the online upgrade method according to any one of claims 1 to 5 is applied to any storage node among a plurality of storage nodes included in a distributed cluster, wherein a virtual service corresponding to a storage service is deployed in the storage node, and the device comprises: A first sending module is used to send a notification message to the client when the upgrade process is triggered, so that the client switches the service interface for interacting with the storage node to a virtual interface, the service interface corresponds to the storage service, and the virtual interface corresponds to the virtual service; A writing module, used to perform an upgrade operation of the storage service, and receive a request message sent by the client through the virtual interface, and switch the write operation from the storage file created under the pointed storage service to a temporary file created under the virtual service, so as to write the data in the request message into the temporary file; The second sending module is used to send a notification message to the client after completing the upgrade of the storage services of all storage nodes, so that the client can restore the interface for interacting with the storage nodes.
7. A storage node, It is characterized in that The electronic device comprises one or more storage media and one or more processors communicating with the storage media, wherein the one or more storage media store machine executable instructions executable by the processor, and when the electronic device is running, the processor executes the machine executable instructions to perform the method steps described in any one of claims 1 to 5.
8. A distributed cluster, It is characterized in that Used to implement the online upgrade method according to any one of claims 1 to 5, the distributed cluster includes multiple storage nodes, and a virtual service corresponding to the storage service is deployed in each of the storage nodes; One of the multiple storage nodes is used to send a notification message to the client when triggering an upgrade, so that the client switches the service interface for interacting with each storage node to a virtual interface, the service interface corresponds to the storage service, and the virtual interface corresponds to the virtual service; Each of the storage nodes is configured to receive a request message sent by the client through the virtual interface, and switch a write operation from a storage file created under the storage service to a temporary file created under the virtual service, so as to write data in the request message into the temporary file; Each of the storage nodes is used to execute the upgrade operation of the storage service, and after completing the upgrade of the storage services of all storage nodes, sends a notification message to the client, so that the client will restore the interface for interacting with the storage node.
Citation Information
Patent Citations
Grid resource management system
CN102790788A
Upgrading system and virtual machine-based upgrading method and device
CN108021378A
Multi-cluster data processing system and method
CN112104723A
Data service platform visual management tool, method and application based on resource tree
CN113032364A
Redundant storage solution
US20170163475A1
