CN108833163B - Linux virtual server creating method and device, computer equipment and storage medium - Google Patents

Linux virtual server creating method and device, computer equipment and storage medium Download PDF

Info

Publication number
CN108833163B
CN108833163B CN201810606437.8A CN201810606437A CN108833163B CN 108833163 B CN108833163 B CN 108833163B CN 201810606437 A CN201810606437 A CN 201810606437A CN 108833163 B CN108833163 B CN 108833163B
Authority
CN
China
Prior art keywords
virtual server
container
linux virtual
network address
linux
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
CN201810606437.8A
Other languages
Chinese (zh)
Other versions
CN108833163A (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.)
Ping An Technology Shenzhen Co Ltd
Original Assignee
Ping An Technology Shenzhen 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 Ping An Technology Shenzhen Co Ltd filed Critical Ping An Technology Shenzhen Co Ltd
Priority to CN201810606437.8A priority Critical patent/CN108833163B/en
Priority to PCT/CN2018/109383 priority patent/WO2019237588A1/en
Publication of CN108833163A publication Critical patent/CN108833163A/en
Application granted granted Critical
Publication of CN108833163B publication Critical patent/CN108833163B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0803Configuration setting
    • 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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0803Configuration setting
    • H04L41/0806Configuration setting for initial configuration or provisioning, e.g. plug-and-play
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/56Routing software
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45562Creating, deleting, cloning virtual machine instances
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/4557Distribution of virtual machine instances; Migration and load balancing
    • 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/45595Network integration; Enabling network access in virtual machine instances

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The embodiment of the application discloses a method and a device for creating a Linux virtual server, computer equipment and a storage medium. The method comprises the following steps: receiving a creation request sent by a management platform; acquiring a corresponding software image according to the software image identification in the establishment request and establishing a corresponding container according to the software image, wherein the software image comprises a Linux virtual server and routing software; configuring a container according to a container network address allocated to the container by the management platform and configuring a Linux virtual server according to a virtual network address allocated to the Linux virtual server by the management platform; and establishing a neighbor relation between the container and the gateway through routing software to generate a dynamic route in the gateway, wherein the dynamic route comprises a destination address and a next hop address, the destination address is a virtual network address, and the next hop address is a container network address. The method can quickly create the Linux virtual server in the Linux virtual server cluster, realize the transverse capacity expansion of the Linux virtual server and improve the processing efficiency of the request.

Description

