Mount recovery method, device, electronic device and readable storage medium
By creating a source directory in the Kubernetes cluster and performing mount recovery operations, the Node node's mount disconnection caused by container group restart or storage source exception is solved, and the mount recovery is completed without restarting all container groups, improving operational stability and security.
Patent Information
- Application Number
- CN202210515017.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-11
- Publication Date
- 2025-05-23
- Estimated Expiration
- 2042-05-11
AI Technical Summary
The Node node in the Kubernetes cluster has mount disconnected due to the reboot of the container storage interface container group or the temporary storage source abnormality. The existing technology requires restarting all container groups in the Node node to restore the mount, which affects the normal operation of the application container group.
By creating a source directory, mount the storage volume corresponding to the container storage interface container group to the source directory, and mount the source directory to the first mount directory, determine the directory where the mount point in the mount point is disconnected in the mount directory of the container storage interface container group as the target directory, and perform the mount recovery operation of the corresponding target directory to complete the mount recovery of the container storage interface container group.
The mount recovery of the container group of the container storage interface is completed without restarting all container groups in the Node node, avoiding affecting the operation of other container groups, and improving the operation stability and security of the container group.
Smart Images

Figure CN115080307B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of data processing technology, and in particular to the field of artificial intelligence technology such as cloud services and big data. A mounting recovery method, device, electronic device and readable storage medium are provided. Background Art
[0002] Kubernetes cluster is an open source container orchestration management platform for managing containerized applications on multiple hosts in a cloud platform, providing mechanisms for application deployment, planning, updating, and maintenance. However, the Node nodes in the Kubernetes cluster (i.e., the working nodes in the Kubernetes cluster) may experience mount disconnection issues due to problems such as the restart of the container storage interface container group in the Node node or temporary abnormality of the storage source.
[0003] Related technologies usually use a method of restarting all container groups in the Node node to complete the mount recovery of the container storage interface container group, but this will affect the normal operation of the application container group in the Node node, causing the application container group to stop service during the restart process. Summary of the invention
[0004] According to a first aspect of the present disclosure, a mount recovery method is provided, comprising: deploying a container storage interface container group; creating a source directory; after mounting a storage volume corresponding to the container storage interface container group to the source directory, mounting the source directory on which the storage volume is mounted to a first mount directory; determining a directory with a disconnected mount point in the directory mounted by the container storage interface container group as a target directory; and performing a mount recovery operation corresponding to the target directory to complete the mount recovery of the container storage interface container group.
[0005] According to a second aspect of the present disclosure, a mount recovery device is provided, comprising: a first deployment unit, used to deploy a container storage interface container group; a creation unit, used to create a source directory; a mounting unit, used to mount the storage volume corresponding to the container storage interface container group to the source directory, and then mount the source directory on which the storage volume is mounted to a first mount directory; a determination unit, used to determine a directory with a disconnected mount point in the directory mounted by the container storage interface container group as a target directory; and a processing unit, used to execute a mount recovery operation corresponding to the target directory to complete the mount recovery of the container storage interface container group.
[0006] According to a third aspect of the present disclosure, an electronic device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the method as described above.
[0007] According to a fourth aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to cause the computer to execute the method as described above.
[0008] According to a fifth aspect of the present disclosure, a computer program product is provided, comprising a computer program, wherein the computer program implements the method as described above when executed by a processor.
[0009] It can be seen from the above technical solution that the present invention mounts the storage volume corresponding to the container storage interface container group by creating a source directory. When the mount point of the directory mounted by the container storage interface container group is disconnected, there is no need to restart all container groups in the Node node to complete the mounting recovery of the container storage interface container group. Therefore, it will not affect the operation of other container groups in the Node node, thereby improving the operating stability and security of the container group.
[0010] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present disclosure.
[0012] Figure 1 is a schematic diagram according to a first embodiment of the present disclosure;
[0013] Figure 2 is a schematic diagram according to a second embodiment of the present disclosure;
[0014] Figure 3 is a schematic diagram according to a third embodiment of the present disclosure;
[0015] Figure 4 is a schematic diagram according to a fourth embodiment of the present disclosure;
[0016] Figure 5 is a schematic diagram according to a fifth embodiment of the present disclosure;
[0017] Figure 6 It is a block diagram of an electronic device used to implement the mount recovery method of the embodiment of the present disclosure. DETAILED DESCRIPTION
[0018] The following is a description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, the description of well-known functions and mechanisms is omitted in the following description.
[0019] Figure 1 Schematic diagram of the first embodiment of the present disclosure. Figure 1 As shown, the mount recovery method of this embodiment specifically includes the following steps:
[0020] S101, deploying a container storage interface container group;
[0021] S102, create a source directory;
[0022] S103: After mounting the storage volume corresponding to the container storage interface container group to the source directory, mount the source directory on which the storage volume is mounted to the first mounting directory;
[0023] S104, determining a directory whose mount point is disconnected in the directory mounted by the container storage interface container group as a target directory;
[0024] S105: Execute a mount recovery operation corresponding to the target directory to complete the mount recovery of the container storage interface container group.
[0025] It should be noted that the step numbering of the present disclosure does not limit the order of execution. For example, the steps of deploying the container storage interface container group and creating the source directory are not limited to first deploying the container storage interface container group and then creating the source directory. It is also possible to first create the source directory and then deploy the container storage interface container group, or to perform them in parallel. The present disclosure does not make specific limitations on this.
[0026] The execution subject of the mount recovery method of this embodiment may be a Node node located in a Kubernetes (k8s) cluster or a k3s cluster, and the Node node deploys a container storage interface (CSI) container group (Pod). After creating a layer of source directory, the storage volume corresponding to the CSI Pod is mounted in the order of source directory-first mount directory, and then the directory with a disconnected mount point in the directory mounted by the CSI Pod is used as the target directory, and then the mount recovery operation corresponding to the directory type of the target directory is performed to complete the mount recovery of the CSI Pod. This embodiment mounts the storage volume corresponding to the CSI Pod by creating a source directory. When the mount point of the directory mounted by the CSI Pod is disconnected, there is no need to restart all Pods in the Node node to complete the mount recovery of the CSI Pod. Therefore, it will not affect the operation of other Pods in the Node node, thereby improving the operation stability and operation security of the Pod.
[0027] In this embodiment, the k8s cluster is taken as an example for explanation. The k8s cluster includes Master nodes (management nodes) and Node nodes (working nodes). The physical machine is a machine that provides a hardware environment for the operation of the Node nodes in the k8s cluster. The physical machine can also be called a host. Pod (container group) is the smallest / simplest basic unit created or deployed in the k8s cluster. A Pod represents a process running in the k8s cluster, and each Pod consists of one or more containers.
[0028] When executing S101, the Node node in this embodiment can set the propagation attribute between the physical machine and the CSI Pod to rshared, so as to realize two-way propagation of information between the deployed CSI Pod and the physical machine. The two-way propagation in this embodiment includes the physical machine propagating the first mount directory to the CSI Pod and the CSI Pod propagating the mount recovery information to the physical machine. The mount recovery information is specifically the first mount directory of the mount source directory, and the storage volume is mounted on the source directory. The number of CSI Pods deployed in this embodiment can be one or more.
[0029] When executing S101 to deploy the CSI Pod, the Node node in this embodiment can also simultaneously mount the data directory / var / lib / kubelet of the kubelet component provided by the physical machine to the CSI Pod in a bidirectional manner; the kubelet component in this embodiment runs on the Node node to provide proxy services such as creation, startup, and mounting of the Pod in the Node node.
[0030] Since the physical machine corresponding to the Node node and the CSI Pod in the Node node correspond to different mount namespaces (Mount Namespace), the Node node in this embodiment deploys the CSI Pod in a two-way information transmission manner with the physical machine, so that the mount information under the mount namespace in the physical machine and the CSI Pod can be visible to each other, so that after the mount recovery of the CSI Pod is completed, the mount information of the CSI Pod is propagated to the physical machine. If there is an application Pod in the Node node, the physical machine can further propagate the mount information of the CSI Pod to the application Pod, so that the application Pod can see the mount information of the CSI Pod, and the mount recovery of the application Pod is completed.
[0031] After executing S101 to deploy the CSI Pod, the Node node of this embodiment executes S102 to create a source directory, and the created source directory is the source directory.
[0032] In the related art, the Node node only mounts the storage volume through the first mount directory (i.e., the mount directory, which is the directory for the Pod to mount the storage volume set by the kubelet component in the Node node and is located in the mount namespace of the physical machine). Therefore, when the mount point of the directory mounted by the CSI Pod is disconnected, all Pods in the Node node need to be restarted to restore the mount, thereby affecting the operation of the application Pod in the Node node.
[0033] That is to say, after the Node node of this embodiment completes the deployment of the CSI Pod, it will create an additional source directory in addition to the existing first mount directory, and complete the mounting of the storage volume through two layers of directories, so as to implement corresponding mount recovery operations according to the directory disconnected by the CSI Pod.
[0034] After executing S102 to create a source directory, the Node node of this embodiment executes S103 to mount the storage volume corresponding to the container storage interface Pod to the source directory, and then mounts the source directory of the mounted storage volume to the first mounting directory.
[0035] Specifically, when the Node node of this embodiment executes S103 to mount the source directory of the mounted storage volume to the first mounted directory, an optional implementation method that can be adopted is: using the mount bind method to mount the source directory of the mounted storage volume to the first mounted directory.
[0036] After the Node node in this embodiment completes mounting the source directory of the mounted storage volume to the first mount directory, it can also map the first mount directory with the mount point in the container when the container in the CSI Pod is started, and then determine the mount point corresponding to the mount directory through the mapping relationship; the mount point in this embodiment is the mount path.
[0037] After executing S103 to mount the source directory of the mounted storage volume to the first mount directory, the Node node in this embodiment executes S104 to determine a directory with a disconnected mount point in the directory mounted by the CSI Pod as a target directory.
[0038] Specifically, when the Node node in this embodiment executes S104 to determine the directory with a disconnected mount point in the directory mounted by the CSI Pod as the target directory, an optional implementation method that can be adopted is: in the order of checking from the source directory to the first mount directory, check whether the mount point of the directory mounted by the CSI Pod is disconnected; and use the directory with a disconnected mount point as the target directory.
[0039] That is to say, this embodiment checks the mount point of the directory through a preset directory check order, and then uses the directory with a disconnected mount point as the target directory, which can improve the efficiency and accuracy of the directory check and improve the success rate of CSI Pod mount recovery.
[0040] If the Node node in this embodiment does not follow the preset directory checking order when executing S104, for example, first checking the first mount directory and then checking the source directory, if the mount points of the first mount directory and the source directory are disconnected at the same time in actual situation, the first mount directory will be determined as the target directory, and then only the mount recovery operation corresponding to the first mount directory will be executed, and the mount recovery operation corresponding to the source directory will not be executed, and the mount recovery of the CSI Pod will still not be completed.
[0041] When the Node node in this embodiment checks whether the mount point of the directory mounted by the CSI Pod is disconnected, if there is a second mount directory of the subpath in the Node node, the second mount directory is checked after the source directory and the first mount directory are checked.
[0042] In addition, when the Node node in this embodiment performs S104 to determine the directory with a disconnected mount point in the directory mounted by the CSI Pod as the target directory, it can also perform regular checks according to a preset time interval to further ensure the stable operation of each Pod in the Node node.
[0043] The Node node in this embodiment can check whether the mount point of the mounted directory is disconnected through a mount point checker module (mount point checker) pre-set in the CSI Pod.
[0044] After executing S104 to determine the target directory, the Node node in this embodiment executes S105 to perform a mount recovery operation of the corresponding target directory to complete the mount recovery of the CSI Pod.
[0045] That is to say, this embodiment completes the mount recovery of the CSI Pod by presetting mount recovery operations corresponding to different target directories and adopting the mount recovery operation corresponding to the disconnected directory in the actual situation, thereby completing the mount recovery of the CSI Pod without restarting all Pods.
[0046] Specifically, when the Node node in this embodiment executes S105 to perform the mount recovery operation of the corresponding target directory to complete the mount recovery of the CSI Pod, an optional implementation method that can be adopted is: when it is determined that the target directory is the source directory, unmount (umount) the source directory, mount (mount) the storage volume corresponding to the CSI Pod to the source directory, and mount (mount bind) the source directory of the mounted storage volume to the first mount directory to complete the mount recovery of the CSI Pod; wherein, the operation of unmounting the source directory performed in this embodiment is to unmount the storage volume mounted to the source directory.
[0047] When the Node node in this embodiment executes S105 to perform the mount recovery operation of the corresponding target directory to complete the mount recovery of the CSI Pod, an optional implementation method that can be adopted is: when it is determined that the target directory is the first mount directory, the source directory of the mounted storage volume is mounted (mount bind) to the first mount directory to complete the mount recovery of the CSI Pod.
[0048] In addition, if the Node node in this embodiment also has a second mount directory of the sub-path, the Node node in this embodiment will mount (mountbind) the source directory of the mounted storage volume to the second mount directory when determining that the target directory is the second mount directory to complete the mount recovery of the CSI Pod.
[0049] Figure 2 is a schematic diagram according to the second embodiment of the present disclosure. Figure 2 As shown, the mount recovery method of this embodiment may further include the following steps:
[0050] S201, deploying an application container group;
[0051] S202: Mount the storage volume to the application container group.
[0052] That is to say, after deploying the application Pod, the Node node in this embodiment will also mount the storage volume corresponding to the CSI Pod to the application Pod, so that the application container group uses the storage volume mounted to the CSI Pod.
[0053] When executing S201 to deploy the application Pod, the Node node in this embodiment can also set up a one-way transmission of information between the application Pod and the physical machine. The one-way transmission is that the physical machine transmits the first mount directory to the application Pod, so that after the mount of the CSI Pod is restored, the mount information of the CSI Pod is bidirectionally transmitted to the physical machine, and then the physical machine transmits the mount information unidirectionally to the application Pod, so that the application Pod can see the mount content after the mount is restored, and the application Pod also completes the mount recovery accordingly, so there is no need to restart the application Pod, thereby ensuring the operation stability and operation safety of the application Pod.
[0054] The Node node in this embodiment executes the application Pod deployed by S201, which can be a Pod that provides neural network training services or neural network prediction services to users.
[0055] When the Node node in this embodiment executes S202, the storage volume corresponding to the CSI Pod can be mounted to the application Pod by first mounting (mount bind) the storage volume to the first mounting directory and then mounting the first mounting directory to the application Pod.
[0056] In addition, when executing S202, the Node node in this embodiment can also mount the first mount directory of the mount source directory to the application Pod, and the source directory mounts the storage volume corresponding to the CSI Pod; that is, the application Pod can complete the mounting of the storage volume based on the mount recovery information obtained by the physical machine through one-way propagation.
[0057] When executing S202, the Node node in this embodiment can set the propagation attribute between the physical machine and the application Pod to rslave, indicating that the propagation direction is from the physical machine to the application Pod (i.e., Host to Container), thereby realizing a one-way propagation of the mount information between the created application Pod and the physical machine from the physical machine to the application Pod.
[0058] Figure 3 is a schematic diagram according to a third embodiment of the present disclosure. Figure 3The figure shows the overall architecture diagram of mounting and recovery in this embodiment: the Node node includes CSI Pod, application Pod and physical machine, the communication relationship between CSI Pod and physical machine is two-way communication, and the communication relationship between application Pod and physical machine is one-way communication; the k8s application program interface server stores the relevant information of all CSI Pods in the Node node; the controller server in the CSI Pod is used to perform mounting and unmounting operations of the CSI Pod.
[0059] Figure 4 is a schematic diagram according to a fourth embodiment of the present disclosure. Figure 4 The figure shows the communication relationship between the Pod and the physical machine in this embodiment: the CSI Pod and the physical machine are bidirectionally communicated by setting the rshared attribute, and the application Pod and the physical machine are unidirectionally communicated by setting the rslave attribute; Figure 4 The podID in the command indicates the identification information of the CSI Pod, PV indicates the storage address, HDFS indicates the file system, / volumeID indicates the storage volume ID, FUSE indicates the mounting tool, Mount Bind indicates the mounting method, / dependency indicates the dependency files required for mounting, and / prefix indicates the prefix of the setting or return attribute.
[0060] Figure 5 is a schematic diagram according to the fifth embodiment of the present disclosure. Figure 5 As shown, the mount recovery device 500 of this embodiment is located at a Node node in a k8s cluster or a k3s cluster, and includes:
[0061] A first deployment unit 501 is used to deploy a container storage interface container group;
[0062] A creation unit 502, used for creating a source directory;
[0063] The mounting unit 503 is used to mount the storage volume corresponding to the container storage interface container group to the source directory, and then mount the source directory on which the storage volume is mounted to the first mounting directory;
[0064] A determining unit 504 is used to determine a directory with a disconnected mount point in the directory mounted by the container storage interface container group as a target directory;
[0065] The processing unit 505 is configured to execute a mount recovery operation corresponding to the target directory to complete the mount recovery of the container storage interface container group.
[0066] The first deployment unit 501 in this embodiment can set the propagation attribute between the physical machine and the CSI Pod to rshared, so as to realize two-way propagation of information between the deployed CSI Pod and the physical machine. The two-way propagation in this embodiment includes the physical machine propagating the first mount directory to the CSI Pod and the CSI Pod propagating the mount recovery information to the physical machine. The mount recovery information is specifically the first mount directory of the mount source directory, and the storage volume is mounted on the source directory. The number of CSI Pods deployed by the deployment unit 501 can be one or more.
[0067] When deploying the CSI Pod, the first deployment unit 501 can also simultaneously mount the data directory / var / lib / kubelet of the kubelet component provided by the physical machine to the CSI Pod in a bidirectional manner; the kubelet component in this embodiment runs on the Node node to provide proxy services such as creation, startup, and mounting of the Pod in the Node node.
[0068] In this embodiment, after the first deployment unit 501 deploys the CSI Pod, the creation unit 502 creates a source directory, and the created source directory is the source directory.
[0069] After the Node node of this embodiment completes the deployment of the CSI Pod, the first creation unit 502 will create an additional source directory in addition to the existing first mounting directory, and complete the mounting of the storage volume through two layers of directories, so as to implement corresponding mounting recovery operations according to the directory disconnected by the CSI Pod.
[0070] In this embodiment, after the creation unit 502 creates the source directory, the mounting unit 503 mounts the storage volume corresponding to the CSI Pod to the source directory, and then mounts the source directory of the mounted storage volume to the first mounting directory.
[0071] Specifically, when the mounting unit 503 mounts the source directory of the mounted storage volume to the first mounted directory, an optional implementation method that can be adopted is: using the mount bind method to mount the source directory of the mounted storage volume to the first mounted directory.
[0072] After the mounting unit 503 completes mounting the source directory of the mounted storage volume to the first mount directory, it can also map the first mount directory with the mount point in the container when the container in the CSI Pod is started, and then determine the mount point corresponding to the mount directory through the mapping relationship; the mount point in this embodiment is the mount path.
[0073] In this embodiment, after the mounting unit 503 mounts the source directory of the mounted storage volume to the first mounting directory, the determining unit 504 determines a directory with a disconnected mounting point in the directory mounted by the CSI Pod as the target directory.
[0074] Specifically, when the determination unit 504 determines the directory with a disconnected mount point in the directory mounted by the CSI Pod as the target directory, an optional implementation method that can be adopted is: checking whether the mount point of the directory mounted by the CSI Pod is disconnected in turn in the order of checking from the source directory to the first mount directory; and taking the directory with a disconnected mount point as the target directory.
[0075] In this embodiment, if there is a second mount directory of the sub-path in the Node node, the second mount directory is checked after the first mount directory is checked.
[0076] In addition, when determining the directory with a disconnected mount point in the directory mounted by the CSI Pod as the target directory, the determining unit 504 may also perform regular checks according to a preset time interval, thereby further ensuring the stable operation of each Pod in the Node.
[0077] The determining unit 504 in this embodiment may be a mount point checker module (mount point checker) pre-set in the CSI Pod.
[0078] In this embodiment, after the determination unit 504 determines the target directory, the processing unit 505 performs a mount recovery operation corresponding to the target directory to complete the mount recovery of the container storage interface Pod.
[0079] That is, the processing unit 505 completes the mount recovery of the CSI Pod by presetting mount recovery operations corresponding to different target directories and adopting the mount recovery operation corresponding to the directory disconnected in the actual situation, thereby completing the mount recovery of the CSI Pod without restarting all Pods.
[0080] Specifically, when the processing unit 505 performs the mount recovery operation of the corresponding target directory and completes the mount recovery of the CSI Pod, an optional implementation method that can be adopted is: when it is determined that the target directory is the source directory, unmount (umount) the source directory, mount (mount) the storage volume corresponding to the CSI Pod to the source directory, and mount (mount bind) the source directory of the mounted storage volume to the first mount directory to complete the mount recovery of the CSI Pod.
[0081] When the processing unit 505 performs the mount recovery operation of the corresponding target directory to complete the mount recovery of the CSI Pod, an optional implementation method that can be adopted is: when it is determined that the target directory is the first mount directory, the source directory of the mounted storage volume is mounted (mount bind) to the first mount directory to complete the mount recovery of the CSI Pod.
[0082] In addition, if the Node node in this embodiment also has a second mount directory of the subpath, the processing unit 505 will mount (mount bind) the source directory of the mounted storage volume to the second mount directory when determining that the target directory is the first mount directory to complete the mount recovery of the CSI Pod.
[0083] The mount recovery device 500 of this embodiment may further include a second deployment unit 506, which is used to execute the following contents: deploy the application container group; and mount the storage volume to the application container group.
[0084] When the second deployment unit 506 deploys the application Pod, the Node node in this embodiment can also set a one-way propagation of information between the application Pod and the physical machine when executing S201 to deploy the application Pod. The one-way propagation is that the physical machine propagates the first mount directory to the application Pod, so that after the mount of the CSI Pod is restored, the mount information of the CSI Pod is bidirectionally propagated to the physical machine, and then the physical machine propagates the mount information unidirectionally to the application Pod, so that the application Pod can see the mount content after the mount is restored, and the application Pod also completes the mount recovery accordingly, so there is no need to restart the application Pod, thereby ensuring the operation stability and operation safety of the application Pod.
[0085] The application Pod deployed by the second deployment unit 506 may be a Pod that provides a neural network training service or a neural network prediction service to users.
[0086] The second deployment unit 506 may first mount the storage volume to the first mount directory, and then mount the first mount directory to the application Pod, to complete mounting the storage volume corresponding to the CSI Pod to the application Pod.
[0087] The second deployment unit 506 may also mount the first mount directory of the mount source directory to the application Pod, where the source directory mounts the storage volume corresponding to the CSI Pod; that is, the application Pod may complete the mounting of the storage volume according to the mount recovery information obtained by the physical machine through unidirectional propagation.
[0088] The second deployment unit 506 can set the propagation attribute between the physical machine and the application Pod to rslave, indicating that the propagation direction is from the physical machine to the application Pod (i.e., Host to Container), thereby realizing that the way of propagating the mount information between the created application Pod and the physical machine is one-way propagation from the physical machine to the application Pod.
[0089] In the technical solution disclosed herein, the acquisition, storage and application of user personal information involved are in compliance with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0090] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium and a computer program product.
[0091] like Figure 6 , is a block diagram of an electronic device according to a mount recovery method of an embodiment of the present disclosure. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.
[0092] like Figure 6 As shown, the device 600 includes a computing unit 601, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 602 or a computer program loaded from a storage unit 608 into a random access memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the device 600 can also be stored. The computing unit 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.
[0093] A number of components in the device 600 are connected to the I / O interface 605, including: an input unit 606, such as a keyboard, a mouse, etc.; an output unit 607, such as various types of displays, speakers, etc.; a storage unit 608, such as a disk, an optical disk, etc.; and a communication unit 609, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 609 allows the device 600 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0094] The computing unit 601 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 601 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 601 performs the various methods and processes described above, such as the mount recovery method. For example, in some embodiments, the mount recovery method may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 608.
[0095] In some embodiments, part or all of the computer program may be loaded and / or installed on the device 600 via the ROM 602 and / or the communication unit 609. When the computer program is loaded into the RAM 603 and executed by the computing unit 601, one or more steps of the mount recovery method described above may be performed. Alternatively, in other embodiments, the computing unit 601 may be configured to perform the mount recovery method in any other appropriate manner (e.g., by means of firmware).
[0096] Various implementations of the systems and techniques described herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0097] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable mount recovery device, so that when the program code is executed by the processor or controller, the functions / operations specified in the flow chart and / or block diagram are implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0098] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0099] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0100] The systems and techniques described herein may be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), and the Internet.
[0101] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship between the client and the server is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or a cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services ("Virtual Private Server", or "VPS" for short). The server may also be a server for a distributed system, or a server combined with a blockchain.
[0102] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.
[0103] The above specific implementations do not constitute a limitation on the protection scope of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.
Claims
1. A mount recovery method, include: Deploy the container storage interface container group; Create a source directory; After mounting the storage volume corresponding to the container storage interface container group to the source directory, mounting the source directory on which the storage volume is mounted to the first mounting directory; Determine a directory whose mount point is disconnected in the directory mounted by the container storage interface container group as the target directory; Execute a mount recovery operation corresponding to the target directory to complete the mount recovery of the container storage interface container group; The step of determining a directory whose mount point is disconnected in the directory mounted by the container storage interface container group as a target directory includes: Checking in sequence from the source directory to the first mount directory whether the mount points of the directories mounted by the container storage interface container group are disconnected; Using the directory where the mount point is disconnected as the target directory; The performing of the mount recovery operation corresponding to the target directory to complete the mount recovery of the container storage interface container group includes: In the case where it is determined that the target directory is the source directory, unmounting the source directory, mounting the storage volume to the source directory, and mounting the source directory on which the storage volume is mounted to the first mounting directory, so as to complete the mount recovery of the container storage interface container group; or In the case where it is determined that the target directory is the first mount directory, the source directory for mounting the storage volume is mounted to the first mount directory to complete the mount recovery of the container storage interface container group.
2. The method according to claim 1, in, The container storage interface container group and the physical machine perform bidirectional information propagation, wherein the bidirectional propagation includes the physical machine propagating the first mount directory to the container storage interface container group and the container storage interface container group propagating mount recovery information to the physical machine.
3. The method according to any one of claims 1 to 2, further comprising: Deploy application container groups; Mount the storage volume to the application container group.
4. The method according to claim 3, in, The application container group and the physical machine perform one-way information propagation, and the one-way propagation includes the physical machine propagating the first mount directory to the application container group.
5. The method according to claim 3, in, The step of mounting the storage volume to the application container group includes: Mounting the storage volume to the first mounting directory; The first mounting directory for mounting the storage volume is mounted to the application container group.
6. The method according to claim 3, in, The step of mounting the storage volume to the application container group includes: The first mount directory for mounting the source directory is mounted to the application container group.
7. A mount recovery device, include: A first deployment unit, configured to deploy a container storage interface container group; Create unit, used to create source directory; A mounting unit, configured to mount the storage volume corresponding to the container storage interface container group to the source directory, and then mount the source directory on which the storage volume is mounted to the first mounting directory; A determination unit, configured to determine a directory whose mount point is disconnected in the directory mounted by the container storage interface container group as a target directory; A processing unit, configured to execute a mount recovery operation corresponding to the target directory to complete the mount recovery of the container storage interface container group; Wherein, when the determining unit determines the directory with a disconnected mount point in the directory mounted by the container storage interface container group as the target directory, specifically executes: Checking in sequence from the source directory to the first mount directory whether the mount points of the directories mounted by the container storage interface container group are disconnected; Using the directory where the mount point is disconnected as the target directory; When the processing unit performs the mount recovery operation corresponding to the target directory to complete the mount recovery of the container storage interface container group, the processing unit specifically performs: In the case where it is determined that the target directory is the source directory, unmounting the source directory, mounting the storage volume to the source directory, and mounting the source directory on which the storage volume is mounted to the first mounting directory, so as to complete the mount recovery of the container storage interface container group; or When it is determined that the target directory is the first mount directory, the source directory for mounting the storage volume is mounted to the first mount directory to complete the mount recovery of the container storage interface container group.
8. The device according to claim 7, in, The container storage interface container group and the physical machine perform bidirectional information propagation, wherein the bidirectional propagation includes the physical machine propagating the first mount directory to the container storage interface container group and the container storage interface container group propagating mount recovery information to the physical machine.
9. The apparatus according to any one of claims 7-8, further comprising a second deployment unit, configured to execute: Deploy application container groups; Mount the storage volume to the application container group.
10. The device according to claim 9, in, The application container group and the physical machine perform one-way information propagation, and the one-way propagation includes the physical machine propagating the first mount directory to the application container group.
11. The device according to claim 9, in, When mounting the storage volume to the application container group, the second deployment unit specifically performs: Mounting the storage volume to the first mounting directory; Mount the first mount directory to the application container group.
12. The device according to claim 9, in, When mounting the storage volume to the application container group, the second deployment unit specifically performs: The first mount directory for mounting the source directory is mounted to the application container group.
13. An electronic device, include: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 6.
14. A non-transitory computer-readable storage medium storing computer instructions, in, The computer instructions are used to cause the computer to execute the method according to any one of claims 1 to 6.
15. A computer program product, comprising a computer program, which, when executed by a processor, implements the method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Data storage method
CN105471989A
Container deployment method and device
CN111506391A