WO2020181734A1 - 一种管理网络地址转换nat网关的方法及服务器 - Google Patents

一种管理网络地址转换nat网关的方法及服务器 Download PDF

Info

Publication number
WO2020181734A1
WO2020181734A1 PCT/CN2019/103249 CN2019103249W WO2020181734A1 WO 2020181734 A1 WO2020181734 A1 WO 2020181734A1 CN 2019103249 W CN2019103249 W CN 2019103249W WO 2020181734 A1 WO2020181734 A1 WO 2020181734A1
Authority
WO
WIPO (PCT)
Prior art keywords
active
pair
cloud hosts
standby
server
Prior art date
Application number
PCT/CN2019/103249
Other languages
English (en)
French (fr)
Inventor
贾毫杰
Original Assignee
平安科技(深圳)有限公司
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 平安科技(深圳)有限公司 filed Critical 平安科技(深圳)有限公司
Publication of WO2020181734A1 publication Critical patent/WO2020181734A1/zh

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/06Management of faults, events, alarms or notifications
    • H04L41/0654Management of faults, events, alarms or notifications using network fault recovery
    • H04L41/0663Performing the actions predefined by failover planning, e.g. switching to standby network elements
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/09Mapping addresses
    • H04L61/25Mapping addresses of the same type
    • H04L61/2503Translation of Internet protocol [IP] addresses
    • H04L61/2521Translation architectures other than single NAT servers
    • H04L61/2532Clique of NAT servers

