CN114531443A - Cluster-based container control method and system - Google Patents

Cluster-based container control method and system Download PDF

Info

Publication number
CN114531443A
CN114531443A CN202210152236.1A CN202210152236A CN114531443A CN 114531443 A CN114531443 A CN 114531443A CN 202210152236 A CN202210152236 A CN 202210152236A CN 114531443 A CN114531443 A CN 114531443A
Authority
CN
China
Prior art keywords
container
cluster
server
execution server
container control
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202210152236.1A
Other languages
Chinese (zh)
Other versions
CN114531443B (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.)
Jingdong Technology Information Technology Co Ltd
Original Assignee
Jingdong Technology 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 Jingdong Technology Information Technology Co Ltd filed Critical Jingdong Technology Information Technology Co Ltd
Priority to CN202210152236.1A priority Critical patent/CN114531443B/en
Priority claimed from CN202210152236.1A external-priority patent/CN114531443B/en
Publication of CN114531443A publication Critical patent/CN114531443A/en
Application granted granted Critical
Publication of CN114531443B publication Critical patent/CN114531443B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/16File or folder operations, e.g. details of user interfaces specifically adapted to file systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/17Details of further file system functions
    • G06F16/174Redundancy elimination performed by the file system
    • G06F16/1744Redundancy elimination performed by the file system using compression, e.g. sparse files
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1095Replication or mirroring of data, e.g. scheduling or transport for data synchronisation between network nodes
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/04Protocols for data compression, e.g. ROHC
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/22Parsing or analysis of headers
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/02Total factory control, e.g. smart factories, flexible manufacturing systems [FMS] or integrated manufacturing systems [IMS]

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Human Computer Interaction (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The present disclosure provides a cluster-based container control method and system, wherein a cluster includes a management server and at least one container, each container includes an execution server, the management server is in communication connection with the execution server, the method is applied to the execution servers, and the method includes: receiving a container control instruction sent by the management server; acquiring a compressed file included in the container control instruction; and controlling a container corresponding to the execution server to execute the operation corresponding to the compressed file. The method and the device are used for overcoming the defect that the control of the container can only be realized by controlling the resource scheduling unit in the prior art, and realizing the independent control of the container.

Description

Cluster-based container control method and system
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a cluster-based container control method and system.
Background
In the existing cluster technology, control operation on a container cannot be realized, that is, if a remote service is required to control process operation in the container in the running process of the container, a resource scheduling unit needs to be restarted or rebuilt, so as to control the process in the container. The restarting or rebuilding process of the resource scheduling unit is complex, multi-step operations such as scheduling, mounting, container initialization and the like are needed, failure risks are easy to occur, and the time consumption of the whole process is long.
Disclosure of Invention
The present disclosure provides a cluster-based container control method and system, which are used to solve the defect that in the prior art, a container can only be controlled by controlling a resource scheduling unit, and to implement independent control of the container.
The present disclosure provides a cluster-based container control method, where the cluster includes a management server and at least one container, each container includes an execution server, and the management server and the execution server are in communication connection, and the method is applied to the execution servers, and the method includes:
receiving a container control instruction sent by the management server;
acquiring a compressed file included in the container control instruction;
and controlling a container corresponding to the execution server to execute the operation corresponding to the compressed file.
According to a cluster-based container control method provided by the present disclosure,
the obtaining of the compressed file included in the container control instruction includes:
analyzing the container control instruction to obtain the compressed file;
after the compressed file included in the container control instruction is obtained, the method further includes:
and decompressing the compressed file to obtain an executable file, wherein the executable file is a file capable of controlling the container to complete the operation corresponding to the container control instruction.
According to a cluster-based container control method provided by the present disclosure,
the container control instructions include: an instruction control type, the instruction control type comprising: script file type and binary file type;
the controlling and executing the container corresponding to the server side to execute the operation corresponding to the compressed file comprises the following steps:
determining an instruction control type corresponding to the executable file;
when the instruction control type corresponding to the executable file is the script file type, executing the executable file based on a script file execution strategy, and controlling a container corresponding to an execution server to execute the operation corresponding to the executable file;
and when the instruction control type corresponding to the executable file is the binary file type, executing the executable file based on a binary file execution strategy, and controlling a container corresponding to the execution server to execute the operation corresponding to the executable file.
According to the container control method based on the cluster, the method further comprises the following steps:
receiving a service updating instruction sent by the management server, wherein the service updating instruction carries service updating content;
and executing an updating operation based on the service updating content.
According to the cluster-based container control method provided by the disclosure, each container further comprises a monitoring service, and the monitoring service is used for controlling the execution server to recover to normal when the execution server is determined to be abnormal.
The present disclosure also provides a cluster-based container control method, where the cluster includes a management server and at least one container, each container includes an execution server, and the management server and the execution server are in communication connection, and the method is applied to the management server, and the method includes:
generating a container control instruction, wherein the container control instruction comprises a compressed file, and the compressed file is used for indicating a container corresponding to the execution server to execute corresponding operation;
and sending the container control instruction to an execution server corresponding to the container control instruction through a first communication interface.
According to the cluster-based container control method provided by the present disclosure, before generating the container control instruction, the method further includes:
acquiring a network identifier corresponding to a container needing to be provided with the execution server;
generating an installation instruction of an execution server;
and sending the installation instruction of the execution server to a container corresponding to the network identifier through a second communication interface.
According to the container control method based on the cluster, the method further comprises the following steps:
and sending a service updating instruction to at least one execution server, wherein the service updating instruction carries service updating content.
The present disclosure also provides a cluster-based container control system, the system comprising: the system comprises a management server and at least one container, wherein each container comprises an execution server, and the management server is in communication connection with the execution servers;
the management server is configured to generate a container control instruction, and send the container control instruction to an execution server corresponding to the container control instruction through a first communication interface, where the container control instruction includes a compressed file, and the compressed file is used to instruct a container corresponding to the execution server to execute a corresponding operation;
the execution server is used for receiving the container control instruction sent by the management server; acquiring the compressed file included in the container control instruction; and controlling a container corresponding to the execution server to execute the operation corresponding to the compressed file.
The present disclosure also provides a cluster-based container control apparatus, where the cluster includes a management server and at least one container, each container includes an execution server, and the management server is in communication connection with the execution server, and the apparatus includes:
the receiving module is used for receiving a container control instruction sent by the management server side;
the acquisition module is used for acquiring a compressed file included in the container control instruction;
and the control module is used for controlling the container corresponding to the execution server to execute the operation corresponding to the compressed file.
The present disclosure also provides a cluster-based container control apparatus, where the cluster includes a management server and at least one container, each container includes an execution server, and the management server is in communication connection with the execution server, and the apparatus includes:
the generating module is used for generating a container control instruction, wherein the container control instruction comprises a compressed file, and the compressed file is used for indicating a container corresponding to the execution server to execute corresponding operation;
and the sending module is used for sending the container generation instruction to an execution server corresponding to the container control instruction through a first communication interface.
The present disclosure also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor implements the steps of any of the above methods for executing a cluster-based container control method of a server, or the steps of the cluster-based container control method of a management server when executing the program.
The present disclosure also provides a non-transitory computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of any of the methods described above as applied to perform a server-side cluster-based container control method, or the steps of the methods applied to manage a server-side cluster-based container control method.
The cluster-based container control method and system provided by the present disclosure, the cluster includes: the management server side and the at least one container are arranged, each container comprises an execution server side, and the management server side is in communication connection with the execution server side; the execution server receives a container control instruction sent by the management server; acquiring a compressed file included in a container control instruction; the execution server controls the corresponding container to execute the operation corresponding to the compressed file, so that the control operation of the container by the remote service is realized, the defect that the container is controlled by controlling the resource scheduling unit in the prior art is overcome, the operation time is shortened, and the user experience is improved.
Drawings
In order to more clearly illustrate the technical solutions of the present disclosure or the prior art, the drawings needed for the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present disclosure, and other drawings can be obtained by those skilled in the art without creative efforts.
Fig. 1 is one of the flow diagrams of the cluster-based container control method applied to the execution server according to the present disclosure;
fig. 2 is a second flowchart of the cluster-based container control method applied to the execution server according to the present disclosure;
fig. 3 is a third schematic flowchart of a cluster-based container control method applied to an execution server according to the present disclosure;
FIG. 4 is a schematic flow chart diagram of a cluster-based container control method applied to a management server according to the present disclosure;
fig. 5 is a second flowchart of a cluster-based container control method applied to a management server according to the present disclosure;
FIG. 6 is one of the schematic structural diagrams of a cluster-based container control system provided by the present disclosure;
FIG. 7 is a second schematic structural diagram of a cluster-based container control system provided by the present disclosure;
FIG. 8 is one of the schematic structural diagrams of a cluster-based container control apparatus provided by the present disclosure;
fig. 9 is a second schematic structural diagram of a cluster-based container control apparatus provided in the present disclosure;
fig. 10 is a schematic structural diagram of an electronic device provided by the present disclosure.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present disclosure more clear, the technical solutions of the embodiments of the present disclosure will be described clearly and completely with reference to the drawings in the embodiments of the present disclosure, and it is obvious that the described embodiments are some, but not all, of the embodiments of the present disclosure. All other embodiments, which can be obtained by a person skilled in the art without making creative efforts based on the embodiments of the present disclosure, belong to the protection scope of the embodiments of the present disclosure.
A cluster-based container control method of an embodiment of the present disclosure is described below with reference to fig. 1-6.
Briefly introduce the following clusters: a cluster is organized by one or more nodes.
Briefly introduced k8s, k8s is for managing containerized applications on multiple hosts (nodes) in a cloud platform, and the goal of kubernets is to make deploying containerized applications simple and efficient and to provide a mechanism for application deployment, planning, updating, maintenance.
And the pod is a resource scheduling unit of k8s, namely a minimum scheduling unit and a resource unit, and is composed of one or more containers and runs on each node. A pod is a "logical host" in the context of a container, which may include one or more closely coupled applications, which may be on the same physical host or virtual machine.
The present disclosure can rapidly deploy an elastic search (ES cluster) through k8s, where the ES cluster is a distributed system of peer-to-peer (P2P). Of course, the cluster of the present disclosure may also be a redis, kafka, etc. service cluster deployed on k8 s.
The Elasticissearch is a search server and provides a full-text search engine with distributed multi-user capability; redis is an open-source in-memory data structure store that serves as a database, cache, and message broker for providing data structures such as strings, hashes, lists, collections, sorted collections of queries with ranges, bitmaps, geospatial indexes, and streams; kafka is a high-throughput distributed publish-subscribe messaging system that can handle all the action flow data of a consumer in a web site.
In the following, the cluster of the present disclosure will be described by taking an ES cluster as an example.
The embodiment of the disclosure provides a container control method based on a cluster applied to an execution server, wherein the cluster comprises the following steps: the method comprises the following steps that a management server and at least one container are used, each container comprises an execution server, and the management server is in communication connection with the execution server, and the specific implementation of the method is as shown in figure 1:
step 101, receiving a container control instruction sent by a management server.
The management server may be deployed in the k8s cluster in a pod manner, or deployed on other physical machines or virtual machines, that is, the deployment address of the management server has no strict requirement, as long as communication with the execution server deployed in the pod is ensured. The management server provides a plurality of Application Programming Interfaces (APIs) for executing the container control command issued by the server.
And the execution server waits for, analyzes and executes the container control instruction issued by the management server. The execution server also provides a plurality of APIs to receive the container control instruction sent by the management server.
The management server side and the execution server side are designed to be in a communication mode, and the API of the management server side and the API of the execution server side are used for sending and receiving the container control instruction, so that the method is convenient and quick, and the user experience is effectively improved.
Step 102, obtaining a compressed file included in the container control instruction.
The compressed files comprise tar packets, zip compressed packets and the like, and the compressed files are obtained by packaging the files through a packaging tool.
In a specific embodiment, a compressed file is obtained by identifying, verifying and analyzing a container control instruction, and after the compressed file is obtained, the compressed file is decompressed to obtain an executable file, where the executable file is a file capable of controlling a container to complete an operation corresponding to the container control instruction.
Wherein the executable file comprises a script file and a binary file.
Specifically, the management server sends a container control instruction to the execution server through the API interface.
And performing corresponding decompression operation according to the compression formats of different compressed files.
And 103, controlling the container corresponding to the execution server to execute the operation corresponding to the compressed file.
In one embodiment, the container control instructions comprise: the instruction control type comprises the following steps: script file type and binary file type.
The specific implementation of controlling the container corresponding to the execution server to execute the operation corresponding to the compressed file is shown in fig. 2:
step 201, determining the instruction control type corresponding to the executable file.
Specifically, the instruction control type and the executable file may be compressed into a compressed packet, and the executable file and the instruction control type are obtained when performing a decompression operation.
Specifically, the command control type may be recorded in an executable file, and the executable file in which the command control type is recorded is compressed, and when the decompression operation is performed, the executable file and the command control type recorded in the executable file are obtained.
Specifically, when receiving the container control instruction sent by the management server, the management server may also receive an instruction control type sent by the management server.
Specifically, after determining an instruction control type corresponding to the executable file, determining a file execution policy corresponding to the instruction control type, where the file execution policy includes: a script file analysis strategy and a binary file analysis strategy. The script file type corresponds to a script file analysis strategy, and the binary file type corresponds to a binary file analysis strategy.
Step 202, when the instruction control type corresponding to the executable file is the script file type, executing the executable file based on the script file execution policy, and controlling the container corresponding to the execution server to execute the operation corresponding to the executable file.
Specifically, when the instruction control type corresponding to the executable file is the script file type, the obtained executable file is the script file, and the script code of the script file is executed to control the container corresponding to the execution server to execute the operation corresponding to the script file.
The script file can be a shell file.
Step 203, when the instruction control type corresponding to the executable file is a binary file type, executing the executable file based on the binary file execution policy, and controlling a container corresponding to the execution server to execute an operation corresponding to the executable file.
Specifically, when the instruction control type corresponding to the executable file is a binary file type, the executable file is obtained as the binary file, and the program code of the binary file is executed to control the container corresponding to the execution server to execute the operation corresponding to the binary file.
The binary file may be a binary executable file generated by encoding the binary executable file with a plurality of programming languages.
According to the method and the device, the execution server analyzes the container control instruction to obtain the executable file carried by the container control instruction, so that the control of the container is realized, the universality and the adaptability are very strong, and the user experience can be effectively improved. In addition, the container mirror image in the container does not need to be modified, only the content of the executable file in the container control instruction needs to be modified, the user-defined control of the container can be realized, and the invasion to the mirror image in the container is very small. In addition, in the whole process that the management server controls the container through the execution server, other processes or services in the container can normally run, and the whole container control process is convenient, safe and efficient.
The following describes the processing flow of the execution server specifically with reference to fig. 3:
step 301, receiving a container control instruction sent by a management server.
Step 302, analyzing the tar packet in the container control command to obtain a command control type.
Step 303, determining whether the command control type is a script file type, if so, executing step 304, otherwise, executing step 305.
Step 304, a script file is obtained.
Step 305, a binary file is obtained.
Step 306, determining that the execution is finished, and clearing the script file.
Step 307, determining that the execution is finished, and clearing the binary file.
In a specific embodiment, a service updating instruction sent by a management server is received, and the service updating instruction carries service updating content; based on the service update content, an update operation is performed.
Wherein the service update content comprises: adding new functions, changing new functions, optimizing new functions, etc.
In a specific embodiment, each container further includes a monitoring service, and the monitoring service is configured to control the execution server to return to normal when it is determined that the execution server is abnormal.
Specifically, the monitoring service is provided for monitoring the state of the execution server in real time, and when the state of the execution server is determined to be an abnormal state, the execution server can be pulled up again, so that the problem that container control is affected due to the fact that the execution server is abnormal is solved, and user experience is improved.
Specifically, no commands, APIs, etc. are provided externally in k8s to control containers, i.e., the k8s user cannot directly control containers in the cluster pod through k8s, but indirectly control containers within the pod by means of controlling the pod. Based on k8s, in the process of controlling the container, operations such as pod reconstruction, storage mount, pod scheduling and the like need to be performed, the whole process is time-consuming and low in efficiency, and due to the fact that pod control operation is performed, the cluster is unstable, data loss is easy to occur, and further, the problem that data is unsafe is caused.
The container control method and the container control system are applicable to the execution server and the management server which are arranged in the business cluster in k8s, and direct control of the container is performed through communication between the management server and the execution server, so that the control efficiency of the container is improved.
The cluster-based container control method and system provided by the present disclosure, the cluster includes: the management server side and the at least one container are arranged, each container comprises an execution server side, and the management server side is in communication connection with the execution server side; the execution server receives a container control instruction sent by the management server; acquiring a compressed file included in a container control instruction; the execution server controls the corresponding container to execute the operation corresponding to the compressed file, so that the control operation of the container by the remote service is realized, the defect that the container is controlled by controlling the resource scheduling unit in the prior art is overcome, the operation time is shortened, and the user experience is improved.
The embodiment of the present disclosure further provides a container control method based on a cluster applied to a management server, where the cluster includes: the method comprises the following steps that a management server and at least one container are used, each container comprises an execution server, and the management server is in communication connection with the execution server, and the specific implementation of the method is as shown in fig. 4:
in step 401, a container control command is generated.
The container control instruction comprises a compressed file, and the compressed file is used for indicating the container corresponding to the execution server to execute corresponding operation.
In a specific embodiment, before a container control instruction is generated, a network identifier corresponding to a container needing to be installed and executed by a server is acquired; generating an installation instruction of an execution server; and sending the installation instruction of the execution server to a container corresponding to the network identifier through a second communication interface.
The network identifier is a network address in the communication protocol, and may be a unique identifier of the pod, for example.
In particular, the present disclosure may require installation of the executive service in only one container, or may require installation of the executive service in multiple containers. When the execution server is only required to be installed in one container, the container of the execution server to be installed is found through the network identification according to the communication protocol, and finally the execution server is installed in the container of the execution server to be installed.
Or when the container is started, the container automatically runs the pre-stored installation script of the execution server to finish the installation of the execution server.
Or, the container communicates with the management server to download the execution server, as shown in fig. 5:
step 501, the container sends a download request of the execution server to the management server.
Step 502, the management server sends the execution server installation application to the container.
And step 503, the container installs the application based on the execution server, and downloads and installs the execution server.
Step 504, the execution server waits to receive the container control command sent by the management server.
In addition, the execution server may also be copied to the corresponding container manually, for example, the execution server is copied to a physical computer, a virtual machine, or a storage medium, and then the execution server stored in the physical computer, the virtual machine, or the storage medium is copied to the corresponding container by using a shell command. The execution server stored in the physical computer, the virtual machine or the storage medium can be mapped into the container in a container mounting mode.
The present disclosure provides various methods for executing downloading and installation of a server, so that a user can select and use the server based on actual conditions, and user experience is effectively improved.
Step 402, sending the container control instruction to an execution server corresponding to the container control instruction through the first communication interface.
Specifically, the container Control instruction is sent to an execution server in the target container through a network identifier and a request port according to a communication Protocol, where the communication Protocol includes a hypertext Transfer Protocol (HTTP), a Transmission Control Protocol (TCP), and the like.
Furthermore, the executable file needs to be packaged, for example, a tar package, a zip package, etc., and then the packaged executable file is encapsulated into a container control instruction, and the container control instruction carrying the executable file is sent to the execution server corresponding to the network identifier.
In a specific embodiment, the management server sends a service update instruction to at least one execution server, where the service update instruction carries service update content.
Specifically, according to the communication protocol, the service update instruction is sent to the execution server in the target container through the network identifier and the request port.
The service update instruction may only need to be sent to one execution server, or may need to be sent to multiple execution servers, and the processing may be performed based on actual conditions.
The cluster-based container control method and system provided by the present disclosure, the cluster includes: the management server side and the at least one container are arranged, each container comprises an execution server side, and the management server side is in communication connection with the execution server side; the management server generates a container control instruction and sends the container control instruction to the execution server corresponding to the container control instruction through the first communication interface, so that the execution server executes the operation corresponding to the container control instruction, the control operation of the remote service on the container is realized, the defect that the container is controlled through controlling a resource scheduling unit in the prior art is overcome, the operation time is shortened, and the user experience is improved.
The embodiment of the present disclosure further provides a cluster-based container control system, and a specific implementation of the system may refer to the description of the cluster-based container control method, where the description is omitted, and specifically as shown in fig. 6, the system includes: and at least one container 602, each container 602 comprises an execution server 603, and the management server 601 and the execution server 603 are in communication connection;
the management server 601 is configured to generate a container control instruction, and send the container control instruction to the execution server 603 corresponding to the container control instruction through the first communication interface, where the container control instruction includes a compressed file, and the compressed file is used to instruct a container corresponding to the execution server to execute a corresponding operation;
the execution server 603 is configured to receive a container control instruction sent by the management server 601; acquiring a compressed file included in a container control instruction; the container corresponding to the execution server 603 is controlled to execute the operation corresponding to the compressed file.
In a specific embodiment, the execution server 603 is specifically configured to parse the container control instruction to obtain a compressed file; and analyzing the compressed file to obtain an executable file, wherein the executable file is a file capable of controlling the container to complete the operation corresponding to the container control instruction.
In one embodiment, the container control instructions comprise: the instruction control type comprises the following steps: script file type and binary file type; the execution server 603 is specifically configured to determine an instruction control type corresponding to the executable file; when the instruction control type corresponding to the executable file is the script file type, executing the executable file based on the script file execution strategy, and controlling a container corresponding to the execution server to execute the operation corresponding to the executable file; and when the instruction control type corresponding to the executable file is a binary file type, executing the executable file based on the binary file execution strategy, and controlling the container corresponding to the execution server to execute the operation corresponding to the executable file.
In a specific embodiment, the execution server 603 is further configured to receive a service update instruction sent by the management server, where the service update instruction carries service update content; based on the service update content, an update operation is performed.
In a specific embodiment, each container further includes a monitoring service, and the monitoring service is configured to control the execution server to return to normal when it is determined that the execution server is abnormal.
In a specific embodiment, the management server 601 is further configured to obtain a network identifier corresponding to a container in which the execution server needs to be installed; generating an installation instruction of an execution server; and sending the installation instruction of the execution server to a container corresponding to the network identifier through a second communication interface.
In a specific embodiment, the management server 601 is further configured to send a service update instruction to at least one execution server, where the service update instruction carries service update content.
The structure of the cluster-based container control system can be understood with reference to fig. 7.
The system comprises: a management server 601, containers 602, each container 602 including an execution server 603, and the containers 602 running in the pod 701. In fig. 7, 3 pods 701 are illustrated, and each pod701 includes one container 602, which is only an example and does not limit the scope of protection.
The cluster-based container control system provided by the present disclosure utilizes the communication between the management server 601 and the execution server 603 to realize the control of the management server 601 on the container; the management server 601 sends a container control instruction to the execution server 603, and the execution server 603 receives the container control instruction sent by the management server 601; the execution server 603 controls the corresponding container to execute the operation corresponding to the container control instruction, so that the control operation of the management server 601 on the container is realized, the defect that the container is indirectly controlled by controlling the pod701 in the prior art is overcome, the operation time is shortened, and the user experience is improved.
The following description of the cluster-based container control device, the above-described cluster-based container control method, and the above-described cluster-based container control system may be referred to in correspondence, and details are not repeated, and specifically, as shown in fig. 8, the cluster-based container control device includes:
a receiving module 801, configured to receive a container control instruction sent by a management server;
an obtaining module 802, configured to obtain a compressed file included in the container control instruction;
and the control module 803 is configured to control the container corresponding to the execution server to execute the operation corresponding to the compressed file.
The following description of the cluster-based container control device, the above-described cluster-based container control method, and the above-described cluster-based container control system may be referred to in correspondence, and details are not repeated, and specifically, as shown in fig. 9, the cluster-based container control device includes:
a generating module 901, configured to generate a container control instruction, where the container control instruction includes a compressed file, and the compressed file is used to instruct a container corresponding to an execution server to execute a corresponding operation;
a sending module 902, configured to send the container generation instruction to an execution server corresponding to the container control instruction through the first communication interface.
Fig. 10 illustrates a physical structure diagram of an electronic device, and as shown in fig. 10, the electronic device may include: a processor (processor)1001, a communication Interface (communication Interface)1002, a memory (memory)1003 and a communication bus 1004, wherein the processor 1001, the communication Interface 1002 and the memory 1003 complete communication with each other through the communication bus 1004. The processor 1001 may call logic instructions in the memory 1003 to execute a cluster-based container control method applied to an execution server, where a cluster includes a management server and at least one container, each container includes the execution server, and the management server and the execution server are communicatively connected, and the method includes: receiving a container control instruction sent by a management server; acquiring a compressed file included in a container control instruction; the method comprises the following steps of controlling a container corresponding to an execution server to execute an operation corresponding to a compressed file, or executing a container control method based on a cluster applied to a management server, wherein the cluster comprises the management server and at least one container, each container comprises the execution server, and the management server is in communication connection with the execution server, and the method comprises the following steps: generating a container control instruction, wherein the container control instruction comprises a compressed file, and the compressed file is used for indicating a container corresponding to the execution server to execute corresponding operation; and sending the container control instruction to an execution server corresponding to the container control instruction through the first communication interface.
In addition, the logic instructions in the memory 1003 may be implemented in the form of software functional units and may be stored in a computer readable storage medium when the logic instructions are sold or used as independent products. Based on such understanding, the technical solutions of the embodiments of the present disclosure may be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the methods described in the embodiments of the present disclosure. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
In another aspect, the present disclosure also provides a computer program product including a computer program stored on a non-transitory computer readable storage medium, the computer program including program instructions, when the program instructions are executed by a computer, the computer being capable of executing a cluster-based container control method applied to an execution server, where a cluster includes a management server and at least one container, each container includes the execution server, and the management server and the execution server are in communication connection, the method including: receiving a container control instruction sent by a management server; acquiring a compressed file included in a container control instruction; the method comprises the following steps of controlling a container corresponding to an execution server to execute an operation corresponding to a compressed file, or executing a container control method based on a cluster applied to a management server, wherein the cluster comprises the management server and at least one container, each container comprises the execution server, and the management server is in communication connection with the execution server, and the method comprises the following steps: generating a container control instruction, wherein the container control instruction comprises a compressed file, and the compressed file is used for indicating a container corresponding to the execution server to execute corresponding operation; and sending the container control instruction to an execution server corresponding to the container control instruction through the first communication interface.
In yet another aspect, the present disclosure also provides a non-transitory computer readable storage medium, on which a computer program is stored, the computer program being implemented by a processor to execute the above-mentioned cluster-based container control method applied to an execution server, where a cluster includes a management server and at least one container, each container includes the execution server, the management server and the execution server are in communication connection, and the method includes: receiving a container control instruction sent by a management server; acquiring a compressed file included in a container control instruction; the method comprises the following steps of controlling a container corresponding to an execution server to execute an operation corresponding to a compressed file order, or executing a container control method based on a cluster applied to a management server, wherein the cluster comprises the management server and at least one container, each container comprises the execution server, and the management server is in communication connection with the execution server, and the method comprises the following steps: generating a container control instruction, wherein the container control instruction comprises a compressed file, and the compressed file is used for indicating a container corresponding to the execution server to execute corresponding operation; and sending the container control instruction to an execution server corresponding to the container control instruction through the first communication interface.
The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware. With this understanding in mind, the above-described technical solutions may be embodied in the form of a software product, which can be stored in a computer-readable storage medium such as ROM/RAM, magnetic disk, optical disk, etc., and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the methods described in the embodiments or some parts of the embodiments.
Finally, it should be noted that: the above examples are only intended to illustrate the technical solutions of the present disclosure, not to limit them; although the present disclosure has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present disclosure.

Claims (14)

1. A cluster-based container control method is characterized in that a cluster comprises a management server and at least one container, each container comprises an execution server, the management server is in communication connection with the execution server, the method is applied to the execution servers, and the method comprises the following steps:
receiving a container control instruction sent by the management server;
acquiring a compressed file included in the container control instruction;
and controlling a container corresponding to the execution server to execute the operation corresponding to the compressed file.
2. The cluster-based container control method according to claim 1, wherein the obtaining of the compressed file included in the container control instruction comprises:
analyzing the container control instruction to obtain the compressed file;
after the compressed file included in the container control instruction is obtained, the method further includes:
and decompressing the compressed file to obtain an executable file, wherein the executable file is a file capable of controlling the container to complete the operation corresponding to the container control instruction.
3. The cluster-based container control method of claim 2, wherein the container control instructions comprise: an instruction control type, the instruction control type comprising: script file type and binary file type;
the controlling and executing the container corresponding to the server side to execute the operation corresponding to the compressed file comprises the following steps:
determining an instruction control type corresponding to the executable file;
when the instruction control type corresponding to the executable file is the script file type, executing the executable file based on a script file execution strategy, and controlling a container corresponding to an execution server to execute the operation corresponding to the executable file;
and when the instruction control type corresponding to the executable file is the binary file type, executing the executable file based on a binary file execution strategy, and controlling a container corresponding to the execution server to execute the operation corresponding to the executable file.
4. The cluster-based container control method according to any one of claims 1-3, wherein the method further comprises:
receiving a service updating instruction sent by the management server, wherein the service updating instruction carries service updating content;
and executing an updating operation based on the service updating content.
5. The cluster-based container control method according to any one of claims 1 to 3, wherein each of the containers further comprises a monitoring service, and the monitoring service is configured to control the execution server to return to normal when it is determined that the execution server is abnormal.
6. A cluster-based container control method is characterized in that a cluster comprises a management server and at least one container, each container comprises an execution server, the management server is in communication connection with the execution server, and the method is applied to the management server and comprises the following steps:
generating a container control instruction, wherein the container control instruction comprises a compressed file, and the compressed file is used for indicating a container corresponding to the execution server to execute corresponding operation;
and sending the container control instruction to an execution server corresponding to the container control instruction through a first communication interface.
7. The cluster-based container control method of claim 6, wherein before generating the container control instruction, further comprising:
acquiring a network identifier corresponding to a container needing to be provided with the execution server;
generating an installation instruction of an execution server;
and sending the installation instruction of the execution server to a container corresponding to the network identifier through a second communication interface.
8. The cluster-based container control method according to claim 6 or 7, wherein the method further comprises:
and sending a service updating instruction to at least one execution server, wherein the service updating instruction carries service updating content.
9. A cluster-based container control system, the system comprising: the system comprises a management server and at least one container, wherein each container comprises an execution server, and the management server is in communication connection with the execution servers;
the management server is configured to generate a container control instruction, and send the container control instruction to an execution server corresponding to the container control instruction through a first communication interface, where the container control instruction includes a compressed file, and the compressed file is used to instruct a container corresponding to the execution server to execute a corresponding operation;
the execution server is used for receiving the container control instruction sent by the management server; acquiring the compressed file included in the container control instruction; and controlling a container corresponding to the execution server to execute the operation corresponding to the compressed file.
10. A cluster-based container control apparatus, wherein the cluster includes a management server and at least one container, each container includes an execution server, and the management server and the execution server are communicatively connected, the apparatus comprising:
the receiving module is used for receiving a container control instruction sent by the management server side;
the acquisition module is used for acquiring a compressed file included in the container control instruction;
and the control module is used for controlling the container corresponding to the execution server to execute the operation corresponding to the compressed file.
11. A cluster-based container control apparatus, wherein the cluster includes a management server and at least one container, each container includes an execution server, and the management server and the execution server are communicatively connected, the apparatus comprising:
the generating module is used for generating a container control instruction, wherein the container control instruction comprises a compressed file, and the compressed file is used for indicating a container corresponding to the execution server to execute corresponding operation;
and the sending module is used for sending the container generation instruction to an execution server corresponding to the container control instruction through a first communication interface.
12. An electronic device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of any one of claims 1 to 5 applied to a cluster-based container control method of an executive server, or implements the steps of the cluster-based container control method of any one of claims 6 to 8 applied to a management server when executing the program.
13. A non-transitory computer readable storage medium, on which a computer program is stored, which, when being executed by a processor, implements the steps of any one of claims 1 to 5 applied to a cluster-based container control method of an executive server, or implements the steps of any one of claims 6 to 8 applied to a cluster-based container control method of a management server.
14. A computer program product comprising a computer program, wherein the computer program, when being executed by a processor, performs the steps of any one of claims 1 to 5 applied to an execution server's cluster-based container control method, or performs the steps of any one of claims 6 to 8 applied to a management server's cluster-based container control method.
CN202210152236.1A 2022-02-18 Container control method and system based on cluster Active CN114531443B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210152236.1A CN114531443B (en) 2022-02-18 Container control method and system based on cluster

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210152236.1A CN114531443B (en) 2022-02-18 Container control method and system based on cluster

Publications (2)

Publication Number Publication Date
CN114531443A true CN114531443A (en) 2022-05-24
CN114531443B CN114531443B (en) 2024-05-17

Family

ID=

Citations (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104219329A (en) * 2014-09-28 2014-12-17 浪潮软件集团有限公司 Method for deploying service through content distribution in cluster server
WO2018003020A1 (en) * 2016-06-28 2018-01-04 日本電気株式会社 Control device, container starting method, and program
CN110119308A (en) * 2018-02-07 2019-08-13 北京第一视角科技有限公司 The system for managing extensive container application
CN110995473A (en) * 2019-11-18 2020-04-10 腾讯科技(深圳)有限公司 Service node control method and related equipment
CN111290768A (en) * 2020-01-22 2020-06-16 北京百度网讯科技有限公司 Updating method, device, equipment and medium for containerization application system
DE102019133923A1 (en) * 2018-12-14 2020-06-18 Hewlett Packard Enterprise Development Lp APPLICATION USE IN A CONTAINER MANAGEMENT SYSTEM
CN111935323A (en) * 2020-10-12 2020-11-13 江苏润和软件股份有限公司 Remote LXC container application dynamic management system and method
CN112433818A (en) * 2020-11-30 2021-03-02 上海天旦网络科技发展有限公司 Method and system for persisting kubernets
CN112905197A (en) * 2020-11-23 2021-06-04 京东数字科技控股股份有限公司 Information processing method, device and system, electronic equipment and storage medium
WO2021141543A1 (en) * 2020-01-09 2021-07-15 Envision Digital International Pte. Ltd. Method and apparatus for authority control, computer device and storage medium
CN113364727A (en) * 2020-03-05 2021-09-07 北京金山云网络技术有限公司 Container cluster system, container console and server
CN113407310A (en) * 2021-07-09 2021-09-17 科东(广州)软件科技有限公司 Container management method, device, equipment and storage medium
US20210390172A1 (en) * 2020-06-15 2021-12-16 Electronics And Telecommunications Research Institute Apparatus and method for generating system call whitelist of application container and method for controlling system call of application container

Patent Citations (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104219329A (en) * 2014-09-28 2014-12-17 浪潮软件集团有限公司 Method for deploying service through content distribution in cluster server
WO2018003020A1 (en) * 2016-06-28 2018-01-04 日本電気株式会社 Control device, container starting method, and program
CN110119308A (en) * 2018-02-07 2019-08-13 北京第一视角科技有限公司 The system for managing extensive container application
DE102019133923A1 (en) * 2018-12-14 2020-06-18 Hewlett Packard Enterprise Development Lp APPLICATION USE IN A CONTAINER MANAGEMENT SYSTEM
CN110995473A (en) * 2019-11-18 2020-04-10 腾讯科技(深圳)有限公司 Service node control method and related equipment
WO2021141543A1 (en) * 2020-01-09 2021-07-15 Envision Digital International Pte. Ltd. Method and apparatus for authority control, computer device and storage medium
CN111290768A (en) * 2020-01-22 2020-06-16 北京百度网讯科技有限公司 Updating method, device, equipment and medium for containerization application system
CN113364727A (en) * 2020-03-05 2021-09-07 北京金山云网络技术有限公司 Container cluster system, container console and server
US20210390172A1 (en) * 2020-06-15 2021-12-16 Electronics And Telecommunications Research Institute Apparatus and method for generating system call whitelist of application container and method for controlling system call of application container
CN111935323A (en) * 2020-10-12 2020-11-13 江苏润和软件股份有限公司 Remote LXC container application dynamic management system and method
CN112905197A (en) * 2020-11-23 2021-06-04 京东数字科技控股股份有限公司 Information processing method, device and system, electronic equipment and storage medium
CN112433818A (en) * 2020-11-30 2021-03-02 上海天旦网络科技发展有限公司 Method and system for persisting kubernets
CN113407310A (en) * 2021-07-09 2021-09-17 科东(广州)软件科技有限公司 Container management method, device, equipment and storage medium

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
杨忠;: "面向Docker容器的动态负载集群伸缩研究", 舰船电子工程, no. 08, 20 August 2018 (2018-08-20) *
陆志刚等: "应用感知的容器资源调度优化方法", 《计算机应用系统》, vol. 26, no. 3, 31 March 2017 (2017-03-31) *

Similar Documents

Publication Publication Date Title
US11650807B2 (en) Self-healing learning system for one or more controllers
CN109525624B (en) Container login method and device and storage medium
US20220197953A1 (en) Model pushing method and device, model requesting method and device, storage medium and electronic device
CN108170448B (en) System for automatically and efficiently releasing software update version
US7124289B1 (en) Automated provisioning framework for internet site servers
CN111061491B (en) LXC container technology-based edge computing gateway management system and method
US9003389B2 (en) Generating an encoded package profile based on executing host processes
CN102945175A (en) Terminal software online upgrading system and method based on cloud computing environment
CN113742031B (en) Node state information acquisition method and device, electronic equipment and readable storage medium
CN107911467B (en) Service operation management system and method for scripted operation
CN112860282B (en) Cluster plug-in upgrading method, device and server
CN110865840B (en) Application management method, device, server and storage medium
CN112698838A (en) Multi-cloud container deployment system and container deployment method thereof
CN115248692A (en) Device and method for supporting cloud deployment of multiple deep learning framework models
CN111400041A (en) Server configuration file management method and device and computer readable storage medium
CN112579289B (en) Distributed analysis engine method and device capable of being intelligently scheduled
CN112925648B (en) Business strategy issuing method and device
CN112565416B (en) Cloud-native-based large-scale edge android equipment nanotube system and nanotube method thereof
CN109766131A (en) The system and method for the intelligent automatic upgrading of software is realized based on multithreading
CN114531443B (en) Container control method and system based on cluster
CN114531443A (en) Cluster-based container control method and system
CN113746676B (en) Network card management method, device, equipment, medium and product based on container cluster
CN114879977A (en) Application deployment method, device and storage medium
CN110795113B (en) Redis cluster service installation method, server and medium
CN114840243A (en) Operating system upgrading system of distributed edge node

Legal Events

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