CN109582487B - Method and apparatus for transmitting information - Google Patents

Method and apparatus for transmitting information Download PDF

Info

Publication number
CN109582487B
CN109582487B CN201811453902.5A CN201811453902A CN109582487B CN 109582487 B CN109582487 B CN 109582487B CN 201811453902 A CN201811453902 A CN 201811453902A CN 109582487 B CN109582487 B CN 109582487B
Authority
CN
China
Prior art keywords
container
address
file system
information
equipment
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
CN201811453902.5A
Other languages
Chinese (zh)
Other versions
CN109582487A (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.)
Beijing Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and 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 Beijing Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN201811453902.5A priority Critical patent/CN109582487B/en
Publication of CN109582487A publication Critical patent/CN109582487A/en
Application granted granted Critical
Publication of CN109582487B publication Critical patent/CN109582487B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/0703Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation
    • G06F11/0766Error or fault reporting or storing
    • G06F11/0787Storage of error reports, e.g. persistent data storage, storage using memory protection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1415Saving, restoring, recovering or retrying at system level
    • G06F11/1435Saving, restoring, recovering or retrying at system level using file system or storage system metadata

Landscapes

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

Abstract

The embodiment of the application discloses a method and a device for sending information. One embodiment of the method comprises: acquiring container information of a container in a running stop state, wherein the container information comprises a container identity; determining whether the container information exists in a historical container information list or not according to the container identity; in response to determining that the container does not exist, determining the address of the file system corresponding to the container indicated by the container identity, and determining a backup address of the file system; controlling a target server to store files in the file system to a storage space corresponding to the backup address; and sending the backup address to the client side of the communication connection. The embodiment is beneficial to operation and maintenance personnel of a container user to accurately check the reason of the abnormal container instance.

Description

