A cloud-based multi-cluster management method, device, medium and electronic equipment
By adopting a multi-cluster management model in the cloud platform and using transmission threads to transmit mirror files in parallel to each server cluster, the problem of inefficient management of large-scale server clusters in the cloud computing platform is solved, and efficient virtual machine creation and management is achieved.
Patent Information
- Application Number
- CN202010505429.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-06-05
- Publication Date
- 2025-08-12
- Estimated Expiration
- 2040-06-05
AI Technical Summary
In cloud computing platforms, it is difficult for existing technology to efficiently manage large-scale server clusters, resulting in inefficient data processing and virtual machine creation, especially inadequate management efficiency when scaling.
By adopting a multi-cluster management mode in the cloud platform, the image files are read and sent to each server cluster in parallel, and the transmission thread is used for parallel transmission and management, ensuring that the image files are quickly created in each cluster.
It improves the data acquisition efficiency of the server cluster and the creation efficiency of virtual machines, achieves the goal of creating virtual machines in seconds, and reduces management complexity and operation and maintenance costs.
Smart Images

Figure CN111800468B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of cloud computing technology, and more specifically, to a cloud-based multi-cluster management method, device, computer-readable medium, and electronic device. Background Art
[0002] Cloud computing is a computing model that distributes computing tasks across a resource pool consisting of numerous cloud servers, enabling various application systems to access computing power, storage space, and information services as needed. Related technologies utilize a single, integrated cloud system for virtualized data management, resulting in large-scale and difficult management. Furthermore, expansion of the cloud system requires processing based on existing data, reducing the efficiency of cloud platform system management. Summary of the Invention
[0003] The embodiments of the present application provide a cloud-based multi-cluster management method, apparatus, computer-readable medium, and electronic device, which can improve the data acquisition efficiency of a server cluster to a certain extent, thereby improving the efficiency of creating and managing virtual machines.
[0004] Other features and advantages of the present application will become apparent from the following detailed description, or may be learned in part by practice of the present application.
[0005] According to one aspect of an embodiment of the present application, a cloud-based multi-cluster management method is provided, including: reading an image file used to create a virtual machine; obtaining the cluster identifiers of each server cluster connected to the cloud platform; determining the transmission thread corresponding to each cluster identifier; and based on the transmission thread corresponding to each cluster identifier, sending the image file in parallel to each server cluster corresponding to each cluster identifier.
[0006] According to one aspect of an embodiment of the present application, a cloud-based multi-cluster management device is provided, including: a reading unit for reading an image file for creating a virtual machine; an acquisition unit for acquiring cluster identifiers of each server cluster connected to a cloud platform; a creation unit for determining a transmission thread corresponding to each cluster identifier; and a sending unit for sending the image file in parallel to each server cluster corresponding to each cluster identifier based on the transmission thread corresponding to each cluster identifier.
[0007] In some embodiments of the present application, based on the aforementioned scheme, the reading unit includes: a first reading unit, used to read a preset amount of mirror data from the mirror file used to create a virtual machine one by one; a data adding unit, used to add the read mirror data to the mirror data queue in the reading order.
[0008] In some embodiments of the present application, based on the aforementioned scheme, the sending unit includes: a second reading unit, used to read a preset amount of mirror data from the mirror data queue; a first broadcast unit, used to broadcast the read mirror data to the transmission thread corresponding to each cluster identifier; a second sending unit, used to send the read mirror data in parallel to each server cluster corresponding to each cluster identifier through the transmission thread, until the mirror file is sent to each server cluster.
[0009] In some embodiments of the present application, based on the aforementioned scheme, the acquisition unit includes: a detection unit, used to call the detection component to detect the information of the server cluster contained in the storage component of the cloud platform; a first determination unit, used to determine the cluster identifier of the server cluster connected to the cloud platform based on the information of the server cluster contained in the storage component.
[0010] In some embodiments of the present application, based on the aforementioned scheme, the sending unit includes: an area creation unit, used to determine, based on the cluster identifier, a blank storage area corresponding to the cluster identifier in the storage component of the server cluster; and a parallel sending unit, used to send the image file in parallel to the blank storage area corresponding to the cluster identifier based on the transmission thread corresponding to each server identifier.
[0011] In some embodiments of the present application, based on the aforementioned scheme, the detection unit includes: a periodic detection unit, which is used to control the detection component in the management node to call the service corresponding to the storage component based on a preset period to obtain the cluster identifier of the server cluster managed by the storage component.
[0012] In some embodiments of the present application, based on the aforementioned scheme, the cloud-based multi-cluster management device also includes: a third reading unit, used to read the historical image file of the original server cluster in the cloud platform when a new server cluster is registered in the cloud platform; the historical image file is used to create a virtual machine; a second determination unit, used to determine the transmission thread corresponding to each of the historical image files; a second sending unit, used to send each of the historical image files in parallel to the new server cluster based on the transmission thread corresponding to each of the historical image files, so that the new server cluster creates a virtual machine based on the historical image file.
[0013] In some embodiments of the present application, based on the aforementioned scheme, the second sending unit includes: an identification acquisition unit, used to obtain the cluster identification of the registered server cluster in the cloud platform; a new determination unit, used to identify the cluster identification not stored in the storage component as the new identification corresponding to the new server cluster based on the historical cluster identification stored in the storage component of the cloud platform and the cluster identification of the registered server cluster; a third sending unit, used to send each of the historical image files in parallel to the new server cluster corresponding to the new identification based on the transmission thread corresponding to each of the historical image files.
[0014] In some embodiments of the present application, based on the aforementioned scheme, the second sending unit includes: a fourth reading unit, used to read mirror files of a preset data volume in parallel from the queue based on the queue composed of each of the historical mirror files; a second transmission unit, used to transmit the preset number of mirror files to the transmission thread corresponding to each of the mirror files; and a fourth sending unit, used to send the mirror files in parallel to the newly added server cluster through the transmission thread until all historical mirror files are sent to the newly added server cluster.
[0015] According to one aspect of an embodiment of the present application, a cloud-based multi-cluster management method is provided, including: obtaining mirror data sent by a management node in a cloud platform based on a transmission thread corresponding to a cluster identifier of the server cluster, wherein the transmission thread is created by the management node for the cluster identifier of the server cluster and is independent of the transmission threads corresponding to other server clusters in the cloud platform; when the mirror data is obtained, synthesizing the obtained mirror data according to data bits to obtain a mirror file; synchronizing the mirror file to a server in the server cluster; and creating a virtual machine in the server according to the mirror file.
[0016] According to one aspect of an embodiment of the present application, a cloud-based multi-cluster management device is provided, including: a data transmission unit, configured to obtain mirror data sent by a management node in a cloud platform based on a transmission thread corresponding to a cluster identifier of the server cluster, wherein the transmission thread is created by the management node for the cluster identifier of the server cluster and is independent of the transmission threads corresponding to other server clusters in the cloud platform; a file synthesis unit, configured to synthesize the acquired mirror data according to data bits to obtain a mirror file when the mirror data is acquired; a file synchronization unit, configured to synchronize the mirror file to a server in the server cluster; and a virtual machine creation unit, configured to create a virtual machine in the server according to the mirror file.
[0017] In some embodiments of the present application, based on the aforementioned scheme, the cloud-based multi-cluster management device further includes: a registration request unit, used to send a registration request to the cloud platform; a historical data acquisition unit, used to obtain the historical image files sent in parallel by the management node based on the transmission threads corresponding to the historical image files in other server clusters in the cloud platform if the registration in the cloud platform is completed; and a first creation unit, used to create a virtual machine based on the historical image file.
[0018] In some embodiments of the present application, based on the aforementioned solution, the cloud-based multi-cluster management device further includes: a file storage unit for storing the image file; and a location adding unit for adding the storage location of the image file to the metadata information of the image file.
[0019] According to one aspect of an embodiment of the present application, a computer-readable medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the cloud-based multi-cluster management method as described in the above embodiment is implemented.
[0020] According to one aspect of an embodiment of the present application, an electronic device is provided, comprising: one or more processors; and a storage device for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the cloud-based multi-cluster management method as described in the above embodiments.
[0021] In the technical solutions provided in some embodiments of the present application, by reading the image file used to create a virtual machine, the cluster identification of each server cluster connected to the cloud platform is obtained, and the transmission thread corresponding to the cluster identification of each cloud server cluster is determined. Based on the transmission threads corresponding to the cluster identification of the server cluster, the image file is sent in parallel and batches to the server cluster corresponding to each cluster identification, thereby improving the data acquisition efficiency of the server cluster, and thereby improving the creation efficiency and management efficiency of the virtual machine.
[0022] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] The accompanying drawings are incorporated into and constitute a part of the specification, illustrating embodiments consistent with the present application and, together with the specification, explaining the principles of the present application. Obviously, the drawings described below are only some embodiments of the present application, and those skilled in the art can derive other drawings based on these drawings without inventive effort. In the drawings:
[0024] Figure 1A schematic diagram showing an exemplary system architecture to which the technical solutions of the embodiments of the present application can be applied;
[0025] Figure 2 Schematically shows a flow chart of a cloud-based multi-cluster management method according to an embodiment of the present application;
[0026] Figure 3 The following schematically illustrates a system architecture diagram of a cloud platform for multi-cluster image management according to an embodiment of the present application;
[0027] Figure 4 A flowchart for obtaining cluster identifiers of server clusters connected to a cloud platform according to an embodiment of the present application is schematically shown;
[0028] Figure 5 The following schematically illustrates a schematic diagram of multi-cluster detection and discovery according to an embodiment of the present application;
[0029] Figure 6 A schematic diagram of creating transmission threads based on various server clusters according to an embodiment of the present application is shown schematically;
[0030] Figure 7 A schematic diagram of parallel transmission of image files according to an embodiment of the present application is schematically shown;
[0031] Figure 8 A schematic diagram schematically illustrates mirror data synchronization of a newly added cluster according to an embodiment of the present application;
[0032] Figure 9 Schematically shows a flow chart of a cloud-based multi-cluster management method according to an embodiment of the present application;
[0033] Figure 10 Schematically shows a block diagram of a cloud-based multi-cluster management device according to an embodiment of the present application;
[0034] Figure 11 Schematically shows a block diagram of a cloud-based multi-cluster management device according to an embodiment of the present application;
[0035] Figure 12 A schematic diagram of the structure of a computer system suitable for implementing an electronic device according to an embodiment of the present application is shown. DETAILED DESCRIPTION
[0036] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in many forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this application will be thorough and complete and will fully convey the concepts of the example embodiments to those skilled in the art.
[0037] In addition, described feature, structure or characteristic can be combined in one or more embodiments in any suitable manner.In the following description, many specific details are provided so as to provide a full understanding of the embodiments of the present application. However, it will be appreciated by those skilled in the art that the technical scheme of the present application can be put into practice without one or more of the specific details, or other methods, components, devices, steps etc. can be adopted. In other cases, known methods, devices, implementations or operations are not shown or described in detail to avoid blurring the various aspects of the application.
[0038] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically separate entities. That is, these functional entities may be implemented in software, in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.
[0039] The flowcharts shown in the accompanying drawings are for illustrative purposes only and do not necessarily include all contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps may be decomposed, while others may be combined or partially combined. Therefore, the actual execution order may vary depending on the actual situation.
[0040] Cloud computing is a computing model that distributes computing tasks across a resource pool consisting of a large number of computers, enabling various application systems to access computing power, storage space, and information services as needed. The network that provides these resources is called the "cloud." To users, these resources appear infinitely scalable, readily accessible, usable on demand, and scalable at any time, with a pay-per-use policy. Driven by the growth of the internet, real-time data streams, and the diversification of connected devices, as well as the demand for search services, social networks, mobile commerce, and open collaboration, cloud computing has rapidly developed. Unlike previous parallel and distributed computing approaches, cloud computing promises to revolutionize the entire internet model and enterprise management model.
[0041] As a provider of cloud computing's basic capabilities, a cloud computing resource pool platform, referred to as a cloud platform, is established. This is generally referred to as Infrastructure as a Service (IaaS). Various types of virtual resources are deployed in the resource pool for external customers to choose from. The cloud computing resource pool primarily includes: computing devices (virtualized machines, including operating systems), storage devices, and network devices. These are divided according to logical functions. Specifically, a Platform as a Service (PaaS) layer can be deployed on the IaaS layer; a Software as a Service (SaaS) layer can be deployed on top of the PaaS layer, or SaaS can be deployed directly on IaaS. PaaS is a platform for software operation, such as databases and web containers; SaaS is a variety of business software, such as web portals and SMS mass senders. Generally speaking, SaaS and PaaS are upper layers relative to IaaS.
[0042] In the field of cloud computing, there is a large amount of data in the cloud platform that needs to be processed or transmitted, which is where big data technology comes in. Big data refers to a collection of data that cannot be captured, managed, and processed using conventional software tools within a certain timeframe. It is a massive, high-growth, and diverse information asset that requires new processing models to achieve stronger decision-making power, insight discovery, and process optimization capabilities. With the advent of the cloud era, big data has also attracted increasing attention. Big data requires special technologies to effectively process large amounts of data within a tolerable timeframe. Technologies suitable for big data include large-scale parallel processing databases, data mining, distributed file systems, distributed databases, cloud computing platforms, the Internet, and scalable storage systems. In this embodiment, big data is stored and managed by creating virtual machines in the cloud platform, thereby improving the efficiency and scale of big data processing.
[0043] In one embodiment of the present application, the servers in the server cluster can be independent physical servers, or a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud computing services. The terminal can be a smartphone, tablet computer, laptop computer, desktop computer, smart speaker, smart watch, etc., but is not limited to these. The terminal and the server can be directly or indirectly connected via wired or wireless communication, which is not limited in this application.
[0044] Figure 1 A schematic diagram shows an exemplary system architecture to which the technical solutions of the embodiments of the present application can be applied.
[0045] like Figure 1 As shown, the system architecture may include at least two server clusters (such as Figure 1 101 and 102 (which may also be virtual server clusters), a network 103, and a server 104 corresponding to the management node. The network 103 is used to provide a medium for communication links between the server clusters and the servers 104. The network 103 may include various connection types, such as wired communication links, wireless communication links, etc.
[0046] It should be understood that Figure 1 The number of server clusters, networks, and servers in the embodiment is merely illustrative. Any number of devices, networks, and servers may be used as needed. For example, server 104 may be a server cluster consisting of multiple servers.
[0047] In one embodiment of the present application, a user can send a control instruction to the device corresponding to the server cluster through the control server 104 to control the virtual machines in the server cluster to perform installation, operation and other operations. Specifically, in this embodiment, the server 104 corresponding to the management node reads the image file used to create the virtual machine, obtains the cluster identifier of each server cluster connected to the cloud platform, determines the transmission thread corresponding to each cluster identifier, and sends the image file in parallel to each server cluster based on the transmission thread corresponding to the cluster identifier of each server cluster, so that each server cluster creates a virtual machine based on the image file. By creating a corresponding thread for each cloud server cluster, and sending the image file in parallel and batches to the server cluster corresponding to each cluster identifier based on each thread, the data acquisition efficiency of the server cluster is improved, thereby improving the creation efficiency and management efficiency of the virtual machine.
[0048] It should be noted that the cloud-based multi-cluster management method provided in the embodiments of the present application is generally executed by the server 104, and accordingly, the cloud-based multi-cluster management device is generally provided in the server 104. However, in other embodiments of the present application, the terminal device may also have similar functions to the server, thereby executing the cloud-based multi-cluster management method provided in the embodiments of the present application.
[0049] The following is a detailed description of the implementation details of the technical solution of the embodiment of the present application:
[0050] Figure 2 A flowchart of a cloud-based multi-cluster management method according to an embodiment of the present application is shown. The cloud-based multi-cluster management method can be executed by a server, which can be Figure 1 Refer to the server shown in . Figure 2 As shown, the cloud-based multi-cluster management method includes at least steps S210 to S240, which are described in detail as follows:
[0051] In step S210, an image file for creating a virtual machine is read.
[0052] In one embodiment of the present application, a distributed system is generally used to provide storage services in a cloud platform based on the cloud computing management platform project Openstack. Typically, a set of storage clusters is used in the cloud platform. However, as the business grows, the cloud platform has more and more data, and the cluster often needs to be expanded, resulting in an increasing size of the storage cluster, which will lead to an increase in the failure rate of the storage cluster and an increase in operation and maintenance costs. In this embodiment, a multi-cluster mode is proposed in the cloud platform, which provides storage services by connecting multiple small storage clusters to a set of cloud platforms, thereby achieving storage expansion. This allows multiple clusters to divide and conquer, and the data of each cluster is independent of each other.
[0053] Figure 3 This is a system architecture diagram of multi-cluster image management on the cloud platform provided in an embodiment of the present application.
[0054] like Figure 3 As shown, the system architecture of the cloud platform provided by the embodiment for multi-cluster image management is mainly divided into four layers, which are described in detail as follows: The first layer is the business layer 310, which mainly includes platforms that users can directly operate, such as self-service platforms, monitoring platforms, and operation and maintenance platforms. Among them, the self-service platform is used to provide an interface for user terminals to apply for resources; the monitoring platform is used to monitor the total resource usage of the entire platform; the operation and maintenance platform is used to manage the operation interface, such as performing some host machine migration and other operations. The second layer is the cloud gateway layer 320, which is mainly composed of the gateway Venus, the Internet Protocol (IP) system, and the role-based access control component (RBAC). Among them, the gateway Venus is used to provide a unified original platform resource interface; the IP system is used to manage network resources such as IP; and RBAC is used for authentication. The third layer is the basic cloud layer 330, which is mainly an open source cloud platform that provides Iaas services. The virtual machine management component Nova is used to manage the life cycle of virtual machines, the image management component Glance is used to manage the life cycle of images, and the storage component Cinder is used to manage the life cycle of volumes. The fourth layer is the storage layer 340, which includes at least two clusters for providing block storage services by using a storage cluster in a multi-cluster mode.
[0055] In one embodiment of the present application, the image file can be pre-stored in the storage space of the management node. The image file can be read directly from the storage space of the management node, or from other management nodes, or by reading existing image data and integrating them to obtain the image file, etc.
[0056] In one embodiment of the present application, the image file is used to load and start the virtual machine in each cluster, so that when multiple clusters run in parallel, an image file is uploaded to each cluster, so that when the virtual machine is created, each cluster searches for the image within its own cluster, and through the snapshot and cloning technology within the cluster, the cloud platform can start the virtual machines in each cluster in seconds.
[0057] In one embodiment of the present application, the process of reading the image file for creating a virtual machine in step S210 specifically includes the following steps: reading a preset amount of image data from the image file for creating the virtual machine one by one; and adding the read image data to the image data queue in the reading order.
[0058] Specifically, in this embodiment, because the image file may contain a large amount of data, a preset amount of image data is read sequentially when reading the image file. The read image data is then added to the image data queue in batches according to the read data. When the image file is sent in parallel to the server clusters corresponding to each cluster identifier, the preset amount of image data is read from the image data queue. Next, the read image data is broadcast to the transmission thread corresponding to each cluster identifier. The transmission thread then sends the read image data in parallel to the server clusters corresponding to each cluster identifier until the image file is sent to each server cluster.
[0059] In one embodiment of the present application, due to the large amount of data in the image file, it may not be possible to transmit the data to the server cluster all at once. Therefore, in this embodiment, a preset data volume is set, so that the transmission threads corresponding to each server cluster can read the preset data volume from the image file one by one, and broadcast the data read each time in parallel to the transmission threads corresponding to each server cluster until all the data in the image file is transmitted.
[0060] By using the above-mentioned method of reading and sending the image file, when the amount of image file data is large, the image file data can be sent to each server cluster at the fastest speed, which can not only ensure the load balancing during the image data transmission, but also improve the efficiency of the image data transmission.
[0061] In step S220, the cluster identifier of each server cluster connected to the cloud platform is obtained.
[0062] In one embodiment of the present application, storage capacity expansion is achieved by using a multi-cluster model within a cloud platform, adding small clusters to the cloud platform. Therefore, during the operation of the cloud platform, multiple new server clusters may be registered or connected to the cloud platform. In this embodiment, cluster identifications of each server cluster connected to the cloud platform are obtained to manage the server clusters and determine the server clusters to which image files need to be sent in parallel.
[0063] In one embodiment of the present application, the cluster identifiers of the server clusters connected to the cloud platform may be obtained by detecting the server clusters connected to the cloud platform. For example, the cluster identifiers of the server clusters connected to the cloud platform may be determined by collecting application information of the server clusters and then using the application information to determine the cluster identifiers of the server clusters connected to the cloud platform.
[0064] In one embodiment of the present application, Figure 4 As shown, the process of obtaining the cluster identifier of each server cluster connected to the cloud platform in step S220 includes the following steps S410 to S420, which are described in detail as follows:
[0065] In step S410, the detection component is called to detect information of the server cluster included in the storage component of the cloud platform.
[0066] In one embodiment of the present application, the process of calling the detection component in step S410 to detect the information of the server cluster contained in the storage component of the cloud platform includes: based on a preset period, controlling the detection component in the management node to call the service corresponding to the storage component to obtain the information of the server cluster managed by the storage component.
[0067] In one embodiment of the present application, a cloud platform management node is configured with a detection component, Probe, and a storage component, Cinder. The detection component, Probe, is used to detect information about the server cluster within the cloud platform, while the storage component, Cinder, is used to store and manage data within the server cluster. Based on these two components, this embodiment uses a set period to control the detection component's detection of the server cluster information contained in the storage component.
[0068] Specifically, when detecting information of the server cluster, the control detection component Probe calls the service corresponding to the storage component Cinder to obtain information of the server cluster managed by the storage component, and then determines the server cluster to which the image file needs to be sent through the cluster identifier.
[0069] Figure 5 A schematic diagram of multi-cluster detection and discovery provided in an embodiment of the present application.
[0070] like Figure 5As shown, the image management component Glance (510) includes: an application programming interface (API), a storage library Cinder store, a detection component Probe, and a database computer (DBC) on the client. Among them, the API is used to accept image operation requests; the Cinder store is used to call the storage component Cinder to upload the image data to the volume of the storage component 520, that is, the Volume in Cinder; the detection component Probe is a background timed detection task, which obtains the cluster identifier corresponding to each cluster by calling the Cinder interface, such as the volume type Volume-type, such as: cluster 1, set1, cluster 2, set2, etc.; DBC is a client that interacts with the database and is used to access the cluster discovered by the detection. The Cinder component includes an API, a volume resource control component, and a cluster controller Driver corresponding to each server cluster. Among them, the API is used to receive volume operation requests; the volume resource control component is used for volume resource control, such as data snapshots, data backups, etc., and the cluster controller Driver is used to control each cluster, such as Figure 5 Cluster controllers 1 to 3 are used to control clusters 1 to 3 (530) respectively.
[0071] For example, in a specific application process, the detection and discovery of multiple server clusters is to enable the image management component Glance to perceive the multiple clusters connected to the storage component Cinder. In this embodiment, a volume type Volume-type represents a server cluster, and the volume type Volume-type of each server cluster is identified by the storage component Cinder. For example Figure 5 Volume types 1 to 3 in the table. When a probe is triggered, the Probe component, as a background service, calls the Cinder service of the storage component every 5 minutes to obtain the volume type Volume-type of the cluster currently managed by the Cinder storage component.
[0072] After obtaining the volume types for the server cluster currently managed by Cinder, the storage module's memory is updated. Specifically, the probe component passes the detected volume types to the storage module Cinder store for updating. The Cinder store stores the latest detected volume types in memory for unified management, improving server cluster management efficiency.
[0073] In step S420, based on the information of the server cluster included in the storage component, the cluster identifier of the server cluster connected to the cloud platform is determined.
[0074] In one embodiment of the present application, after detecting and obtaining the information of the server cluster contained in the storage component in the cloud platform, the server cluster connected to the cloud platform is determined based on the information of the server cluster contained in the storage component, so as to transfer the image file to the server cluster connected to the cloud platform.
[0075] Specifically, this step in this embodiment is aimed at creating multiple new server clusters in the cloud platform at the same time, and it is necessary to transfer and update the mirror files of the multiple server clusters. Therefore, based on the information of the server clusters contained in the storage component obtained by detection, the server clusters corresponding to the information of these server clusters can all be identified as server clusters connected to the cloud platform, or the information of the server clusters contained in the storage component can be compared with the information of the server clusters contained historically to determine the information of the newly added server clusters. For example, the cluster information of the newly added server clusters can be determined, the identification information in the cluster information of these server clusters can be detected, and the identification information can be identified as the cluster identification of the server cluster connected to the cloud platform.
[0076] In step S230 , the transmission thread corresponding to each cluster identifier is determined.
[0077] In one embodiment of the present application, after obtaining the cluster identifiers of each server cluster connected to the cloud platform, a transmission thread corresponding to each server cluster is determined based on the cluster identifiers. In one embodiment of the present application, the transmission thread in this embodiment can be pre-created based on the server cluster, or can be generated based on the cluster identifiers of the server clusters after the server clusters are detected.
[0078] It should be noted that this embodiment creates a transmission thread corresponding to each server cluster to transmit image files to the server clusters in parallel. This avoids the need for another cluster, not in the same cluster as the image file, to copy the image file across clusters to complete virtual machine creation. This copy operation consumes management network traffic between control nodes and requires downloading the image file to the local cluster. This download process is related to the size of the image file, especially when the image file has a large data volume. Therefore, this method cannot create virtual machines in seconds. This requires a multi-cluster management solution, including how the Glance component perceives multiple sets, how to register with Glance when adding clusters, and how Glance can quickly upload data to each cluster when uploading images, rather than increasing linearly with the number of clusters. This ensures that users do not notice the difference between the multi-cluster cloud platform and the previous platform when using it, achieving transparency for user services. This embodiment improves the efficiency of image file transmission by establishing transmission threads and transmitting image files to each server based on the transmission threads, thereby improving the efficiency of loading virtual machines based on image files.
[0079] Figure 6 A schematic diagram of creating transmission threads based on various server clusters provided in an embodiment of the present application.
[0080] like Figure 6 As shown, in the cloud platform, after uploading an image file 610 to the image management component 620, the image management component 620 connects to the storage component 630 and uses a unified volume management image. When the storage component 630 connects to multiple clusters, the image management component 620 uses the storage component 630 to manage each server cluster based on the volume type. For example, based on the volume types corresponding to clusters 1 to 3, transmission threads corresponding to clusters 1 to 3 are created.
[0081] In step S240 , based on the transmission threads corresponding to each cluster identifier, the image file is sent in parallel to the server clusters corresponding to each cluster identifier.
[0082] In one embodiment of the present application, after creating a corresponding transmission thread for each server cluster, the image file is sent in parallel to each server cluster corresponding to each cluster ID based on the transmission thread corresponding to each cluster ID. This allows the image file to arrive at each server cluster simultaneously, avoiding the delay caused by serial transmission of the image file. This allows each server cluster to quickly create a virtual machine based on the obtained image file, achieving the goal of instant virtual machine startup.
[0083] In one embodiment of the present application, the process of sending the image file in parallel to each server cluster corresponding to each cluster identifier based on the transmission thread corresponding to each cluster identifier in step S420 includes: based on the cluster identifier, determining the blank storage area corresponding to the cluster identifier in the storage component of the server cluster; based on the transmission thread corresponding to each server identifier, sending the image file in parallel to the blank storage area corresponding to the cluster identifier.
[0084] In one embodiment of the present application, a transfer thread is initiated based on the cluster identifier of each server cluster to perform online operations. The transfer thread creates a blank storage area based on the cluster identifier of each server cluster. For example, the cluster identifier can be a Volume-Type. Based on the cluster identifier of the server cluster, the blank storage area created is a Volume, which is used to store the image files of the server cluster.
[0085] Specifically, a transmission thread is started for each server cluster to perform the upload operation. The Volume-type of each cluster is obtained by detection. Each transmission thread calls the Cinder service through the Volume-type parameter to create a blank volume for storing the image files to be uploaded later, so as to ensure the reliability of image file transmission and the integrity of the data in the image files.
[0086] In one embodiment of the present application, the process of sending the mirror file in parallel to each server cluster corresponding to each cluster identifier based on the transmission thread corresponding to each cluster identifier includes the following steps: reading a preset amount of data from the mirror file one by one; and broadcasting the data read each time in parallel to each server cluster based on the transmission thread corresponding to each server cluster.
[0087] Furthermore, since data may be lost due to block transmission based on a preset data volume, in this embodiment, after the mirror data transmission is completed, a check can be performed in the server cluster and the management node to ensure the integrity of the mirror data.
[0088] Figure 7 This is a schematic diagram of a parallel transmission image file provided by an embodiment of the present application.
[0089] like Figure 7 As shown, the preset data volume in the embodiment of the present application can be 4M, 5M, etc. When the preset data volume is 4M, it can be transmitted according to an integer multiple of the data bits, thereby preventing data leakage and improving the reliability and integrity of data transmission.
[0090] In one embodiment of the present application, the process of parallel transmission of image files is carried out in the repository 710 of the management node. Specifically, the Cinder store module uses the image file handle as the starting point, reads 4M data from the image file each time, sorts the data in the order of reading, and puts the data into a data queue 720. Each 4M data block in the queue will be broadcast to the processing thread corresponding to each cluster, and form a thread set 730. For example, the first 4M of data is processed by thread 1. In the processing thread 740 within the sliding window, based on the previously created blank storage area, that is, the blank volume, the previously created blank volume is opened through the block repository Librbd, and the 4M image data is written to the cluster 750 using the Write interface. After writing the image data, the corresponding location information is generated to facilitate the subsequent indexing, searching, and other processing of the image file.
[0091] In one embodiment of the present application, if the number of server clusters is at least three, a preselected cluster corresponding to the size of the sliding window is selected from each server cluster in turn according to the size of the sliding window; and the image file is sent to the preselected cluster in parallel based on the transmission threads corresponding to each server cluster.
[0092] like Figure 7 As shown, in the cluster management method of this embodiment, in order to avoid excessive storage network traffic and network overload, especially when there are many clusters, a sliding window is used for flow control, and the processing threads of all clusters are placed in a thread set 730. In this embodiment, based on the size of the sliding window, pre-selected clusters corresponding to the size of the sliding window are selected from each server cluster in sequence, and the image files are sent to the pre-selected clusters in parallel based on the transmission threads corresponding to each server cluster.
[0093] For example, in this embodiment, the sliding window size is set to the number of clusters running concurrent uploads. For example, when the sliding window is 2, 4MB of image data is uploaded simultaneously by the processing threads corresponding to clusters 1 and 2. After clusters 1 and 2 complete the processing, the sliding window moves back 2 squares, that is, the image data is transmitted to the processing threads of clusters 3 and 4, until the 4MB of data is transmitted to each cluster.
[0094] In one embodiment of the present application, the above-mentioned window transmission method avoids the problem of excessive storage network traffic caused by parallel data transmission when there are too many clusters, thereby improving the efficiency of parallel data transmission.
[0095] In one embodiment of the present application, the cloud-based multi-cluster management method in this embodiment further includes the following steps S710 to S730, which are described in detail as follows:
[0096] In step S710, when a new server cluster is registered in the cloud platform, a historical image file of an existing server cluster in the cloud platform is read; the historical image file is used to create a virtual machine.
[0097] In one embodiment of the present application, during the operation of the cloud platform, some registered server clusters are operating normally, and newly registered server clusters are also added. In this embodiment, new server clusters can be registered in the cloud platform based on cluster information such as cluster identifiers to achieve capacity expansion of the cloud platform.
[0098] It should be noted that the server management in this embodiment is done through cluster management, so that new server clusters can be added and registered in the cloud platform at any time without affecting the work of other server clusters in the cloud platform, thereby achieving the expansion of the cloud platform and facilitating the management of server clusters in the cloud platform.
[0099] In one embodiment of the present application, after a new server cluster is registered, a historical image file needs to be transferred to the newly added server cluster. In this embodiment, since each server cluster in the cloud platform may contain image files corresponding to different data, the historical image file in this embodiment is used to represent the image files in all or some of the server clusters in the cloud platform. By reading the historical image files in each server cluster, the integrity of the data in the newly added server cluster is guaranteed, and the newly added server cluster can store data from other server clusters in the same cloud platform.
[0100] In step S720 , the transmission thread corresponding to each historical image file is determined.
[0101] In one embodiment of the present application, since there are a large number of historical files to be transmitted, a transmission thread corresponding to each historical image file is determined in this embodiment, so that each historical image file can be transmitted to the newly added server cluster in parallel based on these transmission threads.
[0102] In step S730 , each historical image file is sent in parallel to the newly added server cluster based on the transmission thread corresponding to each historical image file.
[0103] During the operation of the cloud platform in the embodiment of the present application, newly registered server clusters will be added one after another. In this embodiment, these newly registered server clusters are detected and identified as newly added server clusters, and image files are transferred to these newly added server clusters in parallel. This improves the efficiency of transferring historical image files to the newly added server clusters by transferring each historical image file in parallel, thus ensuring that virtual machines in this cluster can be created in seconds based on the image files.
[0104] In one embodiment of the present application, the cluster identifiers of the registered server clusters in the cloud platform can be obtained; based on the historical cluster identifiers stored in the storage component of the cloud platform and the cluster identifiers of the registered server clusters, the two can be compared to obtain the server clusters corresponding to the cluster identifiers not stored in the storage component. The cluster identifiers not stored in the storage component are identified as newly added identifiers corresponding to the newly added server clusters, and this type of server cluster is treated as a newly added server cluster. Each historical image file is sent in parallel to the newly added server cluster corresponding to the newly added identifier using the transmission thread corresponding to each historical image file.
[0105] In one embodiment of the present application, the cluster identifier of a registered server cluster is obtained based on the historical cluster identifier pre-stored in the storage component of the cloud platform. For example, the Volume-type set of each component regularly detected by the Probe module of Glance is compared with the memory in the Cinder store module. The cluster corresponding to the Volume-type that is not originally in the Cinder store is the newly added server cluster.
[0106] In one embodiment of the present application, periodic detection can be performed based on a set detection cycle, such as 5 minutes, 1 hour, etc. Periodic detection can improve the efficiency of server cluster monitoring, thereby improving the intelligence of cloud platform management.
[0107] In one embodiment of the present application, each historical image file can be sent in parallel to a newly added server cluster based on the transmission thread corresponding to each historical image file. First, the historical image files are formed into a queue. Based on the queue composed of the historical image files, image files with a preset data volume are read in parallel from the queue; the preset number of image files are transmitted to the transmission thread corresponding to each image file; and the image files are sent in parallel to the newly added server cluster through the transmission thread until all historical image files are sent to the newly added server cluster.
[0108] Figure 8 A schematic diagram of mirror data synchronization of a newly added cluster provided in an embodiment of the present application.
[0109] like Figure 8As shown, the synchronization process of the mirror data of the newly added cluster in this embodiment is executed in the repository 810 of the cloud platform management node. First, the historical mirror files of each server cluster in the cloud platform, such as mirror 1 to mirror 3, are obtained to form a mirror queue 820, and a preset number of mirror files are read from the mirror queue 820 one by one. Then, the preset number of mirror files are transferred to the transmission threads corresponding to each historical mirror file in the thread set 830. For example, the data in mirror 1 to mirror 3 are respectively obtained through threads 1 to thread 3 in the thread set 830. Finally, based on the transmission thread of each historical mirror file, each historical mirror file is sent in parallel to the newly added server cluster. For example, the data in mirror 1 to mirror 3 are respectively transmitted to cluster 1 to cluster 3 through threads 1 to thread 3 in the thread set 830.
[0110] In one embodiment of the present application, the data of a corresponding number of threads may be acquired through the sliding window 840 to ensure load balancing of the newly added server cluster.
[0111] In one embodiment of the present application, when a cloud platform server cluster creates a virtual machine, each server cluster searches for an image file within its own cluster. A virtual machine can be created based on either the latest image file or all of the image files. Specifically, snapshot and cloning technologies within the server cluster can be used to create virtual machines in seconds.
[0112] In one embodiment of the present application, Glance achieves multi-cluster awareness through multi-cluster detection and discovery. It then concurrently uploads image data to multiple clusters, synchronizing images during cluster expansion. This allows for instant virtual machine startup across multiple clusters. This is completely user-aware and has no impact on services. This image management ensures the stable operation of multiple storage clusters on the cloud platform, thereby ensuring stable and reliable data storage and processing.
[0113] Figure 9 A flowchart of a cloud-based multi-cluster management method according to an embodiment of the present application is shown. The cloud-based multi-cluster management method can be executed by a server cluster, which can be Figure 1 The server cluster shown in . Figure 9 As shown, the cloud-based multi-cluster management method includes at least steps S910 to S940, which are described in detail as follows:
[0114] In step S910, based on the transmission thread corresponding to the cluster identifier of this server cluster, the mirror data sent by the management node in the cloud platform is obtained, wherein the transmission thread is created by the management node for the cluster identifier of this server cluster and is independent of the transmission threads corresponding to other server clusters in the cloud platform.
[0115] In one embodiment of the present application, when generating a server cluster for a cloud platform, a management node creates a corresponding transmission thread for the cluster identifier of this server cluster. Furthermore, the transmission thread created by the management node for this server cluster is independent of the transmission threads created for other server clusters in the cloud platform, allowing this server cluster to retrieve image files sent by the management node based on this transmission thread. This approach allows each server cluster to retrieve image files in a single-threaded, non-interference manner, improving image file retrieval efficiency.
[0116] It should be noted that the image file acquisition method in this embodiment is the same as Figure 2 The transmission method of the mirror file in the corresponding embodiment corresponds to that in the embodiment. For details, please refer to Figure 2 Description in the corresponding embodiment.
[0117] In step S920, when the mirror data is acquired, the acquired mirror data is synthesized according to the data bits to obtain a mirror file.
[0118] In one embodiment of the present application, since the mirror data is partially and dispersedly transmitted to the server cluster, in this embodiment, when the mirror data is acquired, the acquired mirror data is synthesized according to the data bits to obtain a complete mirror file.
[0119] In step S930 , the mirror file is synchronized to the servers in the server cluster.
[0120] In one embodiment of the present application, after the server cluster obtains the complete image file, the image file is synchronized to the servers in the server cluster. The process of synchronizing the image file can be synchronizing to some servers in the server cluster or to all servers in the server cluster.
[0121] In step S940 , a virtual machine is created in the server according to the image file.
[0122] In one embodiment of the present application, after obtaining the image file, the servers in the server cluster search for the image file in their respective memories and start the virtual machine in seconds through the snapshot and cloning technology within the server cluster.
[0123] In one embodiment of the present application, before obtaining the image data sent by the management node in the cloud platform based on the transmission thread corresponding to the cluster identifier of the server cluster, it also includes: sending a registration request to the cloud platform; if the registration in the cloud platform is completed, then based on the transmission thread corresponding to the historical image file in other server clusters in the cloud platform, obtaining the historical image file sent in parallel by the management node; creating a virtual machine based on the historical image file.
[0124] In one embodiment of the present application, when a server cluster is newly registered with the cloud platform, it is necessary to obtain image files for all server clusters in the cloud platform. In this case, the embodiment creates corresponding transmission threads based on the historical image files in each server cluster, obtains the image data through the transmission threads corresponding to each historical image file, and then creates a virtual machine based on the historical image data.
[0125] In one embodiment of the present application, the above solution can enable the newly registered server cluster to efficiently obtain historical image files and efficiently create virtual machines, thereby improving the efficiency of registering server clusters in the cloud platform and the management efficiency of server clusters in the cloud platform.
[0126] In one embodiment of the present application, after obtaining the image data sent by the management node in the cloud platform based on the transmission thread corresponding to the cluster identifier of the server cluster, the method further includes: storing the image file and generating local location information of the image file. The storage location of the image file is added to the metadata information of the image file for subsequent processing such as retrieval of the image file.
[0127] In one embodiment of the present application, by concurrently uploading image data to multiple clusters and synchronizing images during cluster expansion, virtual machines can be instantly started across multiple clusters. This is done without user awareness and without impacting services. This image management ensures the stable operation of multiple storage clusters on the cloud platform, thereby ensuring stable and reliable data storage and processing.
[0128] The following describes an embodiment of the device of the present application, which can be used to execute the cloud-based multi-cluster management method in the above-mentioned embodiment of the present application. It can be understood that the device can be a computer program (including program code) running on a computer device, for example, the device is an application software; the device can be used to execute the corresponding steps in the method provided in the embodiment of the present application. For details not disclosed in the embodiment of the device of the present application, please refer to the embodiment of the cloud-based multi-cluster management method described above in the present application.
[0129] Figure 10 A block diagram of a cloud-based multi-cluster management device according to an embodiment of the present application is shown.
[0130] Reference Figure 10As shown, according to an embodiment of the present application, a cloud-based multi-cluster management device 1000 corresponds to a management node and includes: a reading unit 1010 for reading an image file for creating a virtual machine; an acquisition unit 1020 for acquiring cluster identifiers of each server cluster connected to the cloud platform; a creation unit 1030 for determining a transmission thread corresponding to each cluster identifier; and a sending unit 1040 for sending the image file in parallel to each server cluster corresponding to each cluster identifier based on the transmission thread corresponding to each cluster identifier.
[0131] In some embodiments of the present application, based on the aforementioned scheme, the reading unit 1010 includes: a first reading unit, used to read a preset amount of mirror data from the mirror file used to create a virtual machine one by one; a data adding unit, used to add the read mirror data to the mirror data queue in the reading order.
[0132] In some embodiments of the present application, based on the aforementioned scheme, the sending unit 1040 includes: a second reading unit, used to read a preset amount of mirror data from the mirror data queue; a first broadcast unit, used to broadcast the read mirror data to the transmission thread corresponding to each cluster identifier; a second sending unit, used to send the read mirror data in parallel to each server cluster corresponding to each cluster identifier through the transmission thread, until the mirror file is sent to each server cluster.
[0133] In some embodiments of the present application, based on the aforementioned scheme, the acquisition unit 1020 includes: a detection unit, used to call the detection component to detect the information of the server cluster contained in the storage component of the cloud platform; a first determination unit, used to determine the cluster identifier of the server cluster connected to the cloud platform based on the information of the server cluster contained in the storage component.
[0134] In some embodiments of the present application, based on the aforementioned scheme, the sending unit 1040 includes: an area creation unit, which is used to determine, based on the cluster identifier, a blank storage area corresponding to the cluster identifier in the storage component of the server cluster; and a parallel sending unit, which is used to send the image file in parallel to the blank storage area corresponding to the cluster identifier based on the transmission thread corresponding to each server identifier.
[0135] In some embodiments of the present application, based on the aforementioned scheme, the detection unit includes: a periodic detection unit, which is used to control the detection component in the management node to call the service corresponding to the storage component based on a preset period to obtain the cluster identifier of the server cluster managed by the storage component.
[0136] In some embodiments of the present application, based on the aforementioned scheme, the cloud-based multi-cluster management device 1000 also includes: a third reading unit, used to read the historical image file of the original server cluster in the cloud platform when a new server cluster is registered in the cloud platform; the historical image file is used to create a virtual machine; a second determination unit, used to determine the transmission thread corresponding to each historical image file; a second sending unit, used to send each historical image file in parallel to the new server cluster based on the transmission thread corresponding to each historical image file, so that the new server cluster creates a virtual machine based on the historical image file.
[0137] In some embodiments of the present application, based on the aforementioned scheme, the second sending unit includes: an identification acquisition unit, used to obtain the cluster identification of the registered server cluster in the cloud platform; a new determination unit, used to identify the cluster identification not stored in the storage component as the new identification corresponding to the new server cluster based on the historical cluster identification stored in the storage component of the cloud platform and the cluster identification of the registered server cluster; a third sending unit, used to send each historical image file in parallel to the new server cluster corresponding to the new identification based on the transmission thread corresponding to each historical image file.
[0138] In some embodiments of the present application, based on the aforementioned scheme, the second sending unit includes: a fourth reading unit, used to read mirror files of a preset data volume in parallel from the queue based on the queue composed of each historical mirror file; a second transmission unit, used to transmit a preset number of mirror files to the transmission thread corresponding to each mirror file; and a fourth sending unit, used to send the mirror files in parallel to the newly added server cluster through the transmission thread until all historical mirror files are sent to the newly added server cluster.
[0139] Figure 11 A block diagram of a cloud-based multi-cluster management device according to an embodiment of the present application is shown.
[0140] Reference Figure 11 As shown, according to an embodiment of the present application, a cloud-based multi-cluster management device 1100 corresponds to a server cluster and includes: a data transmission unit 1110, which is used to obtain the mirror data sent by the management node in the cloud platform based on the transmission thread corresponding to the cluster identifier of the server cluster, wherein the transmission thread is created by the management node for the cluster identifier of the server cluster and is independent of the transmission threads corresponding to other server clusters in the cloud platform; a file synthesis unit 1120, which is used to synthesize the acquired mirror data according to the data bits when the mirror data is acquired to obtain a mirror file; a file synchronization unit 1130, which is used to synchronize the mirror file to the server in the server cluster; and a virtual machine creation unit 1140, which is used to create a virtual machine in the server according to the mirror file.
[0141] In some embodiments of the present application, based on the aforementioned solution, the cloud-based multi-cluster management device 1100 further includes: a registration request unit, configured to send a registration request to the cloud platform; a historical data acquisition unit, configured to obtain, if registration in the cloud platform is completed, historical image files sent in parallel by the management node based on transmission threads corresponding to historical image files in other server clusters in the cloud platform; and a first creation unit, configured to create a virtual machine based on the historical image files.
[0142] In some embodiments of the present application, based on the aforementioned solution, the cloud-based multi-cluster management device 1100 further includes: a file storage unit for storing image files; and a location adding unit for adding the storage location of the image file to the metadata information of the image file.
[0143] Figure 12 A schematic diagram of the structure of a computer system suitable for implementing an electronic device according to an embodiment of the present application is shown.
[0144] It should be noted that Figure 12 The computer system 1200 of the electronic device 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.
[0145] like Figure 12 As shown, the computer system 1200 includes a central processing unit (CPU) 1201, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 1202 or the program loaded from the storage part 1208 into the random access memory (RAM) 1203, such as executing the method in the above embodiment. Various programs and data required for system operation are also stored in the RAM 1203. The CPU 1201, ROM 1202 and RAM 1203 are connected to each other via a bus 1204. An input / output (I / O) interface 1205 is also connected to the bus 1204.
[0146] The following components are connected to the I / O interface 1205: an input section 1206 including a keyboard, a mouse, and the like; an output section 1207 including devices such as a cathode ray tube (CRT), a liquid crystal display (LCD), and a speaker; a storage section 1208 including a hard disk; and a communication section 1209 including a network interface card such as a LAN (Local Area Network) card or a modem. The communication section 1209 performs communication processing via a network such as the Internet. A drive 1210 is also connected to the I / O interface 1205 as needed. Removable media 1211, such as a magnetic disk, an optical disk, a magneto-optical disk, or a semiconductor memory, is installed in the drive 1210 as needed, so that computer programs read from the removable media can be installed in the storage section 1208 as needed.
[0147] In particular, according to an embodiment of the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a computer program for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network via the communication section 1209, and / or installed from a removable medium 1211. When the computer program is executed by the central processing unit (CPU) 1201, the various functions defined in the system of the present application are executed.
[0148] It should be noted that the computer-readable medium shown in the embodiments of the present application may be a computer-readable signal medium or a computer-readable storage medium or any combination of the two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or component, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present application, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, which carries a computer-readable computer program. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. A computer program embodied on a computer-readable medium may be transmitted using any suitable medium, including but not limited to wireless, wired, or any suitable combination thereof.
[0149] The flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present application. Among them, each box in the flowchart or block diagram can represent a module, program segment, or part of the code, and the above-mentioned module, program segment, or part of the code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in an order different from that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of boxes in the block diagram or flowchart, can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0150] The units involved in the embodiments described in this application may be implemented by software or hardware, and the units described may also be set in a processor. In some cases, the names of these units do not constitute limitations on the units themselves.
[0151] As another aspect, the present application further provides a computer-readable medium, which may be included in the electronic device described in the above embodiments, or may exist independently without being incorporated into the electronic device. The computer-readable medium carries one or more programs, and when the one or more programs are executed by the electronic device, the electronic device implements the method described in the above embodiments.
[0152] It should be noted that, although several modules or units of the device for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiment of the application, the features and functions of two or more modules or units described above can be concretized in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into multiple modules or units to be concretized.
[0153] Through the description of the above embodiments, it is easy for those skilled in the art to understand that the example embodiments described herein can be implemented by software or by combining software with necessary hardware. Therefore, the technical solution according to the embodiments of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which can be a personal computer, a server, a touch terminal, or a network device, etc.) to execute the method according to the embodiments of the present application.
[0154] Those skilled in the art will readily conceive of other embodiments of the present application after considering the specification and practicing the embodiments disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present application that follow the general principles of this application and include common knowledge or customary techniques in the art that are not disclosed herein.
[0155] It should be understood that the present application is not limited to the exact structures 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 application is limited only by the appended claims.
Claims
1. A cloud-based multi-cluster management method, characterized in that: include: Read the image file used to create a virtual machine; Obtain the cluster ID of each server cluster connected to the cloud platform; Determine the transmission thread corresponding to each cluster identifier; Based on the transmission threads corresponding to each cluster identifier, the image file is sent in parallel to each server cluster corresponding to each cluster identifier, so that each server cluster creates a virtual machine based on the image file through snapshot and cloning technology within the server cluster.
2. The method according to claim 1, characterized in that The reading of the image file for creating the virtual machine includes: Reading a preset amount of image data from the image file used to create the virtual machine one by one; The read mirror data is added to the mirror data queue in the reading order.
3. The method according to claim 2, characterized in that The sending of the image file in parallel to the server clusters corresponding to each cluster identifier based on the transmission thread corresponding to each cluster identifier includes: Reading a preset amount of mirror data from the mirror data queue; Broadcasting the read mirror data to the transmission thread corresponding to each cluster identifier; The read mirror data is sent in parallel to each server cluster corresponding to each cluster identifier through the transmission thread until the mirror file is sent to each server cluster.
4. The method according to claim 1, wherein The obtaining of cluster identifiers of each server cluster connected to the cloud platform includes: Invoking a detection component to detect information of a server cluster included in a storage component of the cloud platform; Based on the information of the server cluster included in the storage component, a cluster identifier of the server cluster connected to the cloud platform is determined.
5. The method according to claim 1, wherein The sending of the image file in parallel to the server clusters corresponding to each cluster identifier based on the transmission thread corresponding to each cluster identifier includes: Based on the cluster identifier, determining a blank storage area corresponding to the cluster identifier in a storage component of the server cluster; Based on the transmission threads corresponding to each server identifier, the mirror file is sent in parallel to the blank storage area corresponding to the cluster identifier.
6. The method according to claim 4, characterized in that The calling of the detection component to detect information of the server cluster included in the storage component of the cloud platform includes: Based on a preset period, the detection component in the control management node calls the service corresponding to the storage component to obtain information about the server cluster managed by the storage component.
7. The method according to claim 1, characterized in that The method further comprises: When a new server cluster is registered in the cloud platform, a historical image file of the original server cluster in the cloud platform is read; the historical image file is used to create a virtual machine; Determine the transmission thread corresponding to each of the historical image files; Based on the transmission thread corresponding to each of the historical image files, the historical image files are sent to the newly added server cluster in parallel.
8. The method according to claim 7, characterized in that The sending of each of the historical image files to the newly added server cluster in parallel based on the transmission thread corresponding to each of the historical image files includes: Obtaining the cluster identifier of the server cluster registered in the cloud platform; Based on the historical cluster identifiers stored in the storage component of the cloud platform and the cluster identifiers of the registered server clusters, identifying the cluster identifier not stored in the storage component as a new identifier corresponding to the new server cluster; Based on the transmission thread corresponding to each of the historical image files, each of the historical image files is sent in parallel to the newly added server cluster corresponding to the newly added identifier.
9. The method according to claim 7, characterized in that The sending of each of the historical image files to the newly added server cluster in parallel based on the transmission thread corresponding to each of the historical image files includes: Based on the queue composed of the historical image files, reading the image files of the preset data volume from the queue in parallel; Transmitting the preset number of image files to the transmission threads corresponding to each of the image files; The image files are sent in parallel to the newly added server cluster through the transmission thread until all historical image files are sent to the newly added server cluster.
10. A cloud-based multi-cluster management method, characterized in that: include: Obtaining mirror data sent by a management node in the cloud platform based on a transmission thread corresponding to the cluster identifier of the server cluster, wherein the transmission thread is created by the management node for the cluster identifier of the server cluster and is independent of the transmission threads corresponding to other server clusters in the cloud platform; When the mirror data is acquired, the acquired mirror data is synthesized according to the data bits to obtain a mirror file; Synchronize the image file to the server in the server cluster; A virtual machine is created in the server according to the image file through the snapshot and cloning technology within the server cluster.
11. The method according to claim 10, characterized in that Before obtaining the mirror data sent by the management node in the cloud platform based on the transmission thread corresponding to the cluster identifier of the server cluster, the method further includes: Sending a registration request to the cloud platform; If the registration in the cloud platform is completed, then based on the transmission threads corresponding to the historical image files in other server clusters in the cloud platform, the historical image files sent in parallel by the management node are obtained; A virtual machine is created according to the historical image file.
12. The method according to claim 10, characterized in that After the transmission thread corresponding to the cluster identifier of the server cluster obtains the mirror data sent by the management node in the cloud platform, the method further includes: Storing the image file; The storage location of the image file is added to the metadata information of the image file.
13. A cloud-based multi-cluster management device, characterized in that: include: A reading unit, used for reading an image file used to create a virtual machine; An acquisition unit, used to acquire cluster identifiers of each server cluster connected to the cloud platform; A determination unit, configured to determine a transmission thread corresponding to each cluster identifier; The sending unit is used to send the image file in parallel to each server cluster corresponding to each cluster identifier based on the transmission thread corresponding to each cluster identifier, so that each server cluster creates a virtual machine based on the image file through the snapshot and cloning technology within each server cluster.
14. A computer-readable medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the cloud-based multi-cluster management method according to any one of claims 1 to 12 is implemented.
15. An electronic device, characterized in that: include: one or more processors; A storage device for storing one or more programs, which, when executed by the one or more processors, enables the one or more processors to implement the cloud-based multi-cluster management method according to any one of claims 1 to 12.
Citation Information
Patent Citations
Container cluster management method, device and system
CN110290189A