CN113312145A - Container scheduling method and device, electronic equipment and medium - Google Patents

Container scheduling method and device, electronic equipment and medium Download PDF

Info

Publication number
CN113312145A
CN113312145A CN202110593960.3A CN202110593960A CN113312145A CN 113312145 A CN113312145 A CN 113312145A CN 202110593960 A CN202110593960 A CN 202110593960A CN 113312145 A CN113312145 A CN 113312145A
Authority
CN
China
Prior art keywords
mysql
cluster
orchester
instance
operator
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.)
Pending
Application number
CN202110593960.3A
Other languages
Chinese (zh)
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.)
CCB Finetech Co Ltd
Original Assignee
CCB Finetech Co Ltd
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 CCB Finetech Co Ltd filed Critical CCB Finetech Co Ltd
Priority to CN202110593960.3A priority Critical patent/CN113312145A/en
Publication of CN113312145A publication Critical patent/CN113312145A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • 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/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

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The embodiment of the application discloses a container scheduling method, a container scheduling device, electronic equipment and a medium, and relates to the technical field of cloud computing. The method is realized based on a Kubernetes platform and comprises the following steps: developing a MySQL-Operator controller according to set service logic by using a CoreOS KuberneteseOperator Framework; deploying an Orchester cluster in a Kubernetes Global cluster; and establishing communication connection between the Orchester cluster and the MySQL-Operator controller, so that the Orchester cluster acquires the construction data of the MySQL instance cluster through the MySQL-Operator controller and performs high-availability management on the MySQL instance cluster. The scheme solves the problem that the Kubernets platform does not realize MySQL cluster enterprise-level supporting capability, thereby realizing clustering, stateful and data persistence on the Kubernets platform and providing multi-cluster capability in a large-scale deployment scene.

Description