Definitions

  • This application relates to the field of image recognition, and in particular to a method and server for managing a network address translation NAT gateway.
  • the NAT gateway is the entrance and exit for accessing the Internet. It is a network cloud service that supports IP address translation. The public network can be accessed through the NAT gateway. Ping An Cloud currently uses a cloud host to deploy a Network Address Translation (NAT) gateway; in order to achieve high reliability, it usually uses two cloud hosts to form a master and backup to provide NAT gateway services; the advantages of this approach It is very flexible, and can make full use of the powerful computing resources in the cloud. The disadvantage is that the startup and destruction of the cloud host takes a long time, and the whole process takes a long time, which seriously affects the user experience.
  • NAT Network Address Translation
  • the embodiment of the present invention provides a method and server for managing a network address translation NAT gateway.
  • By creating multiple pairs of active and standby cloud hosts in advance when a tenant network needs NAT gateway services, only the pre-created multiple pairs of active and standby cloud hosts choose a pair of active and standby cloud hosts from the cloud host to provide NAT gateway services for the tenant network. No need to spend time to create a NAT gateway.
  • the tenant network no longer uses the pair of active and standby cloud hosts, there is no need to destroy the pair For the active and standby cloud hosts, you only need to delete the information configured to provide the NAT gateway service for the tenant network in the pair of active and standby cloud hosts, and release the pair of active and standby cloud hosts.
  • a method for managing a network address translation NAT gateway includes:
  • the server receives a request instruction from the first tenant network to request the NAT gateway service
  • the server selects a pair of active and standby cloud hosts from a plurality of pre-created pairs of active and standby cloud hosts according to the request instruction.
  • Each pair of active and standby cloud hosts in the multiple pairs of active and standby cloud hosts includes a primary cloud host and one A backup cloud host, where the one backup cloud host is used to replace the one primary cloud host to provide NAT services when the one primary cloud host fails;
  • the server configures the pair of active and standby cloud hosts so that the pair of active and standby cloud hosts establish a communication channel with the first tenant network, so as to provide a NAT gateway service for the first tenant network.
  • multiple pairs of active and standby cloud hosts are created in advance.
  • a tenant network needs NAT gateway services
  • only one pair of active and standby cloud hosts is selected as the tenant network from the pre-created multiple pairs of active and standby cloud hosts.
  • Providing NAT gateway services eliminates the need to spend time creating NAT gateways, which can save tenants' network time from requesting NAT gateway services to completing NAT gateway services to create gateways, thereby improving the efficiency of NAT gateway services.
  • the method further includes :
  • the server deletes the configuration information for the communication channel to release the pair of active and standby cloud hosts.
  • the server is based on the number of tenant network registrations, the total number of virtual private cloud VPCs, and presets One or more of the number of pairs of active and standby cloud hosts newly configured to each tenant network and the number of pairs of active and standby cloud hosts released by each tenant network adjusts the number of the multiple pairs of active and standby cloud hosts.
  • the performance parameters of a primary cloud host in the pair of primary and standby cloud hosts are The difference between the performance parameters of a standby cloud host in the pair of active and standby cloud hosts is less than a preset threshold, and the performance parameters include one or more of bandwidth, memory, CPU, and the number of TCP connections supported by the transmission control protocol item.
  • the request instruction includes the number of users in the first tenant network; the server Selecting a pair of active and standby cloud hosts from multiple pairs of pre-created active and standby cloud hosts according to the request instruction includes:
  • the server selects the pair of active and standby cloud hosts from a plurality of pre-created pairs of active and standby cloud hosts according to the number of users in the first tenant network, so that the pair of active and standby cloud hosts can satisfy the first NAT requirements of users of a tenant network.
  • the number of users of the tenant network is carried in the request instruction of the NAT gateway service, and the server selects an appropriate pair of active and standby cloud hosts according to the number of users, thereby ensuring that the selected active and standby cloud hosts can satisfy the tenant NAT requirements of users in the network.
  • the one primary cloud host and the one backup cloud host are connected by a heartbeat line.
  • an embodiment of the present invention provides a server, which includes:
  • the receiving unit is configured to receive a request instruction from the first tenant network to request the NAT gateway service
  • the selection unit is configured to select a pair of active and standby cloud hosts from a plurality of pre-created pairs of active and standby cloud hosts according to the request instruction, and each pair of the active and standby cloud hosts in the multiple pairs of active and standby cloud hosts includes a primary cloud host And a backup cloud host, where the one backup cloud host is used to replace the one primary cloud host to provide NAT services when the one primary cloud host fails;
  • the configuration unit is configured to configure the pair of active and standby cloud hosts so that the pair of active and standby cloud hosts establish a communication channel with the first tenant network, so as to provide a NAT gateway service for the first tenant network.
  • multiple pairs of active and standby cloud hosts are created in advance.
  • a tenant network needs NAT gateway services
  • only one pair of active and standby cloud hosts is selected as the tenant network from the pre-created multiple pairs of active and standby cloud hosts.
  • Providing NAT gateway services eliminates the need to spend time creating NAT gateways, which can save tenants' network time from requesting NAT gateway services to completing NAT gateway services to create gateways, thereby improving the efficiency of NAT gateway services.
  • the server further includes a deletion unit, configured to: when the first tenant network no longer uses the pair of active and standby cloud hosts After the selection unit selects a pair of active and standby cloud hosts from a plurality of pre-created pairs of active and standby cloud hosts according to the request instruction, the deleting unit is used to delete the configuration information for the communication channel to release The pair of active and standby cloud hosts.
  • the server further includes an adjustment unit, and the adjustment unit is configured to register according to the tenant network
  • the request instruction includes the number of users in the first tenant network; the selection The unit is specifically configured to select the pair of active and standby cloud hosts from a plurality of pre-created pairs of active and standby cloud hosts according to the number of users in the first tenant network, so that the pair of active and standby cloud hosts can meet the requirements of the NAT requirements of users of the first tenant network.
  • the number of users of the tenant network is carried in the request instruction of the NAT gateway service, and the server selects an appropriate pair of active and standby cloud hosts according to the number of users, thereby ensuring that the selected active and standby cloud hosts can satisfy the tenant NAT requirements of users in the network.
  • the performance parameters of one primary cloud host in the pair of primary and standby cloud hosts are The difference between the performance parameters of a standby cloud host in the pair of active and standby cloud hosts is less than a preset threshold, and the performance parameters include one or more of bandwidth, memory, CPU, and the number of TCP connections supported by the transmission control protocol item.
  • the one primary cloud host and the one backup cloud host are connected by a heartbeat line.
  • an embodiment of the present invention provides a computer-readable storage medium that stores a computer program, and the computer program includes program instructions that, when executed by a processor, cause all The processor executes the method described in the first aspect above.
  • an embodiment of the present invention provides a server, including a processor, a communication interface, and a computer-readable storage medium.
  • the processor, the communication interface, and the computer-readable storage medium are connected to each other.
  • the storage medium is used to store application program code, and the processor is configured to call the application program code to execute the method described in the first aspect.
  • multiple pairs of active and standby cloud hosts are created in advance.
  • a tenant network needs NAT gateway services, only one pair of active and standby cloud hosts needs to be selected from the pre-created multiple pairs of active and standby cloud hosts.
  • the host provides the NAT gateway service for the tenant network. It is no longer necessary to create a NAT gateway.
  • the tenant network no longer uses the pair of active and standby cloud hosts, there is no need to destroy the pair of active and standby cloud hosts, just delete the For the information configured to provide the NAT gateway service for the tenant network in a pair of active and standby cloud hosts, release the pair of active and standby cloud hosts.
  • Figure 1 is a system architecture diagram of a method for managing a NAT gateway provided by an embodiment of the present invention
  • FIG. 2 is a schematic flowchart of a method for managing a NAT gateway according to an embodiment of the present invention
  • FIG. 3 is a schematic structural diagram of a server provided by an embodiment of the present invention.
  • Fig. 4 is a schematic structural diagram of a server for managing a NAT gateway provided by an embodiment of the present invention.
  • the embodiment of the present invention provides a method and server for managing a network address translation NAT gateway.
  • multiple pairs of active and standby cloud hosts are created in advance.
  • a tenant network needs NAT gateway services, it only needs to be created in advance.
  • the tenant network no longer uses the pair of active and standby cloud hosts, neither To destroy the pair of active and standby cloud hosts, simply delete the information configured to provide the NAT gateway service for the tenant network in the pair of active and standby cloud hosts, and release the pair of active and standby cloud hosts.
  • FIG. 1 is a schematic diagram of the system architecture of a method for managing a network address translation NAT gateway provided by an embodiment of the solution.
  • the system architecture may include a server 101, one or more tenant networks 102, one or more primary cloud hosts 103 and one or more backup cloud hosts 104.
  • the server 101 may represent a server or a type of server. When it represents a type of server, this type of server forms a server cluster to jointly provide services.
  • the primary cloud host 103 and the backup cloud host 104 are created by the server 101, and the server 101 pairs the primary cloud host 103 and the backup cloud host 104 into a pair of primary and backup cloud hosts according to performance parameters.
  • the performance parameters may include bandwidth, memory, One or more of the number of connections between a central processing unit (Central Processing Unit, CPU) and a supported Transmission Control Protocol (Transmission Control Protocol, TCP).
  • CPU Central Processing Unit
  • TCP Transmission Control Protocol
  • the server 101 can pair multiple created primary cloud hosts 103 and backup cloud hosts 104 in pairs to obtain multiple pairs of primary and backup cloud hosts, so that when the tenant network requests the NAT gateway service, the server 101 can choose from them.
  • the right main and standby cloud hosts provide NAT gateway services for the tenant network; the tenant network 102 may be a tenant network that has been registered in the system managed by the server 101.
  • the server 101, the tenant network 102, the main cloud host 103, and the standby cloud host 104 can all communicate with each other according to certain communication rules.
  • the server 101 includes a life cycle management system and a scheduling configuration system (both the life cycle management system and the scheduling configuration system belong to the software platform carried on the server cluster).
  • the life cycle management system is mainly responsible for managing the life cycle process of cloud hosts, including operations such as creating, deleting, and updating cloud hosts (such as cloud host 103 and cloud host 104).
  • the scheduling configuration system is responsible for intelligent scheduling, including determining the size of the main and backup resource pools according to the number of VPCs, user scales, and tenant resources, as well as when to expand or reduce the resource pool, and issue creation, deletion, and modification to the life cycle management system Cloud host instructions; on the other hand, when a tenant applies for a NAT gateway instance, the scheduling configuration system will also modify the configuration of the NAT gateway and add the NAT gateway to the tenant network. The configuration of the NAT gateway by the user will be issued through the intelligent configuration system To the NAT instance. More detailed implementation will be described in the method flow shown in FIG. 2.
  • system architecture of the method for managing a network address translation NAT gateway provided in this application is not limited to that shown in FIG. 1.
  • the server receives a request instruction from the first tenant network to request a NAT gateway service.
  • the first tenant network has been registered on the server, so the first tenant network can communicate with the server and request the NAT gateway service from the server.
  • the first tenant network needs to connect to the external network, it will send a request instruction requesting the NAT gateway service to the server.
  • the server receives the request instruction.
  • the request instruction is used to request the server to provide the first tenant network with Access the NAT gateway service of the external network.
  • the server selects a pair of active and standby cloud hosts from a plurality of pre-created pairs of active and standby cloud hosts according to the request instruction.
  • each of the multiple pairs of active and standby cloud hosts includes a primary cloud host and a standby cloud host, and the one standby cloud host is used to replace the one when the one primary cloud host fails.
  • the main cloud host provides NAT services.
  • the server After receiving the request instruction, the server, in response to the request instruction, selects a pair of active and standby cloud hosts from multiple pairs of pre-created and paired active and standby cloud hosts to provide NAT for the first tenant network Gateway service.
  • the number of pre-created pairs of active and standby cloud hosts is dynamically balanced.
  • the servers will be based on the number of tenant network registrations, the total number of virtual private clouds (Virtual Private Cloud, VPC), daily or weekly Wait for one or more of the number of pairs of active and standby cloud hosts newly configured to each tenant network and the number of pairs of active and standby cloud hosts released by each tenant network within the preset unit time to adjust the number of the multiple pairs of active and standby cloud hosts, thereby This ensures that there are enough active and standby cloud hosts to provide NAT gateway services for each tenant network, and avoid waste of resources.
  • VPC Virtual Private Cloud
  • the number of tenant network registrations can be the number of private networks that are registered on the server and can request NAT gateway services from the server.
  • the total amount of VPC is also acceptable. Request the number of private networks served by the NAT gateway from the server.
  • the allocated amount of the active and standby cloud hosts represents the logarithm of the active and standby cloud hosts newly configured by the server to each tenant network in the preset unit time, and the release amount of the active and standby cloud hosts.
  • the total number of idle active and standby cloud hosts represents the number of pairs of active and standby cloud hosts that can be selected by the server to provide NAT gateway services for the tenant network within a preset unit time.
  • the number of tenant network registrations in the first preset unit time is 500, the total number of VPCs is 200, the allocation amount of active and standby cloud hosts is 50 pairs, the release amount of active and standby cloud hosts is 20 pairs, and the number of active and standby cloud hosts is 20.
  • the number of newly created pairs is 30, and the total number of idle primary and backup cloud hosts is 100 pairs.
  • the server will give them all The tenant network allocates the active and standby cloud host pairs to provide NAT services, then the allocation amount of the active and standby cloud hosts is 50 pairs, and the release amount of the active and standby cloud hosts in this preset unit time is 5 pairs, so in order to keep idle
  • the server can newly create 45 pairs of active and standby cloud hosts to compensate for the allocated active and standby cloud hosts.
  • the number of tenant network registrations has increased by 50 to 600, and the total number of VPCs has increased by 20 to 220.
  • the server allocates active and standby cloud host pairs to these tenant networks and VPCs to provide NAT services.
  • the allocation amount of active and standby cloud hosts is 70 pairs, and in this preset unit time, the active and standby clouds
  • the release amount of the host is 10 pairs, so in order to maintain the balance of the total number of idle active and standby cloud hosts, the server can newly create 60 pairs of active and standby cloud hosts to compensate for the allocated active and standby cloud hosts.
  • the server creates a new master and backup cloud host adjustment based on one or more of the number of tenant network registrations, the total amount of VPC, the allocation amount of the master and backup cloud hosts, and the release amount of the master and backup cloud hosts.
  • the number of idle active and standby cloud hosts There are other feasible methods for the number of idle active and standby cloud hosts, and these methods are not limited here.
  • the server selects two cloud hosts to form a master and backup cloud host based on the parameter performance of the created cloud host.
  • These parameter performances can be bandwidth, memory, CPU, and supported transmission control protocols.
  • the pair For one or more of the number of TCP connections, only when the parameter performance of the two cloud hosts are the same or the difference in parameter performance is less than the preset threshold can the pair form a pair of active and standby cloud hosts.
  • the bandwidth of cloud host 1 and cloud host 3 are both 10M, the memory is 16G Hz, the CPU is both 8-core, and the number of TCP connections is 65535, then these two cloud hosts It can be paired to form a pair of active and standby cloud hosts; also, the bandwidth of cloud host 2 is 8M, the memory is 12G Hz, the CPU is 8 cores, and the number of TCP connections is 65535, so the bandwidth of cloud host 1 and cloud host 2 is different 2M, the memory difference is 4M, and other performance parameters are the same, you can also pair to form the active and standby cloud host; also, the bandwidth of the cloud host 4 is 12M, the memory is 16G Hz, the CPU is 8 cores, and the number of TCP connections is 65535, then the cloud
  • the bandwidth difference between host 2 and cloud host 4 is 4 megabytes, which does not meet the preset rules, and therefore cannot be paired to form a primary and backup cloud host. As long as the performance of two cloud hosts is the same or
  • the above-mentioned active and standby cloud hosts are connected through a heartbeat line, and corresponding software is installed on the active and standby cloud hosts, and the corresponding software uses the heartbeat line to monitor the running status of each other in real time.
  • the heartbeat line will be reflected to the standby cloud host, and the standby cloud host can be put into work immediately, which can ensure the normal operation of the network to the greatest extent.
  • the request instruction includes the number of users of the first tenant network, and the server selects a pair of active and standby cloud hosts according to the number of users of the first tenant network in the request instruction, This enables the pair of active and standby cloud hosts to meet the NAT requirements of users of the first tenant network.
  • the NAT service processing volume in Table 3 represents the number of NAT service requests that a pair of active and standby cloud hosts can process at the same time.
  • the NAT service throughput of the first pair of active and standby cloud hosts, the second pair of active and standby cloud hosts, and the third pair of active and standby cloud hosts are 500, 1000, and 200, respectively. If the number of tenant network users included in the NAT gateway service request instruction received by the server is 400, then the server will select the first pair of active and standby cloud hosts to provide the tenant network with NAT gateway services based on the number of users.
  • the number of users of the tenant network is carried in the request instruction of the NAT gateway service, and the server selects an appropriate pair of active and standby cloud hosts according to the number of users, thereby ensuring that the selected active and standby cloud hosts can satisfy the tenant NAT requirements of users in the network.
  • Active and standby cloud hosts NAT service throughput
  • the first pair of active and standby cloud hosts 500 The second pair of active and standby cloud hosts 1000
  • the server configures the pair of active and standby cloud hosts so that the pair of active and standby cloud hosts establish a communication channel with the first tenant network, so as to provide a NAT gateway service for the first tenant network.
  • the server configures the pair of active and standby cloud hosts, mainly for the pair of active and standby cloud hosts.
  • the network card of the host is configured, and the network IP accessed by the network card is configured as the IP of the first tenant network, so that the pair of active and standby cloud hosts and the first tenant network can communicate.
  • the server deletes the configuration information for the communication channel to release the pair of active and standby cloud hosts.
  • Cloud hosting if the first tenant network no longer uses the pair of active and standby cloud hosts, the server deletes the configuration information for the communication channel to release the pair of active and standby cloud hosts.
  • the server when the first tenant network does not need or no longer uses the pair of active and standby cloud hosts to provide NAT services for it, the server will delete its connection to the pair of active and standby cloud hosts. It is done in order to realize the configuration of communication between the pair of active and standby cloud hosts and the first tenant network, thereby releasing the pair of active and standby cloud hosts, and the released pair of active and standby cloud hosts can be re-used by the The server chooses to provide NAT services for other tenant networks.
  • this solution creates multiple pairs of active and standby cloud hosts in advance.
  • a tenant network requires NAT gateway services, you only need to select a pair of active and standby cloud hosts from the pre-created multiple pairs of active and standby cloud hosts.
  • the tenant network provides NAT gateway services, no need to spend time to create a NAT gateway.
  • the tenant network no longer uses the pair of active and standby cloud hosts, there is no need to destroy the pair of active and standby cloud hosts, just delete the pair
  • Using this solution can greatly save the tenant network from requesting the NAT gateway service to completing the NAT gateway service.
  • the NAT gateway service is not required, only the active and standby cloud hosts in use need to be released without destroying, thereby reducing the waste of resources.
  • the embodiment of the present invention also provides a corresponding server, which will be described in detail below with reference to FIG. 3.
  • Fig. 3 shows a schematic structural diagram of a server 300.
  • the server 300 includes: a receiving unit 301, a selecting unit 302, and a configuration unit 303, wherein:
  • the receiving unit 301 is configured to receive a request instruction from the first tenant network to request the NAT gateway service;
  • the selecting unit 302 is configured to select a pair of active and standby cloud hosts from a plurality of pre-created pairs of active and standby cloud hosts according to the request instruction, and each pair of the active and standby cloud hosts in the multiple pairs of active and standby cloud hosts includes a primary cloud A host and a backup cloud host, where the one backup cloud host is used to replace the one primary cloud host to provide NAT services when the one primary cloud host fails;
  • the configuration unit 303 is configured to configure the pair of active and standby cloud hosts so that the pair of active and standby cloud hosts establish a communication channel with the first tenant network, so as to provide a NAT gateway service for the first tenant network.
  • the server further includes a deleting unit
  • the selecting unit 301 is configured to select a pair of active and standby cloud hosts from a plurality of pre-created pairs of active and standby cloud hosts according to the request instruction, if If the first tenant network no longer uses the pair of active and standby cloud hosts, the deleting unit is used to delete the configuration information for the communication channel to release the pair of active and standby cloud hosts.
  • the server further includes an adjustment unit, which is used to newly configure each tenant network and the network according to the number of tenant network registrations, the total amount of virtual private cloud VPC, and a preset unit time.
  • an adjustment unit which is used to newly configure each tenant network and the network according to the number of tenant network registrations, the total amount of virtual private cloud VPC, and a preset unit time.
  • One or more of the number of pairs of active and standby cloud hosts released by each tenant network adjusts the number of the multiple pairs of active and standby cloud hosts.
  • the difference between the performance parameter of one primary cloud host in the pair of active and standby cloud hosts and the performance parameter of one standby cloud host in the pair of primary and standby cloud hosts is less than a preset threshold
  • the performance parameter includes one or more of bandwidth, memory, CPU, and the number of TCP connections that can be supported.
  • the request instruction includes the number of users in the first tenant network; the selection unit 301 is specifically configured to select the number of pre-created multiple pairs according to the number of users in the first tenant network.
  • the pair of active and standby cloud hosts is selected from the active and standby cloud hosts, so that the pair of active and standby cloud hosts can meet the NAT requirements of users of the first tenant network.
  • the one primary cloud host and the one backup cloud host are connected through a heartbeat line.
  • FIG. 4 is a server 400 for managing a network address translation NAT gateway provided by an embodiment of the present invention.
  • the server 400 includes a processor 401, a memory 402 (also called a computer-readable storage medium), and a communication interface 403.
  • the processor 401, the memory 402, and the communication interface 403 are connected to each other through a bus 404.
  • the memory 402 includes, but is not limited to, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), or A portable read-only memory (compact disc read-only memory, CD-ROM), the memory 402 is used for storage of related instructions and data.
  • the communication interface 403 is used to receive and send data.
  • the processor 401 may be one or more central processing units (CPU).
  • the CPU may be a single-core CPU or a multi-core CPU.
  • the processor 401 in the server 400 is configured to read the program code stored in the memory 402 and perform the following operations:
  • the processor 401 receives a request instruction from the first tenant network to request a NAT gateway service through the communication interface 403;
  • the processor 401 selects a pair of active and standby cloud hosts from a plurality of pre-created pairs of active and standby cloud hosts according to the request instruction, and each pair of the active and standby cloud hosts in the multiple pairs of active and standby cloud hosts includes a primary cloud host and one A backup cloud host, where the one backup cloud host is used to replace the one primary cloud host to provide NAT services when the one primary cloud host fails;
  • the processor 401 configures the pair of active and standby cloud hosts so that the pair of active and standby cloud hosts establish a communication channel with the first tenant network, so as to provide a NAT gateway service for the first tenant network.
  • the method further includes:
  • the processor 401 deletes the configuration information for the communication channel to release the pair of active and standby cloud hosts.
  • the processor 401 is newly configured to each tenant network and the active and standby cloud hosts released by each tenant network according to the number of tenant network registrations, the total amount of virtual private cloud VPC, and a preset unit time. One or more of the logarithms of to adjust the number of the multiple pairs of active and standby cloud hosts.
  • the difference between the performance parameter of one primary cloud host in the pair of active and standby cloud hosts and the performance parameter of one standby cloud host in the pair of primary and standby cloud hosts is less than a preset threshold
  • the performance parameter includes one or more of bandwidth, memory, CPU, and the number of TCP connections that can be supported.
  • the request instruction includes the number of users in the first tenant network; the processor 401 selects a pair of active and standby cloud hosts from multiple pairs of pre-created active and standby cloud hosts according to the request instruction. Host, including:
  • the processor 401 selects the pair of active and standby cloud hosts from a plurality of pre-created pairs of active and standby cloud hosts according to the number of users in the first tenant network, so that the pair of active and standby cloud hosts can satisfy the first NAT requirements of users of a tenant network.
  • the one primary cloud host and the one backup cloud host are connected through a heartbeat line.
  • each operation in the server 400 shown in FIG. 4 may also correspond to the corresponding description of the method embodiment shown in FIG. 2.
  • the server 400 described in FIG. 4 creates multiple pairs of active and standby cloud hosts in advance.
  • a tenant network needs NAT gateway services, you only need to select a pair of active and standby cloud hosts from the pre-created multiple pairs of active and standby cloud hosts.
  • Provide NAT gateway service for the tenant network no need to spend time to create a NAT gateway, when the tenant network no longer uses the pair of active and standby cloud hosts, there is no need to destroy the pair of active and standby cloud hosts, just delete the one
  • the embodiment of the present invention also provides a computer-readable storage medium, the computer storage medium stores a computer program, the computer program includes program instructions, when the program instructions are executed by a processor, the method shown in FIG. 2 The process is realized.
  • multiple pairs of active and standby cloud hosts are created in advance.
  • a tenant network needs NAT gateway services, only one pair of active and standby cloud hosts needs to be selected from the pre-created multiple pairs of active and standby cloud hosts.
  • the host provides the NAT gateway service for the tenant network. It is no longer necessary to create a NAT gateway.
  • the tenant network no longer uses the pair of active and standby cloud hosts, there is no need to destroy the pair of active and standby cloud hosts, just delete the For the information configured to provide the NAT gateway service for the tenant network in a pair of active and standby cloud hosts, release the pair of active and standby cloud hosts.
  • the process can be completed by a computer program instructing relevant hardware.
  • the program can be stored in a computer readable storage medium. , May include the processes of the foregoing method embodiments.
  • the aforementioned storage media include: ROM or random storage RAM, magnetic disks or optical discs and other media that can store program codes.
  • server and method may be implemented in other ways.
  • the server embodiment described above is only illustrative.
  • the division of the units is only a logical function division, and there may be other divisions in actual implementation, for example, multiple units or components can be combined or It can be integrated into another system, or some features can be ignored or not implemented.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