Method and apparatus for transmitting information
Technical Field
The embodiment of the application relates to the technical field of computers, in particular to a method and a device for sending information.
Background
In the related art, the life cycle of a container running on a target server is managed by a control server. And after the container instance running in the container is abnormal, the control server controls the target server to delete the container. This affects the troubleshooting of the abnormal cause of the container instance by the operation and maintenance personnel on the container user side.
Disclosure of Invention
The embodiment of the application provides a method and a device for sending information.
In a first aspect, an embodiment of the present application provides a method for sending information, where the method includes: acquiring container information of a container in a running stop state, wherein the container information comprises a container identity; determining whether the container information exists in a historical container information list or not according to the container identity; in response to determining that the container does not exist, determining the address of the file system corresponding to the container indicated by the container identity, and determining a backup address of the file system; controlling a target server to store files in the file system to a storage space corresponding to the backup address; and sending the backup address to the client side of the communication connection.
In some embodiments, the method further comprises: the container information is added to the historical container information list.
In some embodiments, the method further comprises: and controlling the target server to delete the file in response to determining that the storage time of the file in the storage space exceeds a preset storage time threshold.
In some embodiments, before determining the address of the file system corresponding to the container indicated by the container identifier, the method further comprises: determining a storage driving mode of the container according to the container identity, wherein the storage driving mode is one of the following modes: the device maps the storage drive and the other unites the file system storage drive.
In some embodiments, the storage drive manner is a device mapping storage drive; determining the address of the file system corresponding to the container indicated by the container identity, and determining the backup address of the file system, including: finding the equipment meta-information of the virtual equipment corresponding to the container according to the container identity, wherein the equipment meta-information comprises the equipment size and the equipment identity; generating and executing an instruction for controlling the virtual equipment to run according to the equipment size and the equipment identity; according to the equipment identity identification, the equipment address of the virtual equipment is searched in the operating equipment address list, and the equipment address is determined as the address of the file system; and the device address is loaded to a preset address to generate a backup address.
In some embodiments, the storage drive is another federated file system storage drive; determining the address of the file system corresponding to the container indicated by the container identity, and determining the backup address of the file system, including: according to the container identity, finding out the read-write layer identity of the read-write layer corresponding to the container; determining the address of the file system according to the read-write layer identity; and determining the address of the preset backup file system as a backup address.
In a second aspect, an embodiment of the present application provides an apparatus for transmitting information, where the apparatus includes: an information acquisition unit configured to acquire container information of a container in a stopped state, the container information including a container identification; the information comparison unit is configured to determine whether the container information exists in the historical container information list according to the container identity; an address determination unit configured to determine, in response to determining that the address does not exist, an address of a file system corresponding to the container indicated by the container identification, and determine a backup address of the file system; the file backup unit is configured to control the target server to store the files in the file system to a storage space corresponding to the backup address; an address sending unit configured to send the backup address to a client of the communication connection.
In some embodiments, the apparatus further comprises: an information adding unit configured to add the container information to the history container information list.
In some embodiments, the apparatus further comprises: and the file deleting unit is configured to control the target server to delete the file in response to the fact that the storage time of the file in the storage space exceeds a preset storage time threshold.
In some embodiments, the apparatus further comprises: a drive determining unit configured to determine a storage drive mode of the container according to the container identity, wherein the storage drive mode is one of: the device maps the storage drive and the other unites the file system storage drive.
In some embodiments, the address determination unit is further configured to: finding the equipment meta-information of the virtual equipment corresponding to the container according to the container identity, wherein the equipment meta-information comprises the equipment size and the equipment identity; generating and executing an instruction for controlling the virtual equipment to run according to the equipment size and the equipment identity; according to the equipment identity identification, the equipment address of the virtual equipment is searched in the operating equipment address list, and the equipment address is determined as the address of the file system; and the device address is loaded to a preset address to generate a backup address.
In some embodiments, the address determination unit is further configured to: according to the container identity, finding out the read-write layer identity of the read-write layer corresponding to the container; determining the address of the file system according to the read-write layer identity; and determining the address of the preset backup file system as a backup address.
In a third aspect, an embodiment of the present application provides a server, including: one or more processors; a storage device having one or more programs stored thereon which, when executed by one or more processors, cause the one or more processors to implement a method as in any embodiment of a method for transmitting information.
In a fourth aspect, embodiments of the present application provide a computer-readable storage medium on which a computer program is stored, which, when executed by a processor, implements a method as in any one of the embodiments of the method for transmitting information.
The method and the device for sending the information can acquire the container information of the container in the stop operation state. Wherein the container information includes a container identification. Secondly, whether the container information exists in the historical container information list or not is determined according to the container identity. Then, in response to determining that the container does not exist, an address of a file system corresponding to the container indicated by the container identification is determined, and a backup address of the file system is determined. And then, controlling the target server to store the file in the file system to a storage space corresponding to the backup address. And finally, sending the backup address to the client side of the communication connection. According to the method and the device, because the file in the file system records the operation process of the container instance, the file in the file system is stored in the storage space corresponding to the backup address, the file in the operation process of the container instance can be backed up, and the operation and maintenance personnel of a container user can accurately check the reason for the abnormality of the container instance.
Drawings
Other features, objects and advantages of the present application will become more apparent upon reading of the following detailed description of non-limiting embodiments thereof, made with reference to the accompanying drawings in which:
FIG. 1 is an exemplary system architecture diagram in which one embodiment of the present application may be applied;
FIG. 2 is a flow diagram of one embodiment of a method for transmitting information according to the present application;
FIG. 3 is a schematic diagram of an application scenario of a method for transmitting information according to an embodiment of the present application;
FIG. 4 is a flow diagram of yet another embodiment of a method for transmitting information according to the present application;
FIG. 5 is a schematic block diagram illustrating one embodiment of an apparatus for transmitting information in accordance with the present application;
FIG. 6 is a schematic block diagram of a computer system suitable for use in implementing a server according to embodiments of the present application.
Detailed Description
The present application will be described in further detail with reference to the following drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the relevant invention and not restrictive of the invention. It should be noted that, for convenience of description, only the portions related to the related invention are shown in the drawings.
It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict. The present application will be described in detail below with reference to the embodiments with reference to the attached drawings.
Fig. 1 illustrates an exemplary system architecture 100 to which a method for transmitting information or an apparatus for transmitting information of an embodiment of the present application may be applied.
As shown in fig. 1, the system architecture 100 may include a client 101, a control server 102, a target server 103, and networks 104, 105. The networks 104, 105 serve to provide a medium of communication links between the client 101, the control server 102 and the target server 103. The networks 104, 105 may include various connection types, such as wired, wireless communication links, or fiber optic cables, among others.
The client 101 may interact with the control server 102 via the network 104 to receive information or to send information, etc. Various applications, such as a browsing-type application, a searching-type application, a failure analysis-type application, etc., may be installed on the client.
The client 101 may be hardware or software. When the client 101 is hardware, it may be various electronic devices having a display screen and supporting user information input, including but not limited to tablet computers, laptop portable computers, desktop computers, and the like. When the client 101 is software, it can be installed in the electronic devices listed above. It may be implemented as multiple pieces of software or software modules (e.g., to provide distributed services) or as a single piece of software or software module. And is not particularly limited herein.
The control server 102 may interact with the client 101 and the target server 103 via networks 104, 105 to receive or transmit information and the like. The control server 102 may be a server that provides various services. For example, the backup address is sent to the control server of the client. The control server 102 may determine whether the container information exists in the historical container information list according to the container identity when the container information of the container in the stopped operation state is acquired; in response to determining that the container does not exist, determining the address of the file system corresponding to the container indicated by the container identity, and determining a backup address of the file system; the control target server 103 stores the file in the file system to the storage space corresponding to the backup address, and transmits the backup address to the communication-connected client 101.
The target server 103 may interact with the control server 102 through the network 105 to receive or transmit information or the like. The target server 103 may be a server that provides various services. For example, the files in the file system are stored to the target server in the storage space corresponding to the backup address according to the control instruction of the control server 102. The target server may store the file in the file system to the storage space corresponding to the backup address after receiving the related control instruction of the control server.
It should be noted that the method for sending information provided in the embodiment of the present application is generally executed by the control server 102, and accordingly, the apparatus for sending information is generally disposed in the control server 102.
It should be understood that the number of clients, control servers, target servers, and networks in fig. 1 is merely illustrative. There may be any number of clients, control servers, target servers, and networks, as desired for implementation.
With continued reference to fig. 2, a flow 200 of one embodiment of a method for transmitting information in accordance with the present application is shown. The method for transmitting information comprises the following steps:
in step 201, container information of a container in a stopped state is acquired.
In the present embodiment, an execution subject of the method for transmitting information (e.g., the control server 102 shown in fig. 1) may acquire container information of a container in a stopped state from a destination server of a communication connection by a wired connection manner or a wireless connection manner. The container information includes, but is not limited to, a container Identity (ID). The target server may be various servers connected to the execution agent in communication, on which the container runs.
Step 202, determining whether the container information exists in the historical container information list according to the container identity.
In this embodiment, after acquiring the container identifiers, the executing entity may compare the acquired container identifiers with the container identifiers in the history container information list one by one. If a container identifier identical to the obtained container identifier exists in the history container information list, the obtained container information may be considered to exist in the history container information list. Otherwise, the obtained container information may be considered not to exist in the history container information list. Wherein, the history container information list is empty in the initial state.
Step 203, in response to determining that the container does not exist, determining the address of the file system corresponding to the container indicated by the container identifier, and determining the backup address of the file system.
In this embodiment, after determining that the obtained container information does not exist in the history container information list, the execution principal may determine the address and the backup address of the file system corresponding to the container indicated by the container identification by: firstly, the container ID is adopted, and the file system address corresponding to the container ID is searched from a prestored container ID-file system address corresponding relation table. Here, the container id-file system address correspondence table may be a correspondence table that is pre-established by the execution subject and stores a plurality of container ids and addresses of file systems of containers indicated by the container ids. Then, a backup address is randomly selected from a pre-stored backup address set to serve as the backup address of the file system.
In some optional implementation manners of this embodiment, the execution subject may further determine, before determining the address of the file system corresponding to the container indicated by the container identity, a storage driving manner of the container according to the container identity.
Optionally, the storage driving manner may be one of the following: a device map (devicemmapper) storage drive, another federated file system (aufs) storage drive. It should be noted that the storage driving method may be other storage driving methods.
Alternatively, the execution body may determine the storage driving manner of the container by: and searching the storage drive information corresponding to the container identity identifier from the container identity identifier-storage drive information corresponding relation table by adopting the container identity identifier. The container id-storage drive information correspondence table may be a correspondence table that is pre-established for the execution subject and in which a plurality of container ids and storage drive information are recorded. The storage drive information may be various information for characterizing a storage drive manner of the container. As an example, the storage drive information may be a digital "1" used to characterize the storage drive style of the container as an aufs storage drive.
In some optional implementation manners of this embodiment, when the storage driver manner is a devicemmapper storage driver, the execution subject may determine the address and the backup address of the file system corresponding to the container indicated by the container identity in the following manner:
firstly, finding the device meta-information of the virtual device corresponding to the container according to the container identity. It should be noted that all containers running on the target server that have a storage drive in the manner of a devicemmapper storage drive share a resource pool. Each container is correspondingly allocated with a virtual device in the resource pool. Each virtual device has device meta information. In this embodiment, the device meta information includes a device size and a device identification. In addition, the device meta information may also include other various information for describing the virtual device. In this embodiment, when the container is started, the target server may feed back the device meta information of the virtual device corresponding to the container to the execution subject. In this way, the executing agent may store the received device meta-information in association with the container identity. Thus, when the container is in the operation stop state, the execution subject may search the device meta information of the virtual device corresponding to the container by using the container identity.
And secondly, generating and executing an instruction for controlling the virtual equipment to run according to the equipment size and the equipment identity. Here, the execution agent may generate an instruction for controlling the operation of the virtual device using the device size and the device id. The execution main body may also search a size code corresponding to the device size from a size-code correspondence table stored in advance by using the device size, and then generate an instruction for controlling the operation of the virtual device by using the size code and the device identification.
And thirdly, searching the equipment address of the virtual equipment in the operating equipment address list according to the equipment identity, and determining the equipment address as the address of the file system. Here, after the execution subject executes the instruction for controlling the operation of the virtual device, the virtual device may be activated, and the device address and the device id of the virtual device may be presented in the operating device address list. It should be noted that, in general, the running device address list has device addresses and device ids of virtual devices corresponding to all running containers. When the container is in the operation stop state, the execution subject may control the operation of the virtual device by using the instruction for controlling the operation of the virtual device. Then, the device address of the virtual device may be found from the operating device address list by using the device identity, and the found device address is the address of the file system corresponding to the container.
And fourthly, mounting the equipment address on a preset address to generate a backup address. Here, the execution body may place the obtained device address on a preset address to obtain a backup address. For example, if the obtained device address is a and the preset address is B, the backup address may be B \ a after a is mounted on B. The preset address may be various addresses preset by a technician.
In some optional implementations of this embodiment, when the storage drive mode is an aufs storage drive, the execution principal may determine the address and the backup address of the file system corresponding to the container indicated by the container identifier by:
firstly, according to the container identity, finding out the read-write layer identity of the read-write layer corresponding to the container. Here, it should be noted that the storage drive is a container of an aufs storage drive, and its corresponding file system is a file system supporting mounting of different directories to the same virtual file system, and the file system has multiple layers, and the directory between each two layers is different. In addition, in the file system, the layers below the uppermost layer are all read-only, only the file system at the uppermost layer is writable, and the writable layer is the read-write layer.
In this embodiment, the file system with the storage drive mode of aufs stores files in a format commonly used in the art. Therefore, the execution subject can obtain the read-write layer identity (i.e., mount-id) of the read-write layer based on the common format in the field. Specifically, the format commonly used in the art for storing the address of the mount-id is: /var/lib/docker/image/aufs/layerdb/mounts/{ containerID }/mount-id. Thus, the executing agent may use the container identity (i.e., container id) to find the address that holds the mount-id. And then obtaining the mount-id stored in the address.
And secondly, determining the address of the file system according to the read-write layer identity.
In this embodiment, the execution agent may obtain the address of the file system based on a format commonly used in the art. Specifically, the format of the address of the file system commonly used in the art is: /var/lib/docker/aufs/diff/{ mount-id }. Therefore, the execution subject can use the obtained mount-id to obtain the address of the file system.
And thirdly, determining the address of the preset backup file system as a backup address. Here, the execution main body may directly determine an address of a previously set backup file system as a backup address of the file system. The preset address of the backup file system may be various addresses preset by a technician.
And step 204, controlling the target server to store the file in the file system to a storage space corresponding to the backup address.
In this embodiment, the execution main body may generate, by using the address and the backup address of the file system, an instruction for executing to store the file in the file system to the storage space corresponding to the backup address, so as to control the target server to store the file in the file system to the storage space corresponding to the backup address. It should be noted that, in step 201, the execution principal may obtain container information of one or more containers in an operating state at a time. In addition, when the execution main body acquires container information of a plurality of containers in an operating state at a time, the acquired plurality of container information may be combined into a container information list. At this time, for each container information in the container information list, the execution subject may adopt the container information to execute the steps of 202 and 204.
Step 205, the backup address is sent to the communicatively connected client.
In this embodiment, the execution main body may send the backup address to the client through a wired connection manner or a wireless connection manner. Therefore, operation and maintenance personnel on the container user can find the backed-up file by using the backup address, and the method is favorable for accurately checking the reason of the abnormal container instance.
With continued reference to fig. 3, fig. 3 is a schematic diagram of an application scenario of the method for transmitting information according to the present embodiment. The control server may be various servers installed with kubernets, and the target server may be various servers managed by kubernets and installed with Docker. The client can be various terminal devices used by operation and maintenance personnel of a container user. It should be noted that Docker is an open-source application container engine, and a developer may integrate an application and a dependency package of the application into a portable container and then publish the container to any target server on which Docker is installed to run. Kubernetes is an open source container orchestration engine that manages containers that are accessed on target servers. Kubernetes is recognized as a de facto industry standard for large-scale deployment of containerized applications in scenarios such as public, private, and hybrid clouds.
In the application scenario 300 of fig. 3, first, the control server 302 acquires container information of the container M in the stopped state from the target server 303. Wherein the container information includes a container identity containerrid-M. Then, it is determined whether the container information exists in the history container information list according to the container identification ContainerID-M. Thereafter, in response to determining that there is no file system, the address "address-X" of the file system corresponding to the container M is determined, and the backup address "address-Y" of the file system is determined. Then, the target server 303 is controlled to store the file in the file system to the storage space corresponding to the backup address "address-Y". Finally, the backup address "address-Y" is sent to the communicatively connected client 301, so that the operation and maintenance personnel 304 on the container user can view the backed-up file by using the backup address "address-Y".
The method for sending information provided by the above embodiment of the present application may first acquire the container information of the container in the shutdown state. Wherein the container information includes a container identification. Secondly, whether the container information exists in the historical container information list or not is determined according to the container identity. Then, in response to determining that the container does not exist, an address of a file system corresponding to the container indicated by the container identification is determined, and a backup address of the file system is determined. And then, controlling the target server to store the file in the file system to a storage space corresponding to the backup address. And finally, sending the backup address to the client side of the communication connection. In the method of the embodiment, because the file in the file system records the operation process of the container instance, the file in the file system is stored in the storage space corresponding to the backup address, so that the file in the operation process of the container instance can be backed up, and the operation and maintenance personnel on a container user can accurately check the reason for the abnormality of the container instance.
With further reference to fig. 4, a flow 400 of yet another embodiment of a method for transmitting information is shown. The process 400 of the method for transmitting information includes the steps of:
step 401, container information of a container in a stopped state is acquired.
Step 402, determining whether the container information exists in the historical container information list according to the container identity.
In response to determining that the container does not exist, the address of the file system corresponding to the container indicated by the container identifier is determined, and a backup address of the file system is determined in step 403.
Step 404, controlling the target server to store the file in the file system to the storage space corresponding to the backup address.
Step 405, the backup address is sent to the communicatively connected client.
In the present embodiment, the specific operations of steps 401 and 405 are substantially the same as the operations of steps 201 and 205 in the embodiment shown in fig. 2, and are not described herein again.
At step 406, container information is added to the historical container information list.
In this embodiment, the execution subject may add the container information determined not to exist in the history container information list to the history container information list. Therefore, repeated backup can be avoided, and the backup efficiency of the files in the file system can be improved.
Step 407, in response to determining that the storage duration of the file in the storage space exceeds a preset storage duration threshold, controlling the target server to delete the file.
In this embodiment, after storing the file in the storage space, the execution main body may calculate a storage duration of the file in the storage space, and if the storage duration exceeds a preset storage duration threshold, the file may be considered to be deleted. At this time, the executing body may send an instruction to the target server to execute deletion of the file, thereby controlling the target server to delete the file. The storage duration threshold may be a data value preset by a technician. In the embodiment, the storage time length exceeding the preset storage time length threshold is deleted, so that the storage space of the target server can be saved, and the utilization efficiency of the storage space is improved.
As can be seen from fig. 4, compared with the embodiment corresponding to fig. 2, the flow 400 of the method for sending information in the present embodiment embodies a step of adding container information on which backup processing has been performed to the history container information list, and a step of deleting files whose storage time length exceeds a preset storage time length threshold. Therefore, the scheme described in this embodiment can help to improve the backup efficiency of the files in the file system corresponding to the container, and at the same time, can save the storage space of the target server, and helps to improve the utilization efficiency of the storage space.
With further reference to fig. 5, as an implementation of the methods shown in the above-mentioned figures, the present application provides an embodiment of an apparatus for sending information, which corresponds to the method embodiment shown in fig. 2, and which is specifically applicable to various servers.
As shown in fig. 5, the apparatus 500 for transmitting information of the present embodiment includes: an information obtaining unit 501 configured to obtain container information of a container in a stopped state, the container information including a container identification; an information comparing unit 502 configured to determine whether container information exists in the history container information list according to the container identity; an address determination unit 503 configured to determine, in response to determining that the address does not exist, an address of a file system corresponding to the container indicated by the container identification, and determine a backup address of the file system; a file backup unit 504 configured to control the target server to store the file in the file system to the storage space corresponding to the backup address; an address sending unit 505 configured to send the backup address to a client of the communication connection.
In some optional implementations of this embodiment, the apparatus further includes an information adding unit (not shown in the figure). The information adding unit may be configured to add the container information to the history container information list.
In some optional implementations of this embodiment, the apparatus further includes a file deleting unit (not shown in the figure). The file deleting unit may be configured to control the target server to delete the file in response to determining that a storage duration of the file in the storage space exceeds a preset storage duration threshold.
In some optional implementations of this embodiment, the apparatus further comprises a drive determination unit (not shown in the figure). The drive determination unit may be configured to determine a storage drive mode of the container based on the container identity. Wherein, the storage driving mode is one of the following modes: the device maps the storage drive and the other unites the file system storage drive.
In some optional implementations of this embodiment, the address determination unit may be further configured to: firstly, according to the container identity, finding the device meta-information of the virtual device corresponding to the container. Wherein the device meta-information includes a device size and a device identity. And then, generating and executing an instruction for controlling the virtual equipment to run according to the equipment size and the equipment identity. And then, according to the equipment identity, finding the equipment address of the virtual equipment in the operating equipment address list, and determining the equipment address as the address of the file system. And finally, the device address is loaded to a preset address to generate a backup address.
In some optional implementations of this embodiment, the address determination unit may be further configured to: firstly, according to the container identity, the read-write layer identity of the read-write layer corresponding to the container is found. And then, determining the address of the file system according to the read-write layer identity. And finally, determining the address of the preset backup file system as a backup address.
In the apparatus provided in the foregoing embodiment of the present application, the information obtaining unit 501 obtains container information of a container in a stop operation state, where the container information includes a container identifier. The information comparing unit 502 determines whether the container information exists in the history container information list according to the container identification. The address determination unit 503 determines the address of the file system corresponding to the container indicated by the container identification in response to determining that there is no container, and determines the backup address of the file system. The file backup unit 504 controls the target server to store the file in the file system to the storage space corresponding to the backup address. The address transmission unit 505 transmits the backup address to the client of the communication connection. According to the device, the file in the file system records the operation process of the container instance, so that the file in the file system is stored in the storage space corresponding to the backup address, the file in the operation process of the container instance can be backed up, and the operation and maintenance personnel on a container user can accurately check the reason for the abnormality of the container instance.
Referring now to FIG. 6, shown is a block diagram of a computer system 600 suitable for use in implementing a server according to embodiments of the present application. The server shown in fig. 6 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present application.
As shown in fig. 6, the computer system 600 includes a Central Processing Unit (CPU)601 that can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM)602 or a program loaded from a storage section 608 into a Random Access Memory (RAM) 603. In the RAM 603, various programs and data necessary for the operation of the system 600 are also stored. The CPU 601, ROM 602, and RAM 603 are connected to each other via a bus 604. An input/output (I/O) interface 605 is also connected to bus 604.
The following components are connected to the I/O interface 605: an input portion 606 including a keyboard, a mouse, and the like; an output portion 607 including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage section 608 including a hard disk and the like; and a communication section 609 including a network interface card such as a LAN card, a modem, or the like. The communication section 609 performs communication processing via a network such as the internet. The driver 610 is also connected to the I/O interface 605 as needed. A removable medium 611 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 610 as necessary, so that a computer program read out therefrom is mounted in the storage section 608 as necessary.
In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication section 609, and/or installed from the removable medium 611. The computer program performs the above-described functions defined in the method of the present application when executed by a Central Processing Unit (CPU) 601. It should be noted that the computer readable medium of the present application can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present application, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In this application, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in the embodiments of the present application may be implemented by software or hardware. The described units may also be provided in a processor, and may be described as: a processor comprises an information acquisition unit, an information comparison unit, an address determination unit, a file backup unit and an address sending unit. Here, the names of these units do not constitute a limitation of the unit itself in some cases, and for example, the information acquiring unit may also be described as a "unit that acquires container information of a container in a stopped state".
As another aspect, the present application also provides a computer-readable medium, which may be contained in the apparatus described in the above embodiments; or may be present separately and not assembled into the device. The computer readable medium carries one or more programs which, when executed by the apparatus, cause the apparatus to: acquiring container information of a container in a running stop state, wherein the container information comprises a container identity; determining whether the container information exists in a historical container information list or not according to the container identity; in response to determining that the container does not exist, determining the address of the file system corresponding to the container indicated by the container identity, and determining a backup address of the file system; controlling a target server to store files in the file system to a storage space corresponding to the backup address; and sending the backup address to the client side of the communication connection.
The above description is only a preferred embodiment of the application and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the invention herein disclosed is not limited to the particular combination of features described above, but also encompasses other arrangements formed by any combination of the above features or their equivalents without departing from the spirit of the invention. For example, the above features may be replaced with (but not limited to) features having similar functions disclosed in the present application.