Container scheduling method and device, electronic equipment and medium
Technical Field
The embodiment of the application relates to the technical field of cloud computing, in particular to a container scheduling method and device, electronic equipment and a medium.
Background
Kubernets, K8S for short, is an open source for managing containerized applications on multiple hosts in a cloud platform, and aims to make deploying containerized applications simple and efficient, and provides a mechanism for application deployment, planning, updating, and maintenance. Orchester is a MySQL high availability and replication management tool written using the Go language. And the adjustment of a copy topological structure, automatic failover, manual master-slave switching and the like are supported.
Orchestrator currently provides only simple containerization capability, but does not provide enterprise-level support capability (clustering, stateful, data persistence capability) of the K8S platform, much less multi-clustering capability in large-scale deployment scenarios.
Disclosure of Invention
Embodiments of the present application provide a container scheduling method, an apparatus, an electronic device, and a medium, so as to implement clustering, stateful data persistence on a kubernets platform, and provide a multi-cluster capability in a large-scale deployment scenario.
In one embodiment, an embodiment of the present application provides a container scheduling method, including:
creating a MySQL-Operator controller by using a CoreOS Kubernets Operator Framework;
deploying an Orchester cluster in a Kubernetes Global cluster;
and the MySQL establishes communication connection between the Orchester cluster and the MySQL-Operator controller, so that the Orchester cluster acquires the construction data of the MySQL instance cluster through the MySQL-Operator controller and manages the MySQL instance cluster.
In another embodiment, an embodiment of the present application further provides a container scheduling apparatus, including:
the controller creating module is used for creating a MySQL-Operator controller by using a CoreOS Kubernets Operator Framework;
the deployment module is used for deploying the Orchester cluster in a Kubernets Global cluster;
and the connection module is used for the MySQL to establish communication connection between the Orchester cluster and the MySQL-Operator controller so that the Orchester cluster can acquire the construction data of the MySQL instance cluster through the MySQL-Operator controller to manage the MySQL instance cluster.
In another embodiment, an embodiment of the present application further provides an electronic device, including: one or more processors;
a memory for storing one or more programs;
when the one or more programs are executed by the one or more processors, the one or more processors implement the container scheduling method according to any one of the embodiments of the present application.
In yet another embodiment, the present application further provides a computer-readable storage medium, on which a computer program is stored, which when executed by a processor implements the container scheduling method according to any one of the embodiments of the present application.
In the embodiment of the application, a MySQL-Operator controller is created by using a CoreOS Kubernets Operator Framework; deploying an Orchester cluster in a Kubernetes Global cluster; and the MySQL establishes communication connection between the Orchester cluster and the MySQL-Operator controller, so that the Orchester cluster acquires the construction data of the MySQL instance cluster through the MySQL-Operator controller and manages the MySQL instance cluster. The scheme solves the problem that the Kubernets platform is difficult to realize enterprise-level supporting capability, thereby realizing clustering, stateful and data persistence on the Kubernets platform and providing multi-clustering capability in a large-scale deployment scene.
Drawings
Fig. 1 is a flowchart of a container scheduling method according to an embodiment of the present application;
fig. 2 is a schematic diagram of a cluster connection structure according to an embodiment of the present application;
fig. 3 is a flowchart of a container scheduling method according to another embodiment of the present application;
FIG. 4 is a schematic view of a MySQL Pod inner container distribution provided by another embodiment of the present application;
FIG. 5 is a schematic diagram of a high-availability implementation structure of a MySQL cluster and an Orchester cluster according to another embodiment of the present application;
fig. 6 is a schematic structural diagram of a cluster repair implementation provided in another embodiment of the present application;
fig. 7 is a schematic structural diagram of a container scheduling apparatus according to an embodiment of the present application;
fig. 8 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
The present application will be described in further detail with reference to the following drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the application and are not limiting of the application. It should be further noted that, for the convenience of description, only some of the structures related to the present application are shown in the drawings, not all of the structures.
Fig. 1 is a flowchart of a container scheduling method according to an embodiment of the present application. The container scheduling method provided by the embodiment of the application can be suitable for the condition of scheduling the MySQL container. Typically, the embodiment of the application is suitable for the condition of scheduling the MySQL container based on a kubernets platform. The method may be specifically performed by a container scheduling apparatus, which may be implemented by software and/or hardware, and may be integrated in an electronic device capable of implementing the container scheduling method. Referring to fig. 1, the method of the embodiment of the present application specifically includes:
and S110, creating a MySQL-Operator controller by using a CoreOS Kubernets Operator Framework.
Among other things, the Operator was developed by CoreOS to extend the kubernets API-specific application controller that was used to create, configure and manage complex stateful applications such as databases, caches and monitoring systems. The Operator is built on top of kubernets' resource and controller concept, but at the same time contains application specific domain knowledge. The key to creating the Operator is the design of the CRD (custom resource). The kubernets version 1.7 has introduced the concept of custom controllers that allow developers to add new functionality, update existing functionality, and automatically perform management tasks, just like kubernets native components, operators have developed directly using kubernets API, that is they can monitor clusters, change Pods/Services, and scale running applications according to custom rules written inside the controllers. Operator Framework is also a toolkit for rapid Operator development that is open source to CoreOS, and the Framework contains two main parts: operator SDK: without knowing the complex Kubernets API characteristics, you can build an Operator application according to your own professional knowledge. Operator Lifecycle Manager OLM: help install, update, and manage all operators in operation across the cluster.
In the embodiment of the application, a core OS Kubernets Operator Framework is used to create MySQL-Operator. The Operator has the main functions of: and (4) creating a MySQL instance cluster. Performing high-availability management on multiple sets of MySQL instance clusters through an Orchester cluster, wherein the high-availability management comprises the following steps: master-slave copy relationship management, master-slave fault automatic switching, fault master node isolation, cluster state restoration and the like.
In this embodiment of the present application, after creating the MySQL-Operator controller by using the CoreOS kubernets Operator Framework, the method further includes: and controlling the life cycle of the MySQL instance cluster through a MySQL-Operator controller.
S120, deploying the Orchester cluster in the Kubernetes Global cluster.
Among them, Orchestrator is a MySQL high availability and copy management tool written using Go language. And the adjustment of a copy topological structure, automatic failover, manual master-slave switching and the like are supported. The method supports the use of a MySQL or SQLite back-end database for storing metadata, provides a Web interface for displaying the topological relation and the state of MySQL replication, can change the replication relation and partial configuration information of a MySQL instance through Web, and simultaneously provides a command line and an api interface, thereby facilitating operation and maintenance management.
In the embodiment of the application, the Orchester cluster is deployed in the Kubernets Global cluster, so that the MySQL instance cluster in the Kubernets platform is managed based on the Orchester cluster, state scanning, fault detection, fault switching and the like are realized, and clustering, state and data persistence capabilities are realized.
S130, the MySQL establishes communication connection between the Orchester cluster and the MySQL-Operator controller, so that the Orchester cluster acquires the construction data of the MySQL instance cluster through the MySQL-Operator controller and manages the MySQL instance cluster.
As shown in fig. 2, the orchetrator cluster in the kubernets Global cluster is connected to the MySQL-Operator controller created in the kubernets platform, and after the MySQL-Operator controller creates the MySQL instance cluster, the related creation parameters of the MySQL instance cluster are transferred to the orchetrator cluster, so that the orchetrator cluster can know the currently created MySQL instance cluster, and further manage the MySQL instance cluster. Communication connection can be established between the Orchester cluster and the MySQL instance cluster for management and control.
In the embodiment of the application, a MySQL-Operator controller is created by using a CoreOS Kubernets Operator Framework; deploying an Orchester cluster in a Kubernetes Global cluster; and the MySQL establishes communication connection between the Orchester cluster and the MySQL-Operator controller, so that the Orchester cluster acquires the construction data of the MySQL instance cluster through the MySQL-Operator controller and manages the MySQL instance cluster. The scheme solves the problem that the Kubernets platform is difficult to realize enterprise-level supporting capability, thereby realizing clustering, stateful and data persistence on the Kubernets platform and providing multi-clustering capability in a large-scale deployment scene.
Fig. 3 is a flowchart of a container scheduling method according to another embodiment of the present application. For further optimization of the embodiments, details which are not described in detail in the embodiments of the present application are described in the embodiments. Referring to fig. 3, a container scheduling method provided in an embodiment of the present application may include:
s210, defining custom resources of the MySQL instance cluster, and defining custom resources of the Orchester cluster.
Illustratively, before the MySQL instance cluster is created in a self-defining manner, the self-defining resources of the MySQL instance cluster need to be defined, so that the MySQL instance cluster can be created in a self-defining manner in the following process, and similarly, before the Orchester cluster is created in the self-defining manner, the self-defining resources of the Orchester cluster need to be defined, so that the Orchester cluster can be created in the following process in a self-defining manner. Namely MySQL Cluster CRD and Orchester CRD are defined.
S220, defining MySQL cluster structure and MySQL cluster fields, MySQL instance structure and MySQL instance fields, and Orchester cluster structure and Orchester cluster fields.
Illustratively, to enable custom creation of the MySQL instance cluster and the Orchester cluster, the MySQL cluster structure and MySQL cluster fields, the MySQL instance structure and MySQL instance fields, and the Orchester cluster structure and Orchester cluster fields also need to be defined.
S230, creating a custom resource CRD in the Kubernets cluster according to the Orchester cluster structure and the Orchester cluster field, and deploying the Orchester cluster in the Kubernets Global cluster.
Illustratively, the orcstrator cluster can be custom deployed in a kubernets Global cluster on a kubernets platform, so as to facilitate management of MySQL containers on the kubernets platform through the orcstrator cluster.
And S240, creating a MySQL instance cluster according to the custom resource of the MySQL instance cluster, the MySQL cluster structural body and the MySQL cluster field, and the MySQL instance structural body and the MySQL instance field through the MySQL-Operator controller.
Illustratively, the MySQL instance cluster can be created in a customized manner through the MySQL-Operator controller, and the created MySQL instance cluster information is transferred to the Orchester cluster, so that the Orchester cluster can know about the currently created MySQL instance cluster and manage the currently created MySQL instance cluster.
In this embodiment of the present application, a MySQL instance cluster is created according to a custom resource of a MySQL instance cluster, a MySQL cluster structure and a MySQL cluster field, a MySQL instance structure and a MySQL instance field through a MySQL-Operator controller, including: for one MySQL container set, three MySQL units are established, including one master MySQL unit and two slave MySQL units.
Illustratively, in the MySQL cluster Pod, three MySQL units are created, including one master MySQL unit and two slave MySQL units, so as to implement master-slave cooperative work.
S250, the MySQL establishes communication connection between the Orchester cluster and the MySQL-Operator controller, so that the Orchester cluster acquires the construction data of the MySQL instance cluster through the MySQL-Operator controller and manages the MySQL instance cluster.
According to the technical scheme in the embodiment of the application, custom creation of the MySQL instance cluster and the Orchester cluster is achieved by defining custom resources of the MySQL instance cluster and defining custom resources, a structure body and field information of the Orchester cluster, the Orchester cluster is deployed in the Kubernetes Global cluster according to the Orchester cluster structure body and the Orchester cluster field, and the MySQL instance cluster is created through the MySQL-Operator controller according to the custom resources, the MySQL cluster structure body, the MySQL cluster field, the MySQL instance structure body and the MySQL instance field of the MySQL instance cluster, so that management and control of the MySQL instance cluster through the Orchester cluster are achieved.
In an embodiment of the present application, the method further includes: in the MySQL unit, for other containers except the MySQL container, based on a SideCar mode, an HAProxy container is established to realize high availability of MySQL Cluster to external services. And executing service discovery, service isolation and service configuration based on the Consul Agent and the Consul Server. Based on the Consul Agent and the Consul Server, executing service discovery, service isolation and service configuration, comprising: acquiring service data through a Consul Agent; and performing service registration and management by the Consul Server according to the service data. The method further comprises the following steps: and monitoring health state data of the MySQL and HAProxy containers based on the MySQL Exporter and the HAProxy Exporter. The method further comprises the following steps: in each MySQL unit, communication connection is established through MySQL own master-slave protocol; and carrying out data synchronization in each MySQL unit.
Illustratively, the SideCar mode is adopted in the MySQL cluster Pod except for the MySQL instance container. The high availability of MySQL Cluster external services is realized through 3 HAProxy containers. And providing services for the client outside the cluster through VPC IP provided by the SDN switch. The Consul Agent and the Consul Server provide service registration service. MySQL Exporter, HAProxy Exporter provide health data collection services. The Orchestrator cluster provides consistency and integrity of data of the Orchestrator cluster through the RAFT protocol. The Consul Server realizes the registration and management of the service by acquiring the data collected by the Consul Agent.
The application further provides a specific application implementation process of the container scheduling method. The method comprises the following specific steps:
1) MySQL Cluster CRD and Orchester CRD are defined.
2) Defining MySQL Cluster, i.e. MySQL Cluster structure and field information, MySQL Instance, i.e. MySQL Instance structure and field information, and Orchester Cluster, i.e. Orchester Cluster structure and field information. MySQL cluster field information is shown in Table 1, MySQL instance field information is shown in Table 2, and Orchester cluster field information is shown in Table 3.
TABLE 1
Figure BDA0003090507740000091
Figure BDA0003090507740000101
TABLE 2
Name of field Description of the invention Type (B)
Region Region(s) String
AvailableZone Usable area String
Role Character String
Status Example states String
Namespace Name space String
PodName Pod name String
ContainerID Container ID String
UnitID Unit ID String
ReadOnly Whether or not to read only Bool
ReplicationStatus Copy state String
TABLE 3
Figure BDA0003090507740000102
3) MySQL-Operator is created using the CoreOS Kubernets Operator Framework. The MySQL-Operator has the main functions as follows:
a) and (4) creating a MySQL instance cluster.
b) Performing high-availability management on multiple sets of MySQL instance clusters through an Orchester cluster, wherein the high-availability management comprises the following steps:
master-slave copy relationship management, master-slave fault automatic switching, fault master node isolation, cluster state restoration and the like.
4) And deploying the Orchester cluster in a K8S Global cluster, and establishing connection with MySQL Operator in a plurality of K8S AZs. A high availability nanotube implementing a multi-AZ, cross-cluster MySQL instance cluster is shown in fig. 2.
5) The inside of the MySQL cluster Pod adopts a SideCar mode except the MySQL instance container. As shown in fig. 4, the high availability of MySQL Cluster to external services is realized by 3 HAProxy containers. And providing services for the client outside the cluster through VPC IP provided by the SDN switch. The Consul Agent and the Consul Server provide service registration service. MySQL Exporter, HAProxy Exporter provide health data collection services.
6) The Orchestrator cluster provides consistency and integrity of data of the Orchestrator cluster via RAFT protocol as shown in figure 5. The Consul Server realizes the registration and management of the service by acquiring the data collected by the Consul Agent. As shown in fig. 6, container monitoring and cluster status repair are realized through the management of the orchelator cluster on the MySQL instance.
The specific implementation method provided by the embodiment of the application has the corresponding beneficial effects of the container scheduling method in the embodiment.
Fig. 7 is a schematic structural diagram of a container scheduling apparatus according to an embodiment of the present application. The device can be applied to the condition of scheduling the MySQL container. Typically, the embodiment of the application is suitable for the condition of scheduling the MySQL container based on a kubernets platform. The apparatus may be implemented by software and/or hardware, and the apparatus may be integrated in an electronic device. Referring to fig. 7, the apparatus specifically includes:
a controller creating module 410, configured to create a MySQL-Operator controller using a CoreOS kubernets Operator Framework;
a deployment module 420, configured to deploy the orchelator cluster in a kubernets Global cluster;
the connection module 430 is configured to establish a communication connection between the Orchestrator cluster and the MySQL-Operator controller through MySQL, so that the Orchestrator cluster obtains the construction data of the MySQL instance cluster through the MySQL-Operator controller, and manages the MySQL instance cluster.
In an embodiment of the present application, the apparatus further includes:
and the first definition module is used for defining the self-defined resources of the MySQL instance cluster and defining the self-defined resources of the Orchester cluster.
In an embodiment of the present application, the apparatus further includes:
and the second definition module is used for defining a MySQL cluster structure body and MySQL cluster fields, a MySQL instance structure body and MySQL instance fields, and an Orchester cluster structure body and Orchester cluster fields.
In this embodiment of the application, the deployment module 420 is specifically configured to:
and creating a custom resource CRD in the Kubernets cluster according to the Orchester cluster structure and the Orchester cluster field, and deploying the Orchester cluster in the Kubernets Global cluster.
In an embodiment of the present application, the apparatus further includes:
and the instance cluster creating module is used for creating the MySQL instance cluster according to the custom resource of the MySQL instance cluster, the MySQL cluster structural body and the MySQL cluster field, and the MySQL instance structural body and the MySQL instance field through the MySQL-Operator controller.
In an embodiment of the present application, the apparatus further includes:
and the control module is used for controlling the life cycle of the MySQL instance cluster through a MySQL-Operator controller.
In an embodiment of the present application, the instance cluster creating module is specifically configured to:
for one MySQL container set, three MySQL units are established, including one master MySQL unit and two slave MySQL units.
In an embodiment of the present application, the apparatus further includes:
and the scheduling implementation module is used for establishing the HAProxy container for other containers except the MySQL container in the MySQL unit based on the SideCar mode.
In an embodiment of the present application, the apparatus further includes:
and the discovery service execution module is used for executing service discovery, service isolation and service configuration based on the Consul Agent and the Consul Server.
In an embodiment of the present application, the discovery service execution module is specifically configured to:
acquiring service data through a Consul Agent;
and performing service registration and management by the Consul Server according to the service data.
In an embodiment of the present application, the apparatus further includes:
and the health state data monitoring module is used for monitoring the health state data of the MySQL and HAProxy containers based on the MySQL Exporter and the HAProxy Exporter.
In an embodiment of the present application, the apparatus further includes:
the communication module is used for establishing communication connection in each MySQL unit through the MySQL own master-slave protocol;
and the synchronization module is used for synchronizing data in each MySQL unit.
The container scheduling device provided by the embodiment of the application can execute the container scheduling method provided by any embodiment of the application, and has corresponding functional modules and beneficial effects of the execution method.
Fig. 8 is a schematic structural diagram of an electronic device according to an embodiment of the present application. FIG. 8 illustrates a block diagram of an exemplary electronic device 412 suitable for use in implementing embodiments of the present application. The electronic device 412 shown in fig. 8 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present application.
As shown in fig. 8, the electronic device 412 may include: one or more processors 416; the memory 428 is configured to store one or more programs, and when the one or more programs are executed by the one or more processors 416, the one or more processors 416 are enabled to implement the container scheduling method provided in the embodiment of the present application, including:
creating a MySQL-Operator controller by using a CoreOS Kubernets Operator Framework;
deploying an Orchester cluster in a Kubernetes Global cluster;
and the MySQL establishes communication connection between the Orchester cluster and the MySQL-Operator controller, so that the Orchester cluster acquires the construction data of the MySQL instance cluster through the MySQL-Operator controller and manages the MySQL instance cluster.
The components of the electronic device 412 may include, but are not limited to: one or more processors or processors 416, a memory 428, and a bus 418 that couples the various device components including the memory 428 and the processors 416.
Bus 418 represents one or more of any of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, and a processor or local bus using any of a variety of bus architectures. By way of example, such architectures include, but are not limited to, Industry Standard Architecture (ISA) bus, micro-channel architecture (MAC) bus, transaction ISA bus, Video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnect (PCI) bus.
Electronic device 412 typically includes a variety of computer device-readable storage media. These storage media may be any available storage media that can be accessed by electronic device 412 and includes both volatile and nonvolatile storage media, removable and non-removable storage media.
Memory 428 can include computer-device readable storage media in the form of volatile memory, such as Random Access Memory (RAM)430 and/or cache memory 432. The electronic device 412 may further include other removable/non-removable, volatile/nonvolatile computer device storage media. By way of example only, storage system 434 may be used to read from and write to non-removable, nonvolatile magnetic storage media (not shown in FIG. 8, and commonly referred to as a "hard drive"). Although not shown in FIG. 8, a magnetic disk drive for reading from and writing to a removable, nonvolatile magnetic disk (e.g., a "floppy disk") and an optical disk drive for reading from or writing to a removable, nonvolatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical storage medium) may be provided. In these cases, each drive may be connected to bus 418 by one or more data storage media interfaces. Memory 428 may include at least one program product having a set (e.g., at least one) of program modules that are configured to carry out the functions of embodiments of the application.
A program/utility 440 having a set (at least one) of program modules 442 may be stored, for instance, in memory 428, such program modules 442 including, but not limited to, an operating device, one or more application programs, other program modules, and program data, each of which examples or some combination thereof may comprise an implementation of a network environment. The program modules 442 generally perform the functions and/or methods of the embodiments described herein.
The electronic device 412 may also communicate with one or more external devices 414 (e.g., keyboard, pointing device, display 424, etc.), with one or more devices that enable a user to interact with the electronic device 412, and/or with any devices (e.g., network card, modem, etc.) that enable the electronic device 412 to communicate with one or more other computing devices. Such communication may occur via input/output (I/O) interfaces 422. Also, the electronic device 412 may communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network, such as the internet) through the network adapter 420. As shown in FIG. 8, network adapter 420 communicates with the other modules of electronic device 412 over bus 418. It should be appreciated that although not shown in FIG. 8, other hardware and/or software modules may be used in conjunction with the electronic device 412, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID devices, tape drives, and data backup storage devices, among others.
The processor 416 executes various functional applications and data processing by executing at least one of other programs of the plurality of programs stored in the memory 428, for example, to implement a container scheduling method provided by the embodiments of the present application.
One embodiment of the present application provides a storage medium containing computer-executable instructions that when executed by a computer processor perform a method of container scheduling, comprising:
creating a MySQL-Operator controller by using a CoreOS Kubernets Operator Framework;
deploying an Orchester cluster in a Kubernetes Global cluster;
and the MySQL establishes communication connection between the Orchester cluster and the MySQL-Operator controller, so that the Orchester cluster acquires the construction data of the MySQL instance cluster through the MySQL-Operator controller and manages the MySQL instance cluster.
The computer storage media of the embodiments of the present application may take any combination of one or more computer-readable storage media. The computer readable storage medium may be a computer readable signal storage medium or a computer readable storage medium. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor device, apparatus, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In embodiments of the present application, a computer readable storage medium may be any tangible storage medium that can contain, or store a program for use by or in connection with an instruction execution apparatus, device, or apparatus.
A computer readable signal storage medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal storage medium may also be any computer readable storage medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution apparatus, device, or apparatus.
Program code embodied on a computer readable storage medium may be transmitted using any appropriate storage medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations for aspects of the present application may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + +, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or device. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present application and the technical principles employed. It will be understood by those skilled in the art that the present application is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the application. Therefore, although the present application has been described in more detail with reference to the above embodiments, the present application is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present application, and the scope of the present application is determined by the scope of the appended claims.