Linux virtual server creating method and device, computer equipment and storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method and an apparatus for creating a Linux virtual server, a computer device, and a storage medium.
Background
The Linux Virtual Server (english name: Linux Virtual Server) is a Virtual Server cluster system, which is widely used due to its good scalability, reliability and manageability. Currently, the industry mostly uses Linux virtual servers in a master-standby mode, that is, only one master Linux virtual server provides services to the outside at any time. However, in the active-standby mode, when the number of the requests to be processed by the main Linux virtual server is large, a large data processing pressure is applied to the main Linux virtual server, and the time for the main Linux virtual server to respond to the requests is prolonged, so that the efficiency for processing the requests by the main Linux virtual server is greatly reduced.
Disclosure of Invention
The application provides a method and a device for creating a Linux virtual server, computer equipment and a storage medium, so that the Linux virtual server is quickly created in a Linux virtual server cluster, the transverse capacity expansion of the Linux virtual server is realized, and the processing efficiency of a request is improved.
In a first aspect, the present application provides a method for creating a Linux virtual server, which is used to create a Linux virtual server in a Linux virtual server cluster, and includes:
receiving a creation request sent by a management platform, wherein the creation request comprises a software image identifier;
acquiring a corresponding software image according to the software image identifier, and creating a corresponding container according to the software image, wherein the software image comprises a Linux virtual server and routing software, and the Linux virtual server and the routing software are operated in the container;
receiving container network addresses distributed to the containers by the management platform and virtual network addresses distributed to the Linux virtual servers, wherein the container network addresses of all the containers in the Linux virtual server cluster are different from each other, and the virtual network addresses of all the Linux virtual servers are the same;
configuring the container according to the container network address, and configuring the Linux virtual server according to the virtual network address; and
and establishing a neighbor relation between the container and the gateway through the routing software to generate a dynamic route in the gateway so as to complete the establishment of the Linux virtual server, wherein the dynamic route comprises a destination address and a next hop address, the destination address is a virtual network address corresponding to the Linux virtual server, and the next hop address is a container network address corresponding to the container.
In a second aspect, the present application provides a creating apparatus for a Linux virtual server, configured to create a Linux virtual server in a Linux virtual server cluster, including:
the management platform comprises a request receiving unit, a creating unit and a processing unit, wherein the request receiving unit is used for receiving a creating request sent by the management platform, and the creating request comprises a software image identifier;
the creating unit is used for acquiring a corresponding software image according to the software image identifier and creating a corresponding container according to the software image, wherein the software image comprises a Linux virtual server and routing software, and the Linux virtual server and the routing software run in the container;
an address receiving unit, configured to receive a container network address allocated to the container by the management platform and a virtual network address allocated to the Linux virtual server, where container network addresses of all containers in the Linux virtual server cluster are different from each other and virtual network addresses of all Linux virtual servers are different from each other;
the configuration unit is used for configuring the container according to the container network address and configuring the Linux virtual server according to the virtual network address;
and the establishing unit is used for establishing a neighbor relation between the container and the gateway through the routing software so as to generate a dynamic route in the gateway, so as to complete the establishment of the Linux virtual server, wherein the dynamic route comprises a destination address and a next hop address, the destination address is a virtual network address corresponding to the Linux virtual server, and the next hop address is a container network address corresponding to the container.
In a third aspect, the present application further provides a computer device, including a memory, a processor, and a computer program stored on the memory and executable on the processor, where the processor implements the creating method of the Linux virtual server according to any one of the first aspects when executing the computer program.
In a fourth aspect, the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, the computer program comprises program instructions, which, when executed by a processor, cause the processor to execute the creating method of the Linux virtual server according to any one of the first aspects.
The application provides a method and a device for creating a Linux virtual server, computer equipment and a storage medium. The method can quickly create the Linux virtual server in the Linux virtual server cluster, and realize the transverse expansion of the Linux virtual server so as to meet the requirement of the request quantity. Meanwhile, the Linux virtual server created by the method can realize that a plurality of Linux virtual servers process requests simultaneously, and the efficiency of processing the requests by the Linux virtual server cluster is improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
FIG. 1 is a schematic flow chart of a method for creating a Linux virtual server in an embodiment of the present application;
FIG. 2 is a schematic diagram illustrating interaction between a Linux virtual server and a management platform in an embodiment of the present application;
FIG. 3 is another schematic flow chart of a method for creating a Linux virtual server in an embodiment of the present application;
FIG. 4 is a schematic diagram illustrating interaction between a Linux virtual server and a processing server according to an embodiment of the present application;
FIG. 5 is a schematic block diagram of a creating device of a Linux virtual server in the embodiment of the present application;
FIG. 6 is another schematic block diagram of a creating device of the Linux virtual server in the embodiment of the present application;
fig. 7 is a schematic block diagram of a computer device according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some, but not all, embodiments of the present application. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
It will be understood that the terms "comprises" and/or "comprising," when used in this specification and the appended claims, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
It is also to be understood that the terminology used in the description of the present application herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used in the specification of the present application and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
It should be further understood that the term "and/or" as used in this specification and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.
Referring to fig. 1 and fig. 2, fig. 1 is a schematic flowchart of a method for creating a Linux virtual server according to an embodiment of the present application, and fig. 2 is an interaction schematic diagram of the Linux virtual server and a management platform according to the embodiment of the present application. The Linux virtual server creating method is used for creating a Linux virtual server 21 in a Linux virtual server cluster. The Linux virtual server cluster includes a plurality of Linux virtual servers 21, and the plurality of Linux virtual servers 21 may be deployed on the same physical machine 20 or on a plurality of physical machines 20, which is not limited herein.
It should be noted that fig. 2 only illustrates the interaction between one physical machine 20 and the management platform 10, and the interaction between the other physical machines 20 and the management platform 10 is similar to that in fig. 2 and is not necessarily depicted. In addition, it is understood that the management platform 10 may be installed in a server of hardware.
As shown in FIG. 1, the Linux virtual server creating method comprises steps S101 to S105.
S101, receiving a creation request sent by a management platform, wherein the creation request comprises a software image identifier.
In this embodiment, when a new Linux virtual server 21 needs to be created in the Linux virtual server cluster, a user such as a developer or a maintainer may send an add Linux virtual server request to the management platform 10, so that the management platform 10 sends a creation request to the physical machine 20 when receiving the add Linux virtual server request. Wherein the creation request includes a software image identification. The software image identifier is an identifier corresponding to the software image in the image repository.
It should be noted that the software image identifier may be an identifier used for uniquely identifying the software image, such as a name and a number of the software image, and specific content of the software image identifier is not limited herein.
S102, acquiring a corresponding software image according to the software image identification, and creating a corresponding container according to the software image, wherein the software image comprises a Linux virtual server and routing software, and the Linux virtual server and the routing software are operated in the container.
In this embodiment, the physical machine 20 may acquire the software image pre-stored in the image repository according to the software image identifier. Two kinds of software, Linux virtual server 21 and routing software, are included in the software image. That is, the Linux virtual server 21 and the routing software are placed in one image.
After acquiring the software image, the physical machine 20 creates a container corresponding to the Linux virtual server 21 and the routing software by using the software image. After the container is created, the Linux virtual server 21 and routing software may be run in the container.
In one embodiment, physical machine 20 may obtain a software image by executing a Docker run command and create a corresponding container from the software image. For example, assuming that the software image is identified as "LVS-Qugga", the physical machine 20 may complete the operation of step S102 by executing the following commands: docker run LVS-Qugga.
In one embodiment, the routing software may be a Qugga software, and the generated container may be a Docker container. Of course, in other embodiments, the routing software and the container may be of other types, and the types of the routing software and the container are not limited herein.
S103, receiving the container network addresses distributed to the containers by the management platform and the virtual network addresses distributed to the Linux virtual servers, wherein the container network addresses of all the containers in the Linux virtual server cluster are different from each other, and the virtual network addresses of all the Linux virtual servers are the same.
In one embodiment, when the physical machine 20 successfully creates the container using the software image, a network address obtaining request is sent to the management platform 10, where the network address obtaining request includes the container creation success identifier and the identity information corresponding to the container. The identity information corresponding to the container may be a name, a number, or the like of the container for identifying the container. After receiving the network address acquisition request sent by the physical machine 20, the management platform 10 allocates a container network address to the container and allocates a virtual network address to the Linux virtual server 21 in the container, and sends the container network address of the container and the virtual network address of the Linux virtual server 21 to the physical machine 20. Meanwhile, the management platform 10 stores the correspondence between the identity information of the container and the container network address of the container, so that the management platform 10 manages the container network address of the container.
Of course, in other embodiments, the physical machine 20 may not send the network address obtaining request to the management platform 10, and the management platform 10 sends the container network address of the container and the virtual network address of the Linux virtual server 21 to the physical machine 20 after allocating the container network address to the container and allocating the virtual network address to the Linux virtual server 21, which is not limited herein.
The physical machine 20 receives the container network address assigned by the management platform 10 for the container and the virtual network address assigned for the Linux virtual server 21. It should be noted that, in this embodiment, because the Linux virtual server 21 runs in a container, a plurality of containers exist in the Linux virtual server cluster, one Linux virtual server 21 runs in each container, the container network address of each container is a private network address, the virtual network addresses corresponding to the Linux virtual servers 21 in all the containers in the Linux virtual server cluster are public network addresses, that is, in the Linux virtual server cluster, the container network addresses of each container are different from each other, and the virtual network addresses corresponding to the Linux virtual servers 21 in all the containers in the Linux virtual server cluster are the same, so that a plurality of Linux virtual servers 21 in the Linux virtual server cluster can work simultaneously, and the efficiency of processing requests by the Linux virtual server cluster is improved.
S104, configuring the container according to the container network address, and configuring the Linux virtual server according to the virtual network address.
After the physical machine acquires the container network address and the virtual network address, the network address of the container is configured as the container network address, and the network address of the Linux virtual server 21 is configured as the virtual network address.
Specifically, in one embodiment, physical machine 20 may configure the network address of the container as the container network address by executing a pipe command, and configure the network address of the Linux virtual server as the virtual network address by executing a Docker run command.
In this embodiment, the management platform 10 performs remote network address binding via an Angle command. Specifically, the management platform 10 starts the physical machine 20 to execute a pipe command and a Docker run command through the anchor command, and transmits a container network address and a virtual network address to the physical machine 20 through the anchor command. The physical machine 20 configures the network address of the container as the container network address by executing a pipeline command, and writes the virtual network address into the configuration file of the Linux virtual server 21 by executing a Docker run command, so that the Linux virtual server 21 can read the virtual network address in the configuration file at the subsequent start-up of the Linux virtual server 21 to complete the configuration of the network address.
In an embodiment, as shown in fig. 3 and fig. 4, fig. 3 is another schematic flowchart of a creating method of a Linux virtual server in an embodiment of the present application, and fig. 4 is an interaction schematic diagram of the Linux virtual server and a processing server in the embodiment of the present application. After step S104, steps S106 and S107 are also included.
S106, when the Linux virtual server is operated, reading a pre-stored configuration file, wherein the configuration file comprises the network address information and the port number of the processing server.
S107, loading the configuration file into a configuration directory of the Linux virtual server, so that the Linux virtual server communicates with the processing server through the network address information and the port number of the processing server.
After the container network address of the container and the virtual network address of the Linux virtual server 21 are configured in step S104, when the Linux virtual server 21 is running, the configuration file pre-stored in the physical machine 20 is read. The configuration file is a configuration file corresponding to the Linux virtual server 21, and the configuration file includes network address information and port numbers of the plurality of processing servers 30 managed by the Linux virtual server 21. The configuration file is then loaded into the configuration directory of the Linux virtual server 21. Thus, when the Linux virtual server 21 needs to send the received request to the processing server 30 for processing, the request can be forwarded to the corresponding processing server 30 according to the network address information and the port number of the processing server 30 in the configuration directory, so that the processing server 30 can process the request.
In an embodiment, the operating mode of the Linux virtual server 21 may be a DR operating mode, a VS/NAT mode, or a VS/TUN mode, which is not limited herein.
It should be noted that fig. 4 only illustrates the management relationship between some of the Linux virtual servers 21 and the processing servers 30, and it is understood that other Linux virtual servers 21 may also have a management relationship between the processing servers 30 illustrated in fig. 4, which is not necessarily illustrated herein.
In addition, in the creating method shown in fig. 3, step S105 and steps S106 and S107 are in parallel, but of course, in other embodiments, step S105 and steps S106 and S107 may also be in a sequential relationship, for example, step S104, step S106 and step S107 are executed in sequence, and then step S105 is executed; or the steps S104 and S105 are executed in sequence, and then the steps S106 and S107 are executed, where the sequence of the steps S105, S106 and S107 is not limited.
S105, establishing a neighbor relation between the container and the gateway through the routing software to generate a dynamic route in the gateway so as to complete the establishment of the Linux virtual server, wherein the dynamic route comprises a destination address and a next hop address, the destination address is a virtual network address corresponding to the Linux virtual server, and the next hop address is a container network address corresponding to the container.
In this embodiment, as shown in fig. 4, the physical machine 20 runs routing software in a container, and then establishes a neighbor relationship between the container and the gateway 40 through the routing software to generate a dynamic route in the gateway 40, thereby completing the creation of the Linux virtual server 21. The dynamic route includes a destination address and a next hop address, the destination address is a virtual network address corresponding to the Linux virtual server 21, and the next hop address is a container network address corresponding to the container.
When the gateway 40 receives a request sent by an external device, the gateway 40 may send the request to a container corresponding to a next hop address according to a dynamic route, and then the Linux virtual server 21 in the container matches with a destination address according to its own virtual network address. And if the matching is successful, processing the request. By adopting the Linux virtual server 21 created by the Linux virtual server creating method in the embodiment, a dynamic route can be established between each container in the Linux virtual server cluster and the gateway 40, and the gateway 40 can evenly distribute a plurality of requests to a plurality of containers, so that a plurality of Linux virtual servers 21 in the Linux virtual server cluster can work simultaneously, and the efficiency of processing the requests is improved. Meanwhile, when the number of the Linux virtual servers 21 in the Linux virtual server cluster is not enough to meet the request processing requirement, the creating method in the embodiment can be adopted to quickly add a new Linux virtual server 21 in the Linux virtual server cluster, so that the transverse expansion of the Linux virtual server 21 is realized, and the processing process of other Linux virtual servers 21 is not influenced.
In an embodiment, the establishing, by the routing software, a neighbor relation between the container and the gateway to generate a dynamic route in the gateway may specifically be: establishing, by the routing software and based on an OSPF protocol, a neighbor relation between the container and a gateway to generate a dynamic route in the gateway. As shown in fig. 4, the OSPF neighbor relationship is established between the container shown in fig. 4 and the gateway 40.
It should be noted that fig. 4 only illustrates the OSPF neighbor relationship between the container in which the Linux virtual server 21 is located and the gateway 40, and it is understood that the OSPF neighbor relationship is also established between the container in which other Linux virtual servers 21 are located and the gateway 40, which is not drawn herein.
Additionally, in other embodiments, the neighbor relationship between the container and the gateway 40 may also be established based on other protocols. For example, the neighbor relationship between the container and the gateway 40 may be established by the routing software based on the BGP protocol to generate dynamic routes in the gateway 40, which is not particularly limited herein.
In one embodiment, after establishing, by the routing software, a neighbor relation between the container and a gateway to generate a dynamic route in the gateway, the method further comprises: if the Linux virtual server is detected to be abnormally operated, sending a removal request to the management platform to enable the management platform to delete the Linux virtual server abnormally operated and the container where the Linux virtual server is located, and recovering the container network address of the container where the Linux virtual server abnormally operated is located.
Specifically, when the physical machine 20 detects that the Linux virtual server 21 is abnormally operated, a removal request may be sent to the management platform 10. After receiving the removal request, the management platform 10 may delete the Linux virtual server 21 running abnormally and the container in which the Linux virtual server 21 is located through the physical machine 20, and delete the correspondence between the identity information of the container in which the Linux virtual server 21 running abnormally is located and the container network address, so as to recover the container network address of the container in which the Linux virtual server 21 running abnormally is located, so as to allocate the container network address to other containers for use. Therefore, the Linux virtual server 21 with abnormal operation can be kicked out of the Linux virtual server cluster, and meanwhile, the working states of other Linux virtual servers 21 are not influenced.
The method for creating the Linux virtual server in the embodiment can quickly create the Linux virtual server 21 in the Linux virtual server cluster, and realize the transverse expansion of the Linux virtual server 21 so as to meet the requirement of the request processing quantity. Meanwhile, the Linux virtual server 21 created by the creating method can realize simultaneous work of a plurality of Linux virtual servers 21, and the efficiency of processing the request by the Linux virtual server cluster is improved.
The embodiment of the application further provides a creating device of the Linux virtual server, and the creating device of the Linux virtual server is used for executing the creating method of the Linux virtual server in the embodiment. Specifically, please refer to fig. 5, wherein fig. 5 is a schematic block diagram of a creating apparatus of a Linux virtual server according to an embodiment of the present application. The creating device 300 of the Linux virtual server may be installed in a physical machine for creating the Linux virtual server in a Linux virtual server cluster.
As shown in fig. 5, the creating apparatus 300 of the Linux virtual server includes a request receiving unit 301, a creating unit 302, an address receiving unit 303, a configuring unit 304, and a establishing unit 305.
A request receiving unit 301, configured to receive a creation request sent by a management platform, where the creation request includes a software image identifier.
A creating unit 302, configured to obtain a corresponding software image according to the software image identifier, and create a corresponding container according to the software image, where the software image includes a Linux virtual server and routing software, and the Linux virtual server and the routing software are run in the container.
In an embodiment, the routing software includes a Qugga software, and the generated container may be a Docker container, but in other embodiments, the routing software and the container may be of other types, and the types of the routing software and the container are not limited herein.
An address receiving unit 303, configured to receive a container network address allocated to the container by the management platform and a virtual network address allocated to the Linux virtual server, where container network addresses of all containers in the Linux virtual server cluster are different from each other and virtual network addresses of all Linux virtual servers are different from each other.
A configuration unit 304, configured to configure the container according to the container network address, and configure the Linux virtual server according to the virtual network address.
Specifically, in an embodiment, the configuration unit 304 is specifically configured to configure the network address of the container as the container network address by executing a pipe command, and configure the network address of the Linux virtual server as the virtual network address by executing a Docker run command.
In an embodiment, as shown in fig. 6, fig. 6 is another schematic block diagram of a creating apparatus of a Linux virtual server in an embodiment of the present application. The creating apparatus 300 of the Linux virtual server further includes a reading unit 306 and a loading unit 307.
A reading unit 306, configured to read a pre-stored configuration file when the Linux virtual server is running, where the configuration file includes network address information and a port number of a processing server.
A loading unit 307, configured to load the configuration file into a configuration directory of the Linux virtual server, so that the Linux virtual server communicates with the processing server through the network address information and the port number of the processing server.
An establishing unit 305, configured to establish, through the routing software, a neighbor relationship between the container and a gateway to generate a dynamic route in the gateway, so as to complete the creation of the Linux virtual server, where the dynamic route includes a destination address and a next-hop address, the destination address is a virtual network address corresponding to the Linux virtual server, and the next-hop address is a container network address corresponding to the container.
In an embodiment, the establishing unit 305 is specifically configured to establish, through the routing software and based on an OSPF protocol or a BGP protocol, a neighbor relationship between the container and the gateway to generate a dynamic route in the gateway.
In an embodiment, as shown in fig. 6, the creating apparatus 300 of the Linux virtual server further includes a sending unit 308.
A sending unit 308, configured to send a removal request to the management platform if it is detected that the Linux virtual server runs abnormally, so that the management platform deletes the Linux virtual server running abnormally and the container where the Linux virtual server is located, and recovers a container network address of the container where the Linux virtual server running abnormally is located.
The creating device 300 for the Linux virtual server in this embodiment can quickly create the Linux virtual server in the Linux virtual server cluster, and implement the horizontal expansion of the Linux virtual server to meet the requirement of the number of requests. Meanwhile, the Linux virtual server created by the creating device 300 can realize simultaneous operation of a plurality of Linux virtual servers, and accelerate the efficiency of processing the request by the Linux virtual server cluster.
The creating means of the Linux virtual server described above may be implemented in the form of a computer program that can be run on a computer device as shown in fig. 7.
Referring to fig. 7, fig. 7 is a schematic block diagram of a computer device according to an embodiment of the present application. The computer device 500 device may be a physical machine for creating a Linux virtual server in a Linux virtual server cluster.
Referring to fig. 7, the computer device 500 includes a processor 502, memory, and a network interface 505 connected by a system bus 501, where the memory may include a non-volatile storage medium 503 and an internal memory 504.
The non-volatile storage medium 503 may store an operating system 5031 and a computer program 5032. The computer programs 5032 include program instructions that, when executed, cause the processor 502 to perform a Linux virtual server creation method.
The processor 502 is used to provide computing and control capabilities that support the operation of the overall computer device 500.
The internal memory 504 provides an environment for running the computer program 5032 in the non-volatile storage medium 503, and when the computer program 5032 is executed by the processor 502, the processor 502 may be enabled to execute a method for creating a Linux virtual server.
The network interface 505 is used for network communication such as sending assigned tasks and the like. Those skilled in the art will appreciate that the configuration shown in fig. 7 is a block diagram of only a portion of the configuration associated with the present application and does not constitute a limitation of the computer device 500 to which the present application may be applied, and that a particular computer device 500 may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
Wherein the processor 502 is configured to run the computer program 5032 stored in the memory to implement the following functions: receiving a creation request sent by a management platform, wherein the creation request comprises a software image identifier; acquiring a corresponding software image according to the software image identifier, and creating a corresponding container according to the software image, wherein the software image comprises a Linux virtual server and routing software, and the Linux virtual server and the routing software are operated in the container; receiving container network addresses distributed to the containers by the management platform and virtual network addresses distributed to the Linux virtual servers, wherein the container network addresses of all the containers in the Linux virtual server cluster are different from each other, and the virtual network addresses of all the Linux virtual servers are the same; configuring the container according to the container network address, and configuring the Linux virtual server according to the virtual network address; and establishing a neighbor relation between the container and the gateway through the routing software to generate a dynamic route in the gateway so as to complete the establishment of the Linux virtual server, wherein the dynamic route comprises a destination address and a next hop address, the destination address is a virtual network address corresponding to the Linux virtual server, and the next hop address is a container network address corresponding to the container.
In an embodiment, the processor 502, after executing the establishing of the neighbor relation between the container and the gateway by the routing software to generate the dynamic route in the gateway, further implements the following functions: if the Linux virtual server is detected to be abnormally operated, sending a removal request to the management platform to enable the management platform to delete the Linux virtual server abnormally operated and the container where the Linux virtual server is located, and recovering the container network address of the container where the Linux virtual server abnormally operated is located.
In an embodiment, after the processor 502 executes the configuration of the container according to the container network address and the configuration of the Linux virtual server according to the virtual network address, the following functions are also implemented: when the Linux virtual server is operated, reading a pre-stored configuration file, wherein the configuration file comprises network address information and a port number of a processing server; and loading the configuration file into a configuration directory of the Linux virtual server so that the Linux virtual server communicates with the processing server through the network address information and the port number of the processing server.
In an embodiment, when the processor 502 executes the configuration of the container according to the container network address and the configuration of the Linux virtual server according to the virtual network address, the following functions are specifically implemented: configuring a network address of the container as the container network address by executing a pipe command, and configuring a network address of the Linux virtual server as the virtual network address by executing a Docker run command.
In an embodiment, when the processor 502 executes the neighbor relation between the container and the gateway established by the routing software to generate the dynamic route in the gateway, the following functions are specifically implemented: establishing, by the routing software and based on an OSPF protocol or a BGP protocol, a neighbor relationship between the container and a gateway to generate a dynamic route in the gateway.
In one embodiment, the routing software comprises Qugga software.
It should be understood that, in the embodiment of the present Application, the Processor 502 may be a Central Processing Unit (CPU), and the Processor 502 may also be other general-purpose processors, Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field-Programmable Gate arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components, and the like. Wherein a general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
It can be understood by those skilled in the art that all or part of the flow in the creating method for the Linux virtual server according to the above embodiments may be implemented by instructing the relevant hardware through a computer program. The computer program includes program instructions, and the computer program may be stored in a storage medium, which is a computer-readable storage medium. The program instructions are executed by at least one processor in the computer system to implement the process steps of an embodiment of the creation method including the Linux virtual server as described above.
The storage medium may be various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a magnetic disk, or an optical disk.
Those of ordinary skill in the art will appreciate that the elements and algorithm steps of the examples described in connection with the embodiments disclosed herein may be embodied in electronic hardware, computer software, or combinations of both, and that the components and steps of the examples have been described in a functional general in the foregoing description for the purpose of illustrating clearly the interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
In the several embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative. For example, the division of each unit is only one logic function division, and there may be another division manner in actual implementation. For example, various elements or components may be combined or may be integrated into another system, or some features may be omitted, or not implemented.
The steps in the method of the embodiment of the application can be sequentially adjusted, combined and deleted according to actual needs. The units in the device of the embodiment of the application can be combined, divided and deleted according to actual needs. In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a storage medium. Based on such understanding, the technical solution of the present application may be substantially or partially implemented in the prior art, or all or part of the technical solution may be embodied in a software product, which is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a terminal, or a network device) to execute all or part of the steps of the method according to the embodiments of the present application.
While the invention has been described with reference to specific embodiments, the scope of the invention is not limited thereto, and those skilled in the art can easily conceive various equivalent modifications or substitutions within the technical scope of the invention. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (10)