Claims (12)

1. A method for transmitting information, comprising:
acquiring container information of a container in a running stop state, wherein the container information comprises a container identity;
determining whether the container information exists in a historical container information list or not according to the container identity;
in response to determining that the storage drive mode does not exist, determining a storage drive mode of the container according to the container identity, determining an address of a file system corresponding to the container indicated by the container identity, and determining a backup address of the file system;
when the storage drive mode is a device mapping storage drive, the determining an address of a file system corresponding to the container indicated by the container identification and determining a backup address of the file system include: finding the equipment meta-information of the virtual equipment corresponding to the container according to the container identity, wherein the equipment meta-information comprises equipment size and equipment identity; generating and executing an instruction for controlling the virtual equipment to run according to the equipment size and the equipment identity; according to the equipment identity identification, finding the equipment address of the virtual equipment in an operating equipment address list, and determining the equipment address as the address of the file system; mounting the equipment address on a preset address to generate the backup address;
controlling a target server to store the files in the file system to a storage space corresponding to the backup address;
and sending the backup address to a client side in communication connection.
2. The method of claim 1, wherein the method further comprises:
adding the container information to the historical container information list.
3. The method of claim 1, wherein the method further comprises:
and controlling the target server to delete the file in response to determining that the storage time of the file in the storage space exceeds a preset storage time threshold.
4. The method of any of claims 1-3, wherein the storage drive approach is a federated file system storage drive.
5. The method of claim 4, wherein the storage drive approach is a federated file system storage drive; and
the determining the address of the file system corresponding to the container indicated by the container identification and the determining the backup address of the file system include:
according to the container identity, finding out a read-write layer identity of a read-write layer corresponding to the container;
determining the address of the file system according to the read-write layer identity;
and determining the address of a preset backup file system as the backup address.
6. An apparatus for transmitting information, comprising:
an information acquisition unit configured to acquire container information of a container in a stopped state, the container information including a container identification;
an information comparison unit configured to determine whether the container information exists in a history container information list according to the container identity;
the drive determining unit is configured to determine a storage drive mode of the container according to the container identity;
an address determination unit configured to determine, in response to determining that the address does not exist, an address of a file system corresponding to the container indicated by the container identifier, and a backup address of the file system, and when the storage drive manner is a device-mapped storage drive, the address of the file system corresponding to the container indicated by the container identifier, and the backup address of the file system are determined, including: according to the container identity, finding the equipment meta-information of the virtual equipment corresponding to the container, wherein the equipment meta-information comprises equipment size and equipment identity, then generating and executing an instruction for controlling the virtual equipment to operate according to the equipment size and the equipment identity, then finding the equipment address of the virtual equipment in an operating equipment address list according to the equipment identity, determining the equipment address as the address of the file system, and finally hanging the equipment address at a preset address to generate the backup address;
the file backup unit is configured to control a target server to store files in the file system to a storage space corresponding to the backup address;
an address sending unit configured to send the backup address to a client of a communication connection.
7. The apparatus of claim 6, wherein the apparatus further comprises:
an information adding unit configured to add the container information to the history container information list.
8. The apparatus of claim 6, wherein the apparatus further comprises:
a file deleting unit configured to control the target server to delete the file in response to determining that a storage duration of the file in the storage space exceeds a preset storage duration threshold.
9. The apparatus of any of claims 6-8, wherein the storage drive approach is a federated file system storage drive.
10. The apparatus of claim 9, wherein the address determination unit is further configured to:
according to the container identity, finding out a read-write layer identity of a read-write layer corresponding to the container;
determining the address of the file system according to the read-write layer identity;
and determining the address of a preset backup file system as the backup address.
11. A server, comprising:
one or more processors;
a storage device having one or more programs stored thereon,
when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-5.
12. A computer-readable medium, on which a computer program is stored which, when being executed by a processor, carries out the method according to any one of claims 1-5.
CN201811453902.5A 2018-11-30 2018-11-30 Method and apparatus for transmitting information Active CN109582487B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811453902.5A CN109582487B (en) 2018-11-30 2018-11-30 Method and apparatus for transmitting information

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811453902.5A CN109582487B (en) 2018-11-30 2018-11-30 Method and apparatus for transmitting information

