CN110287021B - Load balancing application management method and device, computer equipment and storage medium - Google Patents

Load balancing application management method and device, computer equipment and storage medium Download PDF

Info

Publication number
CN110287021B
CN110287021B CN201910411129.4A CN201910411129A CN110287021B CN 110287021 B CN110287021 B CN 110287021B CN 201910411129 A CN201910411129 A CN 201910411129A CN 110287021 B CN110287021 B CN 110287021B
Authority
CN
China
Prior art keywords
load balancing
lvs
preset
application
interface
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
CN201910411129.4A
Other languages
Chinese (zh)
Other versions
CN110287021A (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 CN201910411129.4A priority Critical patent/CN110287021B/en
Publication of CN110287021A publication Critical patent/CN110287021A/en
Application granted granted Critical
Publication of CN110287021B publication Critical patent/CN110287021B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5083Techniques for rebalancing the load in a distributed system
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1001Protocols in which an application is distributed across nodes in the network for accessing one among a plurality of replicated servers
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/2866Architectures; Arrangements
    • H04L67/30Profiles

Abstract

The embodiment of the application provides a load balancing application management method, a load balancing application management device, computer equipment and a storage medium, relates to the technical field of cloud computing, and can be applied to a PaaS platform. The method comprises the following steps: creating LVS load balancing application according to a preset creation interface; after the LVS load balancing application is established, if an opening instruction for opening a preset management interface is received, opening the preset management interface according to the opening instruction; and if a management instruction triggered by a management interface corresponding to a preset management interface is received, managing the created LVS load balancing application according to the management instruction. The embodiment of the application can manage the LVS load balancing application created through the preset creation interface on the management interface corresponding to the preset management interface. Different information of the created LVS load balancing application can be managed through a management interface of the preset management interface, so that the efficiency of LVS load balancing application management is improved, and the user experience is improved.

Description

Load balancing application management method and device, computer equipment and storage medium
Technical Field
The present application relates to the field of cloud computing technologies, and in particular, to a method and apparatus for managing load balancing applications, a computer device, and a storage medium.
Background
At present, the management of Platform-as-a-Service (Platform-as-Service) on LVS load balancing application in the market is manually modified by users with corresponding authorities, so that the users needing modification have higher professional background knowledge, are manually modified, have very complicated modification operation and are easy to make mistakes. In addition, after creating the LVS load balancing application of the container application, if an enterprise has multiple sub-companies, each sub-company wants to use a separate port; or an enterprise may have multiple applications, each requiring a port. In the above cases, management of LVS load balancing applications is involved.
Disclosure of Invention
The embodiment of the application provides a load balancing application management method, a device, computer equipment and a storage medium, which can manage a created LVS load balancing application through a management interface corresponding to a preset management interface, and improve the efficiency of LVS load balancing application management.
In a first aspect, an embodiment of the present application provides a method for managing a load balancing application, where the method includes:
Creating LVS load balancing application according to a preset creation interface; after the LVS load balancing application is established, if an opening instruction for opening a preset management interface is received, opening the preset management interface according to the opening instruction; and if a management instruction triggered by a management interface corresponding to a preset management interface is received, managing the created LVS load balancing application according to the management instruction.
In a second aspect, an embodiment of the present invention provides a load balancing application management apparatus, where the load balancing application management apparatus includes a unit corresponding to the method for executing the first aspect.
In a third aspect, an embodiment of the present invention provides a computer device, where the computer device includes a memory, and a processor connected to the memory;
the memory is configured to store a computer program, and the processor is configured to execute the computer program stored in the memory, so as to perform the method according to the first aspect.
In a fourth aspect, an embodiment of the present invention provides a computer readable storage medium storing a computer program, which when executed by a processor, implements the method according to the first aspect.
The embodiment of the application can manage the LVS load balancing application created through the preset creation interface on the management interface corresponding to the preset management interface. Different information of the created LVS load balancing application can be managed through a management interface of a preset management interface, so that corresponding management is not needed to be carried out by manual modification, the management operation is convenient and simple, the management is realized automatically, errors are not easy to occur, and the efficiency of LVS load balancing application management is improved; and various related information of the created LVS load balancing application can be obtained intuitively and clearly through a management interface of a preset management interface, the information is transparent and intuitive, and the user experience is improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for the description of the embodiments will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present application, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a flow chart of a load balancing application management method according to an embodiment of the present application;
FIG. 2 is a schematic diagram of a setup interface provided by an embodiment of the present application;
fig. 3 is a schematic sub-flowchart of a load balancing application management method according to an embodiment of the present application;
FIG. 4 is a schematic illustration of a setup interface provided by another embodiment of the present application;
fig. 5 is a schematic sub-flowchart of a load balancing application management method according to an embodiment of the present application;
fig. 6 is a flow chart of a port adding method of the load balancing application management method according to the embodiment of the present application;
fig. 7 is a flowchart of a method for deleting a port of the load balancing application management method according to the embodiment of the present application;
fig. 8 is a flowchart of a configuration parameter modification method of a load balancing application management method according to an embodiment of the present application;
fig. 9 is a schematic block diagram of a load balancing application management apparatus provided by an embodiment of the present application;
FIG. 10 is a schematic block diagram of a first creation unit provided by an embodiment of the application;
FIG. 11 is a schematic block diagram of a management unit provided by an embodiment of the present application;
FIG. 12 is a schematic block diagram of a management unit provided by an embodiment of the present application;
FIG. 13 is a schematic block diagram of a management unit provided by an embodiment of the present application;
FIG. 14 is a schematic block diagram of a management unit provided by an embodiment of the present application;
Fig. 15 is a schematic block diagram of a computer device provided by an embodiment of the present application.
Detailed Description
The following description of the embodiments of the present application will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are some, but not all embodiments of the application. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
Fig. 1 is a flow chart of a load balancing application management method according to an embodiment of the present application. As shown in FIG. 1, the method includes S101-S103.
S101, creating LVS load balancing application according to a preset creation interface.
The preset creation interfaces comprise a first preset creation interface and a second preset creation interface. The first preset creating interface is used for firstly creating the container application, then creating the LVS load balancing application of the container application, and setting the association relation between the container application and the LVS load balancing application. It can be appreciated that, through the first preset creation interface, the container application and the LVS load balancing application of the container application are created at one time, that is, the container application is created, and the LVS load balancing application of the container application is created at the same time, and the association relationship between the container application and the LVS load balancing application is set. The second preset creating interface is used for creating the LVS load balancing application. Applicable scenarios include the following: the container application has been created, such as by running the container application for a period of time, and then determining to create an LVS load balancing application for the container application. In this scenario, a load balancing application needs to be created separately for the container application, i.e. a second pre-set creation interface needs to be used. Specifically, the first preset creation interface and the second preset creation interface may exist in the form of a setup interface and an interface function.
It should be noted that only the LVS load balancing application created through the preset creation interface can be managed on the management interface corresponding to the preset management interface.
In an embodiment, if the preset creation interface is the first preset creation interface, the LVS load balancing application is created according to the preset creation interface, that is, step S101 includes the following steps:
acquiring information of a container application and information of a load balancing application set through a first preset creation interface, wherein the type of the load balancing application is LVS; and creating the container application and the LVS load balancing application by using a first preset creating interface according to the information of the set container application, the information of the load balancing application and the preset load balancing parameter information, and setting the association relation between the created container application and the LVS load balancing application.
The first preset creating interface comprises a setting interface through which information of the container application and information of the load balancing application are set, wherein the setting interface is written by a developer and can be presented in the form of a setting interface. As shown in fig. 2, a schematic diagram of a setting interface corresponding to the setting interface is shown. And setting information of the container application to be created and information of the load balancing application through a setting interface of the first preset creation interface. Specifically, information of a container application to be created and information of a load balancing application input/selected by a user are received. Because the information of the container application and the information of the load balancing application can be set in the preset creation interface, the information of the container application and the information of the load balancing application are acquired simultaneously.
The information of the container application comprises application environment of the container application, area of the container application, number of container instances of the container application, mirror image information of the container application and the like. In other embodiments, the information of the container application also includes whether monitoring is enabled, an application administrator or application creator (the person who created the container application may manage the created container application), a resource group of the container application, and so on. The application environment of the container application comprises a production environment, a test environment, a development environment and the like. Wherein, the production environment means that the container application is successfully established and then is connected with the external environment or is accessed by an external user; the test environment means that the container application is used for testing after being successfully created; the development environment means that the container application is successfully created for development and use. The area of the container application refers to the location of the machine room where the container application was created, and consists of two parts: "region" + "safe region". Where a "safe zone" is a sub-zone below the "zone". It is understood that the container application is created in the machine room of the "xxx security zone" below the "xx zone". However, determining in which specific machine room the container application is created needs to be decided together according to the application environment of the container application and the area of the container application, which can be understood as creating the container application in the machine room corresponding to the area of the container application in a certain application environment. It is understood that the machine room corresponding to different application environments in the same area is different. The number of container instances of a container application refers to the number of containers of the container application, and the number of containers of a container application is not limited. Wherein the number of container instances may be determined based on the amount of access to the container application. The container instance image information includes an image version, an image type, and an image name. Wherein the mirrored version comprises an official version, an official version 1.1, an official version 4.5, and the like; the image type refers to which image is used by the container instance, such as nginx, tomcat, weblogic, springboot, etc.; mirror name refers to a specific mirror name, such as tomcat1.1, etc. The mirror image information can be obtained from a corresponding mirror image warehouse for selection by a user, wherein the corresponding mirror image warehouse refers to a mirror image warehouse under the machine room, wherein the application environment of the container application and the area of the container application are determined together. The creation of the container application is charged, and the resource group of the container application includes a resource account for the fee used by the container application creation. Whether monitoring is enabled refers to whether monitoring of the container instance of the container application is selected, such as the use of resources such as CPU/memory/IO of the container instance. In some embodiments, the information of the container application further includes a beneficiary resource pool, which refers to a sub-company/department that creates the container application, decides the IP network segments assigned by the created container and the host resources of the container, and uses different IP network segments and host resources for different resource pools. If the information of the container application also includes a beneficiary resource pool, the beneficiary resource pool, along with the application environment of the container application, the region of the container application, determines the IP network segment allocated by the created container instance, and the host resources of the container instance.
The information of the load balancing application comprises the type of the load balancing application and the port information of the load balancing application, wherein the type of the load balancing application is LVS. The port information of the load balancing application can be one or a plurality of ports, and the ports of the load balancing application refer to access ports supported by the LVS load balancing application, namely ports accessed in an http mode, such as ports 80 and 443.
In an embodiment, as shown in fig. 3, according to the set information of the container application, the set information of the load balancing application, and the preset load balancing parameter information, using a first preset creation interface to create the container application and the LVS load balancing application, and setting an association relationship between the created container application and the LVS load balancing application, including the following steps S1011-S1017. The first preset creation interface further comprises an interface function. The first preset creation interface is understood as an interface function corresponding to the first preset creation interface.
S1011, using a first preset creation interface to create a container instance of the container application according to the application environment of the container application, the area of the container application, the number of container instances and the container application mirror information in the container application information.
Specifically, step S1011 includes: determining a container instance IP of the container application according to the application environment of the container application, the area of the container application and the number of container instances of the container application in the set container application information; determining a mirror image warehouse for storing mirror image information of the container application according to the application environment of the container application and the area of the container application, and extracting a specific mirror image required for creating the container instance from the determined mirror image warehouse according to the mirror image type, the mirror image version and the mirror image name of the mirror image information of the container application; determining resources to be occupied by creating the container instance according to the container mirror image type and the mirror image version, and determining a host machine for creating the container instance according to the application environment of the container application, the area of the container application and the resources to be occupied by creating the container instance; creating a container instance of the container application on the determined host according to the determined specific image, and binding the created container instance with the determined container instance IP to set the determined container instance IP as the IP of the created container instance.
Wherein, the location of the creation of the container application, i.e. in which specific machine room the container application is created, can be determined according to the application environment of the container application, the area of the container application. It should be noted that the mirror warehouse for storing the mirror resources corresponds to each region in each application environment. All the mirror resources needed to be used by the region in the application environment are stored in the mirror repository. Determining a host machine that creates a container application includes: acquiring an IP address pool of a host machine which is pre-allocated at a corresponding position (under the machine room) in a database and used for creating a container instance; and determining the host machine for creating the container instance from the IP address pool of the host machine according to the resources required to be occupied by the container instance. Creating a container instance requires some resources to be taken up on the host, and therefore the resources to be taken up to create the container instance need to be determined first to determine whether the host has sufficient resources to create the container instance. The resources needed to be occupied by creating the container instance comprise a CPU, a memory, monitoring resources and the like. Wherein creating a container instance of the container application on the determined host according to the determined specific image and binding the created container instance with the determined container instance IP comprises: transmitting, by the container orchestration tool, the determined specific image to the determined host that created the container instance, for creation of the container instance; the creation is completed and the container instance is bound to the determined container instance IP by an operation tool, such as an easy tool, to connect the container instance.
And S1012, determining a host machine for creating the LVS load balancing application according to the information of the set container application, and creating the LVS container on the host machine.
The location of creation of the container application, i.e., in which host machine of a particular machine room the container application is created, may be determined based on the application environment of the container application, the region of the container application. After determining the host that created the load balancing application, then creates an LVS container for the LVS load balancing application.
Specifically, step S1012 includes: determining LVS mirror image information according to the application environment and the region of the container application in the container application information; determining a host for creating the LVS load balancing application according to the application environment of the container application, the area of the container application and the LVS mirror image information; and creating a container instance of the LVS load balancing application on the host according to the LVS mirror information, and calling the created container instance of the LVS load balancing application as an LVS container.
When the LVS load balancing application is created, a default configuration file is generated according to LVS mirror image information, and the configuration file is stored in a preset directory.
S1013, virtual IP and management IP are allocated to the created LVS container.
The Virtual IP (VIP) is a service IP, which is an IP required for providing a load balancing service, and may be understood as an IP used externally, that is, an IP corresponding to an external user requesting incoming. The management IP is an IP used to internally manage the LVS container, such as an IP used to log in to the LVS container. Note that since LVS load balancing is four-layer load balancing. The four-layer load balancing receives the request through the virtual IP+ port, forwards the request according to the destination address and the source address in the request, cannot modify or judge the specific type of the request resource, and forwards the request to a real server of the request to be processed through a load balancing algorithm, wherein the real server is a container instance corresponding to the container application in the embodiment. Because of the four-layer load balancing, the load balancing can be performed on all the applications without considering the specific application to be processed. Therefore, two IPs are distributed for the LVS container, so that the LVS can conveniently provide service to the outside, and meanwhile, the LVS container can be conveniently managed by the PaaS platform.
In one embodiment, step S1013 includes the steps of: acquiring two idle IPs from a pre-allocated IP address pool according to the application environment of the container application and the area of the container application in the information of the container application; the two acquired idle IPs are taken as a virtual IP and a management IP, and the virtual IP and the management IP are allocated to the created LVS container. Wherein, the pre-allocated IP address pool can be determined according to the application environment of the container application and the area of the container application in the information of the container application. It should be noted that Virtual IP (VIP) and management IP addresses may be obtained from free IP of two different pre-assigned address pools, such as VIP address pools and management IP address pools; or it may be obtained from a pre-allocated address pool, that is, two free IPs are obtained from an IP address pool, where one free IP is VIP and one free IP is management IP.
S1014, reconstructing a configuration file of the LVS load balancing application according to the virtual IP, the created container instance of the container application and the port information.
Since a default configuration file is generated according to LVS mirror information when creating LVS containers, the configuration file cannot be really used for load balancing. Therefore, the configuration file needs to be reconstructed.
In one embodiment, step S1014 includes: taking the virtual IP, the created container instance of the container application and the port information as variables, and transmitting the variables to a preset configuration file generation interface; generating a new configuration file according to a preset configuration file template integrated in the preset configuration file generation interface; and uploading the new configuration file to a preset directory where the configuration file of the LVS container is located so as to replace the configuration file generated when the LVS container of the LVS load balancing application is created. Wherein, step S1014 further comprises: and generating a preset configuration file template. The step of generating the preset configuration file template comprises the following steps: acquiring preset LVS load balancing parameter information and preset container instance parameter information; setting virtual IP parameters, IP parameters of container examples and load balancing port parameters; and generating a preset configuration file template according to preset LVS load balancing parameter information, preset container instance parameter information, preset virtual IP parameters, container instance IP parameters and load balancing port parameters. In this embodiment, the preset configuration file template may be understood as a configuration file corresponding to a port number, including relevant configuration information corresponding to the port number.
As in one embodiment, the generated profile template may include the following:
wherein xxx.yyy.zz.mmm represents VIP, lvs_port represents a port of load balancing application, lvs_algorithm represents LVS load balancing algorithm parameters, lvs_ind represents LVS load balancing forwarding mode parameters, and protocol represents LVS load balancing forwarding protocol parameters. xxx.yyy.zzz.nnn denotes the IP of the container instance, weight denotes the weight parameter of the server corresponding to the container instance, tcp_check denotes the TCP health CHECK parameter of the server corresponding to the container instance, and the parameters include the following parameters: connection_timeout represents a connection timeout parameter, nb_get_retry represents a reconnection number parameter, delay_before_retry represents a reconnection interval time parameter, and connection_port represents a connected port parameter.
And S1015, starting LVS load balancing service of the LVS container.
S1016, configuring the sub-network card of the LVS container to bind the virtual IP with the sub-network card of the LVS container.
S1017, adding a route for the configured sub-network card to finish creating LVS load balancing application when creating the container application.
The embodiment of the method automatically completes the creation of the container application and the creation of the LVS load balancing application, automatically realizes the basic setting of the created LVS load balancing application, accelerates the creation speed and efficiency, and saves the time cost and the labor cost.
In an embodiment, step S1015 may follow step S1017.
In an embodiment, if the preset creation interface is the second preset creation interface, the LVS load balancing application is created according to the preset creation interface, that is, step S101 includes the following steps:
acquiring information of a load balancing application set through a second preset creation interface and information of an associated application associated with the load balancing application, wherein the type of load balancing is LVS; and creating the LVS load balancing application of the associated application by using a second preset creation interface according to the set information of the load balancing application and the information of the associated application.
The second preset creation interface comprises a setting interface through which information of a load balancing application to be created and an associated application associated with the load balancing application are set, wherein the setting interface is written by a developer and can be presented in the form of a setting interface. As shown in fig. 4, a schematic diagram of a setting interface corresponding to the setting interface of the second preset creation interface is shown. And setting information of the load balancing application to be created and an associated application associated with the load balancing application through the setting interface. The information of the load balancing application includes a load balancing application type (LVS by default), an associated application, a load balancing algorithm (such as polling, etc.), a LVS load balancing forwarding mode (such as DR mode, in which a new MAC address is repackaged for a received request packet to forward to a corresponding server (i.e. a container instance of the associated application)), a LVS load balancing forwarding protocol (TCP by default, which uses LVS four-layer load balancing by default), a health checking mode, a connected port, and so on.
The second preset creating interface further includes an interface function, and creates an LVS load balancing application by using the second preset creating interface, which can be understood as obtaining information of the set LVS load balancing application by using the interface function corresponding to the second preset creating interface, obtaining information of an associated application, and creating the LVS load balancing application of the associated application according to the information of the associated application and the information of the LVS load balancing application.
It should be noted that, the load balancing parameters in the first preset creating interface are preset load balancing parameters, and when the load balancing application is created through the second preset creating interface, the parameters of the load balancing application can be set through the setting interface of the second preset creating interface.
S102, after the LVS load balancing application is established, if an opening instruction for opening the preset management interface is received, opening the preset management interface according to the opening instruction.
The preset management interfaces are a plurality of different management interfaces written by developers. All information of all LVS load balancing applications created through a preset creation interface and relevant information of servers corresponding to LVS load balancing (namely relevant information of container applications or associated applications) can be checked in a management interface. And modifying the related information of all the created LVS load balancing applications and the related information of the server corresponding to the LVS load balancing.
Each LVS load balancing application includes information of the LVS load balancing application, such as virtual IP and management IP of an LVS container of the LVS load balancing application, port information of the LVS load balancing application, parameter information of the LVS load balancing application (such as parameters of an LVS load balancing algorithm, an LVS load balancing forwarding protocol, etc.), creator of the LVS load balancing application, etc. The modification of all information of the LVS load balancing application comprises adding ports of the LVS load balancing application, deleting ports of the LVS load balancing application, modifying configuration parameters of the LVS load balancing application and the like. The relevant information of the servers corresponding to the LVS load balancing comprises weight information corresponding to each server and health check mode information (comprising connection timeout time, reconnection times, reconnection interval time and the like) corresponding to each server.
And S103, if a management instruction triggered by a management interface corresponding to a preset management interface is received, managing the created LVS load balancing application according to the management instruction.
The management instruction is triggered by a user clicking on an associated button on the management interface, wherein the management instruction comprises a port adding instruction, a port deleting instruction, a configuration parameter modifying instruction, a query instruction and the like. The port adding instruction, the port deleting instruction and the configuration parameter modifying instruction all relate to modification of LVS load balancing application, and can be collectively called as modifying instruction.
In one embodiment, as shown in fig. 5, if the management instruction is a modification instruction, step S103 includes S1031-S1037.
S1031, if a modification instruction triggered by a management interface corresponding to a preset management interface is received, calling a preset modification interface corresponding to the modification instruction to set information to be modified through the preset modification interface.
The preset modification interface is developed by a developer. If the modification instruction is a port adding instruction, the corresponding preset modification interface is a preset port adding interface, and the information to be modified is port information to be added; if the modification instruction is a port deletion instruction, the corresponding preset modification interface is a preset port deletion interface, and the information to be modified is port information to be deleted; if the modification instruction is a configuration parameter modification instruction, the corresponding preset modification interface is a preset configuration modification interface, and the information to be modified is configuration parameter information to be modified.
S1032, if a setting completion instruction is received, the set information to be modified is obtained.
The setting completion instruction is triggered by clicking a related button such as 'submit' by a user, and if the setting completion instruction is ended, the set information to be modified is obtained.
S1033, determining the virtual IP of the LVS container corresponding to the LVS load balancing application.
And obtaining the virtual IP of the LVS container corresponding to the LVS load balancing application from the database. Wherein, LVS container refers to a container that creates an LVS load balancing application. The virtual IP is an IP that the load balancing application needs to use to provide a load balancing service, and may also be understood as an IP that is used externally, i.e. an IP corresponding to an external user requesting incoming.
S1034, obtaining the configuration file of the LVS load balancing application according to the virtual IP, and downloading the configuration file to the local.
Specifically, determining a host of the LVS container according to VIP; determining the LVS container on the host according to the VIP, and acquiring a configuration file of the LVS load balancing application from the LVS container; and downloading the acquired configuration file to a local preset directory. It should be noted that the obtained configuration file is downloaded locally to modify the configuration file, instead of directly modifying the configuration file remotely on the LVS container, which is to consider that if the network is interrupted during the modification of the configuration file, the process of rewriting is interrupted, that is, the influence of accidents occurring during the remote rewriting on the rewriting is eliminated, and on the other hand, the speed of rewriting the configuration file locally is faster than that of rewriting the configuration file remotely.
S1035, according to the information to be modified, modifying the configuration file to obtain a target configuration file.
And S1036, pushing the target configuration file into the LVS container.
After the configuration file is modified locally, the modified target configuration file is pushed to the LVS container from a preset catalog.
And S1037, restarting the load balancing service of the LVS container so as to enable the target configuration file to be effective.
In particular, restart commands may be used to restart the load balancing services of the LVS containers.
The embodiment realizes the modification of LVS load balancing application information, and the modification process is automatically completed, so that the modification speed is improved, and the method is convenient and quick; meanwhile, the user who does not need to be modified has higher professional background knowledge, so that the labor cost and the maintenance cost are saved; and when the configuration file is modified, the configuration file is downloaded to the local for modification, so that the modification speed is improved.
The following is a further detailed description of how the LVS load balancing application is managed when a port add instruction, a port delete instruction, and a configuration parameter modify instruction are received, respectively.
If the modification instruction is a port adding instruction, that is, the management instruction is a port adding instruction, correspondingly, the method for managing the created LVS load balancing application includes a port adding method. As shown in fig. 6, the method for adding ports, corresponding to step S103, includes the following steps S1031a-S1039a:
S1031a, if a port adding instruction triggered by a management interface corresponding to a preset management interface is received, calling the preset port adding interface to set port information to be added through the preset port adding interface, wherein the port information comprises a port number.
The preset port adding interface is developed by a developer, and through the preset port adding interface, newly added port information required by the LVS load balancing application can be set, namely, the port information to be added is set. The port information to be added includes a port number to be added. Such as port numbers 443, 7001 to be added.
S1032a, if a setting completion instruction is received, obtaining the set port number to be added.
And S1033a, judging whether the port number to be added exists.
The method includes that port information corresponding to the LVS load balancing application is stored in a management platform of the LVS load balancing application, and then whether the set port number exists or not is judged, including: acquiring a port number corresponding to the LVS load balancing application stored in a management platform; comparing the acquired port number with the set port number to be added; if the set port number to be added does not exist in the obtained port numbers, determining that the set port number to be added does not exist, otherwise, determining that the set port number to be added already exists. It should be noted that if there are a plurality of port numbers to be added, it is determined that there are already a plurality of port numbers to be added.
If the port number to be added already exists in the configuration file, executing step S1034a; if the port number to be added does not exist in the configuration file, step S1035a is performed.
S1034a, the presentation is performed.
And S1035a, determining the virtual IP of the LVS container corresponding to the LVS load balancing application.
S1036a, obtaining the configuration file of the LVS load balancing application according to the virtual IP, and downloading the configuration file to the local.
S1037a, adding a configuration code corresponding to the port number to be added in the configuration file according to the port number to be added to form a target configuration file.
The configuration code corresponding to the port number can be obtained by the following method: acquiring a preset configuration file template, the port number to be added, the virtual IP and the IP information of a server corresponding to the LVS load balancing application, wherein the preset configuration file template is a configuration template corresponding to the port number; filling the port number to be added, the virtual IP and the IP information of the server corresponding to the LVS load balancing application into corresponding positions in the preset configuration file template to form a configuration code corresponding to the port number to be added; the configuration code is appended to the end of the configuration file to form a target configuration file.
The preset configuration file template is a configuration template corresponding to a port number, and the template includes the port number, VIP corresponding to the port number, load balancing related information (including a load balancing algorithm, a load balancing forwarding mode, a load balancing forwarding protocol, etc.), IP addresses of all servers corresponding to the port number (the IP addresses of the servers are container applications or container instances of related applications), parameters of a health check mode corresponding to each IP address, weight of each server, and the like.
And S1038a, pushing the target configuration file into the LVS container.
And S1039a, restarting the load balancing service of the LVS container so as to enable the target configuration file to be effective.
The port adding process is automatically completed in the whole process, so that the speed of adding the interface is improved, and the port adding process is convenient and quick; meanwhile, the user who does not need to be modified has higher professional background knowledge, so that the labor cost and the maintenance cost are saved; and when the port is added, the configuration file can be locally finished without logging in the LVS container, so that the port adding speed is improved.
If the modification instruction is a port deletion instruction, that is, the management instruction is a port deletion instruction, correspondingly, the method for managing the created LVS load balancing application includes a port deletion method. As shown in fig. 7, the method for deleting a port, corresponding to step S103, includes the following steps S1031b-S1039b:
S1031b, if a port deleting instruction triggered by a management interface corresponding to the preset management interface is received, calling the preset port deleting interface to set port information to be deleted through the preset port deleting interface, wherein the port information comprises a port number.
The preset port deleting interface is developed by a developer, and through the preset port deleting interface, the port information required to be deleted by the LVS load balancing application can be set, namely the port information to be deleted is set. The port information to be deleted includes a port number to be deleted. If the port number to be deleted is 443.
S1032b, if a setting completion instruction is received, obtaining the set port number to be deleted.
And S1033b, judging whether the port number to be deleted exists.
And storing port information corresponding to the LVS load balancing application in a management platform of the LVS load balancing application, and judging whether the port number to be deleted exists or not according to the stored port information.
If the port number to be deleted does not exist, executing step S1034b; if the port number to be deleted already exists, step S1035b is performed.
S1034b, the presentation is performed.
And S1035b, determining the virtual IP of the LVS container corresponding to the LVS load balancing application.
S1036b, obtaining the configuration file of the LVS load balancing application according to the virtual IP, and downloading the configuration file to the local.
S1037b, according to the port number to be deleted, locating a configuration code area corresponding to the port number to be deleted in the configuration file, and deleting codes in the configuration code area corresponding to the port number to be deleted to form a target configuration file.
Specifically, a start line and an end line corresponding to the port number to be deleted are located in the configuration file, and a code area between the start line and the end line is used as a configuration code area corresponding to the port number to be deleted. It should be noted that if there are a plurality of port numbers to be deleted, the configuration code area corresponding to the port number to be deleted is sequentially located. The method for locating the initial row corresponding to the port number to be deleted comprises the following steps: detecting a row where the port number to be deleted appears for the first time, and taking the row where the port number to be deleted appears for the first time as a starting row. The method for locating the end row corresponding to the port number to be deleted comprises the following steps: if the starting line of the other port number is detected, determining a line in front of the starting line of the other port number as an end line; or detecting that the first bracket of the port number to be deleted is matched with the other bracket in the pair, and taking the row where the other bracket is located as the end row.
And S1038b, pushing the target configuration file into the LVS container.
And S1039b, restarting the load balancing service of the LVS container so as to enable the target configuration file to be effective.
The process of deleting the ports is automatically completed in the whole course, so that the speed of adding and deleting is improved, and the method is convenient and quick; meanwhile, the user who does not need to be modified has higher professional background knowledge, so that the labor cost and the maintenance cost are saved; and when the port is deleted, the configuration file can be locally finished without logging in the LVS container, so that the speed of deleting the port is improved.
Since the configuration file generated by using the configuration file template is used when creating the LVS load balancing application through the first preset creation interface, the parameters of the configuration file are not adapted to each different scenario, and thus modification of the load balancing configuration parameters may be involved. Even LVS load balancing applications created through the second preset creation interface may involve modification of the load balancing configuration parameters. Previously, the modification mode of the load balancing configuration parameters is to log on the LVS container to modify the configuration parameters in the configuration file, and the modification is performed manually, so that strong expertise is required.
If the modification instruction is a configuration parameter modification instruction, that is, the management instruction is a configuration parameter modification instruction, correspondingly, the method for managing the created LVS load balancing application includes a method for modifying the configuration parameter. As shown in fig. 8, the method for modifying the configuration parameters, corresponding to step S103, includes the following steps S1031c-S1037c:
s1031c, if a configuration parameter modification instruction triggered by the management interface corresponding to the preset management interface is received, calling the preset configuration modification interface to set configuration parameter information to be modified through the preset configuration modification interface.
The preset configuration modification interface is developed by a developer, and configuration parameter information required to be modified by the LVS load balancing application can be modified through the preset configuration modification interface. The configuration parameter information includes LVS load balancing related information and related information of a server corresponding to the LVS load balancing (i.e. related information of a container application or an associated application). The LVS load balancing related information includes an LVS load balancing algorithm (including a polling algorithm, a least connection mode, and the like), an LVS load balancing forwarding mode (including a DR mode, in which a new MAC address is repackaged for a received request packet to forward the request packet to a corresponding server (i.e., a container application or a container instance of an associated application), a NAT mode, in which a target IP of an access request is modified, a tun mode, in which a header information is added to an original access request IP packet, an LVS load balancing forwarding protocol (the forwarding protocol is a TCP protocol, and the protocol uses LVS four-layer load balancing by default), and the like. The relevant information of the servers corresponding to the LVS load balancing comprises weight information corresponding to each server and health check mode information (comprising connection timeout time, reconnection times, reconnection interval time and the like) corresponding to each server. It should be noted that the above parameters are examples only, and more parameters or fewer parameters than those illustrated may be included. In addition, it is noted that the parameter of the above example is a parameter corresponding to each port number. It will also be appreciated that each port number will have the parameters exemplified above.
S1032c, if a setting completion instruction is received, acquiring the set configuration parameter information to be modified.
The configuration parameter information comprises a configuration parameter and a parameter value of the configuration parameter.
And S1033c, determining the virtual IP of the LVS container corresponding to the LVS load balancing application.
S1034c, obtaining the configuration file of the LVS load balancing application according to the virtual IP, and downloading the configuration file to the local.
S1035c, modifying the corresponding configuration parameter information in the configuration file according to the configuration parameter information to be modified so as to obtain a target configuration file.
If the configuration parameter information includes a port number, it means that the configuration parameter to be modified corresponding to the port number is modified. If the configuration parameter information does not have the port number, the configuration parameter information means that the configuration parameters to be modified corresponding to all the port numbers are modified. Specifically, positioning a starting line of a configuration code area corresponding to a port number according to the port number; detecting the configuration parameters to be modified in the configuration code area corresponding to the port number, and replacing the original parameter values of the configuration parameters with the parameter values of the configuration parameters to be modified until all the configuration parameters to be modified, which are set under the port number, are modified. If there are multiple port numbers to be modified, then the next port number is modified in the same manner.
And S1036c, pushing the target configuration file into the LVS container.
And S1037c, restarting the load balancing service of the LVS container so as to enable the target configuration file to be effective.
The whole process of the configuration parameter modification is automatically completed, so that the speed of modifying the configuration parameters is improved, and the method is convenient and quick; meanwhile, the user who does not need to be modified has higher professional background knowledge, so that the labor cost and the maintenance cost are saved; and when the configuration parameters are modified, the configuration files can be locally modified without logging in the LVS container, so that the speed of modifying the configuration parameters is improved.
In an embodiment, the method for managing the load balancing application further includes a query method for querying various information of the load balancing application.
It should be noted that, in the above management methods, other methods besides the query method can adaptively modify the corresponding data in the database.
The load balancing application created through the preset creation interface in the method embodiment can be correspondingly managed on the preset management interface. The management of different information of the created load balance can be realized through the management interface of the preset management interface, so that the corresponding management is not needed to be carried out by logging in a specific LVS container, the management operation is convenient and simple, and errors are not easy to occur; the configuration files of LVS load balancing are modified, such as adding and deleting ports, modifying configuration parameters and the like, automatically, so that the modification speed is improved, and the method is convenient and quick; meanwhile, the user who does not need to be modified has higher professional background knowledge, so that the labor cost and the maintenance cost are saved; the method can meet various different requirements of the user and improve the experience of the user.
Fig. 9 is a schematic block diagram of a load balancing application management apparatus provided in an embodiment of the present application. As shown in fig. 9, the apparatus includes a unit for executing the above-described load balancing application management method. Specifically, as shown in fig. 9, the apparatus 100 includes a creation unit 101, an opening unit 102, and a management unit 103.
A creating unit 101, configured to create an LVS load balancing application according to a preset creating interface;
an opening unit 102, configured to, after the LVS load balancing application is created, open a preset management interface according to an opening instruction if the opening instruction for opening the preset management interface is received;
and the management unit 103 is configured to, if a management instruction triggered by a management interface corresponding to a preset management interface is received, manage the created LVS load balancing application according to the management instruction.
In an embodiment, if the preset creation interface is the first preset creation interface, the creation unit 101 includes a first acquisition unit and a first creation unit. The first obtaining unit is used for obtaining information of the container application and information of the load balancing application set through the first preset creating interface, wherein the type of the load balancing application is LVS. The first creating unit is used for creating the container application and the LVS load balancing application by utilizing a first preset creating interface according to the information of the set container application, the information of the load balancing application and the preset load balancing parameter information, and setting the association relation between the created container application and the LVS load balancing application.
In an embodiment, as shown in fig. 10, the first creation unit 1010 includes an application creation unit 1011, an LVS creation unit 1012, an IP assignment unit 1013, a reconstruction unit 1014, an activation unit 1015, a network card configuration unit 1016, and a route addition unit 1017.
The application creating unit 1011 is configured to create a container instance of the container application according to an application environment of the container application, an area of the container application, the number of container instances, and container application image information in the container application information by using a first preset creating interface. The LVS creating unit 1012 is configured to determine a host for creating the LVS load balancing application according to the information of the set container application, and create the LVS container on the host. An IP allocation unit 1013 for allocating a virtual IP and a management IP for the created LVS container. A reconstruction unit 1014, configured to reconstruct a configuration file of the LVS load balancing application according to the virtual IP, the created container instance of the container application, and the port information. And a starting unit 1015, configured to start the LVS load balancing service of the LVS container. And the network card configuration unit 1016 is configured to configure a sub network card of the LVS container, so as to bind the virtual IP with the sub network card of the LVS container. And the route adding unit 1017 is used for adding a route for the configured sub-network card so as to finish creating the LVS load balancing application when creating the container application.
In an embodiment, the reconstruction unit 1014 does not trigger the turn-on unit 1015 after it, but triggers the turn-on unit 1015 after it is routed to the adding unit 1017.
In an embodiment, if the preset creation interface is a second preset creation interface, the creation unit 101 includes a second acquisition unit and a second creation unit. The second acquisition unit is used for acquiring information of the load balancing application set through the second preset creation interface and information of the associated application associated with the load balancing application, wherein the type of load balancing is LVS. And the second creating unit is used for creating the LVS load balancing application by utilizing a second preset creating interface according to the set information of the load balancing application and the information of the related application.
In an embodiment, if the management instruction is a modification instruction, as shown in fig. 11, the management unit 103 includes a modification setting unit 1031, a modification obtaining unit 1032, a virtual IP determining unit 1033, a configuration downloading unit 1034, a configuration modifying unit 1035, a pushing unit 1036, and a restarting unit 1037. The modification setting unit 1031 is configured to, if a modification instruction triggered by a management interface corresponding to a preset management interface is received, invoke a preset modification interface corresponding to the modification instruction, so as to set information to be modified through the preset modification interface. And the modification obtaining unit 1032 is configured to obtain the set information to be modified if the setting completion instruction is received. And the virtual IP determining unit 1033 is configured to determine a virtual IP of the LVS container corresponding to the LVS load balancing application. And a configuration downloading unit 1034, configured to obtain a configuration file of the LVS load balancing application according to the virtual IP, and download the configuration file to a local area. And a configuration modification unit 1035, configured to modify the configuration file according to the information to be modified, so as to obtain a target configuration file. A pushing unit 1036, configured to push the target configuration file into the LVS container. And a restarting unit 1037, configured to restart the load balancing service of the LVS container, so as to validate the target configuration file.
In an embodiment, if the modification instruction is a port add instruction, as shown in fig. 12, the management unit 103 includes an add setting unit 1031a, an add obtaining unit 1032a, a first port judging unit 1033a, a first prompting unit 1034a, a first IP determining unit 1035a, a first downloading unit 1036a, an adding unit 1037a, a first pushing unit 1038a, and a first restarting unit 1039a. The adding setting unit 1031a is configured to, if a port adding instruction triggered by a management interface corresponding to a preset management interface is received, call the preset port adding interface to set port information to be added through the preset port adding interface, where the port information includes a port number. The addition obtaining unit 1032a is configured to obtain the set port number to be added if a setting completion instruction is received. A first port determining unit 1033a, configured to determine whether the port number to be added already exists. The first prompting unit 1034a is configured to prompt that the port number to be added already exists. The first IP determining unit 1035a is configured to determine, if the port number to be added does not exist, a virtual IP of an LVS container corresponding to the LVS load balancing application. And the first downloading unit 1036a is configured to obtain a configuration file of the LVS load balancing application according to the virtual IP, and download the configuration file to a local area. And an adding unit 1037a, configured to add, according to the port number to be added, a configuration code corresponding to the port number to be added in the configuration file, so as to form a target configuration file. A first pushing unit 1038a is configured to push the target configuration file into the LVS container. A first restarting unit 1039a, configured to restart the load balancing service of the LVS container, so as to validate the target configuration file.
In an embodiment, the adding unit 1037a includes: template acquisition unit, filling unit, add unit. The template acquisition unit is used for acquiring a preset configuration file template, the port number to be added, the virtual IP and the IP information of the server corresponding to the LVS load balancing application, wherein the preset configuration file template is a configuration template corresponding to the port number. And the filling unit is used for filling the port number to be added, the virtual IP and the IP information of the server corresponding to the LVS load balancing application into the corresponding position in the preset configuration file template to form a configuration code corresponding to the port number to be added. And the appending unit is used for appending the configuration code to the tail of the configuration file to form a target configuration file.
In an embodiment, if the modification instruction is a port delete instruction, as shown in fig. 13, the management unit 103 includes a delete setting unit 1031b, a delete obtaining unit 1032b, a second port judging unit 1033b, a second prompting unit 1034b, a second IP determining unit 1035b, a second downloading unit 1036b, a delete unit 1037b, a second pushing unit 1038b, and a second restarting unit 1039b. The deletion setting unit 1031b is configured to, if a port deletion instruction triggered by a management interface corresponding to a preset management interface is received, call the preset port deletion interface to set port information to be deleted through the preset port deletion interface, where the port information includes a port number. The deletion obtaining unit 1032b is configured to obtain the set port number to be deleted if a setting completion instruction is received. The second port judging unit 1033b is configured to judge whether the port number to be deleted already exists. And a second prompting unit 1034b, configured to prompt that the port number to be deleted does not exist. The second IP determining unit 1035b is configured to determine, if the port number to be deleted already exists, a virtual IP of the LVS container corresponding to the LVS load balancing application. And a second downloading unit 1036b, configured to obtain a configuration file of the LVS load balancing application according to the virtual IP, and download the configuration file to a local area. And a deleting unit 1037b, configured to locate a configuration code area corresponding to the port number to be deleted in the configuration file according to the port number to be deleted, and delete a code in the configuration code area corresponding to the port number to be deleted, so as to form a target configuration file. A second pushing unit 1038b, configured to push the target configuration file into the LVS container. And a second restarting unit 1039b, configured to restart the load balancing service of the LVS container, so as to validate the target configuration file.
In an embodiment, if the modification instruction is a configuration parameter modification instruction, as shown in fig. 14, the management unit 103 includes a parameter setting unit 1031c, a parameter obtaining unit 1032c, a third IP determining unit 1033c, a third downloading unit 1034c, a parameter modifying unit 1035c, a third pushing unit 1036c, and a third restarting unit 1037c. The parameter setting unit 1031c is configured to, if a configuration parameter modification instruction triggered by a management interface corresponding to the preset management interface is received, invoke the preset configuration modification interface to set configuration parameter information to be modified through the preset configuration modification interface. And the parameter obtaining unit 1032c is configured to obtain the set configuration parameter information to be modified if a setting completion instruction is received. And a third IP determining unit 1033c, configured to determine a virtual IP of the LVS container corresponding to the LVS load balancing application. And a third downloading unit 1034c, configured to obtain a configuration file of the LVS load balancing application according to the virtual IP, and download the configuration file to a local area. And a parameter modification unit 1035c, configured to modify, according to the configuration parameter information to be modified, the configuration parameter information corresponding to the configuration file, so as to obtain a target configuration file. A third pushing unit 1036c, configured to push the target configuration file into the LVS container. And a third restarting unit 1037c, configured to restart the load balancing service of the LVS container, so as to validate the target configuration file.
It should be noted that, as those skilled in the art can clearly understand the specific implementation process of the foregoing apparatus and each unit, reference may be made to the corresponding description in the foregoing method embodiment, and for convenience and brevity of description, no further description is provided herein.
The above-described apparatus may be implemented in the form of a computer program which is executable on a computer device as shown in fig. 15.
Fig. 15 is a schematic block diagram of a computer device according to an embodiment of the present application. The device is a terminal and other devices, such as a server in a PaaS platform. The device 200 includes a processor 202, memory, and a network interface 203 connected by a system bus 201, where the memory may include a non-volatile storage medium 204 and an internal memory 205. The non-volatile storage medium 204 may store an operating system 2046 and a computer program 2042. The computer program 2042 stored in the nonvolatile storage medium, when executed by the processor 202, can implement the load balancing application management method described above. The processor 202 is used to provide computing and control capabilities to support the operation of the overall device 200. The internal memory 205 provides an environment for the execution of a computer program in a non-volatile storage medium that, when executed by the processor 202, causes the processor 202 to perform the load balancing application management method described above. The network interface 203 is used for network communication. It will be appreciated by persons skilled in the art that the structure shown in fig. 15 is merely a block diagram of a portion of the structure associated with the present inventive arrangements and does not constitute a limitation of the apparatus to which the present inventive arrangements are applied, and that a particular apparatus may include more or less components than those shown in the drawings, or may combine certain components, or have a different arrangement of components.
Wherein the processor 202 is configured to execute a computer program stored in a memory to implement any of the embodiments of the load balancing application management method described above.
It should be appreciated that in embodiments of the present application, the processor 202 may be a central processing unit (Central Processing Unit, CPU), which may also be other general purpose processors, digital signal processors (Digital Signal Processor, DSPs), application specific integrated circuits (application lication Specific Integrated Circuit, ASICs), off-the-shelf programmable gate arrays (Field-Programmable Gate Array, FPGAs) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
Those skilled in the art will appreciate that all or part of the flow in a method embodying the above described embodiments may be accomplished by computer programs instructing the relevant hardware. The computer program may be stored in a storage medium, which may be a computer readable storage medium. The computer program is executed by at least one processor in the computer system to implement the flow steps of the embodiments of the method described above.
Accordingly, the present application also provides a storage medium. The storage medium may be a computer-readable storage medium including a non-volatile computer-readable storage medium. The storage medium stores a computer program which, when executed by a processor, implements any of the embodiments of the load balancing application management method described above.
The storage medium may be a U-disk, a removable hard disk, a Read-Only Memory (ROM), a magnetic disk, or an optical disk, or other various computer-readable storage media that can store program codes.
In the several embodiments provided by the present application, it should be understood that the disclosed apparatus, device and method may be implemented in other manners. For example, the above-described apparatus embodiments are merely illustrative, and the division of the units is merely a logical function division, and other divisions may be implemented in practice. It will be clearly understood by those skilled in the art that, for convenience and brevity of description, specific working procedures of the apparatus, device and unit described above may refer to corresponding procedures in the foregoing method embodiments, which are not repeated herein. While the application has been described with reference to certain preferred embodiments, it will be understood by those skilled in the art that various changes and substitutions of equivalents may be made and equivalents will be apparent to those skilled in the art without departing from the scope of the application. Therefore, the protection scope of the application is subject to the protection scope of the claims.

Claims (9)

1. A method for load balancing application management, the method comprising:
creating LVS load balancing application according to a preset creation interface;
after the LVS load balancing application is established, if an opening instruction for opening a preset management interface is received, opening the preset management interface according to the opening instruction;
if a management instruction triggered by a management interface corresponding to a preset management interface is received, managing the created LVS load balancing application according to the management instruction, wherein the management instruction comprises a modification instruction;
if a management instruction triggered by a management interface corresponding to a preset management interface is received, managing the created LVS load balancing application according to the management instruction, including:
if a modification instruction triggered by a management interface corresponding to a preset management interface is received, calling a preset modification interface corresponding to the modification instruction so as to set information to be modified through the preset modification interface;
if a setting completion instruction is received, acquiring the set information to be modified;
determining virtual IP of the LVS container corresponding to the LVS load balancing application;
acquiring a configuration file of the LVS load balancing application according to the virtual IP, and downloading the configuration file to a local;
Modifying the configuration file according to the information to be modified to obtain a target configuration file;
pushing a target configuration file into the LVS container;
restarting the load balancing service of the LVS container to enable the target configuration file to be effective.
2. The method of claim 1, wherein the modification instruction comprises a port add instruction; and if a management instruction triggered by a management interface corresponding to a preset management interface is received, managing the created LVS load balancing application according to the management instruction, wherein the management instruction comprises the following steps:
if a port adding instruction triggered by a management interface corresponding to a preset management interface is received, calling the preset port adding interface to set port information to be added through the preset port adding interface, wherein the port information comprises a port number;
if a setting completion instruction is received, acquiring a set port number to be added;
judging whether the port number to be added exists or not;
if the port number to be added does not exist, determining the virtual IP of the LVS container corresponding to the LVS load balancing application;
and adding a configuration code corresponding to the port number to be added in the configuration file according to the port number to be added to form a target configuration file.
3. The method according to claim 2, wherein adding, according to the port number to be added, a configuration code corresponding to the port number to be added in the configuration file to form a target configuration file includes:
acquiring a preset configuration file template, the port number to be added, the virtual IP and the IP information of a server corresponding to the LVS load balancing application, wherein the preset configuration file template is a configuration template corresponding to the port number;
filling the port number to be added, the virtual IP and the IP information of the server corresponding to the LVS load balancing application into corresponding positions in the preset configuration file template to form a configuration code corresponding to the port number to be added;
the configuration code is appended to the end of the configuration file to form a target configuration file.
4. The method according to claim 1, wherein the modification instruction includes a port delete instruction, and the managing the created LVS load balancing application according to the management instruction if a management instruction triggered by a management interface corresponding to a preset management interface is received includes:
If a port deleting instruction triggered by a management interface corresponding to a preset management interface is received, calling the preset port deleting interface to set port information to be deleted through the preset port deleting interface, wherein the port information comprises a port number;
if a setting completion instruction is received, acquiring the set port number to be deleted;
judging whether the port number to be deleted exists or not;
if the port number to be deleted already exists, determining a virtual IP of an LVS container corresponding to the LVS load balancing application;
and according to the port number to be deleted, locating a configuration code area corresponding to the port number to be deleted in the configuration file, and deleting codes in the configuration code area corresponding to the port number to be deleted to form a target configuration file.
5. The method according to claim 1, wherein the modifying instruction includes a configuration parameter modifying instruction, and the managing the created LVS load balancing application according to the managing instruction if receiving the managing instruction triggered by the managing interface corresponding to the preset managing interface includes:
if a configuration parameter modification instruction triggered by a management interface corresponding to a preset management interface is received, calling the preset configuration modification interface to set configuration parameter information to be modified through the preset configuration modification interface;
If a setting completion instruction is received, acquiring the set configuration parameter information to be modified;
determining virtual IP of an LVS container corresponding to the LVS load balancing application;
and modifying the corresponding configuration parameter information in the configuration file according to the configuration parameter information to be modified so as to obtain a target configuration file.
6. The method of claim 1, wherein creating the LVS load balancing application from the pre-set creation interface comprises:
acquiring information of a container application and information of a load balancing application set through a first preset creation interface, wherein the type of the load balancing application is LVS;
according to the information of the set container application, the information of the load balancing application and the template configuration file of the LVS load balancing application, creating the container application and the LVS load balancing application by using a first preset creation interface, and setting the association relation between the created container application and the LVS load balancing application; or alternatively
Acquiring information of a load balancing application set through a second preset creation interface and information of an associated application associated with the load balancing application, wherein the type of load balancing is LVS;
and creating the LVS load balancing application by using a second preset creation interface according to the set information of the load balancing application and the information of the related application.
7. A load balancing application management apparatus, characterized in that the load balancing application management apparatus comprises:
the creating unit is used for creating LVS load balancing application according to a preset creating interface;
the opening unit is used for opening the preset management interface according to the opening instruction if the opening instruction for opening the preset management interface is received after the LVS load balancing application is established;
the management unit is used for managing the created LVS load balancing application according to the management instruction if receiving the management instruction triggered by the management interface corresponding to the preset management interface, wherein the management instruction comprises a modification instruction;
wherein the management unit includes:
the modification setting unit is used for calling a preset modification interface corresponding to the modification instruction if receiving the modification instruction triggered by the management interface corresponding to the preset management interface, so as to set information to be modified through the preset modification interface;
the modification acquisition unit is used for acquiring the set information to be modified if a setting completion instruction is received;
the virtual IP determining unit is used for determining the virtual IP of the LVS container corresponding to the LVS load balancing application;
The configuration downloading unit is used for acquiring a configuration file of the LVS load balancing application according to the virtual IP and downloading the configuration file to the local;
the configuration modification unit is used for modifying the configuration file according to the information to be modified so as to obtain a target configuration file;
the pushing unit is used for pushing the target configuration file into the LVS container;
and the restarting unit is used for restarting the load balancing service of the LVS container so as to enable the target configuration file to be effective.
8. A computer device comprising a memory, and a processor coupled to the memory;
the memory is used for storing a computer program; the processor is configured to execute a computer program stored in the memory to perform the method of any one of claims 1-6.
9. A computer readable storage medium, characterized in that the computer readable storage medium stores a computer program which, when executed by a processor, implements the method according to any of claims 1-6.
CN201910411129.4A 2019-05-17 2019-05-17 Load balancing application management method and device, computer equipment and storage medium Active CN110287021B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910411129.4A CN110287021B (en) 2019-05-17 2019-05-17 Load balancing application management method and device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910411129.4A CN110287021B (en) 2019-05-17 2019-05-17 Load balancing application management method and device, computer equipment and storage medium

Publications (2)

Publication Number Publication Date
CN110287021A CN110287021A (en) 2019-09-27
CN110287021B true CN110287021B (en) 2023-09-26

Family

ID=68002043

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910411129.4A Active CN110287021B (en) 2019-05-17 2019-05-17 Load balancing application management method and device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN110287021B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111131439A (en) * 2019-12-20 2020-05-08 浪潮电子信息产业股份有限公司 iSCSI-based message transmission method, device, equipment and storage medium
CN114826919B (en) * 2022-03-21 2023-09-22 浪潮思科网络科技有限公司 SDN-based load balancing software nanotube method, device, equipment and medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
GB0911004D0 (en) * 2008-09-02 2009-08-12 Fujitsu Ltd Load balancer setting method and load balancer setting apparatus
WO2017096838A1 (en) * 2015-12-11 2017-06-15 乐视控股(北京)有限公司 Load balance configuration method, device and system

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP6979264B2 (en) * 2014-12-30 2021-12-08 エヌエイチエヌ コーポレーション Cloud service provision method and system

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
GB0911004D0 (en) * 2008-09-02 2009-08-12 Fujitsu Ltd Load balancer setting method and load balancer setting apparatus
WO2017096838A1 (en) * 2015-12-11 2017-06-15 乐视控股(北京)有限公司 Load balance configuration method, device and system

Also Published As

Publication number Publication date
CN110287021A (en) 2019-09-27

Similar Documents

Publication Publication Date Title
US11095711B2 (en) DNS Resolution of internal tenant-specific domain addresses in a multi-tenant computing environment
US10776171B2 (en) Endpoint management system and virtual compute system
US10365985B2 (en) Predictive management of on-demand code execution
US9811363B1 (en) Predictive management of on-demand code execution
US9830175B1 (en) Predictive management of on-demand code execution
US9430212B2 (en) Automatically generating volume images and launching virtual computing instances
JP2021524090A (en) Selectively provide mutual transport layer security using alternate server names
JP2021530037A (en) Operating system customization in on-demand network code execution system
CN110289982B (en) Container application capacity expansion method and device, computer equipment and storage medium
CN107766126A (en) Construction method, system, device and the storage medium of container mirror image
US10623470B2 (en) Optimizing internet data transfers using an intelligent router agent
CN114586011B (en) Inserting an owner-specified data processing pipeline into an input/output path of an object storage service
CN110262872B (en) Load balancing application management method and device, computer equipment and storage medium
US9590859B2 (en) Discovering resources of a distributed computing environment
US10284660B1 (en) Data flow tokens to trace execution of services in a service provider network
CN110266761B (en) Load balancing application creation method and device, computer equipment and storage medium
CN110287021B (en) Load balancing application management method and device, computer equipment and storage medium
CN110275775A (en) Resource allocation method, system and the storage medium of container application
CN105554137A (en) Backup system and method
US11159607B2 (en) Management for a load balancer cluster
US10783073B2 (en) Chronologically ordered out-of-place update key-value storage system
JP2021039393A (en) Packaging support system and packaging support method
CN112035062B (en) Migration method of local storage of cloud computing, computer equipment and storage medium
US9916155B2 (en) Projects browser for development environments
CN110262894B (en) Load balancing application management method and device, computer equipment and storage medium

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