CN112306640A - Container dispensing method, apparatus, device and medium therefor - Google Patents

Container dispensing method, apparatus, device and medium therefor Download PDF

Info

Publication number
CN112306640A
CN112306640A CN202011259159.7A CN202011259159A CN112306640A CN 112306640 A CN112306640 A CN 112306640A CN 202011259159 A CN202011259159 A CN 202011259159A CN 112306640 A CN112306640 A CN 112306640A
Authority
CN
China
Prior art keywords
container
idle
access channel
resource scheduling
containers
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
CN202011259159.7A
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.)
Guangzhou Cubesili Information Technology Co Ltd
Original Assignee
Guangzhou Cubesili Information Technology 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 Guangzhou Cubesili Information Technology Co Ltd filed Critical Guangzhou Cubesili Information Technology Co Ltd
Priority to CN202011259159.7A priority Critical patent/CN112306640A/en
Publication of CN112306640A publication Critical patent/CN112306640A/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/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/45562Creating, deleting, cloning virtual machine instances
    • 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/45591Monitoring or debugging support
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/50Indexing scheme relating to G06F9/50
    • G06F2209/508Monitor

Abstract

The application discloses a container distribution method, a device, equipment and a medium thereof, wherein the method comprises the following steps: monitoring the idle allowance of a class of container corresponding to at least one database type in the resource scheduling library, and triggering a bin filling event for complementing the idle allowance of the class of container to reach a rated quantity when the idle allowance meets a preset condition; the driving container cluster master control node creates the containers and obtains access channel certificates corresponding to the new containers, wherein the access channel certificates are used for reaching access to the corresponding containers; storing the access channel certificate into a resource scheduling library to add a corresponding new container; and responding to a creation request of a corresponding container of a specific type of database, determining a corresponding idle target container from the resource scheduling library, and distributing an access channel certificate of the idle target container to a requester. The method and the device can automatically deploy the container to realize millisecond-level application and release capacity of the container resources, and greatly improve the container allocation efficiency.

Description