Claims (15)

1. A container scheduling method is realized based on a Kubernetes platform, and comprises the following steps:
creating a MySQL-Operator controller by using a CoreOS Kubernets Operator Framework;
deploying an Orchester cluster in a Kubernetes Global cluster;
and establishing communication connection between the Orchester cluster and the MySQL-Operator controller, so that the Orchester cluster acquires the construction data of the MySQL instance cluster through the MySQL-Operator controller and manages the MySQL instance cluster.
2. The method of claim 1, wherein prior to creating the MySQL-Operator controller using a CoreOS kubernets Operator Framework, the method further comprises:
defining custom resources of the MySQL instance cluster and defining custom resources of the Orchester cluster.
3. The method of claim 2, wherein after defining custom resources for a MySQL instance cluster and defining custom resources for an orastrator cluster, the method further comprises:
MySQL cluster structure and MySQL cluster fields, MySQL instance structure and MySQL instance fields, and Orchester cluster structure and Orchester cluster fields are defined.
4. The method of claim 3, wherein deploying the Orchester cluster in a Kubernets Global cluster comprises:
and creating a custom resource CRD in the Kubernets cluster according to the Orchester cluster structure and the Orchester cluster field, and deploying the Orchester cluster in the Kubernets Global cluster.
5. The method of claim 3, wherein after creating the MySQL-Operator controller using a CoreOS kubernets Operator Framework, the method further comprises:
and creating the MySQL instance cluster according to the custom resource of the MySQL instance cluster, the MySQL cluster structural body and the MySQL cluster field, and the MySQL instance structural body and the MySQL instance field through the MySQL-Operator controller.
6. The method of claim 5, wherein after creating the MySQL-Operator controller using a CoreOS kubernets Operator Framework, the method further comprises:
and controlling the life cycle of the MySQL instance cluster through a MySQL-Operator controller.
7. The method of claim 5, wherein creating, by a MySQL-Operator controller, a MySQL instance cluster from the custom resources of the MySQL instance cluster, the MySQL cluster structure and MySQL cluster fields, the MySQL instance structure and the MySQL instance fields comprises:
for one MySQL container set, three MySQL units are established, including one master MySQL unit and two slave MySQL units.
8. The method of claim 7, further comprising:
in the MySQL unit, for other containers except the MySQL container, based on the SideCar mode, the HAProxy container is established.
9. The method of claim 7, further comprising:
and executing service discovery, service isolation and service configuration based on the Consul Agent and the Consul Server.
10. The method of claim 9, wherein performing service discovery, service isolation and service configuration based on the Consul agent and the Consul Server comprises:
acquiring service data through a Consul Agent;
and performing service registration and management by the Consul Server according to the service data.
11. The method of claim 7, further comprising:
and monitoring health state data of the MySQL and HAProxy containers based on the MySQL Exporter and the HAProxy Exporter.
12. The method of claim 1, further comprising:
in each MySQL unit, communication connection is established through MySQL own master-slave protocol;
and carrying out data synchronization in each MySQL unit.
13. A container scheduling apparatus, the apparatus comprising:
the controller creating module is used for creating a MySQL-Operator controller by using a CoreOS Kubernets Operator Framework;
the deployment module is used for deploying the Orchester cluster in a Kubernets Global cluster;
and the connection module is used for the MySQL to establish communication connection between the Orchester cluster and the MySQL-Operator controller so that the Orchester cluster can acquire the construction data of the MySQL instance cluster through the MySQL-Operator controller to manage the MySQL instance cluster.
14. An electronic device, characterized in that the electronic device comprises:
one or more processors;
a memory for storing one or more programs;
when executed by the one or more processors, cause the one or more processors to implement the container scheduling method of any one of claims 1-12.
15. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the method for container scheduling according to any one of claims 1 to 12.
CN202110593960.3A 2021-05-28 2021-05-28 Container scheduling method and device, electronic equipment and medium Pending CN113312145A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110593960.3A CN113312145A (en) 2021-05-28 2021-05-28 Container scheduling method and device, electronic equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110593960.3A CN113312145A (en) 2021-05-28 2021-05-28 Container scheduling method and device, electronic equipment and medium

