CN112835989A - Single-application multi-MySQL Set deployment method and system - Google Patents

Single-application multi-MySQL Set deployment method and system Download PDF

Info

Publication number
CN112835989A
CN112835989A CN202110347184.9A CN202110347184A CN112835989A CN 112835989 A CN112835989 A CN 112835989A CN 202110347184 A CN202110347184 A CN 202110347184A CN 112835989 A CN112835989 A CN 112835989A
Authority
CN
China
Prior art keywords
mysql
cluster
container
application
deployment
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202110347184.9A
Other languages
Chinese (zh)
Other versions
CN112835989B (en
Inventor
蔡中原
孙政清
李凤超
白佳乐
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Industrial and Commercial Bank of China Ltd ICBC
Original Assignee
Industrial and Commercial Bank of China Ltd ICBC
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Industrial and Commercial Bank of China Ltd ICBC filed Critical Industrial and Commercial Bank of China Ltd ICBC
Priority to CN202110347184.9A priority Critical patent/CN112835989B/en
Publication of CN112835989A publication Critical patent/CN112835989A/en
Application granted granted Critical
Publication of CN112835989B publication Critical patent/CN112835989B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/28Databases characterised by their database models, e.g. relational or object models
    • G06F16/284Relational databases
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5061Partitioning or combining of resources
    • G06F9/5077Logical partitioning of resources; Management or configuration of virtualized resources
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/4557Distribution of virtual machine instances; Migration and load balancing
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Computing Systems (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The invention provides a deployment method and a system of single-application multi-MySQL Set, wherein the method comprises the following steps: according to the application MySQL Set building request, sequentially taking out a MySQL container in the application MySQL Set as a current MySQL container; screening all K8s clusters corresponding to the application according to a strong rule strategy of scheduling; and according to the deployment rate of each K8s cluster to the application MySQL container, scoring the screened K8s clusters, and taking the K8s cluster with the highest score as the K8s cluster to be scheduled of the current MySQL container. The method can save manual deployment of MySQL containers, save operation and maintenance cost, dispersedly deploy single-application MySQL Set in a plurality of K8s clusters, ensure the balance of deployment rates of the application MySQL containers in the K8s cluster as much as possible, and improve high availability.

Description

Single-application multi-MySQL Set deployment method and system
Technical Field
The present disclosure relates to the field of computers, and in particular, to a method and a system for deploying single-application multi-MySQL Set.
Background
For the requirement of applying the newly added MySQL database container, production, operation and maintenance personnel generally select a deployed K8s cluster through established rules such as a deployment park, a high-availability architecture and the like, and then select Node nodes according to subjective judgment such as Node performance capacity, mounting points and the like to build the MySQL container. Generally, one application needs one to multiple MySQL sets according to the size of service usage, and multiple MySQL sets under the application cannot perform dispersion and balance among clusters.
The existing multi-MySQL Set deployment mode has the following defects:
1. the operation and maintenance cost is high, operation and maintenance personnel need to manually deploy a garden and a high available architecture;
2. the deployment rate of each K8s cluster to the application MySQL container cannot be guaranteed to be optimal in the aspects of balance and the like, and the application MySQL Set is deployed in a centralized mode in an individual K8s cluster, so that the high availability of the application database is reduced.
3. It is difficult to integrate the factors of multiple aspects and make an overall trade-off selection in the selection.
Disclosure of Invention
The method and the device are used for solving the problems that the MySQL container deployment is centralized, the MySQL container deployment rate cannot be guaranteed to be balanced, and the manual operation and maintenance cost is high in the prior art.
In order to solve the above technical problem, a first aspect of the present disclosure provides a deployment method for a single-application multi MySQL Set, including:
according to the application MySQL Set building request, sequentially taking out a MySQL container in the application MySQL Set as a current MySQL container;
screening all K8s clusters corresponding to the application according to a strong rule strategy of scheduling;
according to the deployment rate of each K8s cluster to the application MySQL container, scoring the screened K8s clusters, and taking the K8s cluster with the highest score as the K8s cluster to be scheduled of the current MySQL container;
and judging whether the current MySQL container is the last container in the MySQL Set, if so, finishing the deployment of the MySQL Set, and if not, taking out the next container in the MySQL Set as the current MySQL container and continuing to execute the steps after the screening.
In a further embodiment herein, applying the MySQL Set construction request comprises: the name of the Set, the number of MySQL containers and the park where the MySQL main container is located.
In a further embodiment herein, the screening the K8s cluster of MySQL Set according to the scheduled strong rule policy comprises:
and for each K8s cluster of the MySQL Set, judging whether the K8s cluster of the MySQL Set meets a strong rule strategy, if not, filtering out the K8s cluster of the MySQL Set, and if so, retaining the K8s cluster of the MySQL Set.
In further embodiments herein, the deployment rate of each K8s cluster to the MySQL container is calculated as follows:
acquiring the current deployment quantity of each K8s cluster to the application MySQL container;
and dividing the current deployment amount of each K8s cluster to the application MySQL container by the total MySQL container in the application MySQL Set to obtain the deployment rate of each K8s cluster to the application MySQL container.
In an embodiment of this document, scoring the screened K8s clusters according to the deployment rate of each K8s cluster to the MySQL container includes:
and (4) scoring the screened K8s clusters according to the principle that the deployment rate of the K8s clusters to the application MySQL container is inversely proportional to the score of the K8s clusters.
In a further embodiment herein, if there are at least two highest scoring K8s clusters, then randomly selecting one of the highest scoring K8s clusters as the K8s cluster to be scheduled for the current MySQL container.
In a further embodiment of this document, the method for deploying a single-application multi-MySQL Set further includes:
generating a scheduling result according to the K8s cluster to be scheduled of each MySQL container;
and sending the scheduling result to the K8s cluster so that the K8s cluster schedules the MySQL container to a working node in the cluster.
In a further embodiment of this document, the method for deploying a single-application multi-MySQL Set further includes:
receiving a deployment result sent by a K8s cluster, wherein the deployment result comprises a corresponding relation between a MySQL container and a K8s cluster;
and displaying or sending the deployment result.
A second aspect of the present disclosure provides a deployment system of single-application multi-MySQL Set, including:
the parameter processing module is used for sequentially taking out a MySQL container in the application MySQL Set as a current MySQL container according to the application MySQL Set construction request;
the cluster screening module is used for screening all K8s clusters corresponding to the application according to the strong rule strategy of the scheduling;
the cluster deployment module is used for scoring the screened K8s clusters according to the deployment rate of each K8s cluster to the application MySQL container, and taking the K8s cluster with the highest score as the K8s cluster to be scheduled of the current MySQL container;
and the judging module is used for judging whether the current MySQL container is the last container in the MySQL Set or not, finishing the deployment of the MySQL Set if the judging result is positive, and taking the next container in the MySQL Set as the current MySQL container if the judging result is negative, and continuously executing the steps after the screening.
A third aspect of the present disclosure provides a computer device, including a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein the processor, when executing the computer program, implements the steps of the deployment method of single-application multi MySQL Set according to any of the foregoing embodiments.
A fourth aspect herein provides a computer readable storage medium storing a computer program which, when executed by a processor, implements the steps of a method for deployment of a single-application multi MySQL Set.
According to the deployment method and system of the single-application multi-MySQL Set, the K8s cluster is automatically deployed by using a strong rule strategy and the deployment rate of the K8s cluster to the application MySQL container, the manual deployment of the MySQL container can be omitted, the operation and maintenance cost is saved, the MySQL container is built and supplied more quickly, the single-application MySQL Set can be dispersedly deployed in the multiple K8s clusters, the deployment rate balance of the application MySQL containers in the K8s cluster is guaranteed as much as possible, and high availability is improved.
In order to make the aforementioned and other objects, features and advantages of the present invention comprehensible, preferred embodiments accompanied with figures are described in detail below.
Drawings
In order to more clearly illustrate the embodiments or technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art that other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 shows a first flowchart of a deployment method of a single-application multi-MySQL Set according to an embodiment herein;
FIG. 2 shows a block diagram of MySQL Set according to an embodiment herein;
FIG. 3 shows a block diagram of an application MySQL Set deployment according to an embodiment herein;
FIG. 4 shows a second flowchart of a deployment method of a single-application multi-MySQL Set according to an embodiment herein;
FIG. 5 shows a first block diagram of a deployment system for a single application multi MySQL Set according to an embodiment herein;
FIG. 6 is a second block diagram of a deployment system that employs a single-application multi-MySQL Set according to an embodiment of the present disclosure;
FIG. 7 is a flowchart illustrating a deployment method of a single application multi MySQL Set according to an embodiment of the present disclosure;
FIG. 8 is a block diagram of a computer device according to an embodiment of the present disclosure.
Description of the symbols of the drawings:
510. a parameter processing module;
520. a cluster screening module;
530. a cluster deployment module;
540. a judgment module;
550. an information acquisition module;
802. a computer device;
804. a processor;
806. a memory;
808. a drive mechanism;
810. an input/output module;
812. an input device;
814. an output device;
816. a presentation device;
818. a graphical user interface;
820. a network interface;
822. a communication link;
824. a communication bus.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments herein without making any creative effort, shall fall within the scope of protection.
The present specification provides method steps as described in the examples or flowcharts, but may include more or fewer steps based on routine or non-inventive labor. The order of steps recited in the embodiments is merely one manner of performing the steps in a multitude of orders and does not represent the only order of execution. When an actual system or apparatus product executes, it can execute sequentially or in parallel according to the method shown in the embodiment or the figures.
In an embodiment of this document, a deployment method of a single-application multi-MySQL Set is provided, where the method may be run on a server and an intelligent terminal (including a smart phone, a tablet computer, a desktop computer, and the like), may also be a separate application program, an applet embedded in another program, and the like, or may also be in a web page form and the like, and a specific implementation manner is not limited herein. The method and the device for deploying the MySQL container are used for solving the problems that in the prior art, deployment of the MySQL container is often achieved manually, manual deployment modes are concentrated, equilibrium of the MySQL container deployment rate cannot be guaranteed, and manual operation and maintenance cost is high.
Specifically, as shown in fig. 1, the deployment method of single-application multi-MySQL Set includes:
step 110, sequentially taking out a MySQL container in the MySQL Set as a current MySQL container according to the MySQL Set building request;
step 120, screening all the K8s clusters corresponding to the application according to the strong rule strategy of the scheduling;
step 130, according to the deployment rate of each K8s cluster to the application MySQL container, scoring the screened K8s clusters, and taking the K8s cluster with the highest score as the K8s cluster to be scheduled of the current MySQL container;
and 140, judging whether the current MySQL container is the last container in the MySQL Set, if so, finishing the deployment of the MySQL Set, and if not, taking out the next container in the MySQL Set as the current MySQL container and continuing to perform the screening and the subsequent steps.
In the embodiment, the K8s cluster is automatically deployed by using a strong rule strategy and the deployment rate of the K8s cluster to the application MySQL container, so that an optimal K8s cluster can be scheduled for the MySQL container, manual deployment of the MySQL container is omitted, operation and maintenance costs are saved, the MySQL container can be built and supplied more quickly, single-application MySQL Set can be dispersedly deployed in a plurality of K8s clusters, the deployment rate balance of the application MySQL container in the K8s cluster is ensured as much as possible, and high availability is improved.
In detail, each MySQL Set comprises a plurality of MySQL containers, and is divided into a master container and a slave container according to functions, and provides services to the outside through a master-slave-multi-slave high-availability cluster mode, as shown in fig. 2, the master container is responsible for writing, and the slave containers are responsible for synchronizing data of the master container in real time, so that the slave containers can also serve the outside in a high-availability manner when the master container fails. The master-slave copy function provided by the MySQL database can conveniently realize the automatic backup of multiple places of data and realize the expansion of the database. The data backup can not only enhance the data security, but also further improve the load performance of the database by realizing read-write separation. In a database system with one master and multiple slaves, multiple slave servers adopt an asynchronous mode to update the change of a master database, and multiple nodes form a MySQL Set to provide stable data storage service for upper-level application programs.
An application MySQL container general deployment architecture is shown in fig. 3, one application has multiple MySQL sets, and MySQL containers under multiple sets are distributed on different Node nodes of different K8s clusters, for example, a master-slave container in MySQL Set1 is deployed in a K8s-1 cluster, a slave container in MySQL Set1 is deployed in a K8s-2 cluster, a slave container in MySQL Set2 is deployed, and a master-slave container in MySQL Set2 is deployed in a K8s-3 cluster. Deploying a slave-to-slave container in MySQL Setn. It should be noted here that fig. 3 is only an exemplary illustration, and in particular, the MySQL Set deployment is not limited thereto.
The MySQL Set building request can be initiated by operation and maintenance personnel according to requirements, can also be automatically initiated according to a plan, and the initiated time node is not limited in the text. The application MySQL Set building request comprises the following steps: the name of the Set, the number of MySQL containers corresponding to each Set, and the park where the MySQL main container is located. The number of the corresponding MySQL containers under each Set can be the same or different. The campus where the MySQL master container is located refers to a physical location where the MySQL master container should be located, and when the MySQL master container is specifically deployed, different MySQL containers of the same Set may not belong to different K8s clusters. Specifically, the MySQL Set construction request may be represented in a table form, as shown in the following table one.
Watch 1
Figure BDA0003001160400000061
When the step 110 is implemented, the order of taking out the MySQL containers may be determined according to the Set name in the MySQL Set construction request and the MySQL container name in the Set, and the MySQL containers may also be taken out according to a preset order, which is not limited herein.
The strong rule policy described herein is a policy that must be satisfied, and is used to screen a K8s cluster that does not satisfy the strong rule from an existing K8s cluster, specifically, the strong rule policy is, for example, physical isolation, and the isolation is performed through a bottom physical resource domain of a Node, so as to achieve the purposes of fault isolation and high availability. The K8s cluster is called Kubernetes, is an arrangement management tool of a portable container generated for container service, and consists of Master nodes and Node nodes. The Master node is a K8s cluster control node, and manages and controls the whole cluster. Node nodes are hosts of containers, each Node is distributed with some workloads by a Master Node, and when a Node is down, the workload (container) on the Node is automatically transferred to other Node nodes by the Master Node.
The specific implementation process of step 120 includes: and for the K8s cluster corresponding to each MySQL Set, judging whether the K8s cluster meets a strong rule strategy, if not, filtering the K8s cluster, and if so, keeping the K8s cluster.
In some embodiments, the strong rule policy instance includes: determining whether the cluster is available, e.g., insufficient cluster resources; the underlying fault isolation is used for ensuring that the corresponding MySQL containers under the application are not centrally deployed in some K8s clusters, for example, the application A corresponds to 3K 8s clusters, the K8s cluster 1, the K8s cluster 2 and the K8s cluster 3, the K8s cluster 1 is in Shanghai, the K8s cluster 2 is in Beijing, the K8s cluster 3 is in Guangzhou, and the application A has deployed a plurality of MySQL containers in the K8s cluster 1, so that the K8s cluster 1 can be filtered out. Ensure that containers under application a are as little concentrated as possible on individual K8s clusters. Through the screening of the K8s cluster by the strong rule strategy, the influence on the normal use of the application can be avoided when some K8s clusters have faults or the K8s cluster cannot be used due to the fact that nonresistant factors (earthquake, flood and the like) occur in the area where the K8s cluster is located.
The calculation process of the deployment rate of the K8s cluster to the MySQL container comprises the following steps:
(1) and acquiring the current deployment quantity of the MySQL container applied by each K8s cluster. For example, for a certain K8s cluster, 3 application MySQL containers have been deployed to the cluster, the current deployment amount of the MySQL containers for the applications by the K8s cluster is 3;
(2) and dividing the current deployment quantity of the MySQL container applied by each K8s cluster by the total MySQL container in the MySQL Set, namely, the current deployment quantity of the MySQL container applied by the cluster/the total MySQL container in the MySQL Set applied by the cluster, and taking the calculated value as the deployment rate of each K8s cluster to the MySQL container. For example, the total of 10 MySQL Set of one master (container) and three slaves (containers) for the a application is 10 × 4 to 40 MySQL containers, 5 MySQL containers in the a application have been deployed in the cluster 1, 20 MySQL containers in the a application have been deployed in the cluster 2, and 15 MySQL containers in the a application have been deployed in the cluster 3, so that the rate of deployment of MySQL containers in the a application by the cluster 1 is 5/40 to 12.5%, the rate of deployment of MySQL containers in the a application by the cluster 2 is 20/40 to 50%, and the rate of deployment of MySQL containers in the a application by the cluster 3 is 15/40 to 37.5%.
In specific implementation, the information such as the number of containers of the K8s cluster is queried according to a K8s API interface, specifically, the information includes the number of containers, applications to which the containers belong, and specifications of the containers, and the information may be collectively referred to as MySQL container details, after the information is acquired, the information is processed (an application name, an application Set name, the number of containers, and a campus where a main container is located in the information are extracted), and the current MySQL container deployment amount of the applications of each K8s cluster is calculated, where the MySQL container naming specification starts with an application name, and all containers starting with the application name belong to the current application.
And (3) scoring the screened K8s cluster according to the principle that the deployment rate of the application MySQL container by the K8s cluster is in inverse proportion to the score of the K8s cluster, namely scoring according to the principle that the higher the deployment rate of the application MySQL container by the K8s cluster is, the lower the score is.
In specific implementation, the number of all K8s clusters corresponding to the application can be used as the highest score, the K8s clusters are sorted according to the sequence from the small deployment rate of the K8s cluster to the application MySQL container to the large deployment rate, and the sorting is performed according to the sorting result, wherein the deployment rate of the K8s cluster to the application MySQL container is the smallest, the score corresponding to the K8s cluster is the highest, that is, the score of the first K8s cluster in the sorting result is the highest, the deployment rate of the K8s cluster to the application MySQL container is the largest, the score corresponding to the K8s cluster is the lowest, that is, the score of the last K8s cluster in the sorting result is the lowest. Scores differed by 1 between adjacently ranked K8s clusters.
In the above step 130, the K8s cluster with the highest score is used as the K8s cluster to be scheduled of the current MySQL container, for example, if the K8s cluster 1 score is 3 points, the K8s cluster 2 score is 2 points, and the K8s cluster 3 score is 1 point, the K8s cluster 1 is used as the K8s cluster to be scheduled of the current MySQL container.
In specific implementation, if there are at least two K8s clusters with the highest scores, one of the K8s clusters with the highest scores is randomly selected as the K8s cluster to be scheduled of the current MySQL container.
In this embodiment of the present invention, after completing the MySQL container deployment through the above steps 110 to 140, the MySQL container needs to be deployed to a work Node (i.e., a Node) in the K8s cluster to implement MySQL container processing, as shown in fig. 4, the deployment method of a single application multiple MySQL Set includes, in addition to the above steps 110 to 140, further:
step 150, generating a scheduling result according to the K8s cluster to be scheduled of each MySQL container;
and step 160, sending the scheduling result to the K8s cluster so that the K8s cluster schedules the MySQL container to a working node in the cluster.
Specifically, for the step 150, an association relationship between the MySQL container and the K8s cluster to be scheduled is established, as shown in table two, the association relationship may be used as a scheduling result:
watch two
MySQL container identification To-be-scheduled K8s cluster information
MySQL Set 1rq1 K8s Cluster 1
…… ……
The K8s cluster information to be scheduled can be obtained through a K8s API, where the K8s API is K8s, the system is a distributed system, and the system itself has various components, and communication among the components provides http services of rest interfaces to the outside, and these interfaces are collectively referred to as K8s APIs.
When the step 160 is implemented, the Master Node in the K8s cluster to be scheduled schedules the MySQL container to a specific Node. After scheduling is completed, the last scheduling result of the K8s cluster to the MySQL container is persisted to a database.
In a further embodiment, in order to facilitate a user to know the MySQL distribution, the deployment method for a single-application multi-MySQL Set further includes: receiving a deployment result sent by a K8s cluster, wherein the deployment result comprises a corresponding relation between a MySQL container and a Node or a Master Node in the K8s cluster; and displaying or sending the deployment result.
In practice, the user may also query the deployment results from the database.
Based on the same inventive concept, a single-application multi-MySQL Set deployment system is also provided herein, as described in the following embodiments. Because the principle of solving the problems of the deployment system with single application of the multiple MySQL Set is similar to the deployment method with single application of the multiple MySQL Set, the implementation of the deployment system with single application of the multiple MySQL Set can refer to the deployment method with single application of the multiple MySQL Set, and repeated details are omitted.
The deployment system of the single-application multi-MySQL Set provided by this embodiment includes a plurality of functional modules, which may be implemented by dedicated or general chips, and may also be implemented by software programs, which is not limited herein.
Specifically, as shown in fig. 5, the deployment system of single-application multi-MySQL Set includes:
the parameter processing module 510 is configured to sequentially take out a MySQL container in the application MySQL Set as a current MySQL container according to the application MySQL Set construction request;
the cluster screening module 520 is configured to screen all K8s clusters corresponding to the application according to the strong rule policy of the scheduling;
the cluster deployment module 530 is used for scoring the screened K8s clusters according to the deployment rate of each K8s cluster to the application MySQL container, and taking the K8s cluster with the highest score as the K8s cluster to be scheduled of the current MySQL container;
and the judging module 540 is configured to judge whether the current MySQL container is the last container in the MySQL Set, complete deployment of the MySQL Set if the judging result is yes, and take out the next container in the MySQL Set as the current MySQL container if the judging result is no, and continue to perform the steps after the screening until all MySQL containers in the MySQL Set are deployed.
According to the deployment system of the single-application multi-MySQL Set, the K8s cluster is automatically deployed by using a strong rule strategy and the deployment rate of the K8s cluster to the application MySQL container, the manual deployment of the MySQL container can be omitted, the operation and maintenance cost is saved, the MySQL container is built and supplied more quickly, the single-application MySQL Set can be dispersedly deployed in the multiple K8s clusters, the deployment rate balance of the application MySQL containers in the K8s cluster is guaranteed as much as possible, and high availability is improved.
In this embodiment, the parameter processing module 510 is further configured to receive an application MySQL Set construction request, and a result of allocating, by the cluster deployment module 530, a MySQL container in the application MySQL Set.
In an embodiment of this document, as shown in fig. 6, the deployment system of single-application multi MySQL Set further includes: the information acquisition module 550 is configured to query the number of MySQL containers to which the applications belong in the K8s cluster through the K8s API interface, so that the cluster screening module 520 screens the K8s cluster according to the number of MySQL containers to which the applications belong in the K8s cluster, and the cluster deployment module 530 calculates the deployment rate of the MySQL containers according to the number of MySQL containers to which the applications belong in the K8s cluster.
To more clearly illustrate the technical solution herein, a specific embodiment is described in detail below, and specifically, as shown in fig. 7, the deployment method of the single-application multi-MySQL Set includes:
step 701, a user initiates a construction request of an applied MySQL Set through a client of a deployment system of a single-application multi-MySQL Set.
The operation interface is provided with an input box for a user to input a construction request of an applied MySQL Set, and specifically, the construction request of the applied MySQL Set comprises a Set name, the number of MySQL containers corresponding to each Set and a park where the MySQL main container is located.
The server side of the deployment system with single application and multiple MySQL Set executes the following operations:
step 702, receiving the building request from step 701.
And step 703, taking out one container in the MySQL Set as the current container to be scheduled each time in a circulating manner.
Step 704, determining the filtering rules of the K8s cluster, including strong filtering rules (e.g. fault domain isolation, ensuring MySQL service high availability from the physical layer) and the deployment rate of the custom K8s cluster to the application MySQL container. In specific implementation, the filtering rule of the K8s cluster may be predetermined, and the user may further specify a scheduling policy through the client.
Step 705, acquiring the K8s cluster information deployed by applying the MySQL container through an interface (API) of the K8s, and transmitting the cluster information into the scheduling policy as an input parameter.
And step 706, according to the cluster deployment information of the MySQL container, screening the K8s cluster according to a strong rule strategy.
Step 707, according to the application MySQL container deployment cluster information, scoring the screened K8s cluster by using the deployment rate of the K8s cluster to the application MySQL container, and calculating the deployment rate of the K8s cluster to the application MySQL container according to the formula: and the cluster scores the current deployment quantity of the application MySQL containers/the total number of the MySQL containers in the application MySQL Set according to the calculated value.
Step 708, taking the K8s cluster with the highest score in step 707 as the cluster to be scheduled of the current MySQL container, for example, if the cluster 1 is scored 3, the cluster 2 is scored 2, and the cluster 3 is scored 1, then the cluster 1 is taken as the cluster to be scheduled.
And step 709, judging whether the current MySQL container is the last MySQL Set, if so, executing step 710, and considering that the construction of the MySQL Set is finished. If not, the next container in MySQL Set continues to be scheduled until all calls are completed.
And 710, after the cluster screening and the optimization, scheduling according to scheduling logic in the K8s cluster, scheduling the container to a specific working node, and persistently storing the final scheduling result of the K8s cluster in a database.
Step 711, the user queries the scheduling result through result feedback.
The following technical effects can be achieved:
(1) the operation and maintenance cost is saved, and the MySQL container is built and supplied more quickly;
(2) the scheduling strategy is customized for the scene of single application of multiple MySQL Set, the MySQL Set of single application is dispersedly deployed in multiple K8s clusters, the deployment rate balance of MySQL container of cluster application is guaranteed as much as possible, and high availability is improved.
In an embodiment herein, there is also provided a computer device, as shown in fig. 8, the computer device 802 may include one or more processors 804, such as one or more Central Processing Units (CPUs), each of which may implement one or more hardware threads. The computer device 802 may also include any memory 806 for storing any kind of information, such as code, settings, data, etc. For example, and without limitation, memory 806 may include any one or more of the following in combination: any type of RAM, any type of ROM, flash memory devices, hard disks, optical disks, etc. More generally, any memory may store information using any technique, and in particular, the memory 806 stores thereon a computer program that is executable by the processor 804 and that, when executed by the processor 804, implements any of the foregoing steps of the method for deploying multi-application MySQL Set. Further, any memory may provide volatile or non-volatile retention of information. Further, any memory may represent fixed or removable components of computer device 802. In one case, when the processor 804 executes the associated instructions, which are stored in any memory or combination of memories, the computer device 802 can perform any of the operations of the associated instructions. The computer device 802 also includes one or more drive mechanisms 808, such as a hard disk drive mechanism, an optical disk drive mechanism, etc., for interacting with any memory.
Computer device 802 may also include an input/output module 810(I/O) for receiving various inputs (via input device 812) and for providing various outputs (via output device 814)). One particular output mechanism may include a presentation device 816 and an associated graphical user interface 818 (GUI). In other embodiments, input/output module 810(I/O), input device 812, and output device 814 may also be excluded, as just one computer device in a network. Computer device 802 may also include one or more network interfaces 820 for exchanging data with other devices via one or more communication links 822. One or more communication buses 824 couple the above-described components together.
Communication link 822 may be implemented in any manner, such as over a local area network, a wide area network (e.g., the Internet), a point-to-point connection, etc., or any combination thereof. The communication link 822 may include any combination of hardwired links, wireless links, routers, gateway functions, name servers, etc., governed by any protocol or combination of protocols.
Corresponding to the methods in fig. 1 and 3, the embodiments herein also provide a computer-readable storage medium having a computer program stored thereon, where the computer program is executed by a processor to perform the steps of the above-mentioned method.
Embodiments herein also provide a computer readable instruction, wherein when the instruction is executed by a processor, the program causes the processor to execute the method shown in fig. 1 and fig. 3.
It should be understood that, in various embodiments herein, the sequence numbers of the above-mentioned processes do not mean the execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments herein.
It should also be understood that, in the embodiments herein, the term "and/or" is only one kind of association relation describing an associated object, meaning that three kinds of relations may exist. For example, a and/or B, may represent: a exists alone, A and B exist simultaneously, and B exists alone. In addition, the character "/" herein generally indicates that the former and latter related objects are in an "or" relationship.
Those of ordinary skill in the art will appreciate that the elements and algorithm steps of the examples described in connection with the embodiments disclosed herein may be embodied in electronic hardware, computer software, or combinations of both, and that the components and steps of the examples have been described in a functional general in the foregoing description for the purpose of illustrating clearly the interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present disclosure.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the several embodiments provided herein, it should be understood that the disclosed system, apparatus, and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units is only one logical division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may also be an electric, mechanical or other form of connection.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purposes of the embodiments herein.
In addition, functional units in the embodiments herein may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the present invention may be implemented in a form of a software product, which is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the methods described in the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
The principles and embodiments of this document are explained herein using specific examples, which are presented only to aid in understanding the methods and their core concepts; meanwhile, for the general technical personnel in the field, according to the idea of this document, there may be changes in the concrete implementation and the application scope, in summary, this description should not be understood as the limitation of this document.

Claims (10)

1. A deployment method of single-application multi-MySQL Set is characterized by comprising the following steps:
according to the application MySQL Set building request, sequentially taking out a MySQL container in the application MySQL Set as a current MySQL container;
screening all K8s clusters corresponding to the application according to a strong rule strategy of scheduling;
according to the deployment rate of each K8s cluster to the application MySQL container, scoring the screened K8s clusters, and taking the K8s cluster with the highest score as the K8s cluster to be scheduled of the current MySQL container;
and judging whether the current MySQL container is the last container in the MySQL Set, if so, finishing the deployment of the MySQL Set, and if not, taking out the next container in the MySQL Set as the current MySQL container and continuing to execute the steps after the screening.
2. The deployment method of single-application multi-MySQL Set according to claim 1, wherein the application MySQL Set construction request comprises: the name of the Set, the number of MySQL containers corresponding to each Set and the park where the MySQL main container is located.
3. The deployment method of single-application multi-MySQL Set according to claim 1, wherein the screening the K8s cluster of MySQL Set according to the strong rule policy of scheduling comprises:
and for the K8s cluster corresponding to each MySQL Set, judging whether the K8s cluster meets a strong rule strategy, if not, filtering the K8s cluster, and if so, keeping the K8s cluster.
4. The deployment method of the single-application multi-MySQL Set according to claim 1, wherein the deployment rate of each K8s cluster to the application MySQL container is calculated as follows:
acquiring the current deployment quantity of each K8s cluster to the application MySQL container;
and dividing the current deployment amount of each K8s cluster to the application MySQL container by the total MySQL container in the application MySQL Set to obtain the deployment rate of each K8s cluster to the application MySQL container.
5. The deployment method of a single-application multi-MySQL Set according to claim 1, wherein the step of scoring the screened K8s clusters according to the deployment rate of each K8s cluster to the application MySQL container comprises the following steps:
and (4) scoring the screened K8s clusters according to the principle that the deployment rate of the K8s clusters to the application MySQL container is inversely proportional to the score of the K8s clusters.
6. The deployment method of single-application multi-MySQL Set according to claim 1, wherein if there are at least two highest-scoring K8s clusters, one of the highest-scoring K8s clusters is randomly selected as the to-be-scheduled K8s cluster of the current MySQL container.
7. The method of deploying single-application multi-MySQL Set according to claim 1, further comprising:
generating a scheduling result according to the K8s cluster to be scheduled of each MySQL container;
and sending the scheduling result to the K8s cluster so that the K8s cluster schedules the MySQL container to a working node in the cluster.
8. A deployment system of single-application multi-MySQL Set is characterized by comprising:
the parameter processing module is used for sequentially taking out a MySQL container in the application MySQL Set as a current MySQL container according to the application MySQL Set construction request;
the cluster screening module is used for screening all K8s clusters corresponding to the application according to the strong rule strategy of the scheduling;
the cluster deployment module is used for scoring the screened K8s clusters according to the deployment rate of each K8s cluster to the application MySQL container, and taking the K8s cluster with the highest score as the K8s cluster to be scheduled of the current MySQL container;
and the judging module is used for judging whether the current MySQL container is the last container in the MySQL Set or not, finishing the deployment of the MySQL Set if the judging result is positive, and taking the next container in the MySQL Set as the current MySQL container if the judging result is negative, and continuously executing the steps after the screening.
9. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor when executing the computer program implements the steps of the method for deploying single-application multi MySQL Set according to any of claims 1 to 7.
10. A computer-readable storage medium, characterized in that it stores a computer program which, when executed by a processor, implements the steps of the method for deploying single-application multi-MySQL Set according to any of claims 1 to 7.
CN202110347184.9A 2021-03-31 2021-03-31 Deployment method and system for single-application multi-MySQL Set Active CN112835989B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110347184.9A CN112835989B (en) 2021-03-31 2021-03-31 Deployment method and system for single-application multi-MySQL Set

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110347184.9A CN112835989B (en) 2021-03-31 2021-03-31 Deployment method and system for single-application multi-MySQL Set

Publications (2)

Publication Number Publication Date
CN112835989A true CN112835989A (en) 2021-05-25
CN112835989B CN112835989B (en) 2024-02-09

Family

ID=75930711

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110347184.9A Active CN112835989B (en) 2021-03-31 2021-03-31 Deployment method and system for single-application multi-MySQL Set

Country Status (1)

Country Link
CN (1) CN112835989B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113590256A (en) * 2021-06-03 2021-11-02 新浪网技术(中国)有限公司 Application deployment method and device for multiple Kubernetes clusters

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110704165A (en) * 2019-10-08 2020-01-17 浪潮云信息技术有限公司 High-availability deployment method for container
CN111522639A (en) * 2020-04-16 2020-08-11 南京邮电大学 Multidimensional resource scheduling method under Kubernetes cluster architecture system
CN112395269A (en) * 2020-11-16 2021-02-23 中国工商银行股份有限公司 Method and device for building MySQL high-availability group

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110704165A (en) * 2019-10-08 2020-01-17 浪潮云信息技术有限公司 High-availability deployment method for container
CN111522639A (en) * 2020-04-16 2020-08-11 南京邮电大学 Multidimensional resource scheduling method under Kubernetes cluster architecture system
CN112395269A (en) * 2020-11-16 2021-02-23 中国工商银行股份有限公司 Method and device for building MySQL high-availability group

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113590256A (en) * 2021-06-03 2021-11-02 新浪网技术(中国)有限公司 Application deployment method and device for multiple Kubernetes clusters

Also Published As

Publication number Publication date
CN112835989B (en) 2024-02-09

Similar Documents

Publication Publication Date Title
CN111966500B (en) Resource scheduling method and device, electronic equipment and storage medium
CN111045795A (en) Resource scheduling method and device
CN106843745A (en) Capacity expansion method and device
CN109582433A (en) A kind of resource regulating method, device, cloud computing system and storage medium
CN110300130B (en) Resource scheduling method and device, electronic equipment and storage medium
CN111309440B (en) Method and equipment for managing and scheduling multiple types of GPUs
WO2023198061A1 (en) Container scheduling method, electronic device, and storage medium
CN114416352A (en) Computing resource allocation method and device, electronic equipment and storage medium
DE112021005586T5 (en) AUTOMATICALLY SCALING A QUERY CONTROL ROUTINE FOR ENTERPRISE-SCALE BIG DATA WORKLOADS
CN110944067B (en) Load balancing method and server
CN115391023A (en) Computing resource optimization method and device for multitask container cluster
CN112835989A (en) Single-application multi-MySQL Set deployment method and system
CN111767145A (en) Container scheduling system, method, device and equipment
CN111352726B (en) Stream data processing method and device based on containerized micro-service
CN109271235A (en) A kind of data-base cluster method for building up and device
CN107645396B (en) Cluster capacity expansion method and device
US20160246648A1 (en) Information technology resource planning
CN111400046A (en) Database resource management method and device, resource management equipment and storage medium
CN112395269B (en) MySQL high availability group building method and device
CN106126123B (en) A kind of method, apparatus and system of the distribution of host volume
US20150189013A1 (en) Adaptive and prioritized replication scheduling in storage clusters
CN115202810A (en) Kubernetes working node distribution method and system
CN112612579A (en) Virtual machine deployment method, storage medium, and computer device
CN115878303A (en) Resource scheduling method and device and electronic equipment
CN113515524A (en) Automatic dynamic allocation method and device for distributed cache access layer nodes

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant