CN111399974B - Resource management method and device and electronic equipment - Google Patents

Resource management method and device and electronic equipment Download PDF

Info

Publication number
CN111399974B
CN111399974B CN201910234090.3A CN201910234090A CN111399974B CN 111399974 B CN111399974 B CN 111399974B CN 201910234090 A CN201910234090 A CN 201910234090A CN 111399974 B CN111399974 B CN 111399974B
Authority
CN
China
Prior art keywords
parameters
container
operating system
docker
docker container
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
CN201910234090.3A
Other languages
Chinese (zh)
Other versions
CN111399974A (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.)
Shenzhen Honghe Innovation Information Technology Co Ltd
Original Assignee
Shenzhen Honghe Innovation 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 Shenzhen Honghe Innovation Information Technology Co Ltd filed Critical Shenzhen Honghe Innovation Information Technology Co Ltd
Priority to CN201910234090.3A priority Critical patent/CN111399974B/en
Publication of CN111399974A publication Critical patent/CN111399974A/en
Application granted granted Critical
Publication of CN111399974B publication Critical patent/CN111399974B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44505Configuring for program initiating, e.g. using registry, configuration files
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/4557Distribution of virtual machine instances; Migration and load balancing

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

The invention discloses a resource management method and device, and electronic equipment, comprising the following steps: receiving an operation instruction sent by a control container to an operating system and/or a Docker container; determining a corresponding control command according to the operation command; and executing the corresponding control command on the operating system and/or the Docker container. The control container is a Docker container for managing the operating system and all Docker containers installed on the operating system. The method and the device can uniformly manage the operating system and all deployed Docker containers, save resources and are convenient to manage.

Description