Publications (1)

Publication Number Publication Date
CN113312145A true CN113312145A (en) 2021-08-27

Family

ID=77376405

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110593960.3A Pending CN113312145A (en) 2021-05-28 2021-05-28 Container scheduling method and device, electronic equipment and medium

Country Status (1)

Country Link
CN (1) CN113312145A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114253628A (en) * 2021-12-22 2022-03-29 金蝶软件(中国)有限公司 Automatic deployment device and automatic deployment method for middleware
CN114374692A (en) * 2021-12-02 2022-04-19 浪潮云信息技术股份公司 Method and system for realizing multi-container cluster management
CN115794769A (en) * 2022-10-09 2023-03-14 云和恩墨(北京)信息技术有限公司 Method for managing high-availability database, electronic device and storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112199356A (en) * 2020-12-09 2021-01-08 北京顺达同行科技有限公司 Fault processing method, device, server and storage medium
CN112559132A (en) * 2020-12-18 2021-03-26 建信金融科技有限责任公司 Safe static detection method and device for containerized deployment application

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112199356A (en) * 2020-12-09 2021-01-08 北京顺达同行科技有限公司 Fault processing method, device, server and storage medium
CN112559132A (en) * 2020-12-18 2021-03-26 建信金融科技有限责任公司 Safe static detection method and device for containerized deployment application

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
FLAVIUS MECEA: "Deploying Mysql on Kubernetes with a Percona-based Operator", Retrieved from the Internet <URL:https://percona.community/blog/2018/10/11/deploying-mysql-on-kubernetes-with-a-percona-based-operator/> *
ZHANGZHIFEI: "mysql-operator容器化部署mysql8", Retrieved from the Internet <URL:https://www.jianshu.com/p/b83b7040d3fa?ivk_sa=1024320u> *

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114374692A (en) * 2021-12-02 2022-04-19 浪潮云信息技术股份公司 Method and system for realizing multi-container cluster management
CN114253628A (en) * 2021-12-22 2022-03-29 金蝶软件(中国)有限公司 Automatic deployment device and automatic deployment method for middleware
CN115794769A (en) * 2022-10-09 2023-03-14 云和恩墨(北京)信息技术有限公司 Method for managing high-availability database, electronic device and storage medium
CN115794769B (en) * 2022-10-09 2024-03-19 云和恩墨(北京)信息技术有限公司 Method for managing high-availability database, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
CN113312145A (en) Container scheduling method and device, electronic equipment and medium
EP3709227B1 (en) System and method for interoperable communication of an automation system component with multiple information sources
CN108270726B (en) Application instance deployment method and device
US11169787B2 (en) Software acceleration platform for supporting decomposed, on-demand network services
US10726042B2 (en) Replication control using eventually consistent meta-data
CN109871384B (en) Method, system, equipment and storage medium for container migration based on PaaS platform
WO2018192478A1 (en) Cloud management platform, virtual machine management method, system thereof
CN109245908B (en) Method and device for switching master cluster and slave cluster
CN109901985B (en) Distributed test apparatus and method, storage medium, and electronic device
JP2016508638A (en) Method and system using recursive event listeners in nodes of hierarchical data structures
CN111343219B (en) Computing service cloud platform
CN111274002A (en) Construction method and device for supporting PAAS platform, computer equipment and storage medium
CN114138754A (en) Software deployment method and device based on Kubernetes platform
CN112860343B (en) Configuration changing method, system, device, electronic equipment and storage medium
CN108628686A (en) System and method for design and modeling product in cloud environment
US11222072B1 (en) Graph database management system and method for a distributed computing environment
CN115543543A (en) Application service processing method, device, equipment and medium
US11630812B2 (en) Schema based type-coercion for structured documents
EP4209900A1 (en) Method and apparatus for updating cloud platform
CN115277398A (en) Cluster network configuration method and device
CN109445966A (en) Event-handling method, device, medium and calculating equipment
CN112860374A (en) Method, device, server and storage medium for rapidly deploying Ceph
CN112468349B (en) Main node suitable for FT2000+ platform to deploy Ceph
TWI808713B (en) Method and system for deploying operating environments
CN112783610A (en) Saltstack-based Ceph deployment host node

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