Publications (2)

Publication Number Publication Date
CN109582487A CN109582487A (en) 2019-04-05
CN109582487B true CN109582487B (en) 2020-02-14

Family

ID=65925883

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811453902.5A Active CN109582487B (en) 2018-11-30 2018-11-30 Method and apparatus for transmitting information

Country Status (1)

Country Link
CN (1) CN109582487B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112148420B (en) * 2019-06-28 2024-04-02 杭州海康威视数字技术股份有限公司 Abnormal task processing method based on container technology, server and cloud platform
CN110647395A (en) * 2019-08-30 2020-01-03 联想(北京)有限公司 Task processing method, system and device and computer storage medium

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100049931A1 (en) * 2008-08-20 2010-02-25 Jacobson Michael B Copying Logical Disk Mappings Between Arrays
US10019323B1 (en) * 2014-03-25 2018-07-10 EMC IP Holding Company LLC Method and system for container data recovery in a storage system
CN107391313A (en) * 2017-07-31 2017-11-24 郑州云海信息技术有限公司 The operation method and device of a kind of container

Also Published As

Publication number Publication date
CN109582487A (en) 2019-04-05

Similar Documents

Publication Publication Date Title
US10735345B2 (en) Orchestrating computing resources between different computing environments
US10977062B2 (en) System for starting virtual machine using mirror image file stored in units of a distributed block storage system mapped to units of a logical volume
US20110296397A1 (en) Systems and methods for generating cached representations of host package inventories in remote package repositories
US8620926B2 (en) Using a hashing mechanism to select data entries in a directory for use with requested operations
US20140337493A1 (en) Client/server network environment setup method and system
US8423734B2 (en) Making automated use of data volume copy service targets
CN109144785B (en) Method and apparatus for backing up data
CN109542862B (en) Method, device and system for controlling mounting of file system
CN108011949B (en) Method and apparatus for acquiring data
CN109582487B (en) Method and apparatus for transmitting information
CN109828830B (en) Method and apparatus for managing containers
US11194629B2 (en) Handling expiration of resources allocated by a resource manager running a data integration job
CN109150927B (en) File issuing method and device for file storage system
CN110798358B (en) Distributed service identification method and device, computer readable medium and electronic equipment
CN116737662A (en) Method, device, electronic equipment and storage medium for processing business data
CN109120433B (en) Method and apparatus for containerized deployment of hosts
CN114745397B (en) Online storage method and system based on private cloud
US9298487B2 (en) Managing virtual machine images in a distributed computing environment
CN113076175B (en) Memory sharing method and device for virtual machine
CN113778527A (en) Method and apparatus for controlling state of pipeline task
US9075844B1 (en) Correlating and reconciling descriptor data associated with computing systems
CN109769030B (en) Method and apparatus for controlling access of applications
CN112579247A (en) Method and device for determining task state
CN112241337B (en) Method, apparatus and computer program product for managing backup data
CN118192897A (en) Data storage system, method and device

Legal Events

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