Resource management method and device and electronic equipment
Technical Field
The present invention relates to the field of micro-services, and in particular, to a resource management method and apparatus, and an electronic device.
Background
Dock is an open-source application container engine that developers can package applications and rely on packages into a portable container and then issue onto the Linux system. The micro-service architecture is realized based on the Docker container, each service is packaged into the Docker container, the resources and interfaces of each container are isolated, and the application program can be constructed, maintained, released and deployed through the container. At present, the management of each Docker container and the management of the Linux system generally realize the scheduling and control by using a special management tool respectively, and cannot be uniformly managed.
Disclosure of Invention
Accordingly, the present invention aims to provide a resource management method and apparatus, and an electronic device, which can implement unified management of a Docker container and an operating system.
Based on the above object, the present invention provides a resource management method, including:
Receiving an operation instruction sent by a control container to an operating system and/or a Docker container;
Determining a corresponding control command according to the operation command;
And executing the corresponding control command on the operating system and/or the Docker container.
Optionally, the control container is a Docker container for managing the operating system and all Docker containers installed on the operating system.
Optionally, the operating instructions to the operating system include operating parameters corresponding to system security, system configuration, system monitoring, or planning tasks.
Optionally, the operation instruction to the Docker container includes an operation parameter corresponding to configuration information, a container state, a container monitoring or a container file.
Optionally, determining a shell script corresponding to the operation parameter according to the operation instruction, and executing the shell script; or determining a data read/write command corresponding to the operation parameter according to the operation command, and executing the data read/write command.
Optionally, the operation parameters of the system security include a firewall configuration parameter and a security log parameter, the operation parameters of the system configuration include a time parameter, a network address parameter, a hard disk parameter and a data import/export parameter, the operation parameters of the system monitoring include a resource usage condition checking and a device basic information checking, and the operation parameters of the planning task include a task parameter, an adding/removing task, a database parameter, a log parameter, an on/off time parameter and a WebSSH terminal parameter.
Optionally, the operation parameters of the configuration information include a target Docker container parameter, the operation parameters of the container state include a target Docker container parameter and a state parameter, the operation parameters of the container monitoring include viewing resource usage, and the operation parameters of the container file include file parameters for updating the target Docker container.
The embodiment of the invention provides a resource management device, which comprises:
The instruction receiving module is used for receiving an operation instruction which is sent by the control container and is used for operating the operating system and/or the Docker container;
The command determining module is used for determining a corresponding control command according to the operation command;
And the execution module is used for executing the corresponding control command on the operating system and/or the Docker container.
Optionally, the control container is a Docker container for managing the operating system and all Docker containers installed on the operating system.
Optionally, the operating instructions to the operating system include operating parameters corresponding to system security, system configuration, system monitoring, or planning tasks.
Optionally, the operation instruction to the Docker container includes an operation parameter corresponding to configuration information, a container state, a container monitoring or a container file.
Optionally, determining a shell script corresponding to the operation parameter according to the operation instruction, and executing the shell script; or determining a data read/write command corresponding to the operation parameter according to the operation command, and executing the data read/write command.
Optionally, the operation parameters of the system security include a firewall configuration parameter and a security log parameter, the operation parameters of the system configuration include a time parameter, a network address parameter, a hard disk parameter and a data import/export parameter, the operation parameters of the system monitoring include a resource usage condition checking and a device basic information checking, and the operation parameters of the planning task include a task parameter, an adding/removing task, a database parameter, a log parameter, an on/off time parameter and a WebSSH terminal parameter.
Optionally, the operation parameters of the configuration information include a target Docker container parameter, the operation parameters of the container state include a target Docker container parameter and a state parameter, the operation parameters of the container monitoring include viewing resource usage, and the operation parameters of the container file include file parameters for updating the target Docker container.
The embodiment of the invention provides an electronic device, which comprises a memory, a processor and a computer program stored on the memory and capable of running on the processor, wherein the processor realizes the resource management method when executing the program.
From the above, it can be seen that, according to the resource management method and device and the electronic device provided by the invention, the control container sends the operation instruction to the operating system and/or the Docker container to the resource management device, the resource management device receives the operation instruction, determines the corresponding control command according to the operation instruction, and executes the corresponding control command to the operating system and/or the Docker container. According to the method and the device, the control management of the operating system, the equipment for installing the operating system and the Docker container deployed on the equipment can be realized, the management tool for managing the operating system and the management tool for managing the Docker container are not required to be installed, resources are saved, the cost is reduced, and unified management is facilitated.
Drawings
In order to more clearly illustrate the embodiments of the invention or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described, it being obvious that the drawings in the following description are only some embodiments of the invention, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a schematic flow chart of a method according to an embodiment of the invention;
FIG. 2 is a block diagram of an apparatus according to an embodiment of the present invention;
fig. 3 is a schematic diagram of an architecture of an embodiment of the present invention.
Detailed Description
The present invention will be further described in detail below with reference to specific embodiments and with reference to the accompanying drawings, in order to make the objects, technical solutions and advantages of the present invention more apparent.
It should be noted that, in the embodiments of the present invention, all the expressions "first" and "second" are used to distinguish two entities with the same name but different entities or different parameters, and it is noted that the "first" and "second" are only used for convenience of expression, and should not be construed as limiting the embodiments of the present invention, and the following embodiments are not described one by one.
The resource management method provided by the embodiment of the invention is used for uniformly managing the operating system and each Docker container running on the operating system, and comprises the following steps:
Receiving an operation instruction sent by a control container to an operating system and/or a Docker container;
determining a corresponding control command according to the operation command;
Corresponding control commands are executed on the operating system and/or the Docker container.
According to the resource management method provided by the embodiment of the invention, the control container and the resource management device can be used for uniformly managing the operating system and each Docker container installed on the operating system. The control container sends an operation instruction to the operating system and/or the Docker containers to the resource management device, the resource management device receives the operation instruction, determines corresponding control commands according to the operation instruction, and executes the corresponding control commands to the operating system and/or each Docker container so as to realize management of all Docker containers installed on the operating system and the operating system.
Fig. 1 is a flow chart of a method according to an embodiment of the present invention, and fig. 3 is a schematic diagram of an architecture according to an embodiment of the present invention. As shown in the figure, the resource management method provided by the embodiment of the invention includes:
s10: receiving an operation instruction sent by a control container to an operating system and/or a Docker container;
In the embodiment of the invention, the control container is a Docker container for managing the operating system and all Docker containers installed on the operating system.
The control container may manage the operating system's system security, system configuration, system monitoring, planning tasks, and the like. The system security management comprises firewall configuration management, security log management and the like, wherein the system configuration management comprises time setting, network address configuration, hard disk configuration, data import and export and the like, and the system monitoring management comprises resource use condition monitoring, equipment basic information monitoring and the like; scheduled task management includes adding/removing tasks, database backup, log management, on/off, webSSH terminal control, etc.
In particular, the control container may manage the system security of the operating system. Configuring a firewall of an operating system by sending an operation instruction comprising firewall configuration parameters (comprising one or more of firewall opening, closing, restarting and releasing port numbers) to a resource management device; the security log of the operating system is managed by sending an operation instruction including security log parameters (including one or more of view, purge, backup, and partition) to the resource management device.
The control container may manage the system configuration of the operating system. Setting the time of an operating system by sending an operating instruction comprising a time parameter to a resource management device; configuring a network address of an operating system by transmitting an operation instruction including a network address parameter (IP address, port number, etc.) to a resource management device; configuring hard disk resources of an operating system by sending operation instructions comprising hard disk parameters (including hard disk mounting/dismounting, hard disk file sharing paths and the like) to a resource management device; an import/export operation is performed on the specific data by transmitting an operation instruction including a specific data name, a path where the specific data is located, and an import/export destination path to the resource management device.
The control container may manage system monitoring of the operating system. The method comprises the steps that an operation instruction for checking the use condition of resources is sent to a resource management device, and the use condition of the resources such as CPU occupancy rate, memory occupancy rate, disk use rate, network throughput and the like of an operating system is checked and monitored; the basic configuration information of the device is checked by sending an operation instruction for checking the basic information of the device to the resource management device, wherein the basic configuration information comprises operating system information, a CPU model and a manufacturer, a mainboard model and a manufacturer, memory information (the number, the size and the manufacturer of memory banks), hard disk information (capacity, disk positions and manufacturers), network card information (the number, the manufacturer and the model), system time, power supply information (power supply option information) and the like.
The control container may manage the scheduled tasks of the operating system. The method comprises the steps that system tasks of an operating system are configured by sending operation instructions comprising task parameters and adding/removing tasks to a resource management device, wherein the tasks comprise tasks such as data backup task timing, startup/shutdown/restarting timing and the like; the method comprises the steps of carrying out backup management on a database by sending an operation instruction comprising database parameters to a resource management device; the method comprises the steps of managing logs of an operating system by sending operation instructions comprising log parameters and log operation parameters to a resource management device, wherein the log checking, backup, clearing, segmentation and the like are performed on the logs; setting the on/off time of the operating system by transmitting an operation instruction including an on/off time parameter to the resource management device; and starting or closing WebSSH the terminal by sending an operation instruction comprising WebSSH terminal parameters to the resource management device block, and controlling an operation system through the Web page.
The control container may manage configuration information, container status, container monitoring, container files, etc. of all Docker containers installed on the operating system. The configuration information management comprises the deployment of the Docker containers and container management, wherein the container management comprises the unified management of naming, grouping, checking and the like of all deployed Docker containers; container state management includes the opening/closing/restarting of at least one Docker container; the container monitoring management comprises resource use condition monitoring; container file management includes container file updates.
In particular, the control container may manage configuration information of the Docker container. And carrying out configuration management on the target Docker container by sending an operation instruction comprising the target Docker container parameters to a resource management device, wherein the configuration management comprises the unified management of the naming, grouping and the like of the target Docker container by deploying the target Docker container.
The control container may manage the container state of the Docker container. The state control (on/off/restart, etc.) is performed on the target Docker container by sending an operation instruction including the target Docker container parameter, the state parameter to the resource management device.
The control container may manage container monitoring of the Docker container. And the resource management device is used for checking and monitoring the CPU occupancy rate, the memory occupancy rate, the disk utilization rate, the network throughput and other resource utilization conditions of the Docker container by sending an operation instruction for checking the resource utilization condition.
The control container may manage container files of the Docker container. And synchronously updating the file of the Docker container by sending an operation instruction comprising the file parameters to the resource management device. Specifically, when the Docker container is deployed, the files which need to be updated when the Docker container runs are mounted inside and outside the container (stored on the device) respectively, when the Docker container needs to be updated, the files outside the device are updated, the Docker container is restarted, and after the restart, the update of the files inside the Docker container is realized, namely the update of the Docker container is realized.
S11: determining a corresponding control command according to the operation command;
In the embodiment of the invention, the resource management device receives the operation instruction sent by the control container, and determines the corresponding control command according to the operation instruction. Specifically, the resource management device invokes the corresponding shell script according to the operation instruction, executes the corresponding control command by executing the shell script command, or reads/writes data from/to the device where the operating system is located according to the operation instruction, where the data reading/writing operation is implemented through a network protocol (such as HTTP protocol).
Specifically, for system security management of an operating system, a resource management device receives an operation instruction including firewall configuration parameters, invokes a shell script for firewall configuration, and configures a firewall of the operating system according to the firewall configuration parameters (firewall opening, closing, restarting, etc., release ports); the resource management device receives an operation instruction comprising the security log parameters, invokes a shell script for checking the security log, and checks, backs up, clears and the like the security log of the operation system according to the security log parameters.
For system configuration management of an operating system, a resource management device receives an operating instruction comprising a time parameter, invokes a shell script for setting time, and sets the time of the operating system according to the time parameter; the resource management device receives an operation instruction comprising network address parameters, invokes a shell script for configuring the network address, and configures the network address of the operating system according to the network address parameters; the resource management device receives an operation instruction comprising hard disk parameters and hard disk mounting/dismounting, invokes a shell script for configuring the hard disk, executes hard disk mounting/dismounting configuration on the hard disk corresponding to the hard disk parameters, starts an xfs file system, configures a mounted hard disk directory into the xfs file system, and then provides a hard disk access address; the resource management device receives an operation instruction comprising a specific data name, a path where the specific data is located and an import/export target path, executes corresponding import/export operation on the specific data under the path where the specific data is located according to the import/export target path, for example exports log data under the target path, and imports configuration data into a target Docker container.
For system monitoring management of an operating system, a resource management device receives an operation instruction for checking the use condition of resources, invokes a shell script for acquiring the use condition of the resources, and acquires and checks the use condition of the resources such as CPU occupancy rate, memory occupancy rate, disk use rate, network throughput and the like of the operating system; the resource management device receives an operation instruction of basic information of the equipment, and checks basic configuration information of the equipment, wherein the basic configuration information comprises operating system information, CPU model and manufacturer, mainboard model and manufacturer, memory information (number, size and manufacturer of memory strips), hard disk information (capacity, disk position and manufacturer), network card information (number, manufacturer and model), system time, power supply information (power supply option information) and the like.
For the planning task management of an operating system, a resource management device receives an operation instruction comprising task parameters and adding/withdrawing tasks, invokes a shell script for configuring the planning tasks, and configures the tasks corresponding to the task parameters according to the adding/withdrawing task instruction; the resource management device receives an operation instruction comprising database parameters, invokes a shell script for backing up the database, and backs up the database corresponding to the database parameters; the resource management device receives an operation instruction comprising log parameters, and manages the logs corresponding to the log parameters, including log backup, cleaning, segmentation, classification display (classified display according to the safety logs of the equipment and the running logs of the Docker container) and the like; the resource management device receives an operation instruction comprising an on/off time parameter, invokes a shell script for setting the on/off time, and sets the on/off time of the operating system according to the on/off time parameter; the resource management device receives an operation instruction comprising WebSSH terminal parameters and controls WebSSH terminals of the operation system.
For the configuration information management of the Docker container, the resource management device receives an operation instruction comprising the parameters of the target Docker container, invokes a shell script for deploying the Docker container, deploys the target Docker container according to the parameters of the target Docker container, and performs unified management such as naming, grouping and the like on the deployed Docker container.
For container state management of a Docker container, a resource management device receives an operation instruction comprising a target Docker container parameter and a state parameter, invokes a shell script for configuring the Docker container state, and performs state control on a target Docker container corresponding to the target Docker container parameter according to the state parameter (on/off/restart).
For container monitoring management of the Docker container, the resource management device receives an operation instruction for checking the use condition of the resource, invokes a shell script for acquiring the use condition of the resource, acquires and checks the use condition of the resource such as CPU occupancy rate, memory occupancy rate, disk use rate, network throughput and the like of the Docker container.
And managing the container file of the Docker container, receiving an operation instruction comprising file parameters by the resource management device, and synchronously updating the file of the Docker container. Specifically, when the Docker container is deployed, the files which need to be updated when the Docker container runs are mounted inside and outside the container (stored on the device) respectively, when the Docker container needs to be updated, the files outside the device are updated, the Docker container is restarted, and after the restart, the update of the files inside the Docker container is realized, namely the update of the Docker container is realized.
S12: corresponding control commands are executed on the operating system and/or the Docker container.
In the embodiment of the invention, corresponding shell scripts are executed for the operating system and/or the Docker container according to the determined control command, or data reading/writing operation is executed, so that the configuration, monitoring and scheduling management of the operating system and the Docker container are realized.
The control container and the resource management device, and the resource management device and the Docker containers can realize data communication based on the HTTP protocol.
Fig. 2 is a block diagram of a device according to an embodiment of the present invention. As shown in fig. 2 and 3, the resource management device provided by the embodiment of the present invention includes:
The instruction receiving module is used for receiving an operation instruction which is sent by the control container and is used for operating the operating system and/or the Docker container;
the command determining module is used for determining a corresponding control command according to the operation command;
And the execution module is used for executing corresponding control commands on the operating system and/or the Docker container.
In the embodiment of the invention, the control container is a Docker container for managing the operating system and all Docker containers installed on the operating system.
The control container may manage the operating system's system security, system configuration, system monitoring, planning tasks, and the like. The system security management comprises firewall configuration management, security log management and the like, wherein the system configuration management comprises time setting, network address configuration, hard disk configuration, data import and export and the like, and the system monitoring management comprises resource use condition monitoring, equipment basic information monitoring and the like; scheduled task management includes adding/removing tasks, database backup, log management, on/off, webSSH terminal control, etc.
In particular, the control container may manage the system security of the operating system. Configuring a firewall of an operating system by sending an operation instruction comprising firewall configuration parameters (comprising one or more of firewall opening, closing, restarting and releasing port numbers) to a resource management device; the security log of the operating system is managed by sending an operation instruction including security log parameters (including one or more of view, purge, backup, and partition) to the resource management device.
The control container may manage the system configuration of the operating system. Setting the time of an operating system by sending an operating instruction comprising a time parameter to a resource management device; configuring a network address of an operating system by transmitting an operation instruction including a network address parameter (IP address, port number, etc.) to a resource management device; configuring hard disk resources of an operating system by sending operation instructions comprising hard disk parameters (including hard disk mounting/dismounting, hard disk file sharing paths and the like) to a resource management device; an import/export operation is performed on the specific data by transmitting an operation instruction including a specific data name, a path where the specific data is located, and an import/export destination path to the resource management device.
The control container may manage system monitoring of the operating system. The method comprises the steps that an operation instruction for checking the use condition of resources is sent to a resource management device, and the use condition of the resources such as CPU occupancy rate, memory occupancy rate, disk use rate, network throughput and the like of an operating system is checked and monitored; the basic configuration information of the device is checked by sending an operation instruction for checking the basic information of the device to the resource management device, wherein the basic configuration information comprises operating system information, a CPU model and a manufacturer, a mainboard model and a manufacturer, memory information (the number, the size and the manufacturer of memory banks), hard disk information (capacity, disk positions and manufacturers), network card information (the number, the manufacturer and the model), system time, power supply information (power supply option information) and the like.
The control container may manage the scheduled tasks of the operating system. The method comprises the steps that system tasks of an operating system are configured by sending operation instructions comprising task parameters and adding/removing tasks to a resource management device, wherein the tasks comprise tasks such as data backup task timing, startup/shutdown/restarting timing and the like; the method comprises the steps of carrying out backup management on a database by sending an operation instruction comprising database parameters to a resource management device; the method comprises the steps of managing logs of an operating system by sending operation instructions comprising log parameters and log operation parameters to a resource management device, wherein the log checking, backup, clearing, segmentation and the like are performed on the logs; setting the on/off time of the operating system by transmitting an operation instruction including an on/off time parameter to the resource management device; and starting or closing WebSSH the terminal by sending an operation instruction comprising WebSSH terminal parameters to the resource management device block, and controlling an operation system through the Web page.
The control container may manage configuration information, container status, container monitoring, container files, etc. of all Docker containers installed on the operating system. The configuration information management comprises the deployment of the Docker containers and container management, wherein the container management comprises the unified management of naming, grouping, checking and the like of all deployed Docker containers; container state management includes the opening/closing/restarting of at least one Docker container; the container monitoring management comprises resource use condition monitoring; container file management includes container file updates.
In particular, the control container may manage configuration information of the Docker container. And carrying out configuration management on the target Docker container by sending an operation instruction comprising the target Docker container parameters to a resource management device, wherein the configuration management comprises the unified management of the naming, grouping and the like of the target Docker container by deploying the target Docker container.
The control container may manage the container state of the Docker container. The state control (on/off/restart, etc.) is performed on the target Docker container by sending an operation instruction including the target Docker container parameter, the state parameter to the resource management device.
The control container may manage container monitoring of the Docker container. And the resource management device is used for checking and monitoring the CPU occupancy rate, the memory occupancy rate, the disk utilization rate, the network throughput and other resource utilization conditions of the Docker container by sending an operation instruction for checking the resource utilization condition.
The control container may manage container files of the Docker container. And synchronously updating the file of the Docker container by sending an operation instruction comprising the file parameters to the resource management device. Specifically, when the Docker container is deployed, the files which need to be updated when the Docker container runs are mounted inside and outside the container (stored on the device) respectively, when the Docker container needs to be updated, the files outside the device are updated, the Docker container is restarted, and after the restart, the update of the files inside the Docker container is realized, namely the update of the Docker container is realized.
In the embodiment of the invention, the instruction receiving module receives the operation instruction sent by the control container, and the instruction determining module determines the corresponding control instruction according to the operation instruction. Specifically, the command determining module invokes the corresponding shell script according to the operation command, and the executing module executes the corresponding control command by executing the shell script command, or reads/writes data from/to the device where the operating system is located according to the operation command, where the data reading/writing operation is implemented through a network protocol (such as HTTP protocol).
Specifically, for system security management of an operating system, an instruction receiving module receives an operation instruction including firewall configuration parameters, a command determining module invokes a shell script for firewall configuration, and an executing module executes the shell script command to configure a firewall of the operating system according to the firewall configuration parameters (firewall opening, closing, restarting, etc., release ports); the command receiving module receives an operation command comprising the security log parameters, the command determining module invokes a shell script for checking the security log, the executing module executes the shell script command, and the operations of checking, backing up, clearing and the like are carried out on the security log of the operation system according to the security log parameters.
For system configuration management of an operating system, an instruction receiving module receives an operating instruction comprising a time parameter, a command determining module invokes a shell script for setting time, an executing module executes the shell script command, and the time of the operating system is set according to the time parameter; the instruction receiving module receives an operation instruction comprising network address parameters, the command determining module invokes a shell script for configuring a network address, the executing module executes the shell script command, and the network address of the operating system is configured according to the network address parameters; the instruction receiving module receives an operation instruction comprising hard disk parameters and hard disk mounting/dismounting, the command determining module invokes a shell script for configuring the hard disk, the executing module executes the shell script command, the hard disk mounting/dismounting configuration is executed on the hard disk corresponding to the hard disk parameters, an xfs file system is started, the mounted hard disk catalog is configured in the xfs file system, and then a hard disk access address is provided; the instruction receiving module receives an operation instruction comprising a specific data name, a path where the specific data is located and an import/export target path, and the executing module executes corresponding import/export operation on the specific data under the path where the specific data is located according to the import/export target path, for example, exports log data under the target path, and imports configuration data into a target Docker container.
For system monitoring management of an operating system, an instruction receiving module receives an operation instruction for checking the use condition of resources, a command determining module invokes a shell script for acquiring the use condition of the resources, and an executing module executes the shell script command to acquire and check the use condition of the resources such as CPU occupancy rate, memory occupancy rate, disk use rate, network throughput and the like; the command receiving module receives an operation command of basic information of the equipment, the executing module executes a shell script command for checking the basic information of the equipment, and checks basic configuration information of the equipment, wherein the basic configuration information of the equipment comprises operating system information, CPU model and manufacturer, main board model and manufacturer, memory information (memory bank number, size and manufacturer), hard disk information (capacity, disk position and manufacturer), network card information (number, manufacturer and model), system time, power supply information (power supply option information) and the like.
For the planning task management of an operating system, an instruction receiving module receives an operation instruction comprising task parameters and adding/withdrawing tasks, a command determining module invokes shell scripts for configuring the planning tasks, an executing module executes shell script commands, and the tasks corresponding to the task parameters are configured according to the adding/withdrawing task instructions; the command receiving module receives an operation command comprising database parameters, the command determining module invokes shell scripts for backing up the database, and the executing module executes shell script commands to back up the database corresponding to the database parameters; the command receiving module receives an operation command comprising log parameters, the command determining module invokes a shell script for executing log operation, and the executing module manages the log corresponding to the log parameters according to the shell script command, including log backup, clearing, segmentation, classification display (classified display according to the safety log of equipment and the running log of a Docker container) and the like; the command receiving module receives an operation command comprising an on/off time parameter, the command determining module invokes a shell script for setting the on/off time, the executing module executes the shell script command, and the on/off time of the operating system is set according to the on/off time parameter; the instruction receiving module receives an operation instruction comprising WebSSH terminal parameters, and the execution module controls a WebSSH terminal of the operation system according to WebSSH terminal parameters.
For the configuration information management of the Docker container, the instruction receiving module receives an operation instruction comprising the parameters of the target Docker container, the command determining module invokes a shell script for deploying the Docker container, the executing module deploys the target Docker container according to the parameters of the target Docker container, and unified management such as naming, grouping and the like is carried out on the deployed Docker container.
For container state management of a Docker container, an instruction receiving module receives an operation instruction comprising a target Docker container parameter and a state parameter, a command determining module invokes a shell script for configuring the Docker container state, and an executing module performs state control on the target Docker container corresponding to the target Docker container parameter according to the state parameter (on/off/restart).
For container monitoring management of the Docker container, the instruction receiving module receives an operation instruction for checking the use condition of the resource, the command determining module invokes a shell script for acquiring the use condition of the resource, and the executing module executes the shell script command to acquire and check the use condition of the resource such as CPU occupancy rate, memory occupancy rate, disk use rate, network throughput and the like of the Docker container.
And managing the container file of the Docker container, receiving an operation instruction comprising file parameters by an instruction receiving module, and synchronously updating the file of the Docker container by an executing module according to the file parameters. Specifically, when the Docker container is deployed, the files which need to be updated when the Docker container runs are mounted inside and outside the container (stored on the device) respectively, when the Docker container needs to be updated, the files outside the device are updated, the Docker container is restarted, and after the restart, the update of the files inside the Docker container is realized, namely the update of the Docker container is realized.
The resource management method and the device provided by the embodiment of the invention can realize the unified configuration, dispatch and other control management of the operating system, the equipment for installing the operating system and the Docker container deployed on the equipment by controlling the container and the resource management device, and do not need to be respectively provided with a management tool for managing the operating system and a management tool for managing the Docker container, thereby saving resources, reducing cost and being convenient for unified management.
Based on the above object, the embodiment of the present invention further provides an embodiment of an apparatus for a resource management method. The device comprises:
One or more processors and memory.
The apparatus for performing the resource management method may further include: input means and output means.
The processor, memory, input devices, and output devices may be connected by a bus or other means.
The memory is used as a non-volatile computer readable storage medium for storing non-volatile software programs, non-volatile computer executable programs and modules, such as program instructions/modules corresponding to the resource management method in the embodiments of the present invention. The processor executes various functional applications of the server and data processing by running non-volatile software programs, instructions and modules stored in the memory, i.e. implements the resource management method of the above-described method embodiments.
The memory may include a memory program area and a memory data area, wherein the memory program area may store an operating system, at least one application program required for a function; the storage data area may store data created according to the use of a device performing the resource management method, etc. In addition, the memory may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid-state storage device. In some embodiments, the memory optionally includes memory remotely located with respect to the processor, the remote memory being connectable to the membership user action monitoring device through a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The input device may receive input numeric or character information and generate key signal inputs related to user settings and function control of the device performing the resource management method. The output means may comprise a display device such as a display screen.
The one or more modules are stored in the memory that, when executed by the one or more processors, perform the resource management method of any of the method embodiments described above. The technical effects of the embodiment of the device for executing the resource management method are the same as or similar to those of any of the method embodiments.
The embodiment of the invention also provides a non-transitory computer storage medium, which stores computer executable instructions that can execute the method for processing the list item operation in any of the method embodiments. Embodiments of the non-transitory computer storage medium have technical effects identical or similar to any of the method embodiments described above.
Finally, it should be noted that, as will be appreciated by those skilled in the art, all or part of the procedures in implementing the methods of the embodiments described above may be implemented by a computer program for instructing relevant hardware, where the program may be stored in a computer readable storage medium, and the program may include the procedures of the embodiments of the methods described above when executed. The storage medium may be a magnetic disk, an optical disk, a Read-Only Memory (ROM), a random-access Memory (Random Access Memory, RAM), or the like. The technical effects of the computer program embodiments are the same as or similar to any of the method embodiments described above.
In addition, typically, the devices, apparatuses and the like described in the present disclosure may be various electronic terminal apparatuses, such as mobile phones, personal Digital Assistants (PDAs), tablet computers (PADs), smart televisions, and the like, and may also be large-sized terminal apparatuses, such as servers, and the like, so the protection scope of the present disclosure should not be limited to a specific type of device, apparatus, and the like. The client described in the present disclosure may be applied to any of the above electronic terminal devices in the form of electronic hardware, computer software, or a combination of both.
Furthermore, the method according to the present disclosure may also be implemented as a computer program executed by a CPU, which may be stored in a computer-readable storage medium. The above-described functions defined in the methods of the present disclosure are performed when the computer program is executed by a CPU.
Furthermore, the above-described method steps and system units may also be implemented using a controller and a computer-readable storage medium storing a computer program for causing the controller to implement the above-described steps or unit functions.
Further, it should be appreciated that the computer-readable storage medium (e.g., memory) described herein can be either volatile memory or nonvolatile memory, or can include both volatile and nonvolatile memory. By way of example, and not limitation, nonvolatile memory can include Read Only Memory (ROM), programmable ROM (PROM), electrically Programmable ROM (EPROM), electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM), which acts as external cache memory. By way of example and not limitation, RAM may be available in a variety of forms such as synchronous RAM (DRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous Link DRAM (SLDRAM), and direct RambusRAM (DRRAM). The storage devices of the disclosed aspects are intended to comprise, without being limited to, these and other suitable types of memory.
The device of the foregoing embodiment is configured to implement the corresponding method in the foregoing embodiment, and has the beneficial effects of the corresponding method embodiment, which is not described herein.
Those of ordinary skill in the art will appreciate that: the discussion of any of the embodiments above is merely exemplary and is not intended to suggest that the scope of the disclosure, including the claims, is limited to these examples; the technical features of the above embodiments or in the different embodiments may also be combined within the idea of the invention, the steps may be implemented in any order and there are many other variations of the different aspects of the invention as described above, which are not provided in detail for the sake of brevity.
Additionally, well-known power/ground connections to Integrated Circuit (IC) chips and other components may or may not be shown within the provided figures, in order to simplify the illustration and discussion, and so as not to obscure the invention. Furthermore, the devices may be shown in block diagram form in order to avoid obscuring the invention, and also in view of the fact that specifics with respect to implementation of such block diagram devices are highly dependent upon the platform within which the present invention is to be implemented (i.e., such specifics should be well within purview of one skilled in the art). Where specific details (e.g., circuits) are set forth in order to describe example embodiments of the invention, it should be apparent to one skilled in the art that the invention can be practiced without, or with variation of, these specific details. Accordingly, the description is to be regarded as illustrative in nature and not as restrictive.
While the invention has been described in conjunction with specific embodiments thereof, many alternatives, modifications, and variations of those embodiments will be apparent to those skilled in the art in light of the foregoing description. For example, other memory architectures (e.g., dynamic RAM (DRAM)) may use the embodiments discussed.
The embodiments of the invention are intended to embrace all such alternatives, modifications and variances which fall within the broad scope of the appended claims. Therefore, any omission, modification, equivalent replacement, improvement, etc. of the present invention should be included in the scope of the present invention.

Claims (13)

1. The resource management method is characterized by being applied to a resource management device, wherein the resource management device is respectively in communication connection with a control container, a managed operating system and all Docker containers installed on the operating system; the control container is a Docker container for managing the operating system and all Docker containers installed on the operating system; the method comprises the following steps:
Receiving an operation instruction sent by a control container to an operating system and/or a Docker container;
Determining a corresponding control command according to the operation command;
executing the corresponding control command on the operating system and/or the Docker container; the executing the corresponding control command on the operating system and/or the Docker container includes:
and executing corresponding shell scripts or read/write data operations on the operating system and/or the Docker container according to the determined control command so as to perform configuration, monitoring and scheduling management on the operating system and/or the Docker container.
2. The method of claim 1, wherein the operating instructions to the operating system comprise operating parameters corresponding to system security, system configuration, system monitoring, or planning tasks.
3. The method of claim 1, wherein the operating instructions to the Docker container comprise operating parameters corresponding to configuration information, container status, container monitoring, or container files.
4. A method according to claim 2 or 3, wherein a shell script corresponding to the operation parameter is determined according to the operation instruction, and the shell script is executed; or determining a data read/write command corresponding to the operation parameter according to the operation command, and executing the data read/write command.
5. The method of claim 2, wherein the system-safe operating parameters include firewall configuration parameters and security log parameters, the system-configured operating parameters include time parameters, network address parameters, hard disk parameters, and data import/export parameters, the system-monitored operating parameters include viewing resource usage and viewing device base information, and the scheduled task operating parameters include task parameters and add/drop tasks, database parameters, log parameters, on/off time parameters, webSSH terminal parameters.
6. A method according to claim 3, wherein the operation parameters of the configuration information include a target Docker container parameter, the operation parameters of the container state include a target Docker container parameter and a state parameter, the operation parameters of the container monitoring include viewing resource usage, and the operation parameters of the container file include file parameters for updating the target Docker container.
7. A resource management device, characterized in that the resource management device is respectively in communication connection with a control container, a managed operating system and all Docker containers installed on the operating system; the control container is a Docker container for managing the operating system and all Docker containers installed on the operating system; the device comprises:
The instruction receiving module is used for receiving an operation instruction which is sent by the control container and is used for operating the operating system and/or the Docker container;
The command determining module is used for determining a corresponding control command according to the operation command;
The execution module is used for executing the corresponding control command on the operating system and/or the Docker container; the executing the corresponding control command on the operating system and/or the Docker container includes:
and executing corresponding shell scripts or read/write data operations on the operating system and/or the Docker container according to the determined control command so as to perform configuration, monitoring and scheduling management on the operating system and/or the Docker container.
8. The apparatus of claim 7, wherein the operating instructions to the operating system comprise operating parameters corresponding to system security, system configuration, system monitoring, or planning tasks.
9. The apparatus of claim 7, wherein the operating instructions for the Docker container comprise operating parameters corresponding to configuration information, container status, container monitoring, or container files.
10. The apparatus of claim 7, wherein a shell script corresponding to an operation parameter is determined according to the operation instruction, and the shell script is executed; or determining a data read/write command corresponding to the operation parameter according to the operation command, and executing the data read/write command.
11. The apparatus of claim 8, wherein the system-safe operating parameters include firewall configuration parameters and security log parameters, the system-configured operating parameters include time parameters, network address parameters, hard disk parameters, and data import/export parameters, the system-monitored operating parameters include viewing resource usage and viewing device base information, and the scheduled task operating parameters include task parameters and add/drop tasks, database parameters, log parameters, on/off time parameters, webSSH terminal parameters.
12. The apparatus of claim 9, wherein the operational parameters of the configuration information include a target Docker container parameter, the operational parameters of the container state include a target Docker container parameter and a state parameter, the operational parameters of the container monitoring include viewing resource usage, and the operational parameters of the container file include file parameters for updating the target Docker container.
13. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the method of any one of claims 1 to 6 when the program is executed by the processor.
CN201910234090.3A 2019-03-26 2019-03-26 Resource management method and device and electronic equipment Active CN111399974B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910234090.3A CN111399974B (en) 2019-03-26 2019-03-26 Resource management method and device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910234090.3A CN111399974B (en) 2019-03-26 2019-03-26 Resource management method and device and electronic equipment

Publications (2)

Publication Number Publication Date
CN111399974A CN111399974A (en) 2020-07-10
CN111399974B true CN111399974B (en) 2024-05-28

Family

ID=71430243

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910234090.3A Active CN111399974B (en) 2019-03-26 2019-03-26 Resource management method and device and electronic equipment

Country Status (1)

Country Link
CN (1) CN111399974B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115499322B (en) * 2022-11-14 2023-03-24 网络通信与安全紫金山实验室 Management system and method of mimicry equipment cluster and electronic equipment

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103885833A (en) * 2012-12-20 2014-06-25 中国移动通信集团公司 Method and system for managing resources
CN104951360A (en) * 2015-06-30 2015-09-30 北京奇虎科技有限公司 Configuration management mode and device based on Docker
CN104991815A (en) * 2015-06-19 2015-10-21 北京奇虎科技有限公司 Docker container management method and system
CN107704257A (en) * 2017-10-18 2018-02-16 福建星网智慧软件有限公司 A kind of method and device of distributed server centralized management
CN108009001A (en) * 2017-11-10 2018-05-08 中国电力科学研究院有限公司 A kind of power grid GIS and management method based on Docker containerization management
CN108090345A (en) * 2016-11-21 2018-05-29 腾讯科技(深圳)有限公司 Linux system external command performs method and device
CN108205461A (en) * 2016-12-19 2018-06-26 华耀(中国)科技有限公司 The virtual platform and dispositions method of a kind of mixed deployment
WO2018224243A1 (en) * 2017-06-08 2018-12-13 British Telecommunications Public Limited Company Containerised programming

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103885833A (en) * 2012-12-20 2014-06-25 中国移动通信集团公司 Method and system for managing resources
CN104991815A (en) * 2015-06-19 2015-10-21 北京奇虎科技有限公司 Docker container management method and system
CN104951360A (en) * 2015-06-30 2015-09-30 北京奇虎科技有限公司 Configuration management mode and device based on Docker
CN108090345A (en) * 2016-11-21 2018-05-29 腾讯科技(深圳)有限公司 Linux system external command performs method and device
CN108205461A (en) * 2016-12-19 2018-06-26 华耀(中国)科技有限公司 The virtual platform and dispositions method of a kind of mixed deployment
WO2018224243A1 (en) * 2017-06-08 2018-12-13 British Telecommunications Public Limited Company Containerised programming
CN107704257A (en) * 2017-10-18 2018-02-16 福建星网智慧软件有限公司 A kind of method and device of distributed server centralized management
CN108009001A (en) * 2017-11-10 2018-05-08 中国电力科学研究院有限公司 A kind of power grid GIS and management method based on Docker containerization management

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
基于Docker的应用资源池技术研究;马永;王萍;管建超;;电力信息与通信技术(08);53-56 *

Also Published As

Publication number Publication date
CN111399974A (en) 2020-07-10

Similar Documents

Publication Publication Date Title
CN111651178A (en) Container configuration updating method and device, computer equipment and storage medium
CN107526605B (en) Method and device for realizing application program loading service assembly
US9473356B2 (en) Automatic configuration of applications based on host metadata using application-specific templates
CN109739744B (en) Test system and method
CN109587331B (en) Method and system for automatically repairing cloud mobile phone fault
US10404568B2 (en) Agent manager for distributed transaction monitoring system
CN111698283B (en) Management and control method, device, equipment and storage medium of distributed cluster host
CN104754032A (en) Method and device for deploying OpenStack
CN110377314B (en) System upgrading method, device, equipment and medium for distributed storage system
CN111835571A (en) Intelligent network card initialization method and device, computer equipment and storage medium
CN103455346A (en) Application program deployment method, deployment main control computer, deployment client side and cluster
CN112860282A (en) Upgrading method and device of cluster plug-in and server
CN111399974B (en) Resource management method and device and electronic equipment
US9912454B2 (en) Systems and methods for efficient file transfer in a boot mode of a basic input/output system
CN112363731A (en) Application automation deployment method and device and computer readable storage medium
CN107526584B (en) Data access method and device
CN101616430B (en) Management method of gateway software version and home gateway
Sudharsan et al. Ota-tinyml: over the air deployment of tinyml models and execution on iot devices
CN114546588A (en) Task deployment method and device, storage medium and electronic device
CN105224453A (en) The automatic test approach of system compatibility and device
CN107995033B (en) ONU configuration file upgrading method and device
WO2014056350A1 (en) Base station and maintenance method therefor
CN111045616A (en) Time-consuming printing method, time-consuming printing device, time-consuming printing equipment and storage medium
CN104348646A (en) Configuration data processing method, device and system
CN100386726C (en) Method and system for renewing long-distance operation and control of computer platform system programe

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