Container dispensing method, apparatus, device and medium therefor
Technical Field
The application belongs to the technical field of internet, and particularly relates to a container distribution method, and a corresponding device, electronic equipment and a nonvolatile storage medium thereof.
Background
The Internet influences the aspects of global human life, is one of the most important industries in China, and is a main component of GDP in China. During the development process, internet program developers need to apply and configure resources and services correspondingly. Such as download of installation packages, application of machine whitelists, editing of configuration files, etc. The traditional method for configuring the service resources by the machine through the local virtual machine has the characteristics of long time consumption, low efficiency, excessive physical resource occupation of the virtual machine and slow starting, and different development workers are inconsistent in resource configuration environment and difficult to share.
In recent years, various remote resource deployment cloud platforms are emerging, containers of different types of operating system virtualization and different types of databases are deployed in the platforms, so that developers can meet development requirements of various projects in a development process by applying for the containers from the platforms, and the problems of deployment and sharing of local virtual machines are solved. However, various remote deployment cloud platforms still have the following disadvantages:
firstly, most remote resource deployment cloud platforms do not have the function of automatically deploying containers, technical personnel are required to perform deployment in advance, after the containers deployed by the platforms are fully occupied, corresponding containers cannot be provided for developers, the development requirements of the developers are met, the development efficiency of the developers is greatly influenced, and the computing resources of each device in the platforms cannot be scientifically and reasonably utilized.
Secondly, most remote resource deployment cloud platforms do not have a corresponding storage and management mechanism for scheduling containers, so that when a developer applies for a container to the platform, the platform cannot quickly feed back and release the applied container to the developer, and the time for the developer to wait for the platform to feed back is long.
Due to the defects of most remote resource deployment cloud platforms, the platform cannot provide services for developers to apply and release containers more quickly, so that the development time of the developers is shortened, and the development efficiency of the developers is improved.
In order to solve the problems faced by the developers due to the shortage of the remote resource deployment cloud platform, some effective solutions are urgently needed to be provided.
Disclosure of Invention
In view of the shortcomings of the prior art, the present application aims to provide a container dispensing method and a corresponding container dispensing device, an electronic device, and a non-volatile storage medium.
In order to meet the purpose of the application, the following technical scheme is adopted in the application:
a method of dispensing containers adapted for one of the purposes of the present application is provided, comprising the steps of:
monitoring the idle allowance of a class of container corresponding to at least one database type in the resource scheduling library, and triggering a bin filling event for complementing the idle allowance of the class of container to reach a rated quantity when the idle allowance meets a preset condition;
responding to the bin filling event, driving a container cluster main control node to create the containers to acquire access channel certificates corresponding to the new containers, wherein the access channel certificates are used for triggering and accessing the corresponding containers;
storing the access channel certificate into the resource scheduling library to add a corresponding new container, and recovering the idle allowance of the container to the rated amount;
in response to a creation request of a container corresponding to a specific type of database, determining an idle target container of the corresponding type from the resource scheduling library, and distributing an access channel credential of the idle target container to a requester of the creation request.
In a further embodiment, the method further comprises the following pre-step:
and initializing and creating a resource scheduling library, driving a container cluster main control node to control the container cluster main control node to create a rated number of new containers for each preset type of database, and storing access channel certificates of the new containers into the resource scheduling library.
In a preferred embodiment, the method further comprises the following subsequent steps:
and responding to a deletion request aiming at the specified container, driving the container cluster main control node to delete the specified container so as to release the memory space of the specified container, and then deleting the corresponding container from the resource scheduling library.
In a further embodiment, the method further comprises the following subsequent steps:
and in response to the pause request/resume request aiming at the specified container, the driving container cluster master node pauses/resumes the operation of the specified container so as to prohibit/allow the call to the specified container.
In a further embodiment, the method further comprises the following parallel steps:
monitoring a container of which the latest timestamp meets a preset condition in a resource scheduling library, and sending corresponding alarm information to a preset remote interface, wherein the latest timestamp is used for recording the time information of the container when the last control operation is executed.
In a preferred embodiment, when the container cluster master node is driven to create a new container, a port pre-allocated and designated for the new container is submitted to the container cluster master node, so that the access channel credential corresponding to the new container includes the network address of the container cluster working node where the new container is located and the port pre-allocated and designated.
In a further embodiment, the method controls the container cluster main control node by calling an interface provided by a kubernets platform, the container cluster main control node is deployed by a Docker system, and the database is any one or more of the following preset types: mysql, redis, etcd, mongodb.
A container dispensing apparatus adapted for one of the purposes of the present application is provided, comprising:
the system comprises a margin monitoring module, a margin monitoring module and a bin filling module, wherein the margin monitoring module is used for monitoring the idle margin of a class of container corresponding to at least one database type in a resource scheduling library, and when the idle margin meets a preset condition, triggering a bin filling event for complementing the idle margin of the class of container to enable the idle margin to reach a rated number;
the margin reseeding module is used for responding to the reseeding event and driving the container cluster main control node to create the container so as to obtain access channel certificates corresponding to the new containers, and the access channel certificates are used for reaching the access to the corresponding containers;
the voucher adding module is used for storing the access channel voucher into the resource scheduling library to add a corresponding new container of the access channel voucher so as to restore the idle allowance of the container to the rated amount;
and the certificate distribution module is used for responding to a creation request of a container corresponding to a specific type of database, determining an idle target container of a corresponding type from the resource scheduling library, and distributing an access channel certificate of the idle target container to a requester of the creation request.
An electronic device adapted for one of the purposes of the present application includes a central processing unit and a memory, the central processing unit being configured to invoke execution of a computer program stored in the memory to perform the container allocation method.
A non-volatile storage medium adapted for one of the purposes of the present application is provided, which stores in the form of computer-readable instructions a computer program for implementing the method for dispensing containers according to the invention, which computer program, when invoked by a computer, performs the steps comprised by the method.
Compared with the prior art, the method has the following advantages:
first, the present application implements the function of automatically deploying containers: the method includes the steps that idle allowance of containers of various types of databases in a resource scheduling library is monitored in real time, when the idle allowance of one type of container corresponding to one type of database meets a preset condition, a bin filling event is triggered, a main control node of a container cluster is driven to create containers for the type of database, and therefore the number of the containers of the database is recovered to a preset rated number.
Secondly, the application constructs a container management mechanism: obtaining access channel certificates of all containers from the container cluster, storing the access channel certificates of all types of containers into a resource scheduling library, so that when the developer sends a container for creating a request application corresponding to the database to the resource scheduling library, the server resource scheduling library inquires the access channel certificate of the container to which the creation request points, and sends the access channel certificate as feedback to the developer, by the principle, the access channel certificates of all the containers in the container cluster are recorded in advance, when a developer applies for a container from a server for development, the corresponding container does not need to be dispatched from the container cluster, the method can directly inquire the containers of the corresponding database types in the resource scheduling library and quickly send the access channel certificates to developers, thereby reducing the time for the developers to wait for the server to feed back the containers and improving the development efficiency of the developers.
In addition, the application provides millisecond-level container application and release for users in actual measurement by combining the automatic container deployment function and the container management mechanism: the method comprises the steps of creating an idle container in advance and storing an access channel certificate of the idle container in a resource scheduling library, so that the situation that the corresponding container is insufficient and cannot be scheduled when a developer applies for the corresponding container to the resource scheduling library can be prevented, and the access channel certificate of the corresponding container can be quickly used as feedback by inquiring the resource scheduling library, therefore, millisecond-level container application and release can be provided for a user, and the working efficiency of the developer is effectively improved.
Drawings
The foregoing and/or additional aspects and advantages of the present application will become apparent and readily appreciated from the following description of the embodiments, taken in conjunction with the accompanying drawings of which:
fig. 1 is a schematic diagram of a typical network deployment architecture related to implementing the technical solution of the present application;
FIG. 2 is a schematic diagram of a deployment architecture of a container cluster providing containers in conjunction with the container allocation method of the present application;
FIG. 3 is a schematic diagram illustrating a logical structure of a worker node in the container cluster shown in FIG. 2 maintaining containers of multiple database types according to the present application;
FIG. 4 is a schematic flow chart diagram of an exemplary embodiment of a container dispensing method of the present application;
fig. 5 is a functional block diagram of an exemplary embodiment of a container dispensing apparatus of the present application.
Detailed Description
Reference will now be made in detail to embodiments of the present application, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to the same or similar elements or elements having the same or similar function throughout. The embodiments described below with reference to the drawings are exemplary only for the purpose of explaining the present application and are not to be construed as limiting the present application.
As used herein, the singular forms "a", "an", "the" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will be further understood that the terms "comprises" and/or "comprising," when used in this specification, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof. It will be understood that when an element is referred to as being "connected" or "coupled" to another element, it can be directly connected or coupled to the other element or intervening elements may also be present. Further, "connected" or "coupled" as used herein may include wirelessly connected or wirelessly coupled. As used herein, the term "and/or" includes all or any element and all combinations of one or more of the associated listed items.
It will be understood by those within the art that, unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. It will be further understood that terms, such as those defined in commonly used dictionaries, should be interpreted as having a meaning that is consistent with their meaning in the context of the prior art and will not be interpreted in an idealized or overly formal sense unless expressly so defined herein.
As will be appreciated by those skilled in the art, "client," "terminal," and "terminal device" as used herein include both devices that are wireless signal receivers, which are devices having only wireless signal receivers without transmit capability, and devices that are receive and transmit hardware, which have receive and transmit hardware capable of two-way communication over a two-way communication link. Such a device may include: cellular or other communication devices such as personal computers, tablets, etc. having single or multi-line displays or cellular or other communication devices without multi-line displays; PCS (Personal Communications Service), which may combine voice, data processing, facsimile and/or data communication capabilities; a PDA (Personal Digital Assistant), which may include a radio frequency receiver, a pager, internet/intranet access, a web browser, a notepad, a calendar and/or a GPS (Global Positioning System) receiver; a conventional laptop and/or palmtop computer or other device having and/or including a radio frequency receiver. As used herein, a "client," "terminal device" can be portable, transportable, installed in a vehicle (aeronautical, maritime, and/or land-based), or situated and/or configured to operate locally and/or in a distributed fashion at any other location(s) on earth and/or in space. The "client", "terminal Device" used herein may also be a communication terminal, a web terminal, a music/video playing terminal, such as a PDA, an MID (Mobile Internet Device) and/or a Mobile phone with music/video playing function, and may also be a smart tv, a set-top box, and the like.
The hardware referred to by the names "server", "client", "service node", etc. is essentially an electronic device with the performance of a personal computer, and is a hardware device having necessary components disclosed by the von neumann principle such as a central processing unit (including an arithmetic unit and a controller), a memory, an input device, an output device, etc., a computer program is stored in the memory, and the central processing unit calls a program stored in an external memory into the internal memory to run, executes instructions in the program, and interacts with the input and output devices, thereby completing a specific function.
It should be noted that the concept of "server" as referred to in this application can be extended to the case of a server cluster. According to the network deployment principle understood by those skilled in the art, the servers should be logically divided, and in physical space, the servers may be independent from each other but can be called through an interface, or may be integrated into one physical computer or a set of computer clusters. Those skilled in the art will appreciate this variation and should not be so limited as to restrict the implementation of the network deployment of the present application.
Referring to fig. 1, the hardware basis required for implementing the related art embodiments of the present application may be deployed according to the architecture shown in the figure. The server 80 is deployed at the cloud end, and serves as a business server, and is responsible for further connecting a related data server and other servers providing related support, so as to form a logically related server cluster to provide services for related terminal devices, such as a smart phone 81 and a personal computer 82 shown in the figure. Both the smart phone and the personal computer can access the internet through a known network access mode, and establish a data communication link with the cloud server 80 so as to run a terminal application program related to the service provided by the server.
The application program of the application program has various expression forms, and is essentially used for realizing various computer functions, so that the functions can be expressed by calling a third-party browser to access a webpage and executing a program module implanted in the webpage, or developed into various APPs suitable for being installed in terminal equipment, relevant function logics of the browser are embedded in the APPs, and the functions can be expressed by calling a remote webpage and executing various codes when the APPs run. Thus, in a sense, a browser is not a distinct concept from an application, and for an online service developed based on a web page, the application may have a built-in browser for accessing the web page, and the web page accessed through a separate browser may also implement the equivalent functions of the application. In the front of the technological surge of developing terminal applications based on page technology, those skilled in the art should understand this.
The web page and the application related to the present application are usually distributed to the server 80, and the terminal device may initiate access to the web page by calling the web page through a browser or by calling the web page by running the application with the equivalent function. The access to the web page is regarded as an access request to the target web page by the browser (or an application program, the same applies below), so that a request is sent to the server 80 to obtain the corresponding target web page, the server 80 pushes the HTML code of the target web page after responding to the request, the browser analyzes and executes the HTML code, and finally the content of the target web page is displayed in the graphical user interface of the terminal device 81, 82 where the browser is located.
Referring to fig. 2, the container cluster referred to in the present application is deployed through a kubernets container management system, which is often referred to as K8s for short, and the management of the docker container cluster through the K8s container management system is well known to those skilled in the art. The k8s container management system provides services of container deployment, planning and maintenance for the docker container cluster, can realize functions of balancing, automatic monitoring and restarting and the like, and has strong robustness. The k8s container management system constructed by the application adopts double master control nodes for management, for example, master1(90) master control node and master2(91) master control node in fig. 2, and a keepalive keep-alive detection mechanism is arranged between the two master control nodes, so that a docker container cluster composed of working nodes such as node1-1(92) and the like managed by the docker container cluster is ensured to have high availability, and the disaster tolerance capability of the container cluster is improved.
Referring to fig. 2 and fig. 3, a docker container cluster constructed in the present application is a container cluster composed of nodes 1-1(92) and other similar working nodes in fig. 2, where each working node has a plurality of pods deployed thereon, and the number of the deployed pods depends on the number of database types, each pod is used to manage a plurality of containers corresponding to one database type, 4 pods are deployed in the working node shown in fig. 3, pod1(100) deploys a container of mysql database, pod2(101) deploys a container of redis database, pod3(102) containers of mongodb database, and pod4(103) deploys a container of etcd database. Working nodes of the same database type are divided into master nodes and slave nodes, and the master nodes and the slave nodes can perform data synchronization regularly, for example, between node1-1(92) and node1-2(93) in fig. 3, when node1-1(92) goes down, node1-2(93) replaces node1-1(92) to be switched to the master working node for providing service to the outside, and after node1-2(93) switches the master working node, k8s creates the working node of the database type on healthy equipment to become a new slave working node, so as to ensure the number of the working nodes of the database type in the container cluster. It is emphasized that, as to the types of databases involved in the container cluster, depending on the container deployment requirements, only one type of database container may be involved, and any of a plurality of known database types may also be involved, without being limited by the database types listed above.
The person skilled in the art will know this: although the various methods of the present application are described based on the same concept so as to be common to each other, they may be independently performed unless otherwise specified. In the same way, for each embodiment disclosed in the present application, it is proposed based on the same inventive concept, and therefore, concepts of the same expression and concepts of which expressions are different but are appropriately changed only for convenience should be equally understood.
With the above disclosure of the relevant application and development environments associated with the embodiments of the present application in mind, reference is made to the following description for further understanding of various embodiments of the present application:
referring to fig. 2, fig. 3 and fig. 4, a container allocation method according to the present application is executed by an application program in a server hosting a resource scheduling library, and in an exemplary embodiment, the method includes the following steps:
step S11, monitoring the idle allowance of a class of container corresponding to at least one database type in the resource scheduling library, and when the idle allowance satisfies a preset condition, triggering a reselling event for complementing the idle allowance of the class of container to reach a rated quantity:
in one embodiment, before this step is started, the resource scheduling library needs to be initially created, so that the service server can implement a related method through the resource scheduling library, so that a developer can apply for a container to meet development requirements.
The business server triggers an initialization event, controls a certain main control node in the container cluster to create containers with rated quantity for each preset type of database by driving the main control node, and stores access channel certificates of all the containers in the resource scheduling library so as to send the corresponding access channel certificates to a requester applying for the containers.
The resource scheduling library is a database for storing access channel credentials, use states and container identity information of all containers in the container cluster, and is located in the service server, so that the service server provides millisecond feedback service for users and sends the access channel credentials of the corresponding containers to the user side.
The use state is used for representing the current use condition of the container and can be divided into an occupied state, an unoccupied state, a pause state and the like, so that the service server can judge whether the current container can be used for scheduling or not and determine the idle margin of each database type container.
The container identity information is suitable for the service server to distinguish all the containers stored in the resource scheduling library. Of course, the access channel credential can be theoretically regarded as a kind of container identity information, and thus, special container identity information can be set as needed.
The access channel credential generally includes a port designated for communication for a certain container, a network address of a corresponding working node in the container cluster, and corresponding verification information, and the specific generation process is as follows:
when a business server drives a certain main control node of a container cluster to create a corresponding new container, the business server submits a port which is pre-allocated and appointed for the new container to the main control node, so that the main control node generates an access channel certificate of the new container according to the port, the verification information of the container and the network address of the container cluster working node where the new container is located, and sends the access channel certificate to the business server, so that the business server stores the access channel certificate in a resource scheduling library.
The authentication information, which typically includes the user name and password of the database supported by the container, is provided according to the database type, for example, the redis and etcd databases do not necessarily require the authentication information, while mysql and mongodb do. These validation information may be custom provided by the requestor when requesting the container allocation, but is generally intended to be generated by the business server for submission to the container cluster for use.
In order to ensure that the idle allowance of the containers of the various types of databases in the resource scheduling library is enough to meet the container scheduling requirement of developers, the server monitors the current idle allowance of the containers storing the various types of databases in the resource scheduling library in real time, and if the idle allowance of the containers of a certain type of database is monitored to meet a preset condition, a bin filling event is triggered, and a certain main control node in a container cluster is driven to create the containers of the type of databases so as to fill the containers of the type of databases and enable the idle allowance to reach a rated quantity.
For example, the service server monitors the use states of containers of various types in the resource scheduling library, when the use state of a container of a certain database type is in an unoccupied state, the container is determined as an idle container by the service server, and the total amount of the idle containers corresponding to the certain database type is the idle margin of the container of the type.
The preset condition generally can be that a lowest idle number is preset as a trigger condition, and when a service server monitors that the idle allowance of a container of a certain database type is less than or equal to the lowest idle number, a bin filling event is triggered; those skilled in the art can flexibly design the preset condition as long as the service server triggering reselling event is satisfied, so that the idle margin of a container of a certain database type is compensated to the rated quantity.
Step S12, in response to the reselling event, the container cluster master node is driven to create the container type to obtain access channel credentials corresponding to the new containers, where the access channel credentials are used to reach access to the corresponding containers:
as described above, when the service server monitors that the idle allowance of a container of a certain database type meets the preset condition, a reselling event of the database type is triggered and responded, a certain main control node of the container cluster is driven to create the container of the database type, and access channel credentials of all new containers are acquired and stored in the resource scheduling library.
Referring to fig. 2, the service server drives a certain master node in the container cluster to create a container of a database type pointed by a reseeding event, for example, when the master node is master1, master1 queries whether there is a free computing resource in its master working node, such as node1-1, node2-1, etc., to create the container of the database type, and if there is a free computing resource in node1-1, it creates the container, otherwise, it is created by other working nodes, and finally completes creation of a new container.
Referring to fig. 2 and 3, when node1-1 working node is designated by master1, node1-1 working node will create a new container in the pod of the database type that is needed for the reselling event. When a node1-1 working node creates a new container, the access channel credential of the new container is created, so that the service server can obtain the access channel credential, store the access channel credential in the resource scheduling library, and supplement the idle margin of the container.
In one embodiment, if the reselling event contains a specified number of new containers, when the number of new containers created by the node1-1 working schedule reaches the specified number, so that the new containers obtained by the service server are added to the resource scheduling library and reach the rated number, that is, the reselling event is completed, the node1-1 working node will stop creating new containers.
In another embodiment, the service server triggers a reselling event for each new container that it needs, in which case, each reselling event drives the master node to create a new container, and after the new container is created, its access channel credential is returned to the service server, thereby completing the response to the reselling event. If the service server needs to supplement N new containers, N reselling events need to be triggered to drive the master node to implement N responses, so that N new containers are created.
The reselling event sent by the service server usually includes a port designated by the service server for a new container to be created, and if necessary, provides corresponding verification information, when the master node creates the new container, the master node may obtain a network address of a working node where the new container is located, configure the port provided by the service server as a communication port of the new container, and set the verification information for the new container using a database, and finally, form the access channel information with the network address where the working node is located, the port and the verification information (if any), and feed the access channel information back to the service server so as to complete a response to the reselling event. It will be appreciated that the user may access the new container through the network address and port in the access channel credential, and provide the authentication information if necessary to use the database functionality therein.
Step S13, the access channel credential is stored into the resource scheduling library to add a new container corresponding to the access channel credential, so that the idle allowance of the container is restored to the rated amount:
referring to fig. 3, each time a working node creates a new container in the pod of the corresponding type of database and creates an access channel credential of the new container, the service server acquires the access channel credential and stores the access channel credential in the resource scheduling repository, so as to complement the idle number of the containers of the database type to the rated number.
In an initial state, the use state of the new container in the resource scheduling base is set to be an unoccupied state, so that the service server judges the new container as an idle container of the database type.
Referring to fig. 2, the service server continuously monitors the idle number of containers of each database type in the resource database, and when the idle number of containers of multiple database types meets a preset condition, corresponding reservior events are triggered simultaneously, and the idle number of containers of multiple database types replenished by a container cluster reaches a rated number.
Step S14, in response to the request for creating a container corresponding to a specific type of database, determining an idle target container of a corresponding type from the resource scheduling library, and allocating an access channel credential to the requester of the request for creating:
when a user needs a container of a certain database type for program development or test of the user, a background management page provided by the method triggers a corresponding touch event, so that a creation request for creating the container of a specific database type is sent to a service server, the server responds to the creation request, inquires an idle container matched with the database type from a resource scheduling library according to the database type indicated by the creation request, and allocates an access channel certificate of the idle container to the user.
After the service server sends the access channel certificate of a certain container stored in the resource scheduling library to the user terminal, the use state of the container stored in the resource scheduling library is marked as an occupied state, so that the correct statistics of the idle allowance of the container is ensured.
The user side obtains the network address, the port, the user name and the password of the container which is referred by the access channel certificate by analyzing the access channel certificate sent by the service server; the user can access the working node in the container cluster pointed by the network address by referring to the specific information, a communication link reaching the working node is established through the port, and the corresponding database is accessed by the user name and the password. Currently, as mentioned above, the user name and password are dependent on the specific database type, and are not required.
It can be understood that after the user obtains the access channel credential of the container of a certain database type, the user can directly access the corresponding container in the container cluster by using the access channel credential without passing through the service server, and use the database function provided by the container.
The above exemplary embodiments and variations thereof fully disclose the embodiments of the container dispensing method of the present application, but many variations of the method can be deduced by transforming and augmenting some technical means, and other embodiments are briefly described as follows:
in one embodiment, after a user triggers an event for deleting a certain container on a background management page, a deletion request for deleting the container is sent to a service server, the service server responds to the deletion request, sends a corresponding deletion instruction to a master control node of a container cluster, drives the master control node of the container cluster to delete the container specified by the deletion request, and then notifies the service server. After the service server confirms that the corresponding container in the container cluster is deleted, the corresponding data record of the container in the resource scheduling library can be deleted, so that the data in the resource scheduling pool can be updated in time.
In another embodiment, after a user triggers an event for suspending a certain container on a background management page, a suspension request for suspending access to the container is sent to a service server, the service server responds to the suspension request, sends a corresponding suspension instruction to a master node of a container cluster, drives the master node of the container cluster to suspend the container specified by the suspension request, prohibits the user from accessing the container, and then notifies the service server. After the service server confirms that the container is suspended by the container cluster, the service server can mark the use state of the container in the resource scheduling library as a suspended state.
In another embodiment, after the user triggers an event for restoring a certain container on the background management page, a restoring request for restoring the container is sent to the service server, so that the service server responds to the restoring request, sends a corresponding restoring request to the master node of the container cluster, drives the master node of the container cluster to restore the container specified by the restoring request, allows the user to access the container to continue, and then notifies the service server. After the service server confirms that the container is recovered to be used by the container cluster, the service server can mark the use state of the container in the resource scheduling base as a recovery state.
Each call made by the user to the container for which the user applies can be recorded by the service server. When a user accesses a container applied by the user, the service server records the latest use time stamp of the container through the resource scheduling library so as to send corresponding alarm information to the remote interface when the latest use time stamp of the container of each database type in the resource scheduling library meets a preset condition by monitoring the latest use time stamp of the container.
The service server can know the latest use timestamp generated by the use of a container by a user in various ways, one can automatically send a message to inform the service server when the user accesses the container, the other can send a query instruction to a main control node of the container cluster or a working node where the container is located by the service server and receive a feedback message of the main control node or the working node, and the real-time knowledge can be further obtained through a monitoring synchronization mechanism between the service server and the container cluster. Therefore, those skilled in the art can implement the method flexibly, and detailed description is omitted.
The preset condition that the latest timestamp of the container meets is the preset longest timestamp, when the absolute value of the difference value between the latest timestamp of the container and the current timestamp of the container is larger than or equal to the longest timestamp, the service server can inform a background manager to recover the container, and the manager can decide whether to send an instruction to the service server to indicate the service server to delete or initialize the container according to the condition, so that the resource waste caused by the fact that the occupied container is not used for a long time can be prevented, and the container resources are efficiently utilized.
Further, a container dispensing apparatus of the present application may be constructed by functionalizing various embodiments of the container dispensing method described above, according to which please refer to fig. 5, which in an exemplary embodiment comprises:
the surplus monitoring module 11 is configured to monitor an idle surplus of a type of container corresponding to at least one type of database in the resource scheduling library, and when the idle surplus meets a preset condition, trigger a bin filling event for complementing the idle surplus of the type of container to make the idle surplus of the type of container reach a rated number;
a margin reseeding module 12, configured to respond to the reseeding event, drive a container cluster master control node to create the container, so as to obtain access channel credentials corresponding to the new containers, where the access channel credentials are used for reaching access to the corresponding containers;
a voucher adding module 13, configured to store the access channel voucher in the resource scheduling library to add a new container corresponding to the access channel voucher, so that the idle allowance of the type of container is restored to a rated amount;
and the credential distribution module 14 is configured to, in response to a request for creating a container corresponding to a specific type of database, determine an idle target container of the corresponding type from the resource scheduling library, and distribute an access channel credential of the idle target container to a requester of the request for creating.
To facilitate the execution of the present application, an electronic device is provided, comprising a central processing unit and a memory, the central processing unit being configured to invoke the execution of a computer program stored in the memory to perform the steps of a container allocation method as described above.
It can be seen that the memory is suitable for a non-volatile storage medium, and by implementing the foregoing method as a computer program and installing the computer program into an electronic device such as a mobile phone, the related program code and data are stored in the non-volatile storage medium of the electronic device, and further by operating the program by a central processing unit of the electronic device, the program is called from the non-volatile storage medium into a memory for operation, so as to achieve the desired purpose of the present application. It will thus be appreciated that in an embodiment of the present application, there may also be provided a non-volatile storage medium storing, in the form of computer readable instructions, a computer program for implementing the various embodiments of the container dispensing method described herein, which when invoked by a computer performs the steps included in the method.
In summary, the method of the present application implements an automatic container deployment function and constructs a novel container management mechanism, so as to optimize the process of the user applying and releasing the container resources, so that the speed of the user acquiring the new container is increased to millisecond level, and the container allocation efficiency is effectively improved.
Those skilled in the art will appreciate that the present application relates to an apparatus for performing one or more of the operations, methods described in the present application. These devices may be specially designed and manufactured for the required purposes, or they may comprise known devices in general-purpose computers. These devices have computer programs stored in their memories that are selectively activated or reconfigured. Such a computer program may be stored in a device (e.g., computer) readable medium, including, but not limited to, any type of disk including floppy disks, hard disks, optical disks, CD-ROMs, and magnetic-optical disks, ROMs (Read-Only memories), RAMs (Random Access memories), EPROMs (Erasable Programmable Read-Only memories), EEPROMs (Electrically Erasable Programmable Read-Only memories), flash memories, magnetic cards, or optical cards, or any type of media suitable for storing electronic instructions, and each coupled to a bus. That is, a readable medium includes any medium that stores or transmits information in a form readable by a device (e.g., a computer).
It will be understood by those within the art that each block of the block diagrams and/or flowchart illustrations, and combinations of blocks in the block diagrams and/or flowchart illustrations, can be implemented by computer program instructions. Those skilled in the art will appreciate that the computer program instructions may be implemented by a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, implement the aspects specified in the block or blocks of the block diagrams and/or flowchart illustrations disclosed herein.
Those of skill in the art will appreciate that the various operations, methods, steps in the processes, acts, or solutions discussed in this application can be interchanged, modified, combined, or eliminated. Further, other steps, measures, or schemes in various operations, methods, or flows that have been discussed in this application can be alternated, altered, rearranged, broken down, combined, or deleted. Further, steps, measures, schemes in the prior art having various operations, methods, procedures disclosed in the present application may also be alternated, modified, rearranged, decomposed, combined, or deleted.
The foregoing is only a partial embodiment of the present application, and it should be noted that, for those skilled in the art, several modifications and decorations can be made without departing from the principle of the present application, and these modifications and decorations should also be regarded as the protection scope of the present application.