本发明实施例公开了一种管理网络地址转换NAT网关的方法及服务器,该方法包括:服务器接收第一租户网络请求NAT网关服务的请求指令;所述服务器根据所述请求指令从预先创建好的多对主备云主机中选择一对主备云主机;所述服务器配置所述一对主备云主机使得所述一对主备云主机和所述第一租户网络建立通信通道,以为所述第一租户网络提供NAT网关服务。采用本方案可以节省租户网络从请求NAT网关服务到完成NAT网关服务中创建网关的时间,从而提高NAT网关服务的效率。

Description

一种管理网络地址转换NAT网关的方法及服务器
本申请要求于2019年03月08日提交中国专利局、申请号为201910178452.1、申请名称为“一种管理网络地址转换NAT网关的方法及服务器”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及图像识别领域,尤其涉及一种管理网络地址转换NAT网关的方法及服务器。
背景技术
NAT网关是访问Internet的出入口,是一种支持IP地址转换的网络云服务,通过NAT网关可以实现公网访问。平安云当前采用了云主机的方式部署网络地址转换(Network Address Translation,NAT)网关;为了达到高可靠性,通常是采用2个云主机组成主备的方式提供NAT网关服务;这种方式的优势是非常灵活,而且可以充分利用云中强大的计算资源,劣势是云主机的启动和销毁耗时较长,整个过程耗时较长,严重影响用户的使用体验。
发明内容
本发明实施例提供一种管理网络地址转换NAT网关的方法及服务器,通过预先创建好多对主备云主机备用,当有租户网络需要NAT网关服务时,只需从预先创建好的多对主备云主机中选择一对主备云主机为该租户网络提供NAT网关服务,不需再花时间创建NAT网关,当该租户网络不再使用该一对主备云主机,也不需要销毁该一对主备云主机,只需删除该一对主备云主机中为了为所述租户网络提供NAT网关服务而配置的信息,释放该一对主备云主机即可。采用本方案可以节省租户网络从请求NAT网关服务到完成NAT网关服务中创建网关的时间,从而提高NAT网关服务的效率,同时不需要NAT网关服务时只需要释放使用的主备云主机,不必销毁,从而减少了资源的浪费。
第一方面,一种管理网络地址转换NAT网关的方法,该方法包括:
服务器接收第一租户网络请求NAT网关服务的请求指令;
所述服务器根据所述请求指令从预先创建好的多对主备云主机中选择一对主备云主机,所述多对主备云主机中每对主备云主机包括一个主云主机和一个备云主机,所述一个备云主机用于在所述一个主云主机故障时替代所述一个主云主机提供NAT服务;
所述服务器配置所述一对主备云主机使得所述一对主备云主机和所述第一租户网络建立通信通道,以为所述第一租户网络提供NAT网关服务。
本发明实施例通过预先创建好多对主备云主机备用,当有租户网络需要NAT网关服务时,只需从预先创建好的多对主备云主机中选择一对主备云主机为该租户网络提供NAT网关服务,不需再花时间创建NAT网关,可以节省租户网络从请求NAT网关服务到完成NAT网关服务中创建网关的时间,从而提高NAT网关服务的效率。
结合第一方面,在第一方面的第一种可能的实施方式中,所述服务器根据所述请求指令从预先创建好的多对主备云主机中选择一对主备云主机之后,还包括:
如果所述第一租户网络不再使用所述一对主备云主机,则所述服务器删除针对所述通信通道的配置信息,以释放所述一对主备云主机。
采用本发明实施例,不需要NAT网关服务时只需要释放使用的主备云主机,不必销毁,从而减少了资源的浪费。
结合第一方面或者第一方面的第一种可能的实施方式,在第一方面的第二种可能的实施方式中,所述服务器根据租户网络的注册数、虚拟私有云VPC总量、预设的单位时间内新配置给各个租户网络和被所述各个租户网络释放的主备云主机的对数中的一项或多项调整所述多对主备云主机的数量。
结合第一方面或者第一方面的第一种可能的实施方式,在第一方面的第三种可能的实施方式中,所述一对主备云主机中的一个主云主机的性能参数与所述一对主备云主机中的一个备云主机的性能参数的差值小于预设阈值,所述性能参数包括带宽、内存、CPU和可支持的传输控制协议TCP连接数中的一项或者多项。
结合第一方面或者第一方面的第一种可能的实施方式,在第一方面的第四种可能的实施方式中,所述请求指令包含所述第一租户网络中的用户数量;所述服务器根据所述请求指令从预先创建好的多对主备云主机中选择一对主备云主机,包括:
所述服务器根据所述第一租户网络中的用户数量从预先创建好的多对主备云主机中选择所述一对主备云主机,使得所述一对主备云主机能够满足所述第一租户网络的用户的NAT需求。
本发明实施例通过在NAT网关服务的请求指令中携带租户网络的用户数量,服务器根据该用户数量来选择合适的一对主备云主机,从而保证了选择的主备云主机能够满足所述租户网络中用户的NAT需求。
结合第一方面或者第一方面的第一种可能的实施方式,在第一方面的第五种可能的实施方式中,所述一个主云主机和所述一个备云主机通过心跳线连接。
第二方面,本发明实施例提供了一种服务器,该服务器包括:
接收单元,用于接收第一租户网络请求NAT网关服务的请求指令;
选择单元,用于根据所述请求指令从预先创建好的多对主备云主机中选择一对主备云主机,所述多对主备云主机中每对主备云主机包括一个主云主机和一个备云主机,所述一个备云主机用于在所述一个主云主机故障时替代所述一个主云主机提供NAT服务;
配置单元,用于配置所述一对主备云主机使得所述一对主备云主机和所述第一租户网络建立通信通道,以为所述第一租户网络提供NAT网关服务。
本发明实施例通过预先创建好多对主备云主机备用,当有租户网络需要NAT网关服务时,只需从预先创建好的多对主备云主机中选择一对主备云主机为该租户网络提供NAT网关服务,不需再花时间创建NAT网关,可以节省租户网络从请求NAT网关服务到完成NAT网关服务中创建网关的时间,从而提高NAT网关服务的效率。
结合第二方面,在第二方面的第一种可能的实施方式中,所述服务器还包括删除单元,用于在所述第一租户网络不再使用所述一对主备云主机的情况下,在所述选择单元根据所述请求指令从预先创建好的多对主备云主机中选择一对主备云主机之后,所述删除单元用于删除针对所述通信通道的配置信息,以释放所述一对主备云主机。
结合第二方面或者第二方面的第一种可能的实施方式,在第二方面的第二种可能的实施方式中,所述服务器还包括调整单元,所述调整单元用于根据租户网络的注册数、虚拟私有云VPC总量、预设的单位时间内新配置给各个租户网络和被所述各个租户网络释放的主备云主机的对数中的一项或多项调整所述多对主备云主机的数量。
结合第二方面或者第二方面的第一种可能的实施方式,在第二方面的第三种可能的实施方式中,所述请求指令包含所述第一租户网络中的用户数量;所述选择单元具体用于根据所述第一租户网络中的用户数量从预先创建好的多对主备云主机中选择所述一对主备云主机,使得所述一对主备云主机能够满足所述第一租户网络的用户的NAT需求。
本发明实施例通过在NAT网关服务的请求指令中携带租户网络的用户数量,服务器根据该用户数量来选择合适的一对主备云主机,从而保证了选择的主备云主机能够满足所述租户网络中用户的NAT需求。
结合第二方面或者第二方面的第一种可能的实施方式,在第二方面的第四种可能的实施方式中,所述一对主备云主机中的一个主云主机的性能参数与所述一对主备云主机中的一个备云主机的性能参数的差值小于预设阈值,所述性能参数包括带宽、内存、CPU和可支持的传输控制协议TCP连接数中的一项或者多项。
结合第二方面或者第二方面的第一种可能的实施方式,在第二方面的第五种可能的实施方式中,所述一个主云主机和所述一个备云主机通过心跳线连接。
第三方面,本发明实施例提供了一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,所述计算机程序包括程序指令,所述程序指令当被处理器执行时使所述处理器执行上述第一方面所述的方法。
第四方面,本发明实施例提供了一种服务器,包括处理器、通信接口和计算机可读存储介质,所述处理器、通信接口和计算机可读存储介质相互连接,其中,所述计算机可读存储介质用于存储应用程序代码,所述处理器被配置用于调用所述应用程序代码,执行上述第一方面所述的方法。
综上所述,本发明实施例通过预先创建好多对主备云主机备用,当有租户网络需要NAT网关服务时,只需从预先创建好的多对主备云主机中选择一对主备云主机为该租户网络提供NAT网关服务,不需再花时间创建NAT网关,当该租户网络不再使用该一对主备云主机,也不需要销毁该一对主备云主机,只需删除该一对主备云主机中为了为所述租户网络提供NAT网关服务而配置的信息,释放该一对主备云主机即可。采用本方案可以节省租户网络从请求NAT网关服务到完成NAT网关服务中创建网关的时间,从而提高NAT网关服务的效率,同时不需要NAT网关服务时只需要释放使用的主备云主机,不必销毁,从而减少了资源的浪费。
附图说明
下面将对本发明实施例中所需要使用的附图作介绍。
图1为本发明实施例提供的一种管理NAT网关的方法的系统架构图;
图2为本发明实施例提供的一种管理NAT网关的方法的流程示意图;
图3为本发明实施例提供的一种服务器的结构示意图;
图4为本发明实施例提供的一种管理NAT网关的服务器的结构示意图。
具体实施方式
本发明实施例提供了一种管理网络地址转换NAT网关的方法及服务器,本发明实施例通过预先创建好多对主备云主机备用,当有租户网络需要NAT网关服务时,只需从预先创建好的多对主备云主机中选择一对主备云主机为该租户网络提供NAT网关服务,不需再花时间创建NAT网关,当该租户网络不再使用该一对主备云主机,也不需要销毁该一对主备云主机,只需删除该一对主备云主机中为了为所述租户网络提供NAT网关服务而配置的信息,释放该一对主备云主机即可。采用本方案可以节省租户网络从请求NAT网关服务到完成NAT网关服务中创建网关的时间,从而提高NAT网关服务的效率,同时不需要NAT网关服务时只需要释放使用的主备云主机,不必销毁,从而减少了资源的浪费。
本方案的说明书、权利要求书和附图中出现的术语“包括”和“具有”以及它们任何变形,意图在于覆盖不排他的包含。例如包含了一系列步骤或单元的过程、方法、系统、产品或设备没有限定于已列出的步骤或单元,而是可选地还包括没有列出的步骤或单元,或可选地还包括对于这些过程、方法、产品或设备固有的其它步骤或单元。此外,术语“第一”、“第二”和“第三”等是用于区别不同的对象,而并非用于描述特定的顺序。
为了使本领域技术人员更好地理解本发明方案,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分的实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都应当属于本发明保护的范围。
以下分别进行详细说明。
下面先对本方案的系统架构进行描述。图1是本方案实施例提供的管理网络地址转换NAT网关的方法的系统架构示意图。
如图1所示,系统架构可以包括服务器101、一个或多个租户网络102、一个或多个主云主机103以及一个或多个备云主机104。该服务器101可以代表一个服务器,也可以代表一类服务器,当其代表一类服务器时这一类服务器组成一个服务器集群联合提供服务。其中,主云主机103和备云主机104由服务器101创建,并由服务器101根据性能参数将主云主机103和备云主机104结对成一对主备云主机,该性能参数可以包括带宽、内存、中央处理器(Central Processing Unit,CPU)和可支持的传输控制协议(Transmission Control Protocol,TCP)连接数中的一项或者多项。根据这个结对方式,服务器101可以将多个创建好的主云主机103和备云主机104两两结对得到多对主备云主机,以便于当租户网络请求NAT网关服务时,服务器101从中选择成对的主备云主机为租户网络提供NAT网关服务;租户网络102可以是已经在服务器101管理的系统中注册的租户网络。服务器101、租户网络102、主云主机103和备云主机104都可以根据一定的通信规则实现互相通信。
服务器101包括生命周期管理系统和调度配置系统(生命周期管理系统和调度配置系统均属于搭载在服务器集群上的软件平台)。生命周期管理系统主要负责管理云主机的生命周期过程,包括创建、删除、更新云主机(如云主机103、云主机104)等操作。调度配置系统一方面负责智能调度,包括根据VPC数量、用户规模、租户资源等决定了主、备资源池的大小,以及何时扩充缩减资源池,对生命周期管理系统下发创建、删除、更改云主机指令;另外一方面当租户申请NAT网关实例时,调度配置系统还会对NAT网关进行配置 修改,并将NAT网关加入到租户网络中,用户对NAT网关的配置都会通过智能配置系统下发到NAT实例中。更细节的实现将在图2所示的方法流程中进行描述。
需要说明的是,本申请提供的管理网络地址转换NAT网关的方法的系统架构不限于图1所示。
基于图1给出的管理网络地址转换NAT网关的方法的系统架构示意图,下面提供一种管理网络地址转换NAT网关的方法,一种管理网络地址转换NAT网关的方法的流程图如图2所示。具体方法步骤如下。
S101、服务器接收第一租户网络请求NAT网关服务的请求指令。
具体的,第一租户网络已经在服务器上注册,因此第一租户网络可以和服务器互相通信并向服务器请求NAT网关服务。当第一租户网络需要连接外网时会向服务器发送请求NAT网关服务的请求指令,相应地,服务器接收该请求指令,具体的,该请求指令用于请求服务器为所述第一租户网络提供可以访问外网的NAT网关服务。
S102、所述服务器根据所述请求指令从预先创建好的多对主备云主机中选择一对主备云主机。
具体的,所述多对主备云主机中每对主备云主机包括一个主云主机和一个备云主机,所述一个备云主机用于在所述一个主云主机故障时替代所述一个主云主机提供NAT服务。所述服务器接收到所述请求指令后,响应于该请求指令,从预先创建好的并已经结对了的多对主备云主机中选择一对主备云主机为所述第一租户网络提供NAT网关服务。
需要说明的是,预先创建好的多对主备云主机的数量是动态平衡的,所述服务器会根据租户网络的注册数、虚拟私有云(Virtual Private Cloud,VPC)总量、每天或每周等预设的单位时间内新配置给各个租户网络和被所述各个租户网络释放的主备云主机的对数中的一项或多项来调整所述多对主备云主机的数量,从而保证了有足够的主备云主机用于为各个租户网络提供NAT网关服务,又避免了资源的浪费。
为了便于理解主备云主机的数量如何保持动态平衡,可以参阅表1。表1中可以假设以第一预设单位时间内的数据作为参考,租户网络的注册数可以为在服务器上注册了并可以向服务器请求NAT网关服务的专用网络的数量,VPC总量同样是可以向服务器请求NAT网关服务的专用网络的数量,主备云主机的分配量表示在预设的单位时间内服务器新配置给各个租户网络的主备云主机的对数,主备云主机的释放量表示在预设的单位时间内被所述各个租户网络释放的主备云主机的对数,主备云主机的新创建量表示在预设的单位时间内服务器新创建的主备云主机的对数,空闲主备云主机的总量表示在预设的单位时间内可以被服务器选择去为租户网络提供NAT网关服务的主备云主机的对数。第一预设单位时间内租户网络的注册数为500个、VPC总量为200个、主备云主机的分配量为50对、主备云主机的释放量为20对,主备云主机的新创建量为30对,空闲主备云主机的总量为100对。当在第二预设单位时间内,租户网络的注册数增加了50个变成了550个,VPC总量没变,假设新注册的50个租户网络都向服务器请求NAT服务,服务器都给这些租户网络分配了主备云主机对用于提供NAT服务,那么主备云主机的分配量为50对,而在这个预设单位时间内主备云主机的释放量为5对,那么为了保持空闲主备云主机的总量的平衡,服务器可以新创建45对主备云主机用于补偿已经分配使用了的主备云主机。同理,在第三个预设 单位时间内,租户网络的注册数增加了50个变成了600个,VPC总量增加了20个变成了220个,假设新增加的租户网络和VPC都向服务器请求NAT服务,服务器都给这些租户网络和VPC分配了主备云主机对用于提供NAT服务,那么主备云主机的分配量为70对,而在这个预设单位时间内主备云主机的释放量为10对,那么为了保持空闲主备云主机的总量的平衡,服务器可以新创建60对主备云主机用于补偿已经分配使用了的主备云主机。需要说明的是,上述例子仅仅是服务器根据租户网络的注册数、VPC总量、主备云主机的分配量、主备云主机的释放量中一项或多项来新创建主备云主机调整空闲主备云主机的数量的其中的一种方式,还存在其它可行的方式,这里对这些方式不做限定。
表1
Figure PCTCN2019103249-appb-000001
在其中一种可选的方案中,服务器根据创建好的云主机的参数性能来选择两个云主机结对形成主备云主机,这些参数性能可以是带宽、内存、CPU和可支持的传输控制协议TCP连接数中的一项或者多项,只有两个云主机的参数性能一样或者参数性能的差值小于预设阈值时才能结对形成一对主备云主机。例如,可以规定带宽差值小于等于2M、内存差值小于等于4GHz、CPU核数相同、TCP连接数相同的两台云主机可以结对形成主备云主机。参见表2,根据上述预设规则,云主机1和云主机3的带宽都是10兆、内存都为16G赫兹、CPU同是8核以及TCP的连接数都是65535,那么这两个云主机可以结对形成一对主备云主机;又,台云主机2的带宽是8兆、内存为12G赫兹、CPU是8核以及TCP的连接数是65535,那么云主机1和云主机2的带宽相差2M,内存相差4M,其它性能参数一样,也可以结对形成主备云主机;又,云主机4的带宽是12兆、内存为16G赫兹、CPU是8核以及TCP的连接数是65535,那么云主机2和云主机4的带宽相差4兆,不符合预设规则,因而不能结对形成主备云主机。只要两台云主机的性能相同或者相当即可结对形成主备云主机,本方案对此不做进一步的限定。
表2
云主机序号 带宽 内存 CPU TCP连接数
云主机1 10M 16GHz 8核 65535
云主机2 8M 12GHz 8核 65535
云主机3 10M 16GHz 8核 65535
云主机4 12M 16GHz 8核 65535
在其中一种可能的方案中,上述的主备云主机之间是通过心跳线连接的,主备云主机上安装有对应软件,该对应软件通过心跳线来实时监测对方的运行状态。一旦正在工作的主云主机发生故障,心跳线会反映给备云主机,备云主机可以立即投入工作,这样可以在最大限度上保证网络的正常运行。
在其中一种可能的方案中,所述请求指令包含所述第一租户网络的用户数量,所述服务器根据所述请求指令中所述第一租户网络的用户数量选择一对主备云主机,使得该一对主备云主机能够满足所述第一租户网络的用户的NAT需求。例如,可以参阅表3,表3中的NAT服务处理量表示一对主备云主机可以同时处理的NAT服务请求的数量。表3中第一对主备云主机、第二对主备云主机和第三对主备云主机的NAT服务处理量分别为500、1000和200。假如服务器收到的NAT网关服务请求指令中包含的租户网络的用户的数量为400,那么服务器会根据该用户的数量选择第一对主备云主机为该租户网络提供NAT网关服务。
本发明实施例通过在NAT网关服务的请求指令中携带租户网络的用户数量,服务器根据该用户数量来选择合适的一对主备云主机,从而保证了选择的主备云主机能够满足所述租户网络中用户的NAT需求。
表3
主备云主机 NAT服务处理量
第一对主备云主机 500
第二对主备云主机 1000
第三对主备云主机 200
S103、所述服务器配置所述一对主备云主机使得所述一对主备云主机和所述第一租户网络建立通信通道,以为所述第一租户网络提供NAT网关服务。
具体的,所述服务器响应于第一租户网络的请求为其选择了一对主备云主机之后,所述服务器对所述一对主备云主机进行配置,主要是对该一对主备云主机的网卡进行配置,将所述网卡接入的网络IP配置为所述第一租户网络的IP,从而使得该一对主备云主机和所述第一租户网络可以实现通信。
在其中一种可能的方案中,如果所述第一租户网络不再使用所述一对主备云主机,则所述服务器删除针对所述通信通道的配置信息,以释放所述一对主备云主机。
具体的,当所述第一租户网络不需要或者不再使用所述一对主备云主机为其提供NAT 服务的情况下,所述服务器将会删除其对所述一对主备云主机所做的为了实现所述一对主备云主机和所述第一租户网络的通信的配置,从而释放了所述一对主备云主机,该释放的一对主备云主机可以重新被所述服务器选择去为其它的租户网络提供NAT服务。
综上所述,本方案通过预先创建好多对主备云主机备用,当有租户网络需要NAT网关服务时,只需从预先创建好的多对主备云主机中选择一对主备云主机为该租户网络提供NAT网关服务,不需再花时间创建NAT网关,当该租户网络不再使用该一对主备云主机,也不需要销毁该一对主备云主机,只需删除该一对主备云主机中为了为所述租户网络提供NAT网关服务而配置的信息,释放该一对主备云主机即可。采用本方案可以大大节省租户网络从请求NAT网关服务到完成NAT网关服务这一段时间,同时不需要NAT网关服务时只需要释放使用的主备云主机,不必销毁,从而减少了资源的浪费。
为了便于更好地实施本发明的上述方案,本发明实施例还对应提供了一种服务器,下面结合附图3来进行详细说明:
图3所示为一种服务器300的结构示意图,所述服务器300包括:接收单元301,选择单元302,配置单元303,其中:
接收单元301,用于接收第一租户网络请求NAT网关服务的请求指令;
选择单元302,用于根据所述请求指令从预先创建好的多对主备云主机中选择一对主备云主机,所述多对主备云主机中每对主备云主机包括一个主云主机和一个备云主机,所述一个备云主机用于在所述一个主云主机故障时替代所述一个主云主机提供NAT服务;
配置单元303,用于配置所述一对主备云主机使得所述一对主备云主机和所述第一租户网络建立通信通道,以为所述第一租户网络提供NAT网关服务。
在其中一种实施方式中,所述服务器还包括删除单元,所述选择单元301用于根据所述请求指令从预先创建好的多对主备云主机中选择一对主备云主机之后,如果所述第一租户网络不再使用所述一对主备云主机,则所述删除单元用于删除针对所述通信通道的配置信息,以释放所述一对主备云主机。
在其中一种实施方式中,所述服务器还包括调整单元,所述调整单元用于根据租户网络的注册数、虚拟私有云VPC总量、预设的单位时间内新配置给各个租户网络和被所述各个租户网络释放的主备云主机的对数中的一项或多项调整所述多对主备云主机的数量。
在其中一种实施方式中,所述一对主备云主机中的一个主云主机的性能参数与所述一对主备云主机中的一个备云主机的性能参数的差值小于预设阈值,所述性能参数包括带宽、内存、CPU和可支持的传输控制协议TCP连接数中的一项或者多项。
在其中一种实施方式中,所述请求指令包含所述第一租户网络中的用户数量;所述选择单元301具体用于根据所述第一租户网络中的用户数量从预先创建好的多对主备云主机中选择所述一对主备云主机,使得所述一对主备云主机能够满足所述第一租户网络的用户的NAT需求。
在其中一种实施方式中,所述一个主云主机和所述一个备云主机通过心跳线连接。
图3所示的服务器300中各个单元的具体实现及有益效果可以对应参照图2所示的方法实施例中的相应描述,此处不再赘述。
请参见图4,图4是本发明实施例提供的一种管理网络地址转换NAT网关的服务器400, 该服务器400包括处理器401、存储器402(也称计算机可读存储介质)和通信接口403,所述处理器401、存储器402和通信接口403通过总线404相互连接。
存储器402包括但不限于是随机存储记忆体(random access memory,RAM)、只读存储器(read-only memory,ROM)、可擦除可编程只读存储器(erasable programmable read only memory,EPROM)、或便携式只读存储器(compact disc read-only memory,CD-ROM),该存储器402用于相关指令及数据的存储。通信接口403用于接收和发送数据。
处理器401可以是一个或多个中央处理器(central processing unit,CPU),在处理器401是一个CPU的情况下,该CPU可以是单核CPU,也可以是多核CPU。
该服务器400中的处理器401用于读取所述存储器402中存储的程序代码,执行以下操作:
处理器401通过通信接口403接收第一租户网络请求NAT网关服务的请求指令;
处理器401根据所述请求指令从预先创建好的多对主备云主机中选择一对主备云主机,所述多对主备云主机中每对主备云主机包括一个主云主机和一个备云主机,所述一个备云主机用于在所述一个主云主机故障时替代所述一个主云主机提供NAT服务;
处理器401配置所述一对主备云主机使得所述一对主备云主机和所述第一租户网络建立通信通道,以为所述第一租户网络提供NAT网关服务。
在其中一种实施方式中,处理器401根据所述请求指令从预先创建好的多对主备云主机中选择一对主备云主机之后,还包括:
如果所述第一租户网络不再使用所述一对主备云主机,则处理器401删除针对所述通信通道的配置信息,以释放所述一对主备云主机。
在其中一种实施方式中,处理器401根据租户网络的注册数、虚拟私有云VPC总量、预设的单位时间内新配置给各个租户网络和被所述各个租户网络释放的主备云主机的对数中的一项或多项调整所述多对主备云主机的数量。
在其中一种实施方式中,所述一对主备云主机中的一个主云主机的性能参数与所述一对主备云主机中的一个备云主机的性能参数的差值小于预设阈值,所述性能参数包括带宽、内存、CPU和可支持的传输控制协议TCP连接数中的一项或者多项。
在其中一种实施方式中,所述请求指令包含所述第一租户网络中的用户数量;处理器401根据所述请求指令从预先创建好的多对主备云主机中选择一对主备云主机,包括:
处理器401根据所述第一租户网络中的用户数量从预先创建好的多对主备云主机中选择所述一对主备云主机,使得所述一对主备云主机能够满足所述第一租户网络的用户的NAT需求。
在其中一种实施方式中,所述一个主云主机和所述一个备云主机通过心跳线连接。
需要说明的是,图4所示的服务器400中的各个操作的实现还可以对应参照图2所示的方法实施例的相应描述。
在图4所描述的服务器400通过预先创建好多对主备云主机备用,当有租户网络需要NAT网关服务时,只需从预先创建好的多对主备云主机中选择一对主备云主机为该租户网络提供NAT网关服务,不需再花时间创建NAT网关,当该租户网络不再使用该一对主备云主机,也不需要销毁该一对主备云主机,只需删除该一对主备云主机中为了为所述租户 网络提供NAT网关服务而配置的信息,释放该一对主备云主机即可。采用本方案可以节省租户网络从请求NAT网关服务到完成NAT网关服务中创建网关的时间,从而提高NAT网关服务的效率,同时不需要NAT网关服务时只需要释放使用的主备云主机,不必销毁,从而减少了资源的浪费。
本发明实施例还提供了一种计算机可读存储介质,所述计算机存储介质存储有计算机程序,所述计算机程序包括程序指令,当所述程序指令被处理器执行时,图2所示的方法流程得以实现。
综上所述,本发明实施例通过预先创建好多对主备云主机备用,当有租户网络需要NAT网关服务时,只需从预先创建好的多对主备云主机中选择一对主备云主机为该租户网络提供NAT网关服务,不需再花时间创建NAT网关,当该租户网络不再使用该一对主备云主机,也不需要销毁该一对主备云主机,只需删除该一对主备云主机中为了为所述租户网络提供NAT网关服务而配置的信息,释放该一对主备云主机即可。采用本方案可以节省租户网络从请求NAT网关服务到完成NAT网关服务中创建网关的时间,从而提高NAT网关服务的效率,同时不需要NAT网关服务时只需要释放使用的主备云主机,不必销毁,从而减少了资源的浪费。
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,该流程可以由计算机程序来指令相关的硬件完成,该程序可存储于计算机可读取存储介质中,该程序在执行时,可包括如上述各方法实施例的流程。而前述的存储介质包括:ROM或随机存储记忆体RAM、磁碟或者光盘等各种可存储程序代码的介质。
在本发明所提供的几个实施例中,应该理解到,所揭露的服务器和方法,可以通过其它的方式实现。例如,以上所描述的服务器实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。
最后应说明的是:以上各实施例仅用以说明本发明的技术方案,而非对其限制;尽管参照前述各实施例对本发明进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分或者全部技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本发明各实施例技术方案的范围。