1. A method for creating a Linux virtual server in a Linux virtual server cluster is characterized by comprising the following steps:
receiving a creation request sent by a management platform, wherein the creation request comprises a software image identifier;
acquiring a corresponding software image according to the software image identifier, and creating a corresponding container according to the software image, wherein the software image comprises a Linux virtual server and routing software, and the Linux virtual server and the routing software are operated in the container;
receiving container network addresses distributed to the containers by the management platform and virtual network addresses distributed to the Linux virtual servers, wherein the container network addresses of all the containers in the Linux virtual server cluster are different from each other, and the virtual network addresses of all the Linux virtual servers are the same;
configuring the container according to the container network address, and configuring the Linux virtual server according to the virtual network address; and
and establishing a neighbor relation between the container and the gateway through the routing software to generate a dynamic route in the gateway so as to complete the establishment of the Linux virtual server, wherein the dynamic route comprises a destination address and a next hop address, the destination address is a virtual network address corresponding to the Linux virtual server, and the next hop address is a container network address corresponding to the container.
2. The method for creating the Linux virtual server according to claim 1, wherein after the establishing, by the routing software, the neighbor relation between the container and the gateway to generate the dynamic route in the gateway, further comprises:
if the Linux virtual server is detected to be abnormally operated, sending a removal request to the management platform to enable the management platform to delete the Linux virtual server abnormally operated and the container where the Linux virtual server is located, and recovering the container network address of the container where the Linux virtual server abnormally operated is located.
3. The method for creating the Linux virtual server according to claim 1, further comprising, after the configuring the container according to the container network address and the Linux virtual server according to the virtual network address:
when the Linux virtual server is operated, reading a pre-stored configuration file, wherein the configuration file comprises network address information and a port number of a processing server; and
and loading the configuration file into a configuration directory of the Linux virtual server so that the Linux virtual server communicates with the processing server through the network address information and the port number of the processing server.
4. The method for creating the Linux virtual server according to claim 1, wherein the configuring the container according to the container network address and the Linux virtual server according to the virtual network address comprises:
configuring a network address of the container as the container network address by executing a pipe command, and configuring a network address of the Linux virtual server as the virtual network address by executing a Docker run command.
5. The method for creating the Linux virtual server according to claim 1, wherein the establishing, by the routing software, the neighbor relation between the container and a gateway to generate a dynamic route in the gateway comprises:
establishing, by the routing software and based on an OSPF protocol or a BGP protocol, a neighbor relationship between the container and a gateway to generate a dynamic route in the gateway.
6. The method for creating the Linux virtual server of claim 1, wherein the routing software comprises Qugga software.
7. A Linux virtual server creation apparatus for creating a Linux virtual server in a Linux virtual server cluster, comprising:
the management platform comprises a request receiving unit, a creating unit and a processing unit, wherein the request receiving unit is used for receiving a creating request sent by the management platform, and the creating request comprises a software image identifier;
the creating unit is used for acquiring a corresponding software image according to the software image identifier and creating a corresponding container according to the software image, wherein the software image comprises a Linux virtual server and routing software, and the Linux virtual server and the routing software run in the container;
an address receiving unit, configured to receive a container network address allocated to the container by the management platform and a virtual network address allocated to the Linux virtual server, where container network addresses of all containers in the Linux virtual server cluster are different from each other and virtual network addresses of all Linux virtual servers are different from each other;
the configuration unit is used for configuring the container according to the container network address and configuring the Linux virtual server according to the virtual network address;
and the establishing unit is used for establishing a neighbor relation between the container and the gateway through the routing software so as to generate a dynamic route in the gateway, so as to complete the establishment of the Linux virtual server, wherein the dynamic route comprises a destination address and a next hop address, the destination address is a virtual network address corresponding to the Linux virtual server, and the next hop address is a container network address corresponding to the container.
8. The apparatus for creating the Linux virtual server of claim 7, wherein the apparatus further comprises:
and the sending unit is used for sending a removal request to the management platform to enable the management platform to delete the Linux virtual server which abnormally operates and the container thereof and recycle the container network address of the container in which the Linux virtual server which abnormally operates is located if the Linux virtual server is detected to abnormally operate.
9. A computer device comprising a memory, a processor and a computer program stored on said memory and executable on said processor, characterized in that said processor implements the method of creating a Linux virtual server according to any one of claims 1 to 6 when executing said computer program.
10. A computer-readable storage medium, characterized in that it stores a computer program comprising program instructions which, when executed by a processor, cause the processor to carry out the method of creating a Linux virtual server according to any one of claims 1 to 6.
CN201810606437.8A 2018-06-13 2018-06-13 Linux virtual server creating method and device, computer equipment and storage medium Active CN108833163B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201810606437.8A CN108833163B (en) 2018-06-13 2018-06-13 Linux virtual server creating method and device, computer equipment and storage medium
PCT/CN2018/109383 WO2019237588A1 (en) 2018-06-13 2018-10-09 Linux virtual server creation method, device, computer device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810606437.8A CN108833163B (en) 2018-06-13 2018-06-13 Linux virtual server creating method and device, computer equipment and storage medium