Claims (10)

1. A method of dispensing containers, comprising the steps of:
monitoring the idle allowance of a class of container corresponding to at least one database type in the resource scheduling library, and triggering a bin filling event for complementing the idle allowance of the class of container to reach a rated quantity when the idle allowance meets a preset condition;
responding to the bin filling event, driving a container cluster main control node to create the containers to acquire access channel certificates corresponding to the new containers, wherein the access channel certificates are used for triggering and accessing the corresponding containers;
storing the access channel certificate into the resource scheduling library to add a corresponding new container, and recovering the idle allowance of the container to the rated amount;
in response to a creation request of a container corresponding to a specific type of database, determining an idle target container of the corresponding type from the resource scheduling library, and distributing an access channel credential of the idle target container to a requester of the creation request.
2. The method of claim 1, further comprising the pre-step of:
and initializing and creating a resource scheduling library, driving a container cluster main control node to control the container cluster main control node to create a rated number of new containers for each preset type of database, and storing access channel certificates of the new containers into the resource scheduling library.
3. The method of claim 1, further comprising the subsequent steps of:
and responding to a deletion request aiming at the specified container, driving the container cluster main control node to delete the specified container so as to release the memory space of the specified container, and then deleting the corresponding container from the resource scheduling library.
4. The method of claim 1, further comprising the subsequent steps of:
and in response to the pause request/resume request aiming at the specified container, the driving container cluster master node pauses/resumes the operation of the specified container so as to prohibit/allow the call to the specified container.
5. The method of claim 1, further comprising the parallel steps of:
monitoring a container of which the latest timestamp meets a preset condition in a resource scheduling library, and sending corresponding alarm information to a preset remote interface, wherein the latest timestamp is used for recording the time information of the container when the last control operation is executed.
6. The method according to any one of claims 1 to 5, wherein when the container cluster master node is driven to create a new container, a port pre-assigned for the new container is submitted to the container cluster master node, and the access channel credential corresponding to the new container includes a network address of a container cluster working node where the new container is located and the pre-assigned port.
7. The method according to any one of claims 1 to 5, characterized in that: the method comprises the steps that an interface provided by a Kubernetes platform is called to control the container cluster main control node, the container cluster main control node is deployed by a Docker system, and the database is any one or more of the following preset types: mysql, redis, etcd, mongodb.
8. A container dispensing apparatus, comprising:
the system comprises a margin monitoring module, a margin monitoring module and a bin filling module, wherein the margin monitoring module is used for monitoring the idle margin of a class of container corresponding to at least one database type in a resource scheduling library, and when the idle margin meets a preset condition, triggering a bin filling event for complementing the idle margin of the class of container to enable the idle margin to reach a rated number;
the margin reseeding module is used for responding to the reseeding event and driving the container cluster main control node to create the container so as to obtain access channel certificates corresponding to the new containers, and the access channel certificates are used for reaching the access to the corresponding containers;
the voucher adding module is used for storing the access channel voucher into the resource scheduling library to add a corresponding new container of the access channel voucher so as to restore the idle allowance of the container to the rated amount;
and the certificate distribution module is used for responding to a creation request of a container corresponding to a specific type of database, determining an idle target container of a corresponding type from the resource scheduling library, and distributing an access channel certificate of the idle target container to a requester of the creation request.
9. An electronic device comprising a central processor and a memory, wherein the central processor is configured to invoke execution of a computer program stored in the memory to perform the steps of the method according to any one of claims 1 to 7.
10. A non-volatile storage medium, characterized in that it stores, in the form of computer-readable instructions, a computer program implemented according to the method of any one of claims 1 to 7, which, when invoked by a computer, performs the steps comprised by the method.
CN202011259159.7A 2020-11-12 2020-11-12 Container dispensing method, apparatus, device and medium therefor Pending CN112306640A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011259159.7A CN112306640A (en) 2020-11-12 2020-11-12 Container dispensing method, apparatus, device and medium therefor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011259159.7A CN112306640A (en) 2020-11-12 2020-11-12 Container dispensing method, apparatus, device and medium therefor

