Distributed storage service upgrade method, device, electronic device and storage medium
By replacing and redirecting the iSCSI target process and scheduler process, the problem of virtual machine work being affected during the upgrade of distributed storage services is solved, and an uninterrupted upgrade process is achieved.
Patent Information
- Application Number
- CN202111282904.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-01
- Publication Date
- 2025-03-21
- Estimated Expiration
- 2041-11-01
AI Technical Summary
When upgrading distributed storage services, the iSCSI Target process needs to be restarted, which will affect all virtual machines in the physical server's work.
By obtaining the new iSCSI target process and the new scheduler process, replacing the old process in the visitor object to be updated, and opening the IO redirection channel, sending the SCSI command to the new scheduler process, and finally migrating the ring queue to the new visitor object to complete the upgrade.
The upgrade of distributed storage services does not require restarting the corresponding process of the virtual machine, avoiding the impact of the virtual machine's work.
Smart Images

Figure CN114003341B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of hyper-convergence systems, and more specifically, to a method, device, electronic device, and storage medium for upgrading a distributed storage service. Background Art
[0002] Hyper-converged systems include storage management software and commercial hardware, and usually use virtual storage devices. Hyper-converged systems include multiple physical servers, and all physical nodes on the physical servers are uniformly managed and abstracted into a storage resource pool by the distributed storage system. Each physical server enables an iSCSI Target (tgtd) process as an access service for the distributed storage system. The virtual disk used by the virtual machine is used as an iSCSI Initiator to connect to the LUN on the iSCSI Target through the iSCSI protocol. As a logical storage device, the logical unit number LUN is a storage resource divided from the distributed storage system, and the LUN is usually divided according to the capacity space.
[0003] After upgrading the existing distributed storage service, the iSCSI Target (tgtd) process needs to be restarted, which affects the operation of the virtual machine. Summary of the invention
[0004] The purpose of the embodiments of the present application is to provide a method, device, electronic device and storage medium for upgrading a distributed storage service, so as to solve the technical problem that when upgrading the distributed storage service, the iSCSI Target process needs to be restarted, which affects the operation of all virtual machines in the physical server.
[0005] In the first aspect, an embodiment of the present application provides a method for upgrading a distributed storage service, comprising: obtaining a new iSCSI target process and a new scheduler process of a new visitor object, and using the new iSCSI target process and the new scheduler process to replace the iSCSI target process and the scheduler process to be updated in the visitor object to be updated; sending an IO redirection instruction to the visitor object to be updated, so that the scheduler process to be updated in the visitor object to be updated opens an IO redirection channel, and sends the SCSI commands of the storage system in the circular queue and the SCSI commands returned from the distributed storage to the new scheduler process through the IO redirection channel; sending an IO path switching instruction to a virtual machine, so that the virtual machine disconnects the communication with the iSCSI target process to be updated in the visitor object to be updated according to the IO path switching instruction, and establishes communication with the new iSCSI target process; migrating the circular queue in the visitor object to be updated to the new visitor object to complete the update of the visitor object to be updated.
[0006] When updating a visitor object, the embodiment of the present application first replaces the new version of the program, then opens the IO redirection channel, sends the SCSI commands stored in the circular queue to the new scheduler process, and then migrates the circular queue to the new visitor object to complete the update of the visitor object. There is no need to restart the processes corresponding to all virtual machines in the physical server, and the normal operation of the virtual machines in the physical server will not be affected.
[0007] In any embodiment, the method of obtaining a new iSCSI target process and a new scheduler process of a new accessor object, and using the new iSCSI target process and the new scheduler process to replace the iSCSI target process and the scheduler process to be updated in the accessor object to be updated, includes: obtaining a binary program corresponding to the new iSCSI target process and a binary program corresponding to the new scheduler process; replacing the binary program of the iSCSI target process to be updated with the binary program of the new iSCSI target process; replacing the binary program of the scheduler process to be updated with the binary program of the new scheduler process; and starting the new iSCSI target process and the new scheduler process.
[0008] The embodiment of the present application updates the process in the visitor object by replacing the binary program of the iSCSI target process to be updated with the binary program of the new iSCSI target process and replacing the binary program of the scheduler process to be updated with the binary program of the new scheduler process.
[0009] In any embodiment, the migrating the circular queue in the visitor object to be updated to the new visitor object includes: adding the address corresponding to the circular queue in the visitor object to be updated to the circular queue of the new visitor object, so as to realize the migration of the circular queue, and such migration will not affect the normal operation of the virtual machine in the physical server.
[0010] In any embodiment, after sending the IO redirection instruction to the visitor object to be updated, the method also includes: if all SCSI processing commands in the scheduler process to be updated are processed, and all the SCSI commands in the circular queue in the visitor object to be updated are sent to the new scheduler process, then the IO redirection channel is closed.
[0011] In any embodiment, after completing the update of the visitor object to be updated, the method further includes: deleting the visitor object to be updated. Since the visitor to be updated is started based on the old version of the binary and cannot be reused, deleting it reduces the memory usage.
[0012] In any embodiment, after completing the update of the visitor object to be updated, the method further includes: receiving an iSCSI data packet sent by the virtual machine; parsing the iSCSI data packet into a SCSI command through the iSCSI target process of the new visitor object, and storing the SCSI command in the circular queue of the new visitor object, wherein the SCSI command is a command for operating a logical block device of a target logical unit number; reading and processing the SCSI command from the circular queue through the new scheduler process of the new visitor object to obtain a SCSI processing command; sending the SCSI processing command to a distributed storage system so that the distributed storage system returns an operation result corresponding to the SCSI processing command. In the embodiment of the present application, the iSCSI target process accessed by the virtual machine through the iSCSI Initiator is 1:1. When an exception occurs in the iSCSI Target process or the scheduler process, the scope of influence is controlled within the same visitor object, and the virtual machines do not share the visitor object, so the normal use of other virtual machines will not be affected.
[0013] In a second aspect, an embodiment of the present application provides an upgrade device for a distributed storage service, comprising: an acquisition module, used to acquire a new iSCSI target process and a new scheduler process of a new visitor object, and use the new iSCSI target process and the new scheduler process to replace the iSCSI target process and the scheduler process to be updated in the visitor object to be updated; a redirection module, used to send an IO redirection instruction to the visitor object to be updated, so that the scheduler process to be updated in the visitor object to be updated opens an IO redirection channel, and sends the SCSI commands of the storage system in the circular queue and the SCSI commands returned from the distributed storage to the new scheduler process through the IO redirection channel; a switching module, used to send an IO path switching instruction to the virtual machine, so that the virtual machine disconnects the communication with the iSCSI target process to be updated in the visitor object to be updated according to the IO path switching instruction, and establishes communication with the new iSCSI target process; a migration module, used to migrate the circular queue in the visitor object to be updated to the new visitor object, so as to complete the update of the visitor object to be updated.
[0014] In a third aspect, an embodiment of the present application provides a physical server, comprising: a processor, a memory and a bus, wherein the processor and the memory communicate with each other through the bus; the memory stores program instructions that can be executed by the processor, and the processor calls the program instructions to execute the method of the first aspect.
[0015] In a fourth aspect, an embodiment of the present application provides a non-transitory computer-readable storage medium, comprising: the non-transitory computer-readable storage medium stores computer instructions, and the computer instructions enable the computer to execute the method of the first aspect.
[0016] In a fifth aspect, an embodiment of the present application provides a distributed storage system, comprising multiple physical servers as described in the third aspect, wherein the memories in the multiple physical servers are uniformly managed by the system.
[0017] Other features and advantages of the present application will be described in the following description, and partly become apparent from the description, or be understood by practicing the embodiments of the present application. The purpose and other advantages of the present application can be realized and obtained by the structures specifically pointed out in the written description, claims, and drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments of the present application 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.
[0019] Figure 1 A hyper-converged system architecture diagram provided for comparison;
[0020] Figure 2 A schematic diagram of a new hyper-convergence system framework provided in an embodiment of the present application;
[0021] Figure 3 A schematic diagram of a distributed storage service upgrade method provided in an embodiment of the present application;
[0022] Figure 4 A schematic diagram of another method for upgrading a distributed storage service provided in an embodiment of the present application;
[0023] Figure 5 A schematic diagram of the structure of an upgrade device for a distributed storage service provided in an embodiment of the present application;
[0024] Figure 6 A schematic diagram of the physical structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0025] For ease of understanding, the relevant features involved in the embodiments of the present application are explained:
[0026] Hyper-Converged Infrastructure (HCI) is an information infrastructure framework that integrates storage devices and virtual computing. In such an architecture environment, hardware units such as servers and storage from the same manufacturer are integrated into a chassis with virtualization software.
[0027] A hyper-converged system is a system that uses a hyper-converged infrastructure (HCI) to manage storage-related software and hardware, and is usually applied to virtual storage devices. A hyper-converged system uses a virtual machine (VM)-centric strategy to integrate storage management, data protection, and networking into one box, thereby providing users with virtual machine-related services.
[0028] iSCSI (Internet Small Computer System Interface): is a storage protocol based on TCP / IP network and SCSI-3, proposed by the Internet Engineering Task Force (IETF) and became a formal standard. iSCSI is a client-server architecture, the client is called iSCSI Initiator, and the server is called iSCSI Target (iSCSI target process).
[0029] The iSCSI Initiator creates a virtual SCSI device and receives IO requests for writing or reading from the SCSI device. These requests are encapsulated by the SCSI protocol and are collectively referred to as SCSI commands. The SCSI commands / data blocks are then encapsulated into iSCSI packets, which are then encapsulated into TCP packets and IP messages and sent over the TCP / IP network.
[0030] The iSCSI Target establishes a TCP connection with the iSCSI Initiator, receives the request sent by the Initiator, decapsulates it to obtain the iSCSI packet and SCSI command, and finally parses the SCSI command and stores the data.
[0031] TGT is a widely used iSCSI Target software in Linux systems. TGT implements the iSCSI server completely in user mode, avoiding the pure kernel mode implementation of STGT and LIO. When a vulnerability (bug) appears in the server, it is easy to cause a kernel crash. In a distributed storage system, a variety of advanced functions are required, such as IOPS limitation, network RAID, erasure code characteristics, and Cache. Using the TGT framework to add them can avoid kernel development and improve stability.
[0032] Logical Unit Number (LUN) refers to the device identification number of a logical storage device, that is, the storage device identification number used according to logical space requirements. It can refer to a storage space resource divided from a distributed storage system. LUN can usually be divided according to capacity space.
[0033] Figure 1 A hyper-converged system architecture diagram provided for comparison, such as Figure 1 As shown, the hyper-converged system includes multiple physical servers, each of which includes at least one virtual machine and at least one disk. The disks corresponding to all physical servers are uniformly managed by the hyper-converged system. Each physical server enables an iSCSI Target (tgtd) process as the access service of the distributed storage system. Each virtual machine corresponds to a logical unit number. The logical unit number LUN is a logical storage device, which is a storage resource divided from the distributed storage system. Usually, LUN is divided according to capacity space. The virtual disk in the virtual machine acts as an iSCSI Initiator and connects to the LUN on the iSCSI Target through the iSCSI protocol.
[0034] Since virtual machines on the same physical server share one iSCSI Target (tgtd) process, when the iSCSI Target (tgtd) process is upgraded, the process needs to be restarted, which will affect the normal operation of all virtual machines on the physical server.
[0035] In order to solve this technical problem, an embodiment of the present application provides a method for upgrading a distributed storage service, which updates an iSCSI target process and a scheduler process, then opens an IO redirection channel, so that the SCSI commands in the circular queue are sent to the new scheduler process, and then sends an IO path switching instruction to the virtual machine, so that the virtual machine accesses a new visitor object. After all the SCSI commands in the circular queue are sent to the new scheduler process, the circular queue is migrated to the new visitor object, thereby completing the replacement of the original visitor object with the new visitor object, and realizing the upgrade of the original visitor object. During the entire upgrade process, the processing of the business will not be stopped, so the normal operation of the virtual machine will not be affected.
[0036] Since this upgrade method is based on the new hyper-converged system framework, before introducing the upgrade method, the new hyper-converged system framework is described first. Figure 2 A schematic diagram of a new hyper-convergence system framework provided in an embodiment of the present application is shown in FIG. Figure 2As shown, the hyper-convergence system may include multiple physical servers; at least one virtual machine is running on each physical server, and each virtual machine corresponds to an accessor object. The virtual machine communicates with the accessor object on the server through the kernel protocol stack using the iSCSI protocol. A accessor object includes an iSCSI target process, a ring queue, and a dispatcher process.
[0037] The iSCSI target process and the scheduler process communicate with each other (receive and send SCSI commands) through a circular queue, and the iSCSI target process only operates on a logical block device of a logical unit number (LUN) (eg, increases or decreases the space of the logical block device).
[0038] The ring queue is used to temporarily store SCSI commands. The purpose is to solve the problem of abnormal downtime causing a small amount of data loss and the need to repair the virtual machine file system through a persistent ring queue. The ring queue is usually implemented based on shared memory. In addition to the non-persistent ring queue implementation of shared memory, the ring queue structure in the embodiment of the present application also introduces a data persistence ring queue implementation of ultra-high-speed storage devices (such as Intel Optane, Samsung Z-SSD).
[0039] When a physical server crashes, loses power, or needs to be restarted, or a virtual machine crashes, freezes, or needs to be restarted, if there is data in the non-persistent ring queue based on memory, a small amount of data will be lost, and the virtual disk of the virtual machine may need to repair the file system and fail to start normally. The non-persistent ring queue can avoid this problem. When the virtual machine restarts, the data in the ring queue is taken out from the ultra-high-speed storage device and flushed to the distributed storage. The LUN starts to provide services again, and the virtual machine reads the operating system data from the LUN and starts the system.
[0040] The above-mentioned hyper-converged system may also include a distributed storage system, which is a system that manages multiple dispersed storage devices (such as multiple disks) as a virtual elastic and scalable whole. In other words, the disks directly connected to the above physical servers may be managed by the distributed storage system or not. When the disks directly connected to the physical server are managed by the distributed storage system, the visitor object and the distributed storage system communicate with each other using the Transmission Control Protocol / Internet Protocol (TCP / IP). When the disks directly connected to the physical server are not managed by the distributed storage system, the physical server and the disk communicate directly with each other through the SCSI protocol.
[0041] In the hyper-converged system provided in the embodiment of the present application, the iSCSI Target accessed by the virtual machine through the iSCSI Initiator is 1:1. When an exception occurs in the iSCSI Target process or the Dispatcher process, the impact range is controlled within the same Accessor object. The virtual machines do not share the Accessor object, so the normal use of other virtual machines will not be affected.
[0042] The technical solutions in the embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application.
[0043] Figure 3 A schematic diagram of a distributed storage service upgrade method provided in an embodiment of the present application is shown in FIG. Figure 3 As shown, the method is applied to the upgrade module in the new hyper-convergence system provided in the above embodiment, and the upgrade module is a functional module in the new hyper-convergence system. The method includes:
[0044] Step 301: Obtain a new iSCSI target process and a new scheduler process of a new visitor object, and use the new iSCSI target process and the new scheduler process to replace the iSCSI target process to be updated and the scheduler process to be updated in the visitor object to be updated.
[0045] Wherein, the new visitor object is an upgraded version of the visitor object to be updated. The purpose of the embodiment of the present application is to update and upgrade the visitor object to be updated, that is, to replace the visitor object to be updated with the new visitor object. The new visitor object includes a new iSCSI target process and a new scheduler process. It can be understood that the new iSCSI target process and the new scheduler process are pre-created. After receiving the new iSCSI target process and the new scheduler process, the iSCSI target process to be updated is replaced by the new iSCSI target process, and the scheduler process to be updated is replaced by the new scheduler process.
[0046] It should be noted that the circular queue does not need to be recreated. After the new iSCSI target process replaces the iSCSI target process to be updated, and the new scheduler process replaces the scheduler process to be updated, the process required for the new visitor object is started. The new iSCSI target process and the new scheduler process point to the circular queue in the visitor object to be updated. In other words, the new iSCSI target process and the new scheduler process communicate with the circular queue in the visitor object to be updated.
[0047] Step 302: Send an IO redirection instruction to the visitor object to be updated, so that the scheduler process to be updated in the visitor object to be updated opens an IO redirection channel, and sends the SCSI commands of the storage system in the circular queue and the SCSI commands returned from the distributed storage to the new scheduler process through the IO redirection channel.
[0048] In the specific implementation process, the upgrade module sends an IO redirection instruction to the visitor object to be updated, and the instruction is used to enable the scheduler process to be updated to open the IO redirection channel. After opening the IO redirection channel, the scheduler process to be updated obtains the temporarily stored SCSI commands from the circular queue, and sends the temporarily stored SCSI commands in the circular queue and the SCSI commands received from the distributed storage to the new scheduler process through the IO redirection channel.
[0049] Step 303: Send an IO path switching instruction to the virtual machine, so that the virtual machine disconnects the communication with the iSCSI target process to be updated in the visitor object to be updated according to the IO path switching instruction, and establishes communication with the new iSCSI target process.
[0050] In the specific implementation process, since each virtual machine in the physical server corresponds to a visitor object, the upgrade model sends an IO path switching instruction to the virtual machine corresponding to the visitor object to be updated, so that the virtual machine can communicate with the iSCSI target process to be updated and establish communication with the new iSCSI target process, so that the virtual machine can use the iSCSI protocol to access the LUN of the new iSCSI target process in the new visitor object through the iSCSI Initiator.
[0051] Step 304: Migrate the circular queue in the visitor object to be updated to the new visitor object to complete the update of the visitor object to be updated.
[0052] In a specific implementation process, after determining that all SCSI commands in the circular queue are transferred to the new update scheduler process scheduler, the circular queue is released from the visitor object to be updated and incorporated into the new visitor object. The specific implementation method can be to delete the address of the circular queue in the visitor object to be updated, and write the deleted address into the new visitor object.
[0053] When updating a visitor object, the embodiment of the present application first replaces the new version of the program, then opens the IO redirection channel, sends the SCSI commands stored in the circular queue to the new scheduler process, and then migrates the circular queue to the new visitor object to complete the update of the visitor object. There is no need to restart the processes corresponding to all virtual machines in the physical server, and the normal operation of the virtual machines in the physical server will not be affected.
[0054] Based on the above embodiment, the upgrade of the iSCSI target process to be updated and the scheduler process to be updated is achieved in the following manner:
[0055] Obtain a binary program corresponding to the new iSCSI target process and a binary program corresponding to the new scheduler process; it is understandable that the above binary programs are all pre-written.
[0056] Replacing the binary program of the iSCSI target process to be updated with the binary program of the new iSCSI target process; replacing the binary program of the scheduler process to be updated with the binary program of the new scheduler process;
[0057] After the replacement is completed, a new iSCSI target process and the new scheduler process are started.
[0058] The embodiment of the present application updates the process in the visitor object by replacing the binary program of the iSCSI target process to be updated with the binary program of the new iSCSI target process and replacing the binary program of the scheduler process to be updated with the binary program of the new scheduler process.
[0059] Based on the above embodiment, after sending the IO redirection instruction to the visitor object to be updated, the method further includes:
[0060] If all SCSI processing commands in the to-be-updated scheduler process are processed completely, and all the SCSI commands in the circular queue in the to-be-updated visitor object are sent to the new scheduler process, the IO redirection channel is closed.
[0061] In the specific implementation process, if all SCSI processing commands in the scheduler process to be updated are processed, and all SCSI commands in the circular queue in the visitor object to be updated are sent to the new scheduler process, it means that there are no commands to be executed in the visitor object to be updated, and the IO redirection channel can be closed at this time.
[0062] Figure 4 A schematic diagram of another method for upgrading a distributed storage service provided in an embodiment of the present application is shown in FIG. Figure 4 As shown:
[0063] Step 1: Replace the binary program of the Accessor object to be updated in the operating system with the binary program of the new Accessor object (such as the binary program of iSCSI Target and Dispatcher). After the replacement is completed, start the process required by the new Accessor object, but the Ring does not need to be created, but points to the Ring of the Accessor object to be updated.
[0064] Step ②: The upgrade module of the hyper-converged system notifies the updated Dispatcher process of the Accessor object to be updated to open the IO redirection channel, and forwards the SCSI commands obtained from the Ring and the SCSI commands returned by the distributed storage to the new Dispatcher process of the new Accessor object for processing.
[0065] Step 3: The hyper-converged upgrade module notifies the virtual machine to switch the IO path to the new Accessor object and access the LUN of the new iSCSI Target object.
[0066] Step ④: After the updated Accessor object is taken over and switched, it will no longer provide services, and the commands in the Ring will be quickly sent down and handed over to the new Dispatcher process of the new Accessor object through the IO redirection channel for processing.
[0067] Step 5: After waiting for the Accessor object to be updated, the commands being processed by the Dispatcher process to be updated and the command redirection in the Ring are completed, and then the IO redirection channel will be closed.
[0068] Step 6: The Accessor object to be updated releases the Ring, and the new Accessor object manages the Ring.
[0069] Step 7: The process in the Accessor object to be updated is started based on the binary of the old version and cannot be reused. All processes need to be closed and their resources destroyed.
[0070] Based on the above embodiment, after completing the update of the visitor object to be updated, the method further includes:
[0071] The visitor object to be updated is deleted.
[0072] In the specific implementation process, after the new visitor object replaces the visitor object to be updated, since the iSCSI target process to be updated and the scheduler process to be updated in the visitor object to be updated are started based on the old version of the binary program, there is no way to reuse them. In order to reduce the memory usage, the iSCSI target process to be updated and the scheduler process to be updated in the visitor object to be updated are closed and their resources are destroyed.
[0073] On the basis of the above embodiment, after completing the update of the visitor object to be updated, the data interaction method between the virtual machine and the distributed storage system is implemented through a new visitor object, and the specific method is as follows:
[0074] Step 1: Receive the iSCSI data packet sent by the virtual machine;
[0075] Step 2: The iSCSI target process of the new visitor object connected to the virtual machine parses the iSCSI data packet into a SCSI command and stores the SCSI command in the circular queue of the new visitor object. It can be understood that the SCSI command is a command for operating the logical block device LUN of the target logical unit number.
[0076] Step 3: Read and process the SCSI command from the ring queue through the new scheduler process of the new visitor object to obtain the SCSI processing command;
[0077] Step 4: Send a SCSI processing command to the distributed storage system. After receiving the SCSI processing command, the distributed storage system processes the SCSI processing command and returns the processing result to the new scheduler process. After receiving the processing result, the new scheduler process packages the processing result into a SCSI command and writes it into the circular queue again.
[0078] Figure 5 This is a schematic diagram of a distributed storage service upgrade device provided in an embodiment of the present application. The device may be a module, program segment or code on an electronic device. It should be understood that the device is similar to the above-mentioned Figure 3 The method embodiment corresponds to and can be executed Figure 3 The various steps involved in the method embodiment and the specific functions of the device can be found in the above description. To avoid repetition, detailed description is appropriately omitted here. The device includes: an acquisition module 501, a redirection module 502, a switching module 503 and a migration module 504, wherein:
[0079] The acquisition module 501 is used to acquire the new iSCSI target process and the new scheduler process of the new visitor object, and use the new iSCSI target process and the new scheduler process to replace the iSCSI target process and the scheduler process to be updated in the visitor object to be updated; the redirection module 502 is used to send an IO redirection instruction to the visitor object to be updated, so that the scheduler process to be updated in the visitor object to be updated opens an IO redirection channel, and sends the SCSI commands of the storage system in the circular queue and the SCSI commands returned from the distributed storage to the new scheduler process through the IO redirection channel; the switching module 503 is used to send an IO path switching instruction to the virtual machine, so that the virtual machine disconnects the communication with the iSCSI target process to be updated in the visitor object to be updated according to the IO path switching instruction, and establishes communication with the new iSCSI target process; the migration module 504 is used to migrate the circular queue in the visitor object to be updated to the new visitor object to complete the update of the visitor object to be updated.
[0080] Based on the above embodiment, the acquisition module 501 is specifically used for:
[0081] Obtaining a binary program corresponding to the new iSCSI target process and a binary program corresponding to the new scheduler process;
[0082] Replacing the binary program of the iSCSI target process to be updated with the binary program of the new iSCSI target process;
[0083] Replacing the binary program of the to-be-updated scheduler process with the binary program of the new scheduler process;
[0084] The new iSCSI target process and the new scheduler process are started.
[0085] Based on the above embodiment, the migration module 504 is specifically used for:
[0086] The address corresponding to the circular queue in the visitor object to be updated is added to the circular queue of the new visitor object.
[0087] On the basis of the above embodiment, the device further comprises a channel closing module, which is used for:
[0088] If all SCSI processing commands in the to-be-updated scheduler process are processed completely, and all the SCSI commands in the circular queue in the to-be-updated visitor object are sent to the new scheduler process, the IO redirection channel is closed.
[0089] Based on the above embodiment, the device further includes a deletion module, which is used to:
[0090] The visitor object to be updated is deleted.
[0091] Based on the above embodiment, the device further includes a command processing module, which is used to:
[0092] Receiving an iSCSI data packet sent by the virtual machine;
[0093] Parsing the iSCSI data packet into a SCSI command through the iSCSI target process of the new visitor object, and storing the SCSI command in a circular queue of the new visitor object, wherein the SCSI command is a command for operating a logical block device of a target logical unit number;
[0094] Reading and processing the SCSI command from the circular queue through the new scheduler process of the new visitor object to obtain a SCSI processing command;
[0095] The SCSI processing command is sent to the distributed storage system, so that the distributed storage system returns an operation result corresponding to the SCSI processing command.
[0096] Figure 6 A schematic diagram of the physical structure of an electronic device provided in an embodiment of the present application, such as Figure 6 As shown, the electronic device includes: a processor (processor) 601, a memory (memory) 602 and a bus 603; wherein,
[0097] The processor 601 and the memory 602 communicate with each other via the bus 603;
[0098] The processor 601 is used to call the program instructions in the memory 602 to execute the methods provided by the above-mentioned method embodiments, for example, including: obtaining a new iSCSI target process and a new scheduler process of a new visitor object, and using the new iSCSI target process and the new scheduler process to replace the iSCSI target process to be updated and the scheduler process to be updated in the visitor object to be updated; sending an IO redirection instruction to the visitor object to be updated, so that the scheduler process to be updated in the visitor object to be updated opens an IO redirection channel, and sends the SCSI commands of the storage system in the circular queue and the SCSI commands returned from the distributed storage to the new scheduler process through the IO redirection channel; sending an IO path switching instruction to the virtual machine, so that the virtual machine disconnects the communication with the iSCSI target process to be updated in the visitor object to be updated according to the IO path switching instruction, and establishes communication with the new iSCSI target process; migrating the circular queue in the visitor object to be updated to the new visitor object to complete the update of the visitor object to be updated.
[0099] The processor 601 may be an integrated circuit chip with signal processing capabilities. The processor 601 may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it may also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. It may implement or execute various methods, steps and logic block diagrams disclosed in the embodiments of the present application. A general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
[0100] The memory 602 may include but is not limited to random access memory (RAM), read only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable read-only memory (EEPROM), etc.
[0101] The present embodiment discloses a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium, and the computer program includes program instructions. When the program instructions are executed by a computer, the computer can execute the methods provided by the above-mentioned method embodiments, for example, including: obtaining a new iSCSI target process and a new scheduler process of a new visitor object, and replacing the iSCSI target process to be updated and the scheduler process to be updated in the visitor object to be updated with the new iSCSI target process and the new scheduler process; sending an IO redirection instruction to the visitor object to be updated, so that the scheduler process to be updated in the visitor object to be updated opens an IO redirection channel, and sends the SCSI commands of the storage system in the circular queue and the SCSI commands returned from the distributed storage to the new scheduler process through the IO redirection channel; sending an IO path switching instruction to a virtual machine, so that the virtual machine disconnects the communication with the iSCSI target process to be updated in the visitor object to be updated according to the IO path switching instruction, and establishes communication with the new iSCSI target process; migrating the circular queue in the visitor object to be updated to the new visitor object to complete the update of the visitor object to be updated.
[0102] The present embodiment provides a non-transitory computer-readable storage medium, which stores computer instructions, and the computer instructions enable the computer to execute the methods provided by the above-mentioned method embodiments, for example, including: obtaining a new iSCSI target process and a new scheduler process of a new visitor object, and using the new iSCSI target process and the new scheduler process to replace the iSCSI target process to be updated and the scheduler process to be updated in the visitor object to be updated; sending an IO redirection instruction to the visitor object to be updated, so that the scheduler process to be updated in the visitor object to be updated opens an IO redirection channel, and sends the SCSI commands of the storage system in the circular queue and the SCSI commands returned from the distributed storage to the new scheduler process through the IO redirection channel; sending an IO path switching instruction to a virtual machine, so that the virtual machine disconnects the communication with the iSCSI target process to be updated in the visitor object to be updated according to the IO path switching instruction, and establishes communication with the new iSCSI target process; migrating the circular queue in the visitor object to be updated to the new visitor object to complete the update of the visitor object to be updated.
[0103] In the embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, and the indirect coupling or communication connection of the devices or units can be electrical, mechanical or other forms.
[0104] In addition, the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0105] Furthermore, the functional modules in the various embodiments of the present application may be integrated together to form an independent part, or each module may exist independently, or two or more modules may be integrated to form an independent part.
[0106] In this document, relational terms such as first and second, etc. are used merely to distinguish one entity or operation from another entity or operation, but do not necessarily require or imply any such actual relationship or order between these entities or operations.
[0107] The above description is only an embodiment of the present application and is not intended to limit the protection scope of the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.
Claims
1. A method for upgrading a distributed storage service, characterized in that: include: Acquire a new iSCSI target process and a new scheduler process of the new visitor object, and use the new iSCSI target process and the new scheduler process to replace the iSCSI target process to be updated and the scheduler process to be updated in the visitor object to be updated; Sending an IO redirection instruction to the visitor object to be updated, so that the scheduler process to be updated in the visitor object to be updated opens an IO redirection channel, and sends the SCSI commands of the storage system in the circular queue and the SCSI commands returned from the distributed storage to the new scheduler process through the IO redirection channel; Sending an IO path switching instruction to the virtual machine, so that the virtual machine disconnects the communication with the iSCSI target process to be updated in the visitor object to be updated according to the IO path switching instruction, and establishes communication with the new iSCSI target process; Migrating the circular queue in the visitor object to be updated to the new visitor object to complete the update of the visitor object to be updated; Wherein, each virtual machine corresponds to a visitor object, and the virtual machine communicates with the visitor object on the server through the kernel protocol stack by using the iSCSI protocol. One visitor object includes an iSCSI target process, a circular queue and a scheduler process; the iSCSI target process and the scheduler process communicate with each other through the circular queue to receive and send SCSI commands, and the circular queue is used to temporarily store the SCSI commands. The iSCSI target process only operates on a logical block device of a logical unit number LUN; the new visitor object is an upgraded version of the visitor object to be updated.
2. The method according to claim 1, characterized in that The step of obtaining a new iSCSI target process and a new scheduler process of the new visitor object, and replacing the iSCSI target process to be updated and the scheduler process to be updated in the visitor object to be updated with the new iSCSI target process and the new scheduler process, comprises: Obtaining a binary program corresponding to the new iSCSI target process and a binary program corresponding to the new scheduler process; Replacing the binary program of the iSCSI target process to be updated with the binary program of the new iSCSI target process; Replacing the binary program of the to-be-updated scheduler process with the binary program of the new scheduler process; The new iSCSI target process and the new scheduler process are started.
3. The method according to claim 1, characterized in that The step of migrating the circular queue in the visitor object to be updated to the new visitor object includes: The address corresponding to the circular queue in the visitor object to be updated is added to the circular queue of the new visitor object.
4. The method according to claim 1, characterized in that: After sending the IO redirection instruction to the visitor object to be updated, the method further includes: If all SCSI processing commands in the to-be-updated scheduler process are processed completely, and all the SCSI commands in the circular queue in the to-be-updated visitor object are sent to the new scheduler process, the IO redirection channel is closed.
5. The method according to claim 1, characterized in that After completing the update of the visitor object to be updated, the method further includes: The visitor object to be updated is deleted.
6. The method according to claim 1, characterized in that After completing the update of the visitor object to be updated, the method further includes: Receiving an iSCSI data packet sent by the virtual machine; Parsing the iSCSI data packet into a SCSI command through the iSCSI target process of the new visitor object, and storing the SCSI command in a circular queue of the new visitor object, wherein the SCSI command is a command for operating a logical block device of a target logical unit number; Reading and processing the SCSI command from the circular queue through the new scheduler process of the new visitor object to obtain a SCSI processing command; The SCSI processing command is sent to the distributed storage system, so that the distributed storage system returns an operation result corresponding to the SCSI processing command.
7. A distributed storage service upgrade device, characterized in that: include: An acquisition module, used for acquiring a new iSCSI target process and a new scheduler process of a new visitor object, and replacing the iSCSI target process to be updated and the scheduler process to be updated in the visitor object to be updated with the new iSCSI target process and the new scheduler process; A redirection module, used for sending an IO redirection instruction to the visitor object to be updated, so that the scheduler process to be updated in the visitor object to be updated opens an IO redirection channel, and sends the SCSI commands of the storage system in the circular queue and the SCSI commands returned from the distributed storage to the new scheduler process through the IO redirection channel; A switching module, used for sending an IO path switching instruction to the virtual machine, so that the virtual machine disconnects the communication with the iSCSI target process to be updated in the visitor object to be updated according to the IO path switching instruction, and establishes communication with the new iSCSI target process; A migration module, used for migrating the circular queue in the visitor object to be updated to the new visitor object, so as to complete the update of the visitor object to be updated; Wherein, each virtual machine corresponds to a visitor object, and the virtual machine communicates with the visitor object on the server through the kernel protocol stack by using the iSCSI protocol. One visitor object includes an iSCSI target process, a circular queue and a scheduler process; the iSCSI target process and the scheduler process communicate with each other through the circular queue to receive and send SCSI commands, and the circular queue is used to temporarily store the SCSI commands. The iSCSI target process only operates on a logical block device of a logical unit number LUN; the new visitor object is an upgraded version of the visitor object to be updated.
8. A physical server, characterized in that: include: processor, memory and bus, wherein, The processor and the memory communicate with each other via the bus; The memory stores program instructions executable by the processor, and the processor can execute the method according to any one of claims 1 to 6 by calling the program instructions.
9. A non-transitory computer-readable storage medium, characterized in that: The non-transitory computer-readable storage medium stores computer instructions, which, when executed by a computer, cause the computer to perform the method according to any one of claims 1 to 6.
10. A distributed storage system, characterized in that: It comprises a plurality of physical servers as claimed in claim 8, and the memories in the plurality of physical servers are uniformly managed by the system.
Citation Information
Patent Citations
Method and device for updating resources of Android application software
CN105630518A
Virtual machine hot upgrading method and device and related equipment thereof
CN110489150A