CN109992415B - Container dispatching method and dispatching system - Google Patents

Container dispatching method and dispatching system Download PDF

Info

Publication number
CN109992415B
CN109992415B CN201910198327.7A CN201910198327A CN109992415B CN 109992415 B CN109992415 B CN 109992415B CN 201910198327 A CN201910198327 A CN 201910198327A CN 109992415 B CN109992415 B CN 109992415B
Authority
CN
China
Prior art keywords
container
state information
scheduling
scheduling task
task
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.)
Active
Application number
CN201910198327.7A
Other languages
Chinese (zh)
Other versions
CN109992415A (en
Inventor
费永军
张俊
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shanghai Ppdai Finance Information Service Co ltd
Original Assignee
Shanghai Ppdai Finance Information Service 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 Shanghai Ppdai Finance Information Service Co ltd filed Critical Shanghai Ppdai Finance Information Service Co ltd
Priority to CN201910198327.7A priority Critical patent/CN109992415B/en
Publication of CN109992415A publication Critical patent/CN109992415A/en
Application granted granted Critical
Publication of CN109992415B publication Critical patent/CN109992415B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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

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 invention provides a container scheduling method and a scheduling system, which relate to the technical field of data transmission, and the method comprises the following steps: and the server cluster distributes resources to construct a container according to the container scheduling task sent by the scheduling system, monitors the state of the container and then sends the state information of the container scheduling task to the scheduling system. And when the scheduling system determines that the received state information of the container scheduling task is inconsistent with the state information of the container scheduling task correspondingly stored in the database, updating the state information of the container scheduling task correspondingly stored in the database. The scheduling system stores the state information of the container scheduling task in the database instead of relying on the zookeeper to store data, so that the data security is improved, and secondly, the scheduling system correspondingly updates the state information of the container scheduling task in the database when the state information of the container scheduling task is updated, but not updates the database when the state information is received, so that the same state information is prevented from being repeatedly updated.

Description

Container dispatching method and dispatching system
Technical Field
The embodiment of the invention relates to the technical field of data transmission, in particular to a container scheduling method and a scheduling system.
Background
Meso is an open source distributed resource management framework under Apache, which is called the kernel of a distributed system. Mesos are generated before container technology, and as technology evolves, mesos now also support the release of container technology. However, the Mesos only provides management functions of the resources, so that the scheduling and arrangement of the resources are realized by the users.
The existing open source container scheduling system realized based on the mesos technology has marathon and singular, the storage of the two realization depends on zookeeper, and the zookeeper is adopted as data storage to have resource leakage risk. Second, when the container scheduling system updates the task state using the message synchronization mechanism provided by the meso, there are cases where the same task state is updated multiple times, thereby affecting the efficiency of container scheduling.
Disclosure of Invention
Because the container scheduling system in the prior art adopts zookeeper as data storage, the resource leakage risk exists, and the same task state in the container scheduling system is updated for a plurality of times, the embodiment of the invention provides a container scheduling method and a scheduling system.
In one aspect, an embodiment of the present invention provides a container scheduling method, which is applicable to a scheduling system provided with a database, where the method includes:
the scheduling system receives state information of container scheduling tasks sent by a server cluster, and the server cluster is used for distributing resources to construct containers and monitoring the states of the containers according to the container scheduling tasks sent by the scheduling system;
and when the received state information of the container scheduling task is inconsistent with the state information of the container scheduling task correspondingly stored in the database, the scheduling system updates the state information of the container scheduling task correspondingly stored in the database.
Optionally, before the scheduling system receives the status information of the container scheduling task sent by the server cluster, the scheduling system further includes:
the scheduling system receives a container release request sent by a user side and stores initial state information of the container release request to the database, wherein the container release request comprises the number of containers to be released and corresponding container attributes;
the scheduling system constructs a container scheduling task according to the number of containers to be issued and the corresponding container attributes, and stores initial state information of the container scheduling task into the database;
the scheduling system sends the container scheduling task to the server cluster, so that the server cluster distributes resources according to the container scheduling task to construct and start a container.
Optionally, each container to be issued corresponds to a container scheduling task.
Optionally, the scheduling system constructs a container scheduling task according to the number of containers to be published and the corresponding container attribute, including:
determining the resource requirement of each container to be distributed according to the attribute of the container to be distributed;
and the scheduling system determines a container scheduling task of the container to be distributed according to the resource requirement of the container to be distributed and the resource information reported by the server cluster.
Optionally, the method further comprises:
and the scheduling system updates the state information of the container release request in the database according to the state information of all container scheduling tasks corresponding to the container release request.
Optionally, when determining that the received state information of the container scheduling task is inconsistent with the state information of the container scheduling task correspondingly stored in the database, the scheduling system updates the state information of the container scheduling task correspondingly stored in the database, including:
when the scheduling system determines that the received state information of the container scheduling task is inconsistent with the state information of the container scheduling task correspondingly stored in the database, storing the received state information of the container scheduling task into an event queue;
and the scheduling system acquires the received state information of the container scheduling task from the event queue, and updates the state information of the container scheduling task correspondingly stored in the database.
In one aspect, an embodiment of the present invention provides a scheduling system, including:
the receiving module is used for receiving the state information of the container scheduling task sent by the server cluster, and the server cluster is used for distributing resources to construct a container and monitoring the state of the container according to the container scheduling task sent by the scheduling system;
the database is used for storing the state information of the container scheduling task;
and the processing module is used for updating the state information of the container scheduling task correspondingly stored in the database when the received state information of the container scheduling task is not consistent with the state information of the container scheduling task correspondingly stored in the database.
Optionally, the device further comprises a sending module;
the receiving module is further configured to:
before receiving state information of a container scheduling task sent by a server cluster, receiving a container release request sent by a user side and storing initial state information of the container release request into the database, wherein the container release request comprises the number of containers to be released and corresponding container attributes;
the processing module is further configured to:
constructing a container scheduling task according to the number of containers to be published and the corresponding container attributes, and storing initial state information of the container scheduling task into the database;
the sending module is specifically configured to:
and sending the container scheduling task to the server cluster so that the server cluster can construct and start the container according to the resource allocation of the container scheduling task.
Optionally, each container to be issued corresponds to a container scheduling task.
Optionally, the processing module is specifically configured to:
determining the resource requirement of each container to be distributed according to the attribute of the container to be distributed;
and determining a container scheduling task of the container to be distributed according to the resource requirement of the container to be distributed and the resource information reported by the server cluster.
Optionally, the processing module is further configured to:
and updating the state information of the container release request in the database according to the state information of all container scheduling tasks corresponding to the container release request.
Optionally, the processing module is specifically configured to:
when the received state information of the container scheduling task is inconsistent with the state information of the container scheduling task correspondingly stored in the database, storing the received state information of the container scheduling task into an event queue;
and acquiring the received state information of the container scheduling task from the event queue, and updating the state information of the container scheduling task correspondingly stored in the database.
In one aspect, an embodiment of the present invention provides a terminal device, including at least one processing unit, and at least one storage unit, where the storage unit stores a computer program, and when the program is executed by the processing unit, causes the processing unit to execute steps of a container scheduling method.
In one aspect, embodiments of the present invention provide a computer readable medium storing a computer program executable by a terminal device, which when run on the terminal device causes the terminal device to perform the steps of a container scheduling method.
In the embodiment of the invention, the server cluster distributes resources to construct a container and monitors the state of the container according to the container dispatching task sent by the dispatching system, and then sends the state information of the container dispatching task to the dispatching system. And when the scheduling system determines that the received state information of the container scheduling task is inconsistent with the state information of the container scheduling task correspondingly stored in the database, updating the state information of the container scheduling task correspondingly stored in the database. The scheduling system stores the state information of the container scheduling task in the database after receiving the state information of the container scheduling task, rather than relying on the zookeeper in the Mesos to store the data, so that the data safety is improved, and secondly, when the scheduling system determines that the state information of the received container scheduling task is inconsistent with the state information of the container scheduling task correspondingly stored in the database, the scheduling system updates the state information of the container scheduling task correspondingly stored in the database, rather than updating the database when the state information of the container scheduling task is received, thereby avoiding the same state information from being repeatedly updated and improving the efficiency of container scheduling.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings that are needed in the description of the embodiments will be briefly described below, it will be apparent that the drawings in the following description are only some embodiments of the present invention, and that other drawings can be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a schematic view of an application scenario provided in an embodiment of the present invention;
FIG. 2 is a flow chart of a method for scheduling containers according to an embodiment of the present invention;
FIG. 3 is a flow chart of a method for constructing a container scheduling task according to an embodiment of the present invention;
FIG. 4 is a flow chart of a method for scheduling containers according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of a scheduling system according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of a terminal device according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantageous effects of the present invention more apparent, the present invention will be further described in detail with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the invention.
The container scheduling method in the embodiment of the invention can be applied to an application scenario shown in fig. 1, where the application scenario includes a scheduling system 101, a server cluster 102 and a user terminal 103.
The dispatching system 101 comprises a plurality of dispatching examples, the dispatching examples adopt a master-slave mode, only the master dispatching example can initiate container dispatching, other dispatching examples can only receive container release requests sent by the user terminal 103, and the user terminal 103 submits the container dispatching requests through a portal interface or an application programming interface (Application Programming Interface, abbreviated as API). When the master scheduling instance fails, the master scheduling instance is selected from other slave scheduling instances to initiate container scheduling.
The server cluster 102 is composed of a plurality of servers for collecting server resources including a central processing unit (Central Processing Unit, abbreviated as CPU), memory, disk, ports, and the like. Servers in server cluster 102 also employ a master-slave architecture. Each slave server periodically reports resource information to the master server, and the master server gathers all the resource information reported by the slave servers and then periodically pushes the summarized resource information to the scheduling system 101.
Scheduling system 101 initiates container scheduling tasks to server cluster 102 using the interface for resource scheduling. The master server in the server cluster 102 sends the container scheduling task to the corresponding slave server for execution, and the master server periodically sends the state information of the container scheduling task to the scheduling system 101 by calling the state update interface. The scheduling system 101 determines whether or not the state information of the container scheduling task has been changed, and if so, saves the state information of the container scheduling task to a database in the scheduling system 101.
Based on the application scenario diagram shown in fig. 1, the embodiment of the invention provides a flow of a container scheduling method, and the flow of the method can be interactively executed by a scheduling system and a server cluster, as shown in fig. 2, and the method comprises the following steps:
in step S201, the scheduling system receives status information of a container scheduling task sent by the server cluster.
Specifically, container dispatch tasks are built by the dispatch system and sent to the server cluster, and the container dispatch tasks are used for indicating building containers and monitoring subsequent states of the containers. The server cluster is used for dispatching tasks according to containers sent by the dispatching system, distributing resources to construct containers and monitoring the states of the containers. The state information of the container scheduling task consists of a container scheduling task number and the state of the container scheduling task, the state information of the container scheduling task can be starting state information, fault state information, overtime state information, ending state information and the like of the container, and the server cluster can be a Mesos cluster.
In step S202, when determining that the received state information of the container scheduling task is inconsistent with the state information of the container scheduling task stored in the database, the scheduling system updates the state information of the container scheduling task stored in the database.
Specifically, the scheduling system includes a database, which may be a relational database, such as an Oracle database, mySQL database, or the like. The database may also be a non-relational database, such as a Memcached database, a Redis database, or the like. When the dispatching system constructs the container dispatching task, the state information of the container dispatching task is stored in a database. The server cluster calls a state update interface regularly, and sends state information of the container dispatching task to a dispatching system. When the scheduling system receives the state information of the container scheduling task sent by the server cluster, if the state information of the container scheduling task is inconsistent with the state information of the container scheduling task stored in the database, the state information of the container scheduling task correspondingly stored in the database is updated.
The scheduling system stores the state information of the container scheduling task in the database after receiving the state information of the container scheduling task, rather than relying on the zookeeper in the Mesos to store the data, so that the data safety is improved, and secondly, when the scheduling system determines that the state information of the received container scheduling task is inconsistent with the state information of the container scheduling task correspondingly stored in the database, the scheduling system updates the state information of the container scheduling task correspondingly stored in the database, rather than updating the database when the state information of the container scheduling task is received, thereby avoiding the same state information from being repeatedly updated and improving the efficiency of container scheduling.
Optionally, before the scheduling system receives the status information of the container scheduling task sent by the server cluster, the scheduling system needs to construct the container scheduling task and send the container scheduling task to the server cluster, which specifically includes the following steps, as shown in fig. 3:
in step S301, the scheduling system receives a container publishing request sent by a user.
The scheduling system stores initial state information of a container release request to a database, wherein the container release request comprises the number of containers to be released and corresponding container attributes, and the container attributes can be container specifications.
In step S302, the scheduling system constructs a container scheduling task according to the number of containers to be published and the corresponding container attributes.
Optionally, each container to be deployed corresponds to a container scheduling task that is built based on the container properties. For example, the number of the containers to be issued is 2, namely a container to be issued 1 and a container to be issued 2, wherein the attribute of the container to be issued 1 is a memory 100M, the attribute of the container to be issued 2 is a memory 200M, then a container dispatching task a is constructed for the attribute of the container to be issued 1 and the attribute of the container to be issued 1, and a container dispatching task B is constructed for the attribute of the container to be issued 2 and the attribute of the container to be issued 2. After the dispatching system constructs the container dispatching task, the initial state information of the container dispatching task is stored in a database.
In step S303, the scheduling system sends the container scheduling task to the server cluster.
In one possible implementation manner, for each container to be distributed, the scheduling system determines a container scheduling task of the container to be distributed according to the attribute of the container to be distributed, and compares the resource requirement of the container scheduling task with the resource information periodically reported by the server cluster. When the resources in the server cluster meet the resource requirements of the container scheduling task, matching the resources in the server cluster for the container scheduling task, and then sending the container scheduling task to the server cluster.
In one possible implementation manner, when a container scheduling task is constructed, for each container to be distributed, the scheduling system determines a resource requirement of the container to be distributed according to the attribute of the container to be distributed, then determines a container scheduling task of the container to be distributed according to the resource requirement of the container to be distributed and resource information reported by the server cluster, and then sends the container scheduling task to the server cluster.
In the implementation, the server cluster monitors the resource idle condition of each server in the cluster, and then periodically reports resource information to the scheduling system, wherein the resources comprise a CPU, a memory, a disk, a port and the like. For example, the resource requirement of the to-be-issued container a is set as the memory 100M, the server cluster includes the server 1 and the server 2, and the server cluster reports the resource information of the server 1 and the server 2 to the scheduling system, where the resource information of the server 1 is the idle memory 500M, and the resource information of the server 2 is the idle port 8. The scheduling system determines a resource scheduling task of the to-be-distributed container A according to the resource information of the server 1 and the server 2 reported by the server cluster and the resource requirement of the to-be-distributed container A, and the resource scheduling task specifically adopts a 100M memory in the server 1 to construct the to-be-distributed container A.
In step S304, the server cluster allocates resources to build and start the container according to the container scheduling task.
Specifically, the server cluster comprises a master server and slave servers, wherein the master server receives a container scheduling task sent by a scheduling system and then sends the container scheduling task to the corresponding slave server to be executed. And the slave server allocates resources for the container to be issued according to the container dispatching task, then constructs the container to be issued and starts the container, and when the container is successfully started, the state information of the container dispatching task is determined to be the starting state information.
In step S305, the server cluster sends status information of the container scheduling task to the scheduling system.
The server cluster sends the starting state information of the container scheduling task to the scheduling system after the container is successfully started in the server cluster, the scheduling system compares the initial state information of the container scheduling task in the database with the received starting state information, and the initial state information of the container scheduling task in the database is modified into the starting state information because the stored initial state information is inconsistent with the received starting state information. After the dispatching system initiates the container dispatching task, the initial state information of the container dispatching task is stored in a database, and then the initial state information of the container dispatching task in the database is updated according to the state information of the container dispatching task received from the server cluster, so that the real-time tracking of the container dispatching task is realized.
Further, when the scheduling system receives the container release requests sent by the user side, one container release request may correspond to a plurality of container release tasks, so when the state of the container release requests is updated, the state information of the container release requests in the database may be updated according to the state information of all the container release tasks corresponding to the container release requests.
In a specific implementation, after each container scheduling task is processed by the server cluster, state information of the container scheduling task is sent to the scheduling system, and when states of all container scheduling tasks corresponding to one container release request are all in a starting state, the scheduling system updates initial state information of the container release request into starting state information.
Optionally, when determining that the state information of the received container scheduling task is inconsistent with the state information of the container scheduling task stored correspondingly in the database, the scheduling system stores the state information of the received container scheduling task in the event queue, and the scheduling system acquires the state information of the received container scheduling task from the event queue and updates the state information of the container scheduling task stored correspondingly in the database.
Specifically, since the state information of the container scheduling task sent by the server cluster to the scheduling system may be state information which is not updated, if the scheduling system directly updates the database after receiving the state information of the container scheduling task sent by the server cluster, when the container scheduling task is more, the database will be too frequently read and written, and the performance of the database will be affected. Therefore, in the embodiment of the invention, after receiving the state information of the container scheduling task sent by the server cluster, the scheduling system stores the state information of the container scheduling task in the heap cache. And judging whether the state information of the container scheduling task in the cache stack is consistent with the state information of the container scheduling task correspondingly stored in the database, if not, storing the state information of the container scheduling task in an event queue, so that when the database is updated, the state information of the container scheduling task can be sequentially acquired from the event queue and written into the database, thereby avoiding the situation that the same task state is updated for a plurality of times, and avoiding data loss.
Optionally, when the state of the container scheduling task is the end state, the scheduling system recovers the IP address corresponding to the container scheduling task in the server cluster, and when the scheduling system constructs a new container scheduling task, the recovered IP address may be allocated to the container scheduling task, so as to implement management of the IP address.
In order to better explain the embodiment of the present invention, a method for scheduling containers provided by the embodiment of the present invention is described below in conjunction with a specific implementation scenario, where the method is interactively performed by a scheduling system and a server cluster, where the server cluster is a Mesos cluster, and the Mesos cluster adopts a master-slave mode, and the scheduling system includes a mysql database, as shown in fig. 4, and the method includes the following steps:
in step S401, the scheduling system receives a container publishing request sent by a user.
In step S402, the scheduling system saves the initial state information of the container issue request to the mysql database.
The container release request includes the number of containers to be released and the corresponding container attributes.
In step S403, the scheduling system constructs a container scheduling task according to the container issuing request.
In step S404, the scheduling system saves the initial state information of the container scheduling task to the mysql database.
In step S405, the meso cluster periodically reports the resource information to the scheduling system.
Specifically, the resource information periodically reported by the Mesos cluster is information of idle resources in the Mesos cluster, the Mesos cluster comprises a master server and slave servers, each slave server periodically collects the information of the idle resources and reports the information to the master server, and the master server periodically sends the summarized information of the idle resources to a scheduling system.
In step S406, the scheduling system matches the free resources of the meso cluster for the container scheduling task when determining that the free resources of the meso cluster match the resource requirements of the container scheduling task.
In step S407, the scheduling system sends the container scheduling task to the meso cluster.
In step S408, the meso cluster builds and starts a container according to the container scheduling task.
In step S409, the meso cluster periodically sends status information of the container scheduling task to the scheduling system.
In step S410, the scheduling system stores the received status information of the container scheduling task in the heap cache.
In step S411, when determining that the state information of the container scheduling task in the heap cache is inconsistent with the initial state information of the container scheduling task in the mysql database, the scheduling system saves the state information of the container scheduling task in the heap cache to the event queue.
In step S412, the scheduling system acquires the status information of the container scheduling task from the event queue, and updates the initial status information of the container scheduling task in the mysql database.
Specifically, when the state of the container scheduling task is the starting state, the initial state information of the container scheduling task in the mysql database is updated to the starting state. When the state of the container scheduling task is in a failure state and rescheduling is preset, the scheduling system reinitiates the container scheduling task.
In step S413, the scheduling system updates the initial state information of the container publishing request in the mysql database according to the state information of all the container scheduling tasks corresponding to the container publishing request.
Specifically, when the states of all container dispatching tasks corresponding to the container release requests are updated to be the starting states within a preset time period, the initial states of the container release requests in the mysql database are modified to be the finishing states. When the state of at least one container dispatching task in all container dispatching tasks corresponding to the container issuing request is not updated to be a starting state within a preset time, modifying the initial state of the container issuing request in the mysql database to be a failure state.
The Mesos cluster periodically transmits the state information of the container scheduling task to the scheduling system, so that the subsequent scheduling system compares the received state information of the container scheduling task with the state information of the container scheduling task stored in the database correspondingly each time the subsequent scheduling system receives the state information of the container scheduling task, and if the received state information of the container scheduling task is inconsistent with the state information of the container scheduling task stored in the database, the received state information of the container scheduling task is stored in the event queue. The scheduling system acquires the received state information of the container scheduling task from the event queue, and updates the state information of the container scheduling task correspondingly stored in the database. The scheduling system stores the state information of the container scheduling task in the database after receiving the state information of the container scheduling task, rather than relying on the zookeeper in the Mesos to store the data, so that the data safety is improved, and secondly, when the scheduling system determines that the state information of the received container scheduling task is inconsistent with the state information of the container scheduling task correspondingly stored in the database, the scheduling system updates the state information of the container scheduling task correspondingly stored in the database, rather than updating the database when the state information of the container scheduling task is received, thereby avoiding the same state information from being repeatedly updated and improving the efficiency of container scheduling.
Based on the same technical concept, an embodiment of the present invention provides a scheduling system, as shown in fig. 5, the scheduling system 500 includes:
the receiving module 501 is configured to receive status information of a container scheduling task sent by a server cluster, where the server cluster is configured to allocate resources to construct a container according to the container scheduling task sent by the scheduling system, and monitor a status of the container;
a database 502 for storing status information of container scheduling tasks;
and the processing module 503 is configured to update the state information of the container scheduling task correspondingly stored in the database when it is determined that the received state information of the container scheduling task is inconsistent with the state information of the container scheduling task correspondingly stored in the database.
Optionally, a sending module 504 is also included;
the receiving module 501 is further configured to:
before receiving state information of a container scheduling task sent by a server cluster, receiving a container release request sent by a user side and storing initial state information of the container release request into the database, wherein the container release request comprises the number of containers to be released and corresponding container attributes;
the processing module 503 is further configured to:
constructing a container scheduling task according to the number of containers to be published and the corresponding container attributes, and storing initial state information of the container scheduling task into the database;
the sending module 504 is specifically configured to:
and sending the container scheduling task to the server cluster so that the server cluster can construct and start the container according to the resource allocation of the container scheduling task.
Optionally, each container to be issued corresponds to a container scheduling task.
Optionally, the processing module 503 is specifically configured to:
determining the resource requirement of each container to be distributed according to the attribute of the container to be distributed;
and determining a container scheduling task of the container to be distributed according to the resource requirement of the container to be distributed and the resource information reported by the server cluster.
Optionally, the processing module 503 is further configured to:
and updating the state information of the container release request in the database according to the state information of all container scheduling tasks corresponding to the container release request.
Optionally, the processing module 503 is specifically configured to:
when the received state information of the container scheduling task is inconsistent with the state information of the container scheduling task correspondingly stored in the database, storing the received state information of the container scheduling task into an event queue;
and acquiring the received state information of the container scheduling task from the event queue, and updating the state information of the container scheduling task correspondingly stored in the database.
Based on the same technical concept, the embodiment of the present invention provides a terminal device, as shown in fig. 6, including at least one processor 601 and a memory 602 connected to the at least one processor, where in the embodiment of the present invention, a specific connection medium between the processor 601 and the memory 602 is not limited, and in fig. 6, the processor 601 and the memory 602 are connected by a bus as an example. The buses may be divided into address buses, data buses, control buses, etc.
In the embodiment of the present invention, the memory 602 stores instructions executable by the at least one processor 601, and the at least one processor 601 may perform the steps included in the container scheduling method by executing the instructions stored in the memory 602.
The processor 601 is a control center of the terminal device, and may use various interfaces and lines to connect various parts of the terminal device, and execute or execute instructions stored in the memory 602 and call data stored in the memory 602, thereby performing container scheduling. Alternatively, the processor 601 may include one or more processing units, and the processor 601 may integrate an application processor and a modem processor, wherein the application processor primarily processes operating systems, user interfaces, application programs, and the like, and the modem processor primarily processes wireless communications. It will be appreciated that the modem processor described above may not be integrated into the processor 601. In some embodiments, processor 601 and memory 602 may be implemented on the same chip, or they may be implemented separately on separate chips in some embodiments.
The processor 601 may be a general purpose processor such as a Central Processing Unit (CPU), digital signal processor, application specific integrated circuit (Application Specific Integrated Circuit, ASIC), field programmable gate array or other programmable logic device, discrete gate or transistor logic, discrete hardware components, capable of implementing or executing the methods, steps and logic blocks disclosed in embodiments of the present invention. The general purpose processor may be a microprocessor or any conventional processor or the like. The steps of a method disclosed in connection with the embodiments of the present invention may be embodied directly in a hardware processor for execution, or in a combination of hardware and software modules in the processor for execution.
The memory 602 is a non-volatile computer readable storage medium that can be used to store non-volatile software programs, non-volatile computer executable programs, and modules. The Memory 602 may include at least one type of storage medium, which may include, for example, flash Memory, hard disk, multimedia card, card Memory, random access Memory (Random Access Memory, RAM), static random access Memory (Static Random Access Memory, SRAM), programmable Read-Only Memory (Programmable Read Only Memory, PROM), read-Only Memory (ROM), charged erasable programmable Read-Only Memory (Electrically Erasable Programmable Read-Only Memory), magnetic Memory, magnetic disk, optical disk, and the like. Memory 602 is any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer, but is not limited to such. The memory 602 in embodiments of the present invention may also be circuitry or any other device capable of performing storage functions for storing program instructions and/or data.
Based on the same inventive concept, embodiments of the present invention also provide a computer readable storage medium storing computer instructions that, when run on a terminal device, cause the terminal device to perform the steps of the container scheduling method as described above.
It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as a method, or as a computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, 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, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While preferred embodiments of the present invention have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. It is therefore intended that the following claims be interpreted as including the preferred embodiments and all such alterations and modifications as fall within the scope of the invention.
It will be apparent to those skilled in the art that various modifications and variations can be made to the present invention without departing from the spirit or scope of the invention. Thus, it is intended that the present invention also include such modifications and alterations insofar as they come within the scope of the appended claims or the equivalents thereof.

Claims (10)

1. A container scheduling method, suitable for a scheduling system provided with a database, comprising:
the scheduling system receives state information of container scheduling tasks sent by a server cluster, the server cluster is used for distributing resources to construct containers and monitoring the states of the containers according to the container scheduling tasks sent by the scheduling system, and the state information of the container scheduling tasks consists of container scheduling task numbers and the states of the container scheduling tasks;
and when the received state information of the container scheduling task is inconsistent with the state information of the container scheduling task correspondingly stored in the database, the scheduling system updates the state information of the container scheduling task correspondingly stored in the database.
2. The method of claim 1, wherein before the scheduling system receives the status information of the container scheduling task sent by the server cluster, further comprising:
the scheduling system receives a container release request sent by a user side and stores initial state information of the container release request to the database, wherein the container release request comprises the number of containers to be released and corresponding container attributes;
the scheduling system constructs a container scheduling task according to the number of containers to be issued and the corresponding container attributes, and stores initial state information of the container scheduling task into the database;
the scheduling system sends the container scheduling task to the server cluster, so that the server cluster distributes resources according to the container scheduling task to construct and start a container.
3. The method of claim 2, wherein each container to be issued corresponds to a container scheduling task.
4. The method of claim 3, wherein the scheduling system constructs container scheduling tasks based on the number of containers to be published and corresponding container attributes, comprising:
for each container to be distributed, the scheduling system determines the resource requirement of the container to be distributed according to the attribute of the container to be distributed;
and the scheduling system determines a container scheduling task of the container to be distributed according to the resource requirement of the container to be distributed and the resource information reported by the server cluster.
5. The method as recited in claim 2, further comprising:
and the scheduling system updates the state information of the container release request in the database according to the state information of all container scheduling tasks corresponding to the container release request.
6. The method according to any one of claims 1 to 5, wherein the scheduling system, when determining that the received state information of the container scheduling task is inconsistent with the state information of the container scheduling task stored in the database, updates the state information of the container scheduling task stored in the database, includes:
when the scheduling system determines that the received state information of the container scheduling task is inconsistent with the state information of the container scheduling task correspondingly stored in the database, storing the received state information of the container scheduling task into an event queue;
and the scheduling system acquires the received state information of the container scheduling task from the event queue, and updates the state information of the container scheduling task correspondingly stored in the database.
7. A scheduling system, comprising:
the receiving module is used for receiving the state information of the container scheduling task sent by the server cluster, the server cluster is used for distributing resources to construct a container and monitoring the state of the container according to the container scheduling task sent by the scheduling system, and the state information of the container scheduling task consists of a container scheduling task number and the state of the container scheduling task;
the database is used for storing the state information of the container scheduling task;
and the processing module is used for updating the state information of the container scheduling task correspondingly stored in the database when the received state information of the container scheduling task is not consistent with the state information of the container scheduling task correspondingly stored in the database.
8. The scheduling system of claim 7, further comprising a transmission module;
the receiving module is further configured to:
before receiving state information of a container scheduling task sent by a server cluster, receiving a container release request sent by a user side and storing initial state information of the container release request into the database, wherein the container release request comprises the number of containers to be released and corresponding container attributes;
the processing module is further configured to:
constructing a container scheduling task according to the number of containers to be published and the corresponding container attributes, and storing initial state information of the container scheduling task into the database;
the sending module is specifically configured to:
and sending the container scheduling task to the server cluster so that the server cluster can construct and start the container according to the resource allocation of the container scheduling task.
9. A terminal device comprising at least one processing unit and at least one storage unit, wherein the storage unit stores a computer program which, when executed by the processing unit, causes the processing unit to perform the steps of the method of any of claims 1 to 6.
10. A computer readable medium, characterized in that it stores a computer program executable by a terminal device, which program, when run on the terminal device, causes the terminal device to perform the steps of the method according to any of claims 1-6.
CN201910198327.7A 2019-03-15 2019-03-15 Container dispatching method and dispatching system Active CN109992415B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910198327.7A CN109992415B (en) 2019-03-15 2019-03-15 Container dispatching method and dispatching system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910198327.7A CN109992415B (en) 2019-03-15 2019-03-15 Container dispatching method and dispatching system

Publications (2)

Publication Number Publication Date
CN109992415A CN109992415A (en) 2019-07-09
CN109992415B true CN109992415B (en) 2023-07-14

Family

ID=67130457

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910198327.7A Active CN109992415B (en) 2019-03-15 2019-03-15 Container dispatching method and dispatching system

Country Status (1)

Country Link
CN (1) CN109992415B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111522646A (en) * 2020-04-30 2020-08-11 北京江融信科技有限公司 Registration method and system used between batch dispatching center and batch application service
CN112818059B (en) * 2021-01-27 2024-05-17 百果园技术(新加坡)有限公司 Information real-time synchronization method and device based on container release platform
CN116048825A (en) * 2021-10-28 2023-05-02 中移(苏州)软件技术有限公司 Container cluster construction method and system

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107066319A (en) * 2017-01-17 2017-08-18 北京国电通网络技术有限公司 A kind of multidimensional towards heterogeneous resource dispatches system
CN107423112A (en) * 2017-06-28 2017-12-01 郑州云海信息技术有限公司 A kind of Docker container states real-time synchronization method
US10216512B1 (en) * 2016-09-29 2019-02-26 Amazon Technologies, Inc. Managed multi-container builds

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10216512B1 (en) * 2016-09-29 2019-02-26 Amazon Technologies, Inc. Managed multi-container builds
CN107066319A (en) * 2017-01-17 2017-08-18 北京国电通网络技术有限公司 A kind of multidimensional towards heterogeneous resource dispatches system
CN107423112A (en) * 2017-06-28 2017-12-01 郑州云海信息技术有限公司 A kind of Docker container states real-time synchronization method

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
基于容器云的微服务系统;杨迪;《电信科学》;20180920;第34卷(第9期);第169-178页 *

Also Published As

Publication number Publication date
CN109992415A (en) 2019-07-09

Similar Documents

Publication Publication Date Title
CN110941481A (en) Resource scheduling method, device and system
CN109992415B (en) Container dispatching method and dispatching system
CN112379995B (en) DAG-based unitized distributed scheduling system and method
CN110888743B (en) GPU resource using method, device and storage medium
CN107241281B (en) Data processing method and device
CN110389843B (en) Service scheduling method, device, equipment and readable storage medium
CN103297456A (en) Method for accessing sharing resources in distributed system and distributed system
CN108880898A (en) Active and standby containment system switching method and device
CN112486642B (en) Resource scheduling method, device, electronic equipment and computer readable storage medium
CN108345462B (en) Method and device for upgrading components
WO2019006907A1 (en) Systems and methods for allocating computing resources in distributed computing
CN114625533A (en) Distributed task scheduling method and device, electronic equipment and storage medium
CN107066339A (en) Distributed job manager and distributed job management method
CN112416969A (en) Parallel task scheduling system in distributed database
CN112162852A (en) Multi-architecture CPU node management method, device and related components
CN112948050A (en) Method and device for deploying pod
CN112860387A (en) Distributed task scheduling method and device, computer equipment and storage medium
CN108170417B (en) Method and device for integrating high-performance job scheduling framework in MESOS cluster
CN115686346A (en) Data storage method and device and computer readable storage medium
CN113467884A (en) Resource allocation method and device, electronic equipment and computer readable storage medium
CN112286688A (en) Memory management and use method, device, equipment and medium
CN109561134B (en) Electronic device, distributed cluster service distribution method and storage medium
CN113342554B (en) IO multiplexing method, medium, device and operating system
CN109670932B (en) Credit data accounting method, apparatus, system and computer storage medium
CN111813541B (en) Task scheduling method, device, medium and equipment

Legal Events

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