Claims (20)

  1. 一种管理网络地址转换NAT网关的方法,其特征在于,包括:
    服务器接收第一租户网络请求NAT网关服务的请求指令;
    所述服务器根据所述请求指令从预先创建好的多对主备云主机中选择一对主备云主机,所述多对主备云主机中每对主备云主机包括一个主云主机和一个备云主机,所述一个备云主机用于在所述一个主云主机故障时替代所述一个主云主机提供NAT服务;
    所述服务器配置所述一对主备云主机使得所述一对主备云主机和所述第一租户网络建立通信通道,以为所述第一租户网络提供NAT网关服务。
  2. 根据权利要求1所述方法,其特征在于,所述服务器根据所述请求指令从预先创建好的多对主备云主机中选择一对主备云主机之后,还包括:
    如果所述第一租户网络不再使用所述一对主备云主机,则所述服务器删除针对所述通信通道的配置信息,以释放所述一对主备云主机。
  3. 根据权利要求1或2所述方法,其特征在于,还包括:
    所述服务器根据租户网络的注册数、虚拟私有云VPC总量、预设的单位时间内新配置给各个租户网络和被所述各个租户网络释放的主备云主机的对数中的一项或多项调整所述多对主备云主机的数量。
  4. 根据权利要求1或2所述方法,其特征在于,
    所述一对主备云主机中的一个主云主机的性能参数与所述一对主备云主机中的一个备云主机的性能参数的差值小于预设阈值,所述性能参数包括带宽、内存、CPU和可支持的传输控制协议TCP连接数中的一项或者多项。
  5. 根据权利要求1或2所述方法,其特征在于,所述请求指令包含所述第一租户网络中的用户数量;所述服务器根据所述请求指令从预先创建好的多对主备云主机中选择一对主备云主机,包括:
    所述服务器根据所述第一租户网络中的用户数量从预先创建好的多对主备云主机中选择所述一对主备云主机,使得所述一对主备云主机能够满足所述第一租户网络的用户的NAT需求。
  6. 根据权利要求1或2所述方法,其特征在于,所述一个主云主机和所述一个备云主机通过心跳线连接。
  7. 根据权利要求1或2所述的方法,其特征在于,所述服务器配置所述一对主备云主机使得所述一对主备云主机和所述第一租户网络建立通信通道,包括:
    所述服务器对所述一对主备云主机的网卡进行配置,将所述网卡接入的网络IP配置为 所述第一租户网络的IP,从而使得所述一对主备云主机和所述第一租户网络实现通信。
  8. 根据权利要求1或2所述的方法,其特征在于,所述第一租户网络为在所述服务器上注册过的租户网络。
  9. 根据权利要求2所述的方法,其特征在于,所述释放的一对主备云主机用于重新被所述服务器选择来为其它的租户网络提供NAT服务。
  10. 一种服务器,其特征在于,包括:
    接收单元,用于接收第一租户网络请求NAT网关服务的请求指令;
    选择单元,用于根据所述请求指令从预先创建好的多对主备云主机中选择一对主备云主机,所述多对主备云主机中每对主备云主机包括一个主云主机和一个备云主机,所述一个备云主机用于在所述一个主云主机故障时替代所述一个主云主机提供NAT服务;
    配置单元,用于配置所述一对主备云主机使得所述一对主备云主机和所述第一租户网络建立通信通道,以为所述第一租户网络提供NAT网关服务。
  11. 根据权利要求10所述服务器,其特征在于,还包括删除单元,用于在所述第一租户网络不再使用所述一对主备云主机的情况下,在所述选择单元根据所述请求指令从预先创建好的多对主备云主机中选择一对主备云主机之后,删除针对所述通信通道的配置信息,以释放所述一对主备云主机。
  12. 根据权利要求10或11所述服务器,其特征在于,还包括:
    调整单元看,用于根据租户网络的注册数、虚拟私有云VPC总量、预设的单位时间内新配置给各个租户网络和被所述各个租户网络释放的主备云主机的对数中的一项或多项调整所述多对主备云主机的数量。
  13. 根据权利要求10或11所述服务器,其特征在于,
    所述一对主备云主机中的一个主云主机的性能参数与所述一对主备云主机中的一个备云主机的性能参数的差值小于预设阈值,所述性能参数包括带宽、内存、CPU和可支持的传输控制协议TCP连接数中的一项或者多项。
  14. 根据权利要求10或11所述服务器,其特征在于,所述请求指令包含所述第一租户网络中的用户数量;所述选择单元,用于根据所述请求指令从预先创建好的多对主备云主机中选择一对主备云主机,具体为:用于根据所述第一租户网络中的用户数量从预先创建好的多对主备云主机中选择所述一对主备云主机,使得所述一对主备云主机能够满足所述第一租户网络的用户的NAT需求。
  15. 根据权利要求10或11所述服务器,其特征在于,所述一个主云主机和所述一个 备云主机通过心跳线连接。
  16. 根据权利要求10或11所述的服务器,其特征在于,所述配置单元,用于配置所述一对主备云主机使得所述一对主备云主机和所述第一租户网络建立通信通道,具体为:
    用于对所述一对主备云主机的网卡进行配置,将所述网卡接入的网络IP配置为所述第一租户网络的IP,从而使得所述一对主备云主机和所述第一租户网络实现通信。
  17. 根据权利要求10或11所述的服务器,其特征在于,所述第一租户网络为在所述服务器上注册过的租户网络。
  18. 根据权利要求11所述的服务器,其特征在于,所述释放的一对主备云主机用于重新被所述服务器选择来为其它的租户网络提供NAT服务。
  19. 一种服务器,其特征在于,所述服务器包括处理器、计算机可读存储介质和通信接口,其中,所述计算机可读存储介质用于存储程序指令,所述通信接口用于在所述处理器的控制下执行数据的接收和发送操作,所述处理器用于调用所述程序指令来执行权利要求1-9任一项所述的方法。
  20. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质用于存储程序指令,所述程序指令在处理器上运行时,实现权利要求1-9任一项所述的方法。