Publications (1)

Publication Number Publication Date
CN112306640A true CN112306640A (en) 2021-02-02

Family

ID=74325813

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011259159.7A Pending CN112306640A (en) 2020-11-12 2020-11-12 Container dispensing method, apparatus, device and medium therefor

Country Status (1)

Country Link
CN (1) CN112306640A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113407310A (en) * 2021-07-09 2021-09-17 科东(广州)软件科技有限公司 Container management method, device, equipment and storage medium
WO2023024739A1 (en) * 2021-08-24 2023-03-02 支付宝(杭州)信息技术有限公司 Container-based task execution method and apparatus

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2017113074A1 (en) * 2015-12-28 2017-07-06 华为技术有限公司 Resource allocation method, device, and system
CN107948203A (en) * 2017-12-29 2018-04-20 平安科技(深圳)有限公司 A kind of container login method, application server, system and storage medium
CN108228272A (en) * 2016-12-22 2018-06-29 ***通信集团上海有限公司 WEB containers generation processing method, equipment and server
WO2018121334A1 (en) * 2016-12-27 2018-07-05 阿里巴巴集团控股有限公司 Web application service providing method, apparatus, electronic device and system
EP3346379A1 (en) * 2017-01-09 2018-07-11 Sap Se Database management system with dynamic allocation of database requests
CN108958882A (en) * 2018-06-06 2018-12-07 麒麟合盛网络技术股份有限公司 A kind of container method of adjustment, device and system
CN110597623A (en) * 2019-08-13 2019-12-20 平安普惠企业管理有限公司 Container resource allocation method and device, computer equipment and storage medium

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2017113074A1 (en) * 2015-12-28 2017-07-06 华为技术有限公司 Resource allocation method, device, and system
CN108228272A (en) * 2016-12-22 2018-06-29 ***通信集团上海有限公司 WEB containers generation processing method, equipment and server
WO2018121334A1 (en) * 2016-12-27 2018-07-05 阿里巴巴集团控股有限公司 Web application service providing method, apparatus, electronic device and system
EP3346379A1 (en) * 2017-01-09 2018-07-11 Sap Se Database management system with dynamic allocation of database requests
CN107948203A (en) * 2017-12-29 2018-04-20 平安科技(深圳)有限公司 A kind of container login method, application server, system and storage medium
CN108958882A (en) * 2018-06-06 2018-12-07 麒麟合盛网络技术股份有限公司 A kind of container method of adjustment, device and system
CN110597623A (en) * 2019-08-13 2019-12-20 平安普惠企业管理有限公司 Container resource allocation method and device, computer equipment and storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113407310A (en) * 2021-07-09 2021-09-17 科东(广州)软件科技有限公司 Container management method, device, equipment and storage medium
WO2023024739A1 (en) * 2021-08-24 2023-03-02 支付宝(杭州)信息技术有限公司 Container-based task execution method and apparatus

