Underlying storage data distribution method and device, medium and electronic equipment
By identifying and mounting storage volumes of idle slave nodes in the Kubernetes environment, the underlying storage data anti-affinity distribution of stateful workloads in the cloud native environment is solved, and the storage resource optimization and security problems in the cloud native environment are improved. System performance and capacity scalability.
Patent Information
- Application Number
- CN202411044825.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-31
- Publication Date
- 2024-11-22
AI Technical Summary
Under the cloud native environment, there are challenges in realizing dynamic supply of local storage for stateful workloads, data security and optimized storage resource configuration. Existing remote storage solutions cannot guarantee I/O performance and high operation and maintenance costs, while local storage solutions lack Dynamic supply capacity and data security guarantee.
By obtaining storage volumes of multiple slave nodes in the Kubernetes environment, identifying idle and non-idle slave nodes, and using the scheduler to mount the storage volumes of two idle slave nodes to the workload pod, realizing the anti-parent of the underlying storage data and distribution to ensure uniform distribution and security of data.
It realizes stable operation of stateful workloads in a cloud-native environment, meets users' optimized configuration requirements for storage resources, improves system performance, and supports vertical and horizontal capacity expansion.
Smart Images

Figure CN119002810A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of server technology, and in particular to a method, device, medium and electronic device for distributing underlying storage data. Background Art
[0002] "Moving to the cloud and using data to empower intelligence" has become a consensus among enterprises, and digitalization and cloudification are irreversible trends. If stateful workloads represented by middleware are cloudified, product delivery efficiency and service quality can be effectively improved. However, in a cloud-native environment, achieving the goals of building capabilities such as dynamic supply of local storage for stateful workloads, data security, and optimized configuration of storage resources is still a very challenging task. Summary of the invention
[0003] In order to achieve the above objectives, the present disclosure provides a method, device, medium and electronic device for distributing underlying storage data.
[0004] A first aspect of the present disclosure provides a method for distributing underlying storage data, comprising: In the process of creating workload Pods controlled by the Kubernetes master node, the storage volumes of multiple slave nodes are obtained; According to the storage volumes of the multiple slave nodes, the underlying storage data distribution for the target middleware cluster in the multiple slave nodes is identified, and the idle slave nodes and non-idle slave nodes in the multiple slave nodes are determined, wherein the target middleware cluster is the middleware cluster corresponding to the workload Pod, and the idle slave nodes are slave nodes that do not store the underlying storage data of the target middleware cluster; Two idle slave nodes are selected from the idle slave nodes by the scheduler, and the storage volumes of the two idle slave nodes are mounted to the workload Pod, so as to realize anti-affinity distribution of the underlying storage data.
[0005] Optionally, identifying the underlying storage data distribution for the target middleware cluster in the multiple slave nodes according to the storage volumes of the multiple slave nodes, and determining the idle slave nodes and non-idle slave nodes in the multiple slave nodes, comprises: According to the mapping relationship between the storage volumes of the multiple slave nodes and the target middleware cluster, the slave node information occupied by the underlying storage data of the target middleware cluster among the multiple slave nodes is determined, and the slave nodes corresponding to the slave node information are determined as the non-idle slave nodes, and the remaining slave nodes except the idle slave nodes are determined as the idle slave nodes.
[0006] Optionally, before determining the slave node information occupied by the underlying storage data of the target middleware cluster among the multiple slave nodes according to the mapping relationship between the storage volumes of the multiple slave nodes and the target middleware cluster, the method further includes: Monitor key resources in custom resources, where the key resources include the workload Pod and storage volume; According to the attribute information in the workload Pod, query the attribute information of the parent object of the workload Pod and the parent object of the parent object step by step until the type information of the workload Pod is determined; Determine the target middleware cluster corresponding to the type information; A mapping relationship between the target middleware cluster and the storage volume is established.
[0007] Optionally, the method further comprises: Send a storage volume request declaration during the process of creating a workload Pod controlled by the Kubernetes master node; The storage volume request statement is obtained through a container storage interface, and creation of the storage volume is controlled.
[0008] Optionally, the container storage interface includes a CSI Controller Server component and a CSI NodeServer component, the CSI Controller Server component runs in a Kubernetes environment in the form of a container, and the CSI Node Server component runs on each of the slave nodes; The CSI Controller Server component is used to manage and operate the storage resources and storage volumes of the multiple slave nodes, and is deployed with the Deployment resource type; the CSI Node Server component is used to implement the mount function and / or umount function of the storage volume, and is deployed with the DaemonSet resource type.
[0009] Optionally, the two idle slave nodes include a first idle slave node and a second idle slave node, and the storage volumes of the two idle slave nodes are mounted to the workload Pod to implement anti-affinity distribution of underlying storage data, including: The storage volume of the first idle slave node is mounted as a master copy on the workload Pod through the distributed replication block in the first idle slave node, and the storage volume of the second idle slave node is mounted as a slave copy on the workload Pod through the distributed replication block of the second idle slave node, so as to establish a data transmission channel between the first idle slave node and the second idle slave node.
[0010] Optionally, the storage mode of the slave nodes is local storage.
[0011] In a second aspect of the present disclosure, a distribution device for underlying storage data is provided, comprising: The acquisition module is configured to acquire storage volumes of multiple slave nodes during the process of creating workload Pods controlled by the master node of Kubernetes; A determination module is configured to identify the underlying storage data distribution of the multiple slave nodes for the target middleware cluster according to the storage volumes of the multiple slave nodes, and determine the idle slave nodes and non-idle slave nodes among the multiple slave nodes, wherein the target middleware cluster is the middleware cluster corresponding to the workload Pod, and the idle slave nodes are slave nodes that do not store the underlying storage data of the target middleware cluster; The distribution module is configured to select two idle slave nodes from the idle slave nodes through a scheduler, and mount the storage volumes of the two idle slave nodes to the workload Pod to achieve anti-affinity distribution of the underlying storage data.
[0012] In a third aspect of the present disclosure, a non-temporary computer-readable storage medium is provided, on which a computer program is stored, and when the program is executed by a processor, the underlying storage data distribution method provided in the first aspect of the present disclosure is implemented.
[0013] In a fourth aspect of the present disclosure, an electronic device is provided, including: a storage device having a computer program stored thereon; A processing device is used to execute the computer program in the storage device to implement the underlying storage data distribution method provided by the first aspect of the present disclosure.
[0014] In the disclosed embodiment, by identifying the underlying storage data distribution for the target middleware cluster among the multiple slave nodes based on the storage volumes of the multiple slave nodes, and determining the idle slave nodes among the multiple slave nodes, the storage volumes of the two idle slave nodes are mounted to the workload Pod, so as to achieve a uniform distribution of the anti-affinity distribution of the underlying storage data. In this way, it is possible to achieve stable operation of stateful workloads in a cloud-native environment and meet the user's needs for optimized configuration of storage resources.
[0015] Other features and advantages of the present disclosure will be described in detail in the following detailed description. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] The accompanying drawings are used to provide a further understanding of the present disclosure and constitute a part of the specification. Together with the following specific embodiments, they are used to explain the present disclosure but do not constitute a limitation of the present disclosure. In the accompanying drawings: Figure 1 The figure is an architecture diagram in a Kubernetes environment according to an exemplary embodiment.
[0017] Figure 2 The present invention is a flowchart showing a method for distributing underlying storage data according to an exemplary embodiment.
[0018] Figure 3 It is a schematic diagram of affinity distribution of underlying storage data in related technology.
[0019] Figure 4 The diagram is a schematic diagram showing anti-affinity distribution of underlying storage data according to an exemplary embodiment.
[0020] Figure 5 The figure is a flowchart of a reverse tracing algorithm according to an exemplary embodiment.
[0021] Figure 6 The invention is a block diagram showing a distribution device for underlying storage data according to an exemplary embodiment.
[0022] Figure 7 It is a block diagram of an electronic device according to an exemplary embodiment. DETAILED DESCRIPTION
[0023] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.
[0024] In the related technology, stateful workloads are enabled to have service availability, performance, and data security capabilities through remote storage solutions and local storage solutions. Among them, the remote storage solution is a relatively common storage solution that supports stateful workloads in a cloud-native environment. This solution requires the configuration of dedicated Storage Class resources to specify the service information of the remote storage. At the same time, it is also necessary to install the client software of the remote storage service on each working node. In addition, it is also necessary to build a storage cluster dedicated to the cloud-native environment to provide storage services. When the storage service preparation work inside and outside the cloud-native environment is completed, the stateful workload can apply for storage space from the remote storage. The local storage solution uses the local storage on the working nodes in the cloud-native environment to manually pre-create storage resources according to storage requirements. When the underlying storage resources that meet the requirements are created, the stateful workload can be run.
[0025] However, both remote storage solutions and local storage solutions in related technologies have some problems. Among them, the remote storage solution requires data communication through the network, which cannot guarantee I / O performance, and the construction of a storage cluster dedicated to the cloud native environment requires professionals, with high operation and maintenance labor costs. Data security completely depends on the storage service's own capabilities, which has certain risks. The local storage solution does not have the ability to dynamically supply and recycle storage, and cannot achieve large-scale deployment of stateful workloads. Data security cannot be guaranteed, and there is a risk of data loss.
[0026] Both remote storage solutions and local storage solutions have certain defects. Therefore, the embodiments of the present disclosure propose a method, device, medium and electronic device for distributing underlying storage data to solve the shortcomings of the above two solutions, propose the problem of anti-affinity of underlying storage and solutions, and provide an ideal solution for clouding middleware technology that pursues high I / O performance, while also having universality. The embodiments of the present disclosure are described in detail below in conjunction with the drawings in the specification.
[0027] like Figure 1As shown, the architecture diagram of the disclosed technical solution in the Kubernetes environment, Kubernetes includes a master node Master and multiple slave nodes Node, the native scheduler Sch in the master node Master runs the container management service, which can realize task scheduling, and the slave nodes Node01-NodeN are the nodes that actually run the task. UI is a management interface for human-computer interaction. CLI is a variety of management tools that can be used to manage and maintain the content in the Kubernetes cluster, including middleware and other services. For example, kubectl is the official CLI command line tool of Kubernetes, which is used to communicate with the api server, organize and convert the commands entered by the user in the command line into information that the api server can recognize, and then realize an effective way to manage various resources of Kubernetes. CM (Controller Manager) is a collection of controllers, and multiple controllers are in this collection, such as Pod controllers and Statefulset controllers. AS (api server) is the only external interface that provides services through the kube-apiserver process. It can be understood that the Statefulset controller is used to manage the workload API object of stateful applications. The workload that saves data or status during operation is called a stateful workload Statefulset, so the following workloads are all stateful workloads.
[0028] Specifically, Figure 1As shown in the figure, the key component XLSS runs completely in the cloud native environment in the form of containers, including the scheduler component Scheduler, CSI Controller Server component, and DRBD Controller component. The CSI ControllerServer component is an implementation component of the Container Storage Interface (CSI). It provides storage service perspective to manage and operate storage resources and storage volumes. It is used to implement functions such as the creation, destruction, attachment, and removal of storage volumes. It is deployed with the Deployment resource type. The CSI Node Server component is another implementation component of the Container Storage Interface. Each slave node deploys a CSI Node Server component. The CSI Node Server component manages and operates the volumes on the slave nodes. It mainly implements functions such as the mount and umount of storage volumes. It is deployed with the DaemonSet resource type. DRBD (Distributed Replicated Block Device) is a software-based shared-nothing replication storage solution that can mirror the block device content between slave nodes, such as hard disks, partitions, logical volumes, etc. Its characteristics are real-time data synchronization based on physical backup, high data transmission efficiency, high data consistency, and transparency to workloads. DRBD is a kernel module that runs in kernel space and is unaware of applications.
[0029] See also Figure 2 , Figure 2 The invention is a flow chart showing a method for distributing underlying storage data according to an exemplary embodiment, which includes the following steps.
[0030] S201. In the process of the Kubernetes master node controlling the creation of a workload Pod, the storage volumes of multiple slave nodes are obtained.
[0031] For example, a container is a lightweight virtualization technology that requires a cluster management tool, and the container must also have underlying resources to carry it. Kubernetes is an open source containerized application for managing multiple slave nodes in a cloud platform. The goal of Kubernetes is to make the deployment of containerized applications simple and efficient. Kubernetes provides a mechanism for application deployment, planning, updating, and maintenance. The Kubernetes framework based on containerized deployment can deploy multiple distributed middleware clusters. Each middleware cluster can create its own unique database and perform permission isolation at the user level. Specifically, the workload is deployed in cluster mode, and the workload instances will be scheduled to different slave nodes by the container scheduler to avoid the workload instances being concentrated on one slave node, forming an anti-affinity distribution at the workload level.
[0032] For example, Pod itself has a life cycle, so the containers and related data running inside the Pod cannot be persistently stored in the Pod. The storage volume disclosed in this disclosure is PV (Persistent Volume). Using storage volume PV, data can be persistently stored in the storage space outside the container. In the Kubernetes environment, the storage volume PV needs to be bound to the Pod resources.
[0033] S202. According to the storage volumes of the multiple slave nodes, the underlying storage data distribution for the target middleware cluster in the multiple slave nodes is identified, and the idle slave nodes and non-idle slave nodes in the multiple slave nodes are determined, wherein the target middleware cluster is the middleware cluster corresponding to the workload Pod, and the idle slave nodes are slave nodes that do not store the underlying storage data of the target middleware cluster.
[0034] For example, the distribution of underlying storage data for a target middleware cluster in multiple slave nodes is identified, and according to whether the underlying storage resources in the current middleware cluster are distributed to a certain slave node, idle slave nodes and non-idle slave nodes in the slave nodes can be determined. An idle slave node is a slave node that does not store the underlying storage data of the target middleware cluster, and a non-idle slave node is a slave node that stores the underlying storage data of the target middleware cluster.
[0035] S203. Select two idle slave nodes from the idle slave nodes through the scheduler, and mount the storage volumes of the two idle slave nodes to the workload Pod to achieve anti-affinity distribution of the underlying storage data.
[0036] For example, since the scheduler of the Kubernetes environment includes the native scheduler Sch in the master node Master and the scheduler component Scheduler in the key component XLSS, the two can run at the same time, and each Pod and each workload can set any scheduler for scheduling. However, if different Pods and workloads choose any scheduler, there may be workload-level and underlying affinity problems, that is, the above workload instances may be concentrated on a slave node and multiple underlying storage data sets of the target middleware cluster may be concentrated on a slave node. In order to achieve anti-affinity (Ant Affinity) at the workload level and underlying storage resources, only the scheduler component Scheduler in the key component XLSS can be used as the scheduler to implement scheduling, or the global scheduling can be controlled through real-time interaction between the native scheduler Sch and the scheduler component Scheduler. The storage volumes of the two idle slave nodes are mounted on the workload Pod, and the anti-affinity distribution of the underlying storage data can be achieved.
[0037] For example, if the technical solution of the present disclosure is not adopted, Figure 3 As shown in Figure 1, multiple underlying storage data of the target middleware cluster may be centrally stored in one slave node. If the slave node fails, all storage data backups may be lost, resulting in increased data security risks. Figure 4 As shown, the technical solution of the embodiment of the present disclosure is that after the slave node stores the underlying storage data of the target middleware cluster, it no longer stores other underlying storage data of the target middleware cluster, which can avoid storing multiple underlying storage data of the target middleware cluster in one slave node.
[0038] In the disclosed embodiment, by identifying the underlying storage data distribution for the target middleware cluster among the multiple slave nodes based on the storage volumes of the multiple slave nodes, and determining the idle slave nodes among the multiple slave nodes, the storage volumes of the two idle slave nodes are mounted to the workload Pod, so as to achieve a uniform distribution of the anti-affinity distribution of the underlying storage data. In this way, it is possible to achieve stable operation of stateful workloads in a cloud-native environment and meet the user's needs for optimized configuration of storage resources.
[0039] In addition, the anti-affinity distribution of the underlying storage data increases the processing capacity of a single slave node to improve the performance of the entire system. Therefore, the anti-affinity distribution of the underlying storage data disclosed in the present invention supports both vertical expansion and horizontal expansion, and has good storage capacity scalability.
[0040] In some embodiments, based on storage volumes of multiple slave nodes, identifying the underlying storage data distribution for a target middleware cluster in multiple slave nodes, and determining idle slave nodes and non-idle slave nodes in the multiple slave nodes, includes: According to the mapping relationship between the storage volumes of multiple slave nodes and the target middleware cluster, the slave node information occupied by the underlying storage data of the target middleware cluster among the multiple slave nodes is determined, and the slave nodes corresponding to the slave node information are determined as non-idle slave nodes, and the remaining slave nodes except the idle slave nodes are determined as idle slave nodes.
[0041] For example, before determining the slave node information occupied by the underlying storage data of the target middleware cluster among multiple slave nodes, a mapping relationship can be established between the storage volume PV of the slave node and the target middleware cluster, thereby identifying idle slave nodes and non-idle slave nodes among the multiple slave nodes, so that the scheduler can schedule according to the identification result.
[0042] In some embodiments, before determining the slave node information occupied by the underlying storage data of the target middleware cluster among the multiple slave nodes according to the mapping relationship between the storage volumes of the multiple slave nodes and the target middleware cluster, the method further includes: Monitor key resources in custom resources, including workload pods and storage volumes; According to the attribute information in the workload Pod, query the attribute information of the parent object of the workload Pod and the parent object of the parent object step by step until the type information of the workload Pod is determined; Determine the target middleware cluster corresponding to the type information; Establish a mapping relationship between the target middleware cluster and the storage volume.
[0043] For example, in the Kubernetes environment, the creation process of the middleware cluster is created. Taking the Zookeeper cluster as an example, the forward creation process may include: running the controller for CRD (Custom Resource Define) to create the user's custom resource CR (Custom Resource). The custom resource CR defines information in a standard format, such as the number of workload Pods, space size, and other information; the Statefulset controller creates Statefulset resources based on this information, including workload Pod resources and PVC resources (Persistent Volume Claim). PVC resources are used to apply for storage volume PV resources and prepare storage; starting the Zookeeper cluster service, and the Zookeeper middleware cluster is created.
[0044] It can be understood that the above-mentioned Zookeeper middleware cluster creation process is only used as an example to illustrate the technical solution of the present invention. In fact, the technical solution of the present invention is universal. For other middleware clusters, such as Redis cluster, RabbitMQ cluster, Kafka cluster, etc., the method of finding the corresponding target middleware cluster through the reverse tracing algorithm is also applicable to other middleware clusters, and will not be repeated here.
[0045] For example, the above creation of Zookeeper middleware cluster is forward creation, in which the Statefulset resource can be defined as the parent object of the workload Pod, and the custom resource CR can be defined as the parent object of the Statefulset resource. Therefore, the custom resource CR is the parent object of the parent object of the workload Pod. In theory, following this relationship, the middleware cluster to which the stateful workload cluster belongs can be accurately identified. However, the custom resource CR is a user-defined resource. In order to ensure the universality of the algorithm and apply it to all cloud-native environments, a reverse tracing algorithm can be used to organize the stateful middleware cluster.
[0046] The reverse tracing algorithm of the embodiment of the present disclosure is applicable to the middleware cluster identification of all stateful workloads, whether it is native Statefulset resources or various customized forms of stateful workloads, and is universal.
[0047] For example, see Figure 5 ,The specific steps of the reverse tracing algorithm include: S51. Monitor workload Pods and storage volume PVs.
[0048] S52: Trace back from the key attribute field Owner Reference of the workload Pod, and reversely query the type information of the parent object of the workload Pod and the parent object of the workload Pod until the type information of the workload Pod is determined.
[0049] S53: Determine a target middleware cluster corresponding to the type information, and extract characteristic attributes from the workload Pod or its parent object or the parent object's superior object to define the target middleware cluster.
[0050] S54: Process the PV event and determine the slave node information used by the underlying storage data of the storage volume PV.
[0051] S55. By associating the workload Pod with the PVC resource, and then associating the PVC resource with the corresponding PV resource, a mapping relationship between the storage volume PV and the target middleware cluster is established.
[0052] S56. Determine the Node information of the slave nodes used for the underlying storage data according to the storage volume PV. All Node information used for the underlying storage data of the target middleware cluster can be counted, that is, the distribution of the underlying storage data of the target middleware cluster.
[0053] In some embodiments, the method further comprises: Send a storage volume request declaration during the process of creating a workload Pod controlled by the Kubernetes master node; Get storage volume request declaration through container storage interface and control the creation of storage volumes.
[0054] For example, the storage volume request is declared as a PVC resource (Persistent Volume Claim), which is a user storage request and can be used to apply for PV resources. The Container Storage Interface (CSI) defines the specification of an industry standard interface. With the help of the container orchestration system (CO), any storage system can be exposed to its workload Pod, with dynamic supply capabilities, which can realize the automated deployment of large-scale stateful workloads with high deployment efficiency.
[0055] In some embodiments, the container storage interface includes a CSI Controller Server component and a CSI NodeServer component, the CSI Controller Server component runs in a Kubernetes environment in the form of a container, and the CSINode Server component runs on each slave node; The CSI Controller Server component is used to manage and operate the storage resources and storage volumes of multiple slave nodes, and is deployed with the Deployment resource type. The CSI Node Server component is used to implement the mount and / or umount functions of the storage volumes, and is deployed with the DaemonSet resource type.
[0056] For example, the CSI Controller Server component is an implementation component of the Container Storage Interface (CSI), which provides storage service perspective to manage and operate storage resources and storage volumes, and is used to implement functions such as the creation, destruction, attachment, and removal of storage volumes. It is deployed with the Deployment resource type. The CSI NodeServer component is another implementation component of the Container Storage Interface. Each slave node deploys a CSI Node Server component. The CSI Node Server component manages and operates the Volume on the slave node, mainly implementing functions such as the mount and umount of storage volumes. It is deployed with the DaemonSet resource type.
[0057] In some embodiments, the two idle slave nodes include a first idle slave node and a second idle slave node, and the storage volumes of the two idle slave nodes are mounted to the workload Pod to implement anti-affinity distribution of the underlying storage data, including: The storage volume of the first idle slave node is mounted as a master copy on the workload Pod through the distributed replication block in the first idle slave node, and the storage volume of the second idle slave node is mounted as a slave copy on the workload Pod through the distributed replication block of the second idle slave node to establish a data transmission channel between the first idle slave node and the second idle slave node.
[0058] For example, DRBD (Distributed Replicated Block Device) is a software-based shared-nothing replication storage solution that can mirror the contents of block devices between slave nodes, such as hard disks, partitions, logical volumes, etc. A distributed replication block is set up in each slave node. Its working principle is, for example, DRBDController cooperates with the container orchestration system CO to manage DRBD, establishes a stable data transmission channel between slave node NodeA and slave node NodeB, and the workload running on slave node NodeA writes data to the local storage as the primary copy. At the same time, the data is also written to the storage device on the slave node NodeB as a slave copy through the transmission channel, realizing efficient real-time backup of data and ensuring data security. The underlying storage data of the workload Pod can include the primary copy and the slave copy.
[0059] The disclosed embodiment utilizes DRBD Controller in conjunction with a container orchestration system to implement automated management of underlying storage data based on DRBD technology, thereby ensuring data security of the underlying storage data.
[0060] In some embodiments, the storage mode of the slave nodes is local storage.
[0061] For example, the storage method of the slave node disclosed in the present invention is local storage. The local storage of the slave node integrates storage resources and computing resources on each slave node in the cloud native environment, effectively avoiding the time-consuming network transmission. Configuring high-performance SSD (Solid State Disk or Solid State Drive, solid-state hard disk) storage resources on each slave node can maximize the input / output (I / O) performance.
[0062] See also Figure 6 , Figure 6 It is a block diagram of a distribution device for bottom-level storage data according to an exemplary embodiment. The distribution device 600 for bottom-level storage data includes an acquisition module 610 , a determination module 620 and a distribution module 630 .
[0063] The acquisition module 610 is configured to acquire storage volumes of multiple slave nodes during the process of the master node of Kubernetes controlling the creation of the workload Pod; The determination module 620 is configured to identify the underlying storage data distribution for the target middleware cluster in the multiple slave nodes according to the storage volumes of the multiple slave nodes, and determine the idle slave nodes and non-idle slave nodes in the multiple slave nodes, wherein the target middleware cluster is the middleware cluster corresponding to the workload Pod, and the idle slave node is a slave node that does not store the underlying storage data of the target middleware cluster; The distribution module 630 is configured to select two idle slave nodes from the idle slave nodes through the scheduler, and mount the storage volumes of the two idle slave nodes to the workload Pod to achieve anti-affinity distribution of the underlying storage data.
[0064] In some embodiments, the determination module 620 is specifically configured to: According to the mapping relationship between the storage volumes of multiple slave nodes and the target middleware cluster, the slave node information occupied by the underlying storage data of the target middleware cluster among the multiple slave nodes is determined, and the slave nodes corresponding to the slave node information are determined as non-idle slave nodes, and the remaining slave nodes except the idle slave nodes are determined as idle slave nodes.
[0065] In some embodiments, the underlying data storage distribution device 600 further includes: The monitoring module is configured to monitor key resources in custom resources, including workload pods and storage volumes; A query module is configured to query the attribute information of the parent object of the workload Pod and the parent object of the parent object step by step according to the attribute information in the workload Pod until the type information of the workload Pod is determined; A cluster determination module, configured to determine a target middleware cluster corresponding to the type information; The mapping module is configured to establish a mapping relationship between the target middleware cluster and the storage volume.
[0066] In some embodiments, the underlying data storage distribution device 600 further includes: A sending module is configured to send a storage volume request declaration during the process of creating a workload Pod controlled by the Kubernetes master node; The control module is configured to obtain a storage volume request declaration through a container storage interface and control the creation of a storage volume.
[0067] In some embodiments, the container storage interface includes a CSI Controller Server component and a CSI NodeServer component, the CSI Controller Server component runs in a Kubernetes environment in the form of a container, and the CSINode Server component runs on each slave node; The CSI Controller Server component is used to manage and operate the storage resources and storage volumes of multiple slave nodes, and is deployed with the Deployment resource type. The CSI Node Server component is used to implement the mount and / or umount functions of the storage volumes, and is deployed with the DaemonSet resource type.
[0068] In some embodiments, the two idle slave nodes include a first idle slave node and a second idle slave node, and the distribution module 630 is specifically configured as follows: The storage volume of the first idle slave node is mounted as a master copy on the workload Pod through the distributed replication block in the first idle slave node, and the storage volume of the second idle slave node is mounted as a slave copy on the workload Pod through the distributed replication block of the second idle slave node to establish a data transmission channel between the first idle slave node and the second idle slave node.
[0069] In some embodiments, the storage mode of the slave nodes is local storage.
[0070] Regarding the underlying storage data distribution device 600 in the above embodiment, the specific manner in which each module performs operations has been described in detail in the above embodiment of the underlying storage data distribution method, and will not be elaborated here.
[0071] The present disclosure provides a non-temporary computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the underlying storage data distribution method provided by an embodiment of the present disclosure is implemented.
[0072] The present disclosure provides an electronic device, comprising: a storage device having a computer program stored thereon; A processing device is used to execute the computer program in the storage device to implement the underlying storage data distribution method provided by the embodiment of the present disclosure.
[0073] Figure 7 FIG. 7 is a block diagram of an electronic device 700 according to an exemplary embodiment. Figure 7 As shown, the electronic device 700 may include: a processor 701 , a memory 702 . The electronic device 700 may also include one or more of a multimedia component 703 , an I / O (input / output) interface 704 , and a communication component 705 .
[0074] The processor 701 is used to control the overall operation of the electronic device 700 to complete all or part of the steps in the above-mentioned underlying data distribution method. The memory 702 is used to store various types of data to support the operation of the electronic device 700. For example, these data may include instructions for any application or method used to operate on the electronic device 700, and application-related data, such as contact data, sent and received messages, pictures, audio, video, etc. The memory 702 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (Static Random Access Memory, referred to as SRAM), electrically erasable programmable read-only memory (Electrically Erasable Programmable Read-Only Memory, referred to as EEPROM), erasable programmable read-only memory (Erasable Programmable Read-Only Memory, referred to as EPROM), programmable read-only memory (Programmable Read-Only Memory, referred to as PROM), read-only memory (Read-Only Memory, referred to as ROM), magnetic memory, flash memory, magnetic disk or optical disk. The multimedia component 703 may include a screen and an audio component. The screen may be, for example, a touch screen, and the audio component is used to output and / or input audio signals. For example, the audio component may include a microphone for receiving external audio signals. The received audio signal may be further stored in the memory 702 or sent through the communication component 705. The audio component also includes at least one speaker for outputting audio signals. The I / O interface 704 provides an interface between the processor 701 and other interface modules, and the other interface modules may be keyboards, mice, buttons, etc. These buttons may be virtual buttons or physical buttons. The communication component 705 is used for wired or wireless communication between the electronic device 700 and other devices. Wireless communication, such as Wi-Fi, Bluetooth, Near Field Communication (NFC), 2G, 3G, 4G, NB-IOT, eMTC, or other 5G, etc., or a combination of one or more of them, is not limited here. Therefore, the corresponding communication component 705 may include: Wi-Fi module, Bluetooth module, NFC module, etc.
[0075] In an exemplary embodiment, the electronic device 700 can be implemented by one or more application specific integrated circuits (ASIC), digital signal processors (DSP), digital signal processing devices (DSPD), programmable logic devices (PLD), field programmable gate arrays (FPGA), controllers, microcontrollers, microprocessors or other electronic components to execute the above-mentioned underlying storage data distribution method.
[0076] In another exemplary embodiment, a computer-readable storage medium including program instructions is also provided, and when the program instructions are executed by a processor, the steps of the above-mentioned underlying storage data distribution method are implemented. For example, the computer-readable storage medium can be the above-mentioned memory 702 including program instructions, and the above-mentioned program instructions can be executed by the processor 701 of the electronic device 700 to complete the above-mentioned underlying storage data distribution method.
[0077] In another exemplary embodiment, a computer program product is also provided. The computer program product includes a computer program executable by a programmable device, and the computer program has a code portion for executing the above-mentioned underlying storage data distribution method when executed by the programmable device.
[0078] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the present disclosure. This application is intended to cover any variations, uses or adaptations of the present disclosure, which follow the general principles of the present disclosure and include common knowledge or customary technical means in the art that are not disclosed in the present disclosure. The specification and examples are to be considered as exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims.
[0079] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
Claims
1. A method for distributing underlying storage data, characterized in that: include: In the process of creating workload Pods controlled by the Kubernetes master node, the storage volumes of multiple slave nodes are obtained; According to the storage volumes of the multiple slave nodes, the underlying storage data distribution for the target middleware cluster in the multiple slave nodes is identified, and the idle slave nodes and non-idle slave nodes in the multiple slave nodes are determined, wherein the target middleware cluster is the middleware cluster corresponding to the workload Pod, and the idle slave nodes are slave nodes that do not store the underlying storage data of the target middleware cluster; Two idle slave nodes are selected from the idle slave nodes by the scheduler, and the storage volumes of the two idle slave nodes are mounted to the workload Pod, so as to realize anti-affinity distribution of the underlying storage data.
2. The method according to claim 1, characterized in that According to the storage volumes of the plurality of slave nodes, identifying the underlying storage data distribution for the target middleware cluster in the plurality of slave nodes, and determining the idle slave nodes and non-idle slave nodes in the plurality of slave nodes, including: According to the mapping relationship between the storage volumes of the multiple slave nodes and the target middleware cluster, the slave node information occupied by the underlying storage data of the target middleware cluster among the multiple slave nodes is determined, and the slave nodes corresponding to the slave node information are determined as the non-idle slave nodes, and the remaining slave nodes except the idle slave nodes are determined as the idle slave nodes.
3. The method according to claim 2, characterized in that Before determining the slave node information occupied by the underlying storage data of the target middleware cluster among the multiple slave nodes according to the mapping relationship between the storage volumes of the multiple slave nodes and the target middleware cluster, the method further includes: Monitor key resources in custom resources, where the key resources include the workload Pod and storage volume; According to the attribute information in the workload Pod, query the attribute information of the parent object of the workload Pod and the parent object of the parent object step by step until the type information of the workload Pod is determined; Determine the target middleware cluster corresponding to the type information; A mapping relationship between the target middleware cluster and the storage volume is established.
4. The method according to any one of claims 1 to 3, characterized in that: The method further comprises: Send a storage volume request declaration during the process of creating a workload Pod controlled by the Kubernetes master node; The storage volume request statement is obtained through a container storage interface, and creation of the storage volume is controlled.
5. The method according to claim 4, characterized in that The container storage interface includes a CSI ControllerServer component and a CSI Node Server component. The CSI Controller Server component runs in a Kubernetes environment in the form of a container, and the CSI Node Server component runs on each of the slave nodes. The CSI Controller Server component is used to manage and operate the storage resources and storage volumes of the multiple slave nodes, and is deployed with the Deployment resource type; the CSI Node Server component is used to implement the mount function and / or umount function of the storage volume, and is deployed with the DaemonSet resource type.
6. The method according to any one of claims 1 to 3, characterized in that: The two idle slave nodes include a first idle slave node and a second idle slave node, and the storage volumes of the two idle slave nodes are mounted to the workload Pod to achieve anti-affinity distribution of underlying storage data, including: The storage volume of the first idle slave node is mounted as a master copy on the workload Pod through the distributed replication block in the first idle slave node, and the storage volume of the second idle slave node is mounted as a slave copy on the workload Pod through the distributed replication block of the second idle slave node, so as to establish a data transmission channel between the first idle slave node and the second idle slave node.
7. The method according to any one of claims 1 to 3, characterized in that: The storage mode of the slave nodes is local storage.
8. A distribution device for storing data at the bottom layer, characterized in that: include: The acquisition module is configured to acquire storage volumes of multiple slave nodes during the process of creating workload Pods controlled by the master node of Kubernetes; A determination module is configured to identify the underlying storage data distribution of the multiple slave nodes for the target middleware cluster according to the storage volumes of the multiple slave nodes, and determine the idle slave nodes and non-idle slave nodes among the multiple slave nodes, wherein the target middleware cluster is the middleware cluster corresponding to the workload Pod, and the idle slave nodes are slave nodes that do not store the underlying storage data of the target middleware cluster; The distribution module is configured to select two idle slave nodes from the idle slave nodes through a scheduler, and mount the storage volumes of the two idle slave nodes to the workload Pod to achieve anti-affinity distribution of the underlying storage data.
9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the underlying storage data distribution method described in any one of claims 1-7 is implemented.
10. An electronic device, characterized in that: include: a storage device having a computer program stored thereon; A processing device is used to execute the computer program in the storage device to implement the underlying storage data distribution method described in any one of claims 1-7.