PCT/CN2019/103249 2019-03-08 2019-08-29 一种管理网络地址转换nat网关的方法及服务器 WO2020181734A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910178452.1 2019-03-08
CN201910178452.1A CN109995890B (zh) 2019-03-08 2019-03-08 一种管理网络地址转换nat网关的方法及服务器

Publications (1)

Publication Number Publication Date
WO2020181734A1 true WO2020181734A1 (zh) 2020-09-17

Family

ID=67130145

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/103249 WO2020181734A1 (zh) 2019-03-08 2019-08-29 一种管理网络地址转换nat网关的方法及服务器

Country Status (2)

Country Link
CN (1) CN109995890B (zh)
WO (1) WO2020181734A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117240823A (zh) * 2023-11-10 2023-12-15 快上云(上海)网络科技有限公司 一种广义网络智能优化方法及广义网络智能优化终端

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109995890B (zh) * 2019-03-08 2022-04-22 平安科技(深圳)有限公司 一种管理网络地址转换nat网关的方法及服务器
CN114422599B (zh) * 2021-12-22 2024-04-30 中国电信股份有限公司 数据的传输方法、系统、电子设备及可读介质

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070076729A1 (en) * 2005-10-04 2007-04-05 Sony Computer Entertainment Inc. Peer-to-peer communication traversing symmetric network address translators
CN101150430A (zh) * 2007-09-17 2008-03-26 中兴通讯股份有限公司 一种通过心跳机制实现网络接口板倒换的方法
CN101715008A (zh) * 2008-09-22 2010-05-26 美国索尼电脑娱乐公司 基于所发现的nat类型选择主机的方法
CN101917484A (zh) * 2010-08-23 2010-12-15 中兴通讯股份有限公司 业务数据请求负载均衡的系统与方法
CN104580550A (zh) * 2014-12-30 2015-04-29 北京天融信科技有限公司 分布式系统中多业务板分流时的nat处理方法及设备
CN109218053A (zh) * 2017-07-03 2019-01-15 中兴通讯股份有限公司 虚拟数据中心的实现方法、系统和存储介质
CN109995890A (zh) * 2019-03-08 2019-07-09 平安科技(深圳)有限公司 一种管理网络地址转换nat网关的方法及服务器

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101834831A (zh) * 2009-03-13 2010-09-15 华为技术有限公司 一种实现nat设备冗余备份的方法、装置和系统
US9794186B2 (en) * 2014-03-27 2017-10-17 Nicira, Inc. Distributed network address translation for efficient cloud service access
CN104506635B (zh) * 2014-12-26 2018-07-20 成都极驰科技有限公司 一种快速高效的云主机创建和匹配方法及系统
CN107342895B (zh) * 2017-06-26 2019-12-10 网宿科技股份有限公司 一种多租户的网络优化方法、系统、计算设备及存储介质

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070076729A1 (en) * 2005-10-04 2007-04-05 Sony Computer Entertainment Inc. Peer-to-peer communication traversing symmetric network address translators
CN101150430A (zh) * 2007-09-17 2008-03-26 中兴通讯股份有限公司 一种通过心跳机制实现网络接口板倒换的方法
CN101715008A (zh) * 2008-09-22 2010-05-26 美国索尼电脑娱乐公司 基于所发现的nat类型选择主机的方法
CN101917484A (zh) * 2010-08-23 2010-12-15 中兴通讯股份有限公司 业务数据请求负载均衡的系统与方法
CN104580550A (zh) * 2014-12-30 2015-04-29 北京天融信科技有限公司 分布式系统中多业务板分流时的nat处理方法及设备
CN109218053A (zh) * 2017-07-03 2019-01-15 中兴通讯股份有限公司 虚拟数据中心的实现方法、系统和存储介质
CN109995890A (zh) * 2019-03-08 2019-07-09 平安科技(深圳)有限公司 一种管理网络地址转换nat网关的方法及服务器

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117240823A (zh) * 2023-11-10 2023-12-15 快上云(上海)网络科技有限公司 一种广义网络智能优化方法及广义网络智能优化终端