Publications (2)

Publication Number Publication Date
CN108833163A CN108833163A (en) 2018-11-16
CN108833163B true CN108833163B (en) 2020-08-28

Family

ID=64143828

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810606437.8A Active CN108833163B (en) 2018-06-13 2018-06-13 Linux virtual server creating method and device, computer equipment and storage medium

Country Status (2)

Country Link
CN (1) CN108833163B (en)
WO (1) WO2019237588A1 (en)

Families Citing this family (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111340230B (en) * 2018-12-18 2024-01-23 北京小桔科技有限公司 Service providing method, device, server and computer readable storage medium
CN110224860B (en) * 2019-05-17 2023-05-26 平安科技(深圳)有限公司 Load balancing application creation method and device, computer equipment and storage medium
CN110266761B (en) * 2019-05-17 2022-04-19 平安科技(深圳)有限公司 Load balancing application creation method and device, computer equipment and storage medium
CN112243044B (en) * 2019-07-16 2023-05-19 广州虎牙科技有限公司 Container address allocation method and device
CN112311568B (en) * 2019-07-26 2022-06-03 中移(苏州)软件技术有限公司 Virtual network creating method and device and computer storage medium
CN112532675B (en) * 2019-09-19 2023-04-18 贵州白山云科技股份有限公司 Method, device and medium for establishing network edge computing system
CN110825399B (en) * 2019-11-07 2024-02-20 郑州悉知信息科技股份有限公司 Deployment method and device of application program
CN111124611A (en) * 2019-12-19 2020-05-08 深圳市优必选科技股份有限公司 Robot management method, robot management device and electronic equipment
CN111124692B (en) * 2020-01-02 2023-05-12 神州数码融信软件有限公司 Service request processing system
CN111464603B (en) * 2020-03-24 2022-03-29 聚好看科技股份有限公司 Server capacity expansion method and system
CN111654559B (en) * 2020-05-29 2023-04-07 深圳前海微众银行股份有限公司 Container data transmission method and device
CN112596741B (en) * 2020-11-16 2022-08-30 新华三大数据技术有限公司 Video monitoring service deployment method and device
CN113835825A (en) * 2021-03-03 2021-12-24 京东科技控股股份有限公司 Dynamic adjustment method and device of virtual service host, server and storage medium
CN113568708B (en) * 2021-07-29 2022-10-04 马上消费金融股份有限公司 Platform creation method, device and equipment
CN117811838B (en) * 2024-02-29 2024-05-17 博上(山东)网络科技有限公司 HAProxy server IP white list synchronization method and system

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1482712A1 (en) * 2003-05-30 2004-12-01 Ixia Virtual network addresses
CN103152256A (en) * 2013-02-22 2013-06-12 浪潮电子信息产业股份有限公司 Virtual routing network design method based on cloud computing data center
CN103259735A (en) * 2013-05-15 2013-08-21 重庆邮电大学 Communication method of programmable virtualized router based on NetFPGA
CN105393220A (en) * 2013-05-15 2016-03-09 思杰系统有限公司 Systems and methods for deploying a spotted virtual server in a cluster system
CN106067858A (en) * 2016-05-24 2016-11-02 中国联合网络通信集团有限公司 Communication means between container, Apparatus and system
CN106326226A (en) * 2015-06-16 2017-01-11 苏宁云商集团股份有限公司 Method and system for starting database service on public cloud
CN107666446A (en) * 2017-09-14 2018-02-06 北京京东尚科信息技术有限公司 Downlink traffic, uplink traffic, bidirectional traffics method for limiting and device

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8943203B1 (en) * 2009-07-10 2015-01-27 Netapp, Inc. System and method for storage and deployment of virtual machines in a virtual server environment
CN107368358B (en) * 2016-05-11 2020-07-24 华为技术有限公司 Device and method for realizing migration of virtual machine of client among different hosts
CN108111470B (en) * 2016-11-25 2020-06-16 华为技术有限公司 Container deployment method, communication method between services and related device
CN106973014B (en) * 2017-01-22 2021-07-30 创新先进技术有限公司 Anycast route publishing system and method and electronic equipment

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1482712A1 (en) * 2003-05-30 2004-12-01 Ixia Virtual network addresses
CN103152256A (en) * 2013-02-22 2013-06-12 浪潮电子信息产业股份有限公司 Virtual routing network design method based on cloud computing data center
CN103259735A (en) * 2013-05-15 2013-08-21 重庆邮电大学 Communication method of programmable virtualized router based on NetFPGA
CN105393220A (en) * 2013-05-15 2016-03-09 思杰系统有限公司 Systems and methods for deploying a spotted virtual server in a cluster system
CN106326226A (en) * 2015-06-16 2017-01-11 苏宁云商集团股份有限公司 Method and system for starting database service on public cloud
CN106067858A (en) * 2016-05-24 2016-11-02 中国联合网络通信集团有限公司 Communication means between container, Apparatus and system
CN107666446A (en) * 2017-09-14 2018-02-06 北京京东尚科信息技术有限公司 Downlink traffic, uplink traffic, bidirectional traffics method for limiting and device

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
Linux 虚拟服务器管理系统的设计与实现;史宇锋;《中国优秀硕士学位论文全文数据库信息科技辑》;20150601;全文 *

Also Published As

Publication number Publication date
WO2019237588A1 (en) 2019-12-19
CN108833163A (en) 2018-11-16

Similar Documents

Publication Publication Date Title
CN108833163B (en) Linux virtual server creating method and device, computer equipment and storage medium
WO2019237584A1 (en) Container management method, device, computer apparatus, and storage medium
US20050283606A1 (en) Selecting a boot image
CN109840096B (en) Installation method and device of operating system
CN108737224B (en) Message processing method and device based on micro-service architecture
CN106549789B (en) Method and system for realizing server installation
CN103746977A (en) Connection method and device for Linux server
CN110266761B (en) Load balancing application creation method and device, computer equipment and storage medium
CN107087041B (en) Method and device for statically binding IP address to DHCP client
CN106873970B (en) Installation method and device of operating system
CN109819023B (en) Distributed transaction processing method and related product
CN113810230A (en) Method, device and system for carrying out network configuration on containers in container cluster
CN108933844B (en) Method and equipment for providing DHCP service
CN103987064A (en) Access point (AP) upgrading method and device
CN110012111B (en) Data service cluster system and data processing method
CN114866515A (en) IP address configuration method, device, electronic equipment and storage medium
WO2023198056A1 (en) Firmware update method for embedded device, and embedded device
CN110417856B (en) Capacity expansion method, device, equipment and storage medium for multi-active load balancing application
CN111262771B (en) Virtual private cloud communication system, system configuration method and controller
CN111600833B (en) Network operating system and message forwarding method
CN111752576A (en) Forwarding system deployment method based on 5G data, terminal and storage medium
CN107968718B (en) Method, device and equipment for confirming main standby state
CN113347287B (en) Host discovery and addition method, device, equipment and medium in data center
CN108574587B (en) Capacity updating method and device for distributed equipment
JP2006113754A (en) Software update device and method

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