Similar Documents

Publication Publication Date Title
CN111966305B (en) Persistent volume allocation method and device, computer equipment and storage medium
US10292044B2 (en) Apparatus for end-user transparent utilization of computational, storage, and network capacity of mobile devices, and associated methods
US9529613B2 (en) Methods and apparatus to reclaim resources in virtual computing environments
US11553034B2 (en) Server computer management system for supporting highly available virtual desktops of multiple different tenants
RU2429529C2 (en) Dynamic configuration, allocation and deployment of computer systems
CN105207798B (en) Service arrangement method and device in software defined network
JP2020024733A (en) Dynamic configuration of data volumes
US8104038B1 (en) Matching descriptions of resources with workload requirements
CN109189334B (en) Block chain network service platform, capacity expansion method thereof and storage medium
CN110365762B (en) Service processing method, device, equipment and storage medium
CN113037794B (en) Method, device and system for computing resource allocation scheduling
CN113382077B (en) Micro-service scheduling method, micro-service scheduling device, computer equipment and storage medium
CN112306640A (en) Container dispensing method, apparatus, device and medium therefor
CN114706690A (en) Method and system for sharing GPU (graphics processing Unit) by Kubernetes container
CN114565502A (en) GPU resource management method, scheduling method, device, electronic equipment and storage medium
CN112965817B (en) Resource management method and device and electronic equipment
CN113608838A (en) Deployment method and device of application image file, computer equipment and storage medium
CN114615268B (en) Service network, monitoring node, container node and equipment based on Kubernetes cluster
CN113485830A (en) Micro-service automatic capacity expansion method for power grid monitoring system
EP3786797A1 (en) Cloud resource marketplace
US11095501B2 (en) Provisioning and activating hardware resources
CN112015515A (en) Virtual network function instantiation method and device
CN109995617A (en) Automated testing method, device, equipment and the storage medium of Host Administration characteristic
CN115113800A (en) Multi-cluster management method and device, computing equipment and storage medium
CN116708583A (en) Service execution method, storage medium, device and distributed system

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