Also Published As

Publication number Publication date
CN109995890B (zh) 2022-04-22
CN109995890A (zh) 2019-07-09

Similar Documents

Publication Publication Date Title
US10375015B2 (en) Methods and system for allocating an IP address for an instance in a network function virtualization (NFV) system
US11429449B2 (en) Method for fast scheduling for balanced resource allocation in distributed and collaborative container platform environment
JP6771650B2 (ja) クラウドコンピューティングシステムにおいて仮想マシンが物理サーバにアクセスするための方法、装置、およびシステム
WO2018205325A1 (zh) 在异构资源上构建内容分发网络平台的方法和系统
WO2020135800A1 (zh) 一种域名服务器的分配方法和装置
WO2020181734A1 (zh) 一种管理网络地址转换nat网关的方法及服务器
US10397132B2 (en) System and method for granting virtualized network function life cycle management
US11561813B2 (en) Server support for multiple audio/video operating systems
CN110881007B (zh) 一种容器集群网络接入的方法和装置
CN108139944A (zh) 具有机器级隔离的多租户多会话目录
CN103581324B (zh) 一种云计算资源池系统及其实现方法
TW201008177A (en) Selectively re-mapping a network topology
US11178218B2 (en) Bidirectional communication clusters
CN111585887B (zh) 基于多个网络的通信方法、装置、电子设备及存储介质
CN109729106A (zh) 处理计算任务的方法、系统和计算机程序产品
WO2019029310A1 (zh) 网络管理方法和系统
US20150372935A1 (en) System and method for migration of active resources
CN110224917B (zh) 数据传输方法、装置及系统、服务器
WO2022111313A1 (zh) 一种请求处理方法及微服务系统
US20160253194A1 (en) Hypervisor adjustment for cluster transfers
US20160057210A1 (en) Application profile to configure and manage a software defined environment
US9866496B2 (en) Methods and systems for allocating and de-allocating delivery groups across multiple server farms
WO2022028092A1 (zh) 一种vnf实例化的方法和装置
CN110300192B (zh) 一种根据ip分配表更新分布式训练任务连接参数的方法
JP2019041241A (ja) 振り分けシステム

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 19918600

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19918600

Country of ref document: EP

Kind code of ref document: A1