Storage mounting method, device and electronic equipment
By controlling the CSI container to call the root process of the operating system in the node to execute the mount command, the problem of the daemon stopping during the CSI container update or abnormal restart is solved, and the efficiency and stability of storage mounts are improved.
Patent Information
- Application Number
- CN202210137743.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-02-15
- Publication Date
- 2024-11-15
- Estimated Expiration
- 2042-02-15
AI Technical Summary
The existing storage mount method stops when the CSI container is updated or abnormally restarted, resulting in poor storage mount efficiency.
By calling the root process of the operating system in the control node, the object storage resource is mounted to the local file system, ensuring that the daemon is not affected when the CSI container is updated or abnormally restarted.
Improves the efficiency of storage mounts, prevents mount problems during CSI container updates or abnormal restarts, and ensures the stability and efficiency of the mount process.
Smart Images

Figure CN114546269B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a storage mounting method, device and electronic device. Background Art
[0002] In the related art, the storage mounting method is mainly based on the mechanism of CSI container. The CSI container in the node will call the root process in the CSI container to execute the mounting command. In the above scheme, since the mounting command is executed by the root process of the CSI container, the daemon process is executed by the root process of the CSI container. When the CSI container is updated or restarted abnormally, the daemon process will stop, which makes the storage mounting easy to have problems and the storage mounting efficiency is poor. Summary of the invention
[0003] The present application aims to solve one of the technical problems in the related art at least to some extent.
[0004] The present application proposes a storage mounting method, device and electronic device to realize that a CSI container in a control node calls a root process of an operating system in a node to execute a mount command, so that when the CSI container is updated or abnormally restarted, the daemon process will not be affected, and the storage mounting will not be affected, and the storage mounting efficiency is high.
[0005] The first embodiment of the present application proposes a storage mounting method, which is applied to a node in a container cluster management system, including:
[0006] Determine an object storage resource corresponding to the container set scheduled to the node, and a mount command for the object storage resource;
[0007] Control the CSI container in the node to call the root process of the operating system in the node and execute the mount command to mount the object storage resource to the local file system of the node.
[0008] The storage mounting method of the embodiment of the present application determines the object storage resources corresponding to the container set scheduled to the node, and the mounting command of the object storage resources; the CSI container in the control node calls the root process of the operating system in the node, and executes the mounting command to mount the object storage resources to the local file system of the node, so that when the CSI container is updated or abnormally restarted, it will not affect the daemon process, and thus will not affect the storage mounting, and the storage mounting efficiency is high.
[0009] The second aspect of the present application provides a storage mounting method, which is applied to a cluster control node in a container cluster management system, including:
[0010] For each node in the container cluster management system, a mount parameter is configured in the CSI container of the node, so that the CSI container mounts the root process of the operating system in the node according to the mount parameter when starting, so as to use the root process to execute the mount command of the object storage resource;
[0011] or,
[0012] An inter-process communication mechanism is configured in the CSI container of the node, so that the CSI container communicates with the root process according to the inter-process communication mechanism, so as to notify the root process to execute a mount command of the object storage resource.
[0013] The storage mounting method of the embodiment of the present application configures mounting parameters in the CSI container of each node in the container cluster management system, so that the CSI container mounts the root process of the operating system in the node according to the mounting parameters when starting, so as to use the root process to execute the mounting command of the object storage resource; or, configures an inter-process communication mechanism in the CSI container of the node, so that the CSI container communicates with the root process according to the inter-process communication mechanism, so as to notify the root process to execute the mounting command of the object storage resource, so that when the CSI container is updated or abnormally restarted, it will not affect the daemon process, and thus will not affect the storage mounting, and the storage mounting efficiency is high.
[0014] The third aspect of the present application provides a storage mounting device, which is applied to a node in a container cluster management system, including:
[0015] A first determination module is used to determine an object storage resource corresponding to the container set scheduled to the node, and a mount command for the object storage resource;
[0016] A processing module is used to control the CSI container in the node to call the root process of the operating system in the node and execute the mount command to mount the object storage resource to the local file system of the node.
[0017] The storage mounting device of the embodiment of the present application determines the object storage resources corresponding to the container set scheduled to the node, and the mounting command of the object storage resources; the CSI container in the control node calls the root process of the operating system in the node, and executes the mounting command to mount the object storage resources to the local file system of the node. Therefore, when the CSI container is updated or abnormally restarted, the daemon process will not be affected, and the storage mounting will not be affected, and the storage mounting efficiency is high.
[0018] The fourth aspect of the present application provides a storage mounting device, which is applied to a cluster control node in a container cluster management system, including:
[0019] A first configuration module is used to configure mounting parameters in a CSI container of each node in the container cluster management system, so that the CSI container mounts the root process of the operating system in the node according to the mounting parameters when starting, so as to use the root process to execute the mounting command of the object storage resource;
[0020] or,
[0021] The second configuration module is used to configure an inter-process communication mechanism in the CSI container of the node, so that the CSI container communicates with the root process according to the inter-process communication mechanism to notify the root process to execute a mount command of the object storage resource.
[0022] The storage mounting device of the embodiment of the present application configures mounting parameters in the CSI container of each node in the container cluster management system, so that the CSI container mounts the root process of the operating system in the node according to the mounting parameters when starting, so as to use the root process to execute the mounting command of the object storage resource; or, configures an inter-process communication mechanism in the CSI container of the node, so that the CSI container communicates with the root process according to the inter-process communication mechanism, so as to notify the root process to execute the mounting command of the object storage resource, so that when the CSI container is updated or abnormally restarted, it will not affect the daemon process, and thus will not affect the storage mounting, and the storage mounting efficiency is high.
[0023] The fifth aspect embodiment of the present application proposes an electronic device, 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 storage mounting method proposed in the first aspect embodiment of the present application, or the storage mounting method proposed in the second aspect embodiment of the present application.
[0024] The sixth aspect embodiment of the present application proposes a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to enable the computer to execute the storage mounting method proposed in the first aspect embodiment of the present application, or the storage mounting method proposed in the second aspect embodiment of the present application.
[0025] Additional aspects and advantages of the present application will be given in part in the description below, and in part will become apparent from the description below, or will be learned through the practice of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] The above and / or additional aspects and advantages of the present application will become apparent and easily understood from the following description of the embodiments in conjunction with the accompanying drawings, in which:
[0027] Figure 1A flowchart of the storage mounting method provided in the first embodiment of the present application;
[0028] Figure 2 This is a schematic diagram of storage mounting;
[0029] Figure 3 A flowchart of the storage mounting method provided in the second embodiment of the present application;
[0030] Figure 4 A flowchart of the storage mounting method provided in Embodiment 3 of the present application;
[0031] Figure 5 A flowchart of the storage mounting method provided in the fourth embodiment of the present application;
[0032] Figure 6 A schematic diagram of the structure of a storage mounting device provided in Embodiment 5 of the present application;
[0033] Figure 7 A schematic diagram of the structure of a storage mounting device provided in Embodiment 6 of the present application;
[0034] Figure 8 A block diagram of an exemplary computer device suitable for implementing embodiments of the present application is shown. DETAILED DESCRIPTION
[0035] Embodiments of the present application are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present application, and should not be construed as limiting the present application.
[0036] In the related art, the storage mounting method is mainly based on the mechanism of CSI container. The CSI container in the node will call the root process in the CSI container to execute the mounting command. In the above scheme, since the mounting command is executed by the root process of the CSI container, the daemon process is executed by the root process of the CSI container. When the CSI container is updated or an abnormal container occurs, the daemon process will stop, which makes the storage mounting easy to have problems and the storage mounting efficiency is poor.
[0037] Therefore, this application mainly addresses the technical problem in the related technology that when a CSI container is updated or an abnormal container occurs, the daemon process will stop, resulting in storage mounting problems and poor storage mounting efficiency, and proposes a storage mounting method, device and electronic device.
[0038] The storage mounting method of the embodiment of the present application determines the object storage resources corresponding to the container set scheduled to the node, and the mounting command of the object storage resources; the CSI container in the control node calls the root process of the operating system in the node, and executes the mounting command to mount the object storage resources to the local file system of the node, so that when the CSI container is updated or abnormally restarted, it will not affect the daemon process, and thus will not affect the storage mounting, and the storage mounting efficiency is high.
[0039] The following describes the storage mounting method, device and electronic device of the embodiments of the present application with reference to the accompanying drawings.
[0040] Figure 1 A flowchart of the storage mounting method provided in Example 1 of the present application.
[0041] The embodiment of the present application takes the storage mounting method as an example in which the storage mounting device is configured. The storage mounting device can be applied to a node in a container cluster management system, that is, any other node in the container cluster management system except the cluster control node, so that the node can implement the storage mounting function. The container cluster management system can be, for example, k8s (Kubernetes).
[0042] The node may be an electronic device, which may be a personal computer (PC), a cloud device, a mobile device, etc. The mobile device may be, for example, a mobile phone, a tablet computer, a personal digital assistant, a wearable device, a vehicle-mounted device, or other hardware device with various operating systems, touch screens, and / or display screens.
[0043] like Figure 1 As shown, the storage mounting method may include the following steps:
[0044] Step 101: determine the object storage resource corresponding to the container set scheduled to the node and the mount command of the object storage resource.
[0045] In the embodiment of the present application, the process of the storage mounting device executing step 101 may be, for example, determining the container set bound to the node as the container set scheduled to the node; determining the object storage resource corresponding to the container set; determining the resource type information of the object storage resource, wherein the resource type information includes a mount command. The object storage resource may be a storage resource in a storage class service.
[0046] In the embodiment of the present application, the container set bound to the node is created by the cluster control node according to the user's container set creation request and bound to the node. Figure 2 The figure shows a schematic diagram of storage mounting. In this figure, the structure of the container cluster management system and the interaction between the nodes and the cluster control node in the container cluster management system are described.
[0047] exist Figure 2 In the cluster control node (Master), the automation control center component (Kube ControllerManager), the API service component (API server), the component that saves the cluster status (etcd), etc. Among them, the automation control center component is used to control all resource objects in the system.
[0048] exist Figure 2 In the Node, the node includes: kubelet components, container sets of different resource types (DaemonSetPod, StatefulSet Pod), etc. Among them, the kubelet component is responsible for the creation, start and stop of the container corresponding to the container set in the node, and closely cooperates with the cluster control node to realize the basic functions of cluster management.
[0049] exist Figure 2 In the storage class service (AWSS3), the object storage resource (bucket) is used to mount to the local file system of the node, so that when the container centralized service or application in the node is executed, it can obtain the data in the object storage resource through the local file system, process it, and store the processing results in the object storage resource through the local file system to realize the function of the service or application.
[0050] exist Figure 2In the example, the interaction process between the cluster control node (Master), the node (Node) and the storage class service (AWSS3) can be: (1) the cluster control node creates the resource type information (StorageClass) of the object storage resource, and specifies the mount command (mounter type) in the resource type information, for example, s3fs / goofys / rclone. In other words, any one of s3fs, goofys, and rclone. Among them, s3fs, goofys, and rclone are programs for mounting object storage resources to the local file system. (2) When the cluster control node receives the user's container set creation request and the request to create a persistent storage volume accompanying the request, the API service component in the cluster control node creates a container set according to the container set creation request, selects a target node in the cluster, binds the container set to the target node, and schedules the container set to the target node; when the storage volume expansion component (provisioner resizer) in the StatefulSet Pod in the target node detects the request to create a persistent storage volume, it calls the persistent storage volume creation method (createvolume) of the central control interface (CSI-Controller server) of the CSI container to create a persistent storage volume, and communicates with the storage class service to create an object storage resource (bucket) and the directory information of the object storage resource.
[0051] Step 102, the CSI container in the control node calls the root process of the operating system in the node and executes the mount command to mount the object storage resource to the local file system of the node.
[0052] In an embodiment of the present application, the kubelet component in the node can interact with the CSI container, control the CSI container to call the root process of the operating system in the node, and execute the mount command to mount the object storage resource to the local file system of the node.
[0053] In the embodiment of the present application, when the root process executes the mount command, a daemon process will be created at the same time to guard the storage mount. When the container set is deleted or the persistent storage volume is unmounted, the object storage resource mount will be canceled, and then the daemon process will be exited. When the CSI container is updated or restarted abnormally, the daemon process will not be exited, and the storage mount guarded by the daemon process will not be affected.
[0054] The storage mounting method of the embodiment of the present application determines the object storage resources corresponding to the container set scheduled to the node, and the mounting command of the object storage resources; the CSI container in the control node calls the root process of the operating system in the node, and executes the mounting command to mount the object storage resources to the local file system of the node, so that when the CSI container is updated or abnormally restarted, it will not affect the daemon process, and thus will not affect the storage mounting, and the storage mounting efficiency is high.
[0055] Figure 3 A flowchart of the storage mounting method provided in Example 2 of the present application.
[0056] like Figure 3 As shown, the storage mounting method may include the following steps:
[0057] Step 301: determine the object storage resource corresponding to the container set scheduled to the node and the mount command of the object storage resource.
[0058] Step 302, control the CSI container to call the mounted root process to execute the mount command to mount the object storage resource to the local file system of the node; wherein the root process of the operating system is mounted in the CSI container.
[0059] In the embodiment of the present application, when the root process of the operating system is mounted in the CSI container, when the kubelet component in the node calls the node management interface (CSI-Node server) in the CSI container, the CSI container will automatically call the mounted root process to execute the mount command. When the root process is systemd, the command string when calling the mounted root process to execute the mount command is "systemd-run-s3fs" or "systemd-run-goofys" or "systemd-run-rclone", etc.
[0060] In the embodiment of the present application, in order to ensure that the root process of the operating system is mounted in the CSI container, before step 302, the method may also include the following steps: determining the configured mount parameters; adding the mount parameters to the CSI container, so that when the CSI container is started, the root process of the operating system is mounted to the CSI container according to the mount parameters.
[0061] In the embodiment of the present application, the description of step 301 can refer to Figure 1 The detailed description of step 101 in the illustrated embodiment will not be repeated here.
[0062] The storage mounting method of the embodiment of the present application determines the object storage resources corresponding to the container set scheduled to the node, and the mounting command of the object storage resources; when the root process of the operating system is mounted in the CSI container, the CSI container is controlled to call the mounted root process to execute the mount command to mount the object storage resources to the local file system of the node, so that when the CSI container is updated or abnormally restarted, the daemon process will not be affected, and the storage mounting will not be affected, and the storage mounting efficiency is high.
[0063] Figure 4 A flowchart of the storage mounting method provided in Example 3 of the present application.
[0064] like Figure 4 As shown, the storage mounting method may include the following steps:
[0065] Step 401, determine the object storage resource corresponding to the container set scheduled to the node, and the mount command of the object storage resource.
[0066] Step 402, control the CSI container to communicate with the root process of the operating system according to the inter-process communication mechanism, and notify the root process of the operating system to execute the mount command to mount the object storage resource to the local file system of the node; wherein the CSI container is configured with an inter-process communication mechanism for communicating with the root process of the operating system.
[0067] In an embodiment of the present application, when an inter-process communication mechanism is configured in the CSI container, when the kubelet component in the node calls the node management interface (CSI-Node server) in the CSI container, the CSI container can communicate with the root process of the operating system in the node based on the inter-process communication mechanism, and notify the root process of the operating system to execute the mount command to mount the object storage resource to the local file system of the node.
[0068] In the embodiment of the present application, in order to ensure that an inter-process communication mechanism is configured in the CSI container, before step 402, the method may further include the following steps: determining the configured inter-process communication mechanism; and adding the inter-process communication mechanism to the CSI container.
[0069] The inter-process communication mechanism may be, for example, a dbus communication mechanism.
[0070] In the embodiment of the present application, the description of step 401 can refer to Figure 1 The detailed description of step 101 in the illustrated embodiment will not be repeated here.
[0071] The storage mounting method of the embodiment of the present application determines the object storage resource corresponding to the container set scheduled to the node, and the mount command of the object storage resource; when an inter-process communication mechanism is configured in the CSI container, the CSI container is controlled to communicate with the root process of the operating system according to the inter-process communication mechanism, and the root process of the operating system is notified to execute the mount command to mount the object storage resource to the local file system of the node. Therefore, when the CSI container is updated or abnormally restarted, the daemon process will not be affected, and the storage mounting will not be affected, and the storage mounting efficiency is high.
[0072] Figure 5 A flowchart of the storage mounting method provided in Example 4 of the present application.
[0073] The embodiment of the present application takes the storage mounting method as an example in which the storage mounting device is configured, and the storage mounting device can be applied to a cluster control node in a container cluster management system so that the node can implement a storage mounting function. Among them, the container cluster management system can be, for example, k8s (Kubernetes).
[0074] The node may be an electronic device, which may be a personal computer (PC), a cloud device, a mobile device, etc. The mobile device may be, for example, a mobile phone, a tablet computer, a personal digital assistant, a wearable device, a vehicle-mounted device, or other hardware device with various operating systems, touch screens, and / or display screens.
[0075] like Figure 5 As shown, the storage mounting method may include the following steps:
[0076] Step 501, for each node in the container cluster management system, configure the mount parameters in the CSI container of the node, so that the CSI container mounts the root process of the operating system in the node according to the mount parameters when starting, so as to use the root process to execute the mount command of the object storage resource; or, configure the inter-process communication mechanism in the CSI container of the node, so that the CSI container communicates with the root process according to the inter-process communication mechanism, so as to notify the root process to execute the mount command of the object storage resource.
[0077] In an embodiment of the present application, in one example, an API component in a cluster management control node can configure mount parameters in a CSI container of each node except the cluster control node in the container cluster management system. When the CSI container is started, the CSI container mounts the root process of the operating system into the CSI container according to the mount parameters.
[0078] Among them, when the root process of the operating system is mounted in the CSI container, when the kubelet component in the node calls the node management interface (CSI-Node server) in the CSI container, the CSI container will automatically call the mounted root process to execute the mount command. When the root process is systemd, the command string when calling the mounted root process to execute the mount command is "systemd-run-s3fs" or "systemd-run-goofys" or "systemd-run-rclone", etc.
[0079] In an embodiment of the present application, in another example, the API component in the cluster management control node can configure an inter-process communication mechanism in the CSI container of each node except the cluster control node in the container cluster management system, so that when the kubelet component in the node calls the node management interface (CSI-Nodeserver) in the CSI container to execute a mount command, the CSI container communicates with the root process according to the inter-process communication mechanism to notify the root process to execute the mount command of the object storage resource.
[0080] Among them, when the inter-process communication mechanism is configured in the CSI container, when the kubelet component in the node calls the node management interface (CSI-Nodeserver) in the CSI container to execute the mount command, the CSI container will communicate with the root process of the operating system in the node based on the inter-process communication mechanism, and notify the root process of the operating system to execute the mount command.
[0081] The storage mounting method of the embodiment of the present application configures mounting parameters in the CSI container of each node in the container cluster management system, so that the CSI container mounts the root process of the operating system in the node according to the mounting parameters when starting, so as to use the root process to execute the mounting command of the object storage resource; or, configures an inter-process communication mechanism in the CSI container of the node, so that the CSI container communicates with the root process according to the inter-process communication mechanism, so as to notify the root process to execute the mounting command of the object storage resource, so that when the CSI container is updated or abnormally restarted, it will not affect the daemon process, and thus will not affect the storage mounting, and the storage mounting efficiency is high.
[0082] Figure 6 This is a schematic diagram of the structure of the storage mounting device provided in Example 5 of the present application.
[0083] The storage mounting device can be applied to any node except the cluster control node in the container cluster management system, so that the node can realize the storage mounting function.
[0084] like Figure 6As shown, the storage mounting device 600 may include: a first determining module 610 and a processing module 620 .
[0085] The first determination module 610 is used to determine the object storage resource corresponding to the container set scheduled to the node, and the mount command of the object storage resource;
[0086] The processing module 620 is used to control the CSI container in the node to call the root process of the operating system in the node and execute the mount command to mount the object storage resource to the local file system of the node.
[0087] Furthermore, in a possible implementation of an embodiment of the present application, the root process of the operating system is mounted in the CSI container; the processing module 620 is specifically used to control the CSI container to call the mounted root process to execute the mount command to mount the object storage resource to the local file system of the node.
[0088] Furthermore, in a possible implementation of an embodiment of the present application, the device also includes: a second determination module and a first adding module; the second determination module is used to determine the configured mount parameters; the first adding module is used to add the mount parameters to the CSI container, so that when the CSI container is started, the root process of the operating system is mounted to the CSI container according to the mount parameters.
[0089] Furthermore, in a possible implementation of an embodiment of the present application, an inter-process communication mechanism is configured in the CSI container for communicating with the root process of the operating system; the processing module 620 is specifically used to control the CSI container to communicate with the root process of the operating system according to the inter-process communication mechanism, and notify the root process of the operating system to execute the mount command to mount the object storage resource to the local file system of the node.
[0090] Furthermore, in a possible implementation of an embodiment of the present application, the device also includes: a third determination module and a second adding module; the third determination module is used to determine the configured inter-process communication mechanism; and the second adding module is used to add the inter-process communication mechanism to the CSI container.
[0091] Furthermore, in a possible implementation of an embodiment of the present application, the first determination module 610 is specifically used to determine the container set bound to the node as the container set scheduled to the node; determine the object storage resource corresponding to the container set; determine the resource type information of the object storage resource, and the resource type information includes the mount command.
[0092] Furthermore, in a possible implementation of an embodiment of the present application, the object storage resource is a storage resource in a storage class service.
[0093] It should be noted that the explanations in the aforementioned embodiment 1 are also applicable to the storage mounting device of this embodiment and will not be repeated here.
[0094] The storage mounting device of the embodiment of the present application determines the object storage resources corresponding to the container set scheduled to the node, and the mounting command of the object storage resources; the CSI container in the control node calls the root process of the operating system in the node, and executes the mounting command to mount the object storage resources to the local file system of the node. Therefore, when the CSI container is updated or abnormally restarted, the daemon process will not be affected, and the storage mounting will not be affected, and the storage mounting efficiency is high.
[0095] Figure 7 This is a schematic diagram of the structure of the storage mounting device provided in Example 6 of the present application.
[0096] The storage mounting device can be applied to a cluster control node in a container cluster management system, so that the node can implement a storage mounting function.
[0097] like Figure 7 As shown, the training device 700 for the anomaly detection joint model may include: a first configuration module 710 and a second configuration module 720.
[0098] The first configuration module 710 is used to configure the mount parameters in the CSI container of each node in the container cluster management system, so that the CSI container mounts the root process of the operating system in the node according to the mount parameters when starting, so as to use the root process to execute the mount command of the object storage resource;
[0099] or,
[0100] The second configuration module 720 is used to configure an inter-process communication mechanism in the CSI container of the node, so that the CSI container communicates with the root process according to the inter-process communication mechanism to notify the root process to execute a mount command of the object storage resource.
[0101] It should be noted that the explanations in the aforementioned fourth embodiment are also applicable to the storage mounting device of this embodiment and will not be repeated here.
[0102] The storage mounting device of the embodiment of the present application configures mounting parameters in the CSI container of each node in the container cluster management system, so that the CSI container mounts the root process of the operating system in the node according to the mounting parameters when starting, so as to use the root process to execute the mounting command of the object storage resource; or, configures an inter-process communication mechanism in the CSI container of the node, so that the CSI container communicates with the root process according to the inter-process communication mechanism, so as to notify the root process to execute the mounting command of the object storage resource, so that when the CSI container is updated or abnormally restarted, it will not affect the daemon process, and thus will not affect the storage mounting, and the storage mounting efficiency is high.
[0103] In order to implement the above-mentioned embodiments, the present application also proposes an electronic device, 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 storage mounting method proposed in the aforementioned embodiments of the present application; or, the storage mounting method proposed in the aforementioned embodiments of the present application.
[0104] In order to implement the above embodiments, the present application also proposes a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to enable the computer to execute the storage mounting method proposed in the aforementioned embodiments of the present application; or, the storage mounting method proposed in the aforementioned embodiments of the present application.
[0105] Figure 8 A block diagram of an exemplary computer device suitable for implementing embodiments of the present application is shown. Figure 8 The computer device 12 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0106] like Figure 8 As shown, the computer device 12 is in the form of a general-purpose computing device. The components of the computer device 12 may include, but are not limited to: one or more processors or processing units 16, a system memory 28, and a bus 18 that connects various system components (including the system memory 28 and the processing unit 16).
[0107] The bus 18 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, a graphics acceleration port, a processor or a local bus using any of a variety of bus structures. For example, these architectures include but are not limited to Industry Standard Architecture (ISA) bus, Micro Channel Architecture (MAC) bus, Enhanced ISA bus, Video Electronics Standards Association (VESA) local bus and Peripheral Component Interconnection (PCI) bus.
[0108] The computer device 12 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by the computer device 12, including volatile and non-volatile media, removable and non-removable media.
[0109] The memory 28 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 30 and / or cache memory 32. The computer device 12 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, the storage system 34 may be used to read and write non-removable, non-volatile magnetic media ( Figure 8 not shown, usually called a "hard drive"). Although Figure 8 Not shown in the figure, a disk drive for reading and writing a removable non-volatile disk (such as a "floppy disk"), and an optical disk drive for reading and writing a removable non-volatile optical disk (such as a compact disc read only memory (hereinafter referred to as: CD-ROM), a digital versatile disc read only memory (hereinafter referred to as: DVD-ROM) or other optical media) can be provided. In these cases, each drive can be connected to the bus 18 through one or more data medium interfaces. The memory 28 may include at least one program product, which has a set (for example, at least one) of program modules, which are configured to perform the functions of the various embodiments of the present application.
[0110] A program / utility 40 having a set (at least one) of program modules 42 may be stored, for example, in the memory 28, such program modules 42 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment. The program modules 42 generally perform the functions and / or methods of the embodiments described herein.
[0111] The computer device 12 may also communicate with one or more external devices 14 (e.g., keyboard, pointing device, display 24, etc.), one or more devices that enable a user to interact with the computer device 12, and / or any device that enables the computer device 12 to communicate with one or more other computing devices (e.g., network card, modem, etc.). Such communication may be performed via an input / output (I / O) interface 22. In addition, the computer device 12 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) via a network adapter 20. As shown, the network adapter 20 communicates with other modules of the computer device 12 via a bus 18. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the computer device 12, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0112] The processing unit 16 executes various functional applications and data processing by running programs stored in the system memory 28, such as implementing the methods mentioned in the above embodiments.
[0113] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, without contradiction.
[0114] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In the description of this application, the meaning of "plurality" is at least two, such as two, three, etc., unless otherwise clearly and specifically defined.
[0115] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, fragment or portion of code comprising one or more executable instructions for implementing the steps of a custom logical function or process, and the scope of the preferred embodiments of the present application includes alternative implementations in which functions may not be performed in the order shown or discussed, including performing functions in a substantially simultaneous manner or in the reverse order depending on the functions involved, which should be understood by technicians in the technical field to which the embodiments of the present application belong.
[0116] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute the instructions), or in combination with these instruction execution systems, devices or apparatuses. For the purposes of this specification, "computer-readable medium" can be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in combination with these instruction execution systems, devices or apparatuses. More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection with one or more wires (electronic device), a portable computer disk box (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), a fiber optic device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium and then editing, interpreting or processing in other suitable ways if necessary, and then stored in a computer memory.
[0117] It should be understood that the various parts of the present application can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, multiple steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.
[0118] A person skilled in the art may understand that all or part of the steps in the method for implementing the above-mentioned embodiment may be completed by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, which, when executed, includes one or a combination of the steps of the method embodiment.
[0119] In addition, each functional unit in each embodiment of the present application may be integrated into a processing module, or each unit may exist physically separately, or two or more units may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium.
[0120] The storage medium mentioned above may be a read-only memory, a magnetic disk or an optical disk, etc. Although the embodiments of the present application have been shown and described above, it can be understood that the above embodiments are exemplary and cannot be understood as limiting the present application. A person of ordinary skill in the art may change, modify, replace and modify the above embodiments within the scope of the present application.
Claims
1. A storage mounting method, characterized in that: Nodes used in container cluster management systems include: Determine an object storage resource corresponding to the container set scheduled to the node, and a mount command for the object storage resource; Control the CSI container in the node to call the root process of the operating system in the node to execute the mount command to mount the object storage resource to the local file system of the node, wherein when the root process executes the mount command, a daemon process is created at the same time to guard the storage mounting; Controlling the CSI container in the node to call the root process of the operating system in the node, before executing the mount command, the method further includes: Determine the configured mount parameters; Adding the mount parameter to the CSI container, so that when the CSI container is started, the root process of the operating system is mounted to the CSI container according to the mount parameter; The CSI container is configured with an inter-process communication mechanism for communicating with the root process of the operating system; The controlling the CSI container in the node to call the root process of the operating system in the node to execute the mount command includes: Control the CSI container to communicate with the root process of the operating system according to the inter-process communication mechanism, and notify the root process of the operating system to execute the mount command to mount the object storage resource to the local file system of the node.
2. The method according to claim 1, characterized in that The root process of the operating system is mounted in the CSI container; The controlling the CSI container in the node to call the root process of the operating system in the node to execute the mount command includes: The root process that controls the CSI container to call the mount executes the mount command to mount the object storage resource to the local file system of the node.
3. The method according to claim 1, characterized in that Before controlling the CSI container in the node to call the root process of the operating system in the node and execute the mount command, the method further includes: determining the configured inter-process communication mechanism; The inter-process communication mechanism is added to the CSI container.
4. The method according to claim 1, characterized in that: The determining of the object storage resource corresponding to the container set scheduled to the node and the mount command of the object storage resource includes: Determine the container set bound to the node as the container set scheduled to the node; Determine the object storage resource corresponding to the container set; Determine resource type information of the object storage resource, wherein the resource type information includes the mount command.
5. The method according to any one of claims 1 to 4, characterized in that: The object storage resource is a storage resource in a storage class service.
6. A storage mounting method, characterized in that: Cluster control nodes used in container cluster management systems include: For each node in the container cluster management system, mount parameters are configured in the CSI container of the node, so that the CSI container mounts the root process of the operating system in the node according to the mount parameters when it is started, so as to use the root process to execute the mount command of the object storage resource, wherein when the root process executes the mount command, a daemon process is created at the same time for guarding the storage mount; An inter-process communication mechanism is configured in the CSI container of the node, so that the CSI container communicates with the root process according to the inter-process communication mechanism, so as to notify the root process to execute a mount command of the object storage resource.
7. A storage mounting device, characterized in that: Nodes used in container cluster management systems include: A first determination module is used to determine an object storage resource corresponding to the container set scheduled to the node, and a mount command for the object storage resource; A processing module, used to control the CSI container in the node to call the root process of the operating system in the node to execute the mount command to mount the object storage resource to the local file system of the node, wherein when the root process executes the mount command, a daemon process is created at the same time to guard the storage mounting; The device further comprises: a second determining module and a first adding module; The second determination module is used to determine the configured mounting parameters; The first adding module is used to add the mounting parameters to the CSI container, so that when the CSI container is started, the root process of the operating system is mounted to the CSI container according to the mounting parameters. The CSI container is configured with an inter-process communication mechanism for communicating with the root process of the operating system; the processing module is specifically used to: Control the CSI container to communicate with the root process of the operating system according to the inter-process communication mechanism, and notify the root process of the operating system to execute the mount command to mount the object storage resource to the local file system of the node.
8. The device according to claim 7, characterized in that The root process of the operating system is mounted in the CSI container; the processing module is specifically used to: The root process that controls the CSI container to call the mount executes the mount command to mount the object storage resource to the local file system of the node.
9. The device according to claim 7, characterized in that The device further comprises: a third determining module and a second adding module; The third determining module is used to determine the configured inter-process communication mechanism; The second adding module is used to add the inter-process communication mechanism to the CSI container.
10. The device according to claim 7, characterized in that The first determination module is specifically configured to: Determine the container set bound to the node as the container set scheduled to the node; Determine the object storage resource corresponding to the container set; Determine resource type information of the object storage resource, wherein the resource type information includes the mount command.
11. The device according to any one of claims 7 to 10, characterized in that: The object storage resource is a storage resource in a storage class service.
12. A storage mounting device, characterized in that: Cluster control nodes used in container cluster management systems include: A first configuration module is used to configure mounting parameters in a CSI container of each node in the container cluster management system, so that the CSI container mounts the root process of the operating system in the node according to the mounting parameters when starting, so as to use the root process to execute the mounting command of the object storage resource, wherein when the root process executes the mounting command, a daemon process is created at the same time for guarding the storage mounting; The second configuration module is used to configure an inter-process communication mechanism in the CSI container of the node, so that the CSI container communicates with the root process according to the inter-process communication mechanism to notify the root process to execute a mount command of the object storage resource.
13. An electronic device, characterized in that: include: at least one processor; as well as 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 perform the method according to any one of claims 1 to 5; Alternatively, perform the method of claim 6.
14. A non-transitory computer-readable storage medium storing computer instructions, characterized in that: The computer instructions are used to enable the computer to execute the method of any one of claims 1 to 5; or, to execute the method of claim 6.
