WO2018233372A1 - 支持哈希调度策略的lvs调度方法、设备、装置及存储介质 - Google Patents
支持哈希调度策略的lvs调度方法、设备、装置及存储介质 Download PDFInfo
- Publication number
- WO2018233372A1 WO2018233372A1 PCT/CN2018/084470 CN2018084470W WO2018233372A1 WO 2018233372 A1 WO2018233372 A1 WO 2018233372A1 CN 2018084470 W CN2018084470 W CN 2018084470W WO 2018233372 A1 WO2018233372 A1 WO 2018233372A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- key value
- key
- value
- address
- host
- 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.)
- Ceased
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/46—Multiprogramming arrangements
- G06F9/50—Allocation of resources, e.g. of the central processing unit [CPU]
- G06F9/5005—Allocation of resources, e.g. of the central processing unit [CPU] to service a request
- G06F9/5027—Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/46—Multiprogramming arrangements
- G06F9/50—Allocation of resources, e.g. of the central processing unit [CPU]
- G06F9/5083—Techniques for rebalancing the load in a distributed system
Definitions
- the present application relates to the field of computer network technologies, and in particular, to a lvs scheduling method, apparatus, device, and storage medium that support a hash scheduling policy.
- Lvs ie Linux Virtual Server, which represents the Linux virtual server
- sh sice The address, that is, the source address scheduling method does not support source address consistent hash scheduling, and only selects the corresponding real server for scheduling according to the source address through the normal hash algorithm.
- the server that is, the host
- the real server needs to be deleted from the forwarding table. Otherwise, some clients will not be able to provide services.
- adding new real When the server is used, the real server needs to be added to the forwarding table.
- Current sh scheduling method real The deletion or addition of the server will cause a lot of session (ie, session) drift.
- the purpose of the present application is to provide a lvs scheduling method, apparatus, device, and storage medium that support a hash scheduling policy, and aim to solve the problem of deleting a host when the sh scheduling method is used in the prior art. Adding a problem that causes a lot of session drift.
- An lvs scheduling method supporting a hash scheduling policy comprising the following steps:
- IP addresses of multiple hosts Obtaining IP addresses of multiple hosts, performing hash operations on each host's IP address one by one to obtain a corresponding first key value, and placing the first key value in an annular space of a specified size;
- the data packet is sent by using a host corresponding to the minimum value among the plurality of first key values as the destination address.
- An lvs scheduling device supporting a hash scheduling policy wherein the lvs scheduling device supporting the hash scheduling policy includes a processor, a memory, and a communication bus;
- the communication bus is used to implement connection communication between a processor and a memory
- the processor is configured to execute an lvs scheduler that supports a hash scheduling policy stored in the memory to implement the following steps:
- IP addresses of multiple hosts Obtaining IP addresses of multiple hosts, performing hash operations on each host's IP address one by one to obtain a corresponding first key value, and placing the first key value in an annular space of a specified size;
- the data packet is sent by using a host corresponding to the minimum value among the plurality of first key values as the destination address.
- a storage medium wherein the storage medium stores one or more programs, the one or more programs may be executed by one or more processors to implement the lvs scheduling method supporting the hash scheduling policy A step of.
- An lvs scheduling device supporting a hash scheduling policy includes:
- the first hash module is configured to obtain the IP addresses of the multiple hosts, perform hash operations on each host, and obtain a corresponding first key value, and place the first key value in a circular space of a specified size. ;
- a second hash module configured to obtain a source address of the data packet, and perform a hash operation on the source address of the data packet to obtain a second key value
- a determining module configured to obtain a minimum value of the plurality of first key values stored in the annular space, and determine whether a minimum value of the plurality of first key values is greater than a second key value
- a sending module configured to: when the minimum value of the plurality of first key values is greater than the second key value, send the data packet by using a host corresponding to the minimum value of the plurality of first key values as the destination address.
- the beneficial effects when a host is connected to the Nginx physical server, the connection scheduled to the adjacent hash node is drifted to the joined host; When a host exits, the session scheduled to other hosts does not drift. Only the sessions on the host that is scheduled to be logged out are redistributed, which reduces session drift and improves the quality of load balancing services.
- FIG. 1 is a flowchart of a preferred embodiment of a lvs scheduling method supporting a hash scheduling policy according to the present application.
- FIG. 2 is a flowchart of step S100 in the lvs scheduling method supporting the hash scheduling policy according to the present application.
- FIG. 3 is a flowchart of step S400 in the preferred embodiment of the lvs scheduling method supporting the hash scheduling policy according to the present application.
- FIG. 4 is a schematic diagram of a running environment of a preferred embodiment of a lvs scheduling program supporting a hash scheduling policy according to the present application.
- FIG. 5 is a functional block diagram of a preferred embodiment of a lvs scheduling program supporting a hash scheduling policy according to the present application.
- the present application provides a lvs scheduling method, device, and storage medium that support a hash scheduling policy. To clarify the purpose, technical solutions, and effects of the present application, the present application will be further described in detail below with reference to the accompanying drawings. It is understood that the specific embodiments described herein are merely illustrative of the application and are not intended to be limiting.
- FIG. 1 is a flowchart of a preferred embodiment of a lvs scheduling method supporting a hash scheduling policy according to the present application.
- the lvs scheduling method supporting a hash scheduling policy includes the following steps:
- step S100 the IP addresses of the multiple hosts are obtained, and the IP address of each host is hashed one by one to obtain a corresponding first key value, and the first key value is placed in a circular space of a specified size.
- the host is not selected according to the source address to perform scheduling, but the IP address of the host is hashed to obtain the first key value.
- the IP address of Host 1 is 192.168.1.100
- the IP address of Host 2 is 192.168.1.101
- the IP address of Host 3 is 192.168.
- the first key value is in the same hash space as the host.
- the hash ring is not changed.
- the hash value of the object is calculated, it can be quickly located in the corresponding machine, so that the real storage location of the object can be found.
- Step S200 Obtain a source address of the data packet, and perform a hash operation on the source address of the data packet to obtain a second key value.
- the source address of the data packet is directly hashed, that is, the operation of hash (Packet.source_ip) is performed to obtain the second key value.
- the second key value obtained is not deployed in the ring space (ie, the hash ring), but as an intermediate value for addressing.
- Step S300 Obtain a minimum value of the plurality of first key values stored in the annular space, and determine whether a minimum value of the plurality of first key values is greater than a second key value.
- the minimum value of the plurality of first key values stored in the annular space is obtained first, that is, the operation of MIN ⁇ hash(RealServer.ip) ⁇ is performed, and after the MIN ⁇ hash(RealServer.ip) ⁇ is obtained, Compared with hash (Packet.source_ip) (ie, the second key value), this comparison determines the direction of the destination address.
- Step S400 When the minimum value of the plurality of first key values is greater than the second key value, the data packet is sent by using a host corresponding to the minimum value among the plurality of first key values as the destination address.
- step S400 if it is determined that the minimum value of the plurality of first key values is greater than the second key value, the host corresponding to MIN ⁇ hash(RealServer.ip) ⁇ is obtained, and the IP address corresponding to the host is used as the destination address. The packet is sent here according to the destination address. In this way, when a host is connected to the Nginx physical server, the connection to the neighboring hash node is drifted to the joined host, which does not cause a large amount of session drift and improves the quality of the load balancing service.
- the step S100 includes:
- Step S101 Obtain an IP address of multiple hosts, and perform a hash operation on each host's IP address to obtain a corresponding first key value.
- Step S102 Obtain an address number of ipv4, and set an annular space by using twice the value of the number of addresses of ipv4 as a space size;
- Step S103 placing the first key value in the annular space.
- the number of acquired hosts may be 0, or may be a positive integer greater than 0.
- the IP address of each host is obtained, and the IP address of each host is hashed to obtain the first key value.
- the key values obtained by hashing the IP addresses of multiple hosts are different, that is, each key value is unique, ensuring that subsequent addressing is not an error.
- step S102 in order to ensure that there are enough nodes in the annular space, it is necessary to at least ensure that the size of the annular space is twice the number of addresses of ipv4. This saves a lot of space compared with the circular space of 232-1 when sh scheduling is used in the prior art, and meets the basic requirements of scheduling with a minimum space size.
- the double value of the number of addresses of the ipv4 is selected as the space size of the ring space, because the IP address format of the host is ipv4.
- the double value of the number of addresses of ipv6 can also be selected as the space size of the ring space.
- step S103 when a plurality of first key values are to be placed in the annular space, the annular space is sequentially inserted in a clockwise direction in a sequential order obtained according to the first key value.
- the hash remainder algorithm is used.
- the most uncomfortable place is that after the addition or deletion of the machine, a large number of object storage locations are invalidated, which greatly fails to satisfy the monotony.
- the processing method based on the consistent hash algorithm adopted in steps S101-S103 can effectively satisfy the individuality compared with the ordinary sh scheduling method.
- KEY4 is obtained through the corresponding hash algorithm and mapped to the hash ring.
- object2 is migrated to NODE4, and other objects maintain the original storage location.
- the consistency hash algorithm keeps the monotonicity while the data migration is minimal. Such an algorithm is very suitable for distributed clusters, avoiding a lot of data migration. , reducing the pressure on the server.
- the step S400 shown includes:
- Step S401 When the minimum value of the plurality of first key values is greater than the second key value, the minimum value of the plurality of first key values is recorded as the first minimum key value, and the host corresponding to the first minimum key value is obtained;
- Step S402 Obtain an IP address of the host corresponding to the first minimum key value.
- Step S403 Send the data packet to the destination address by using the IP address of the host corresponding to the first minimum key value as the destination address, and forward the data packet by the host.
- the method further includes:
- Step S10 The host connects to the Nginx physical server by using Http and reverse proxy mode; wherein the Nginx physical server is IMAP/POP3/SMTP Server.
- step S10 includes:
- LXC1-LXC8 in Nginx physical servers are connected to PF1-1 using VF1-VF8 respectively, and LXC1-LXC8 is also connected to PF1-2 using VF1-VF8 respectively;
- LXC9- LXC16 is connected to PF2-1 by VF1-VF8 respectively.
- LXC9-LXC16 is also connected to PF2-2 by VF1-VF8 respectively;
- PF1-1 and PF2-1 are VLANs.
- the External interface that is, the external virtual LAN interface
- PF1-2, and PF2-2 are all VLAN Internal interfaces (that is, internal virtual LAN interfaces).
- Nginx physical server and IPSV are connected through the back-end server load balancer IPVS-DR;
- IPSV establishes BGP through Real IP and Tor Peer, and publishes the host route of the VIP, forms ECMP (ie, equivalent route) and connects with the CXP switch.
- the CXP switch receives the connection request from the external network client. In the above manner, lvs load balancing is implemented.
- the address of each ipv4 in the ring space corresponds to one node, and each node is copied to obtain a corresponding virtual node.
- virtual node (virtual Node) is the actual node (machine) in the hash
- an actual node corresponds to a number of "virtual nodes”
- the corresponding number also becomes the number of "copy”
- the "virtual node” is in the hash Spaces are arranged in hash values.
- the hash calculation of the virtual node can adopt the manner of the IP address of the corresponding node plus a digital suffix. For example, suppose the IP address of NODE1 is 192.168.1.100. Calculate before introducing "virtual node” The hash value of cache A: Hash ("192.168.1.100");
- the present application further provides an lvs scheduling device that supports a hash scheduling policy.
- the lvs scheduling device supporting the hash scheduling policy includes a processor 11, a memory 12, and a communication bus;
- the communication bus is used to implement connection communication between a processor and a memory
- the processor is configured to execute an lvs scheduler that supports a hash scheduling policy stored in the memory to implement the following steps:
- IP addresses of multiple hosts Obtaining IP addresses of multiple hosts, performing hash operations on each host's IP address one by one to obtain a corresponding first key value, and placing the first key value in an annular space of a specified size;
- the data packet is sent by using a host corresponding to the minimum value among the plurality of first key values as the destination address.
- the lvs scheduler 10 supporting the hash scheduling policy is installed and runs in the electronic device 1.
- the electronic device 1 may be a computing device such as a desktop computer, a notebook, a palmtop computer, or a server.
- the electronic device 1 may include, but is not limited to, a memory 11, a processor 12, and a display 13.
- Figure 4 shows only the electronic device 1 with components 11-13, but it should be understood that not all illustrated components may be implemented, and more or fewer components may be implemented instead.
- the memory 11 may be an internal storage unit of the electronic device 1, such as a hard disk or memory of the electronic device 1, in some embodiments.
- the memory 11 may also be an external storage device of the electronic device 1 in other embodiments, such as a plug-in hard disk equipped on the electronic device 1, a smart memory card (Smart Media Card, SMC), Secure Digital (SD) card, flash card (Flash) Card) and so on.
- the memory 11 may also include both an internal storage unit of the electronic device 1 and an external storage device.
- the memory 11 is configured to store application software and various types of data installed in the electronic device 1, such as the program code of the lvs scheduler supporting the hash scheduling policy.
- the memory 11 can also be used to temporarily store data that has been output or is about to be output.
- the processor 12 may be a central processing unit (Central Processing Unit) in some embodiments.
- the display 13 may be an LED display, a liquid crystal display, a touch liquid crystal display, and an OLED (Organic) in some embodiments. Light-Emitting Diode, organic light emitting diodes), etc.
- the display 13 is used to display information processed in the electronic device 1 and a user interface for displaying visualization, such as an application menu interface, an application icon interface, and the like.
- the components 11-13 of the electronic device 1 communicate with one another via a system bus.
- the processor is further configured to execute the lvs scheduler 10 supporting the hash scheduling policy to implement the following steps:
- the first key value is placed in the annular space.
- the processor is further configured to execute the lvs scheduler 10 supporting the hash scheduling policy to implement the following steps:
- the minimum value of the plurality of first key values is greater than the second key value, the minimum value of the plurality of first key values is recorded as the first minimum key value, and the host corresponding to the first minimum key value is obtained;
- the processor is further configured to execute the lvs scheduler 10 supporting the hash scheduling policy to implement the following steps:
- the host connects to the Nginx physical server through Http and reverse proxy; wherein the Nginx physical server is an IMAP/POP3/SMTP server.
- FIG. 5 is a functional block diagram of a preferred embodiment of the lvs scheduler 10 that supports the hash scheduling policy.
- the lvs scheduler 10 supporting the hash scheduling policy includes at least one computer program instruction segment, which may be divided into one or more modules based on different functions implemented by the respective parts.
- One or more modules are stored in the memory 11 and executed by one or more processors (the processor 12 in this embodiment) to perform the hash scheduling policy support of the embodiments of the present application.
- Lvs scheduling method For example, in FIG.
- the lvs scheduler 10 supporting the hash scheduling policy includes a first obtaining module 21, a second obtaining module 22, a determining module 23, and a destination address obtaining module 24; wherein, the first obtaining module 21 For obtaining the IP addresses of multiple hosts, hashing each host's IP address one by one to obtain a corresponding first key value, and placing the first key value in a ring space of a specified size; the second acquiring module 22, for obtaining a source address of the data packet, and performing a hash operation on the source address of the data packet to obtain a second key value; the determining module 23 is configured to obtain a minimum value of the plurality of first key values stored in the annular space, And determining whether the minimum value of the plurality of first key values is greater than the second key value; the destination address obtaining module 24, configured to: when the minimum value of the plurality of first key values is greater than the second key value, the multiple first key The host corresponding to the minimum value of the value transmits the data packet as the destination address.
- IP addresses of multiple hosts Obtaining IP addresses of multiple hosts, performing hash operations on each host's IP address one by one to obtain a corresponding first key value, and placing the first key value in an annular space of a specified size;
- the data packet is sent by using a host corresponding to the minimum value among the plurality of first key values as the destination address.
- the step of obtaining the IP address of the multiple hosts, performing the hash operation on each host's IP address to obtain the corresponding first key value, and placing the first key value in the annular space of the specified size includes:
- the first key value is placed in the annular space.
- the specific implementation is the same as the previous embodiment, and details are not described herein again.
- the step of transmitting the data packet by using the host corresponding to the minimum value of the plurality of first key values as the destination address includes:
- the minimum value of the plurality of first key values is greater than the second key value, the minimum value of the plurality of first key values is recorded as the first minimum key value, and the host corresponding to the first minimum key value is obtained;
- the host connects to the Nginx physical server through Http and reverse proxy; wherein the Nginx physical server is IMAP/POP3/SMTP Server.
- the Nginx physical server is IMAP/POP3/SMTP Server.
- each ipv4 in the ring space corresponds to one node, and each node is copied to obtain a corresponding virtual node.
- the specific implementation is the same as the previous embodiment, and details are not described herein again.
- the present application further provides a storage medium (and a computer readable storage medium).
- the storage medium stores one or more programs, and the one or more programs may be executed by one or more processors to implement the steps of the lvs scheduling method supporting the hash scheduling policy.
- the lvs scheduling device that supports the hash scheduling policy is further provided by the lvs scheduling device that supports the hash scheduling policy, and the lvs scheduling device that supports the hash scheduling policy includes:
- the first obtaining module is configured to obtain an IP address of the plurality of hosts, perform a hash operation on each host's IP address, and obtain a corresponding first key value, and place the first key value in an annular space of a specified size;
- a second acquiring module configured to obtain a source address of the data packet, and perform a hash operation on the source address of the data packet to obtain a second key value
- a determining module configured to obtain a minimum value of the plurality of first key values stored in the annular space, and determine whether a minimum value of the plurality of first key values is greater than a second key value
- the destination address obtaining module is configured to: when the minimum value of the plurality of first key values is greater than the second key value, send the data packet by using a host corresponding to the minimum value of the plurality of first key values as the destination address.
- the first obtaining module includes:
- a hash unit configured to obtain IP addresses of multiple hosts, and perform hash operations on each host's IP address to obtain a corresponding first key value
- the first obtaining unit is configured to obtain the number of addresses of the ipv4, and set an annular space by using twice the value of the number of addresses of the ipv4;
- a setting unit for placing the first key value in the annular space.
- the destination address obtaining module includes:
- a second acquiring unit configured to: when the minimum value of the plurality of first key values is greater than the second key value, record the minimum value of the plurality of first key values as the first minimum key value, and obtain the first minimum key The value corresponds to the host;
- a third acquiring unit configured to acquire an IP address of the host corresponding to the first minimum key value
- a sending unit configured to send the data packet to the destination address by using an IP address of the host corresponding to the first minimum key value as the destination address.
- the lvs scheduling device that supports the hash scheduling policy further includes:
- connection module configured to connect to the Nginx physical server by using a Http and a reverse proxy mode; wherein the Nginx physical server is an IMAP/POP3/SMTP Server.
- the embodiments of the lvs scheduling device that support the hash scheduling policy are substantially the same as the corresponding embodiments of the lvs scheduling method that supports the hash scheduling policy, and therefore are not described here.
- the lvs scheduling method, device, device, and storage medium supporting the hash scheduling policy provided by the present application when a host is connected to the Nginx physical server, schedules connection drift to the adjacent hash node. To join the host; when a host exits, the session scheduled to other hosts will not drift, and only the sessions on the host that is scheduled to exit will be redistributed, which reduces session drift and improves the quality of load balancing services.
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Computer And Data Communications (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
Description
Claims (20)
- 一种支持哈希调度策略的lvs调度方法,其特征在于,所述方法包括以下步骤:获取多个主机的IP地址,以每一主机的IP地址一一进行哈希运算得到对应的第一key值,将第一key值置于指定大小的环形空间中;获取数据包的源地址,并以数据包的源地址进行哈希运算得到第二key值;获取环形空间中所存储多个第一key值中最小值,并判断多个第一key值中最小值是否大于第二key值;当多个第一key值中最小值大于第二key值时,则以多个第一key值中最小值对应的主机作为目的地址发送所述数据包。
- 根据权利要求1所述支持哈希调度策略的lvs调度方法,其特征在于,所述获取多个主机的IP地址,以每一主机的IP地址一一进行哈希运算得到对应的第一key值,将第一key值置于指定大小的环形空间中的步骤包括:获取多个主机的IP地址,并以每一主机的IP地址一一进行哈希运算得到对应的第一key值;获取ipv4的地址个数,并以ipv4的地址个数的两倍值作为空间大小设置一环形空间;将第一key值置于所述环形空间中。
- 根据权利要求1所述支持哈希调度策略的lvs调度方法,其特征在于,所述当多个第一key值中最小值大于第二key值时,则以多个第一key值中最小值对应的主机作为目的地址发送所述数据包的步骤包括:当多个第一key值中最小值大于第二key值时,则将多个第一key值中最小值记为第一最小key值,并获取与第一最小key值对应主机;获取与第一最小key值对应主机的IP地址;以与第一最小key值对应主机的IP地址作为目的地址,将所述数据包发送至所述目的地址。
- 根据权利要求2所述支持哈希调度策略的lvs调度方法,其特征在于,所述当多个第一key值中最小值大于第二key值时,则以多个第一key值中最小值对应的主机作为目的地址发送所述数据包的步骤包括:当多个第一key值中最小值大于第二key值时,则将多个第一key值中最小值记为第一最小key值,并获取与第一最小key值对应主机;获取与第一最小key值对应主机的IP地址;以与第一最小key值对应主机的IP地址作为目的地址,将所述数据包发送至所述目的地址。
- 根据权利要求1所述支持哈希调度策略的lvs调度方法,其特征在于,所述获取多个主机的IP地址,以每一主机的IP地址一一进行哈希运算得到对应的第一key值,将第一key值置于指定大小的环形空间中的步骤之前还包括:主机通过Http和反向代理方式与Nginx物理服务器连接;其中,所述Nginx物理服务器为IMAP/POP3/SMTP 服务器。
- 根据权利要求2所述支持哈希调度策略的lvs调度方法,其特征在于,所述获取多个主机的IP地址,以每一主机的IP地址一一进行哈希运算得到对应的第一key值,将第一key值置于指定大小的环形空间中的步骤之前还包括:主机通过Http和反向代理方式与Nginx物理服务器连接;其中,所述Nginx物理服务器为IMAP/POP3/SMTP 服务器。
- 根据权利要求2所述支持哈希调度策略的lvs调度方法,其特征在于,所述环形空间中每一ipv4的地址对应一个节点,每一节点均复制得到一个对应的虚拟节点。
- 一种支持哈希调度策略的lvs调度设备,其特征在于,所述支持哈希调度策略的lvs调度设备包括处理器、存储器及通信总线;所述通信总线用于实现处理器和存储器之间的连接通信;所述处理器用于执行存储器中存储的支持哈希调度策略的lvs调度程序,以实现以下步骤:获取多个主机的IP地址,以每一主机的IP地址一一进行哈希运算得到对应的第一key值,将第一key值置于指定大小的环形空间中;获取数据包的源地址,并以数据包的源地址进行哈希运算得到第二key值;获取环形空间中所存储多个第一key值中最小值,并判断多个第一key值中最小值是否大于第二key值;当多个第一key值中最小值大于第二key值时,则以多个第一key值中最小值对应的主机作为目的地址发送所述数据包。
- 根据权利要求8所述支持哈希调度策略的lvs调度设备,其特征在于,所述获取多个主机的IP地址,以每一主机的IP地址一一进行哈希运算得到对应的第一key值,将第一key值置于指定大小的环形空间中的步骤中,所述处理器还用于执行所述支持哈希调度策略的lvs调度程序,以实现以下步骤:获取多个主机的IP地址,并以每一主机的IP地址一一进行哈希运算得到对应的第一key值;获取ipv4的地址个数,并以ipv4的地址个数的两倍值作为空间大小设置一环形空间;将第一key值置于所述环形空间中。
- 根据权利要求8所述支持哈希调度策略的lvs调度设备,其特征在于,所述当多个第一key值中最小值大于第二key值时,则以多个第一key值中最小值对应的主机作为目的地址发送所述数据包的步骤中,所述处理器还用于执行所述支持哈希调度策略的lvs调度程序,以实现以下步骤:当多个第一key值中最小值大于第二key值时,则将多个第一key值中最小值记为第一最小key值,并获取与第一最小key值对应主机;获取与第一最小key值对应主机的IP地址;以与第一最小key值对应主机的IP地址作为目的地址,将所述数据包发送至所述目的地址,并由该主机转发所述数据包。
- 根据权利要求8所述支持哈希调度策略的lvs调度设备,其特征在于,所述获取多个主机的IP地址,以每一主机的IP地址一一进行哈希运算得到对应的第一key值,将第一key值置于指定大小的环形空间中的步骤之前还包括以下步骤:主机通过Http和反向代理方式与Nginx物理服务器连接;其中,所述Nginx物理服务器为IMAP/POP3/SMTP 服务器。
- 一种存储介质,其特征在于,所述存储介质存储有一个或者多个程序,所述一个或者多个程序可被一个或者多个处理器执行,以实现如下步骤:获取多个主机的IP地址,以每一主机的IP地址一一进行哈希运算得到对应的第一key值,将第一key值置于指定大小的环形空间中;获取数据包的源地址,并以数据包的源地址进行哈希运算得到第二key值;获取环形空间中所存储多个第一key值中最小值,并判断多个第一key值中最小值是否大于第二key值;当多个第一key值中最小值大于第二key值时,则以多个第一key值中最小值对应的主机作为目的地址发送所述数据包。
- 根据权利要求12所述的存储介质,其特征在于,所述一个或者多个程序可被一个或者多个处理器执行,还实现如下步骤:获取多个主机的IP地址,并以每一主机的IP地址一一进行哈希运算得到对应的第一key值;获取ipv4的地址个数,并以ipv4的地址个数的两倍值作为空间大小设置一环形空间;将第一key值置于所述环形空间中。
- 根据权利要求12所述的存储介质,其特征在于,所述一个或者多个程序可被一个或者多个处理器执行,还实现如下步骤:当多个第一key值中最小值大于第二key值时,则将多个第一key值中最小值记为第一最小key值,并获取与第一最小key值对应主机;获取与第一最小key值对应主机的IP地址;以与第一最小key值对应主机的IP地址作为目的地址,将所述数据包发送至所述目的地址。
- 根据权利要求12所述的存储介质,其特征在于,所述一个或者多个程序可被一个或者多个处理器执行,还实现如下步骤:主机通过Http和反向代理方式与Nginx物理服务器连接;其中,所述Nginx物理服务器为IMAP/POP3/SMTP 服务器。
- 根据权利要求13所述的存储介质,其特征在于,所述环形空间中每一ipv4的地址对应一个节点,每一节点均复制得到一个对应的虚拟节点。
- 一种支持哈希调度策略的lvs调度装置,其特征在于,所述支持哈希调度策略的lvs调度装置包括:第一获取模块,用于获取多个主机的IP地址,以每一主机的IP地址一一进行哈希运算得到对应的第一key值,将第一key值置于指定大小的环形空间中;第二获取模块,用于获取数据包的源地址,并以数据包的源地址进行哈希运算得到第二key值;判断模块,用于获取环形空间中所存储多个第一key值中最小值,并判断多个第一key值中最小值是否大于第二key值;目的地址获取模块,用于当多个第一key值中最小值大于第二key值时,则以多个第一key值中最小值对应的主机作为目的地址发送所述数据包。
- 根据权利要求17所述支持哈希调度策略的lvs调度装置,其特征在于,所述第一获取模块包括:哈希单元,用于获取多个主机的IP地址,并以每一主机的IP地址一一进行哈希运算得到对应的第一key值;第一获取单元,用于获取ipv4的地址个数,并以ipv4的地址个数的两倍值作为空间大小设置一环形空间;设置单元,用于将第一key值置于所述环形空间中。
- 根据权利要求17所述支持哈希调度策略的lvs调度装置,其特征在于,所述目的地址获取模块包括:第二获取单元,用于当多个第一key值中最小值大于第二key值时,则将多个第一key值中最小值记为第一最小key值,并获取与第一最小key值对应主机;第三获取单元,用于获取与第一最小key值对应主机的IP地址;发送单元,用于以与第一最小key值对应主机的IP地址作为目的地址,将所述数据包发送至所述目的地址。
- 根据权利要求17所述支持哈希调度策略的lvs调度装置,其特征在于,所述支持哈希调度策略的lvs调度装置还包括:连接模块,用于主机通过Http和反向代理方式与Nginx物理服务器连接;其中,所述Nginx物理服务器为IMAP/POP3/SMTP 服务器。
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201710481690.0 | 2017-06-22 | ||
| CN201710481690.0A CN107329827A (zh) | 2017-06-22 | 2017-06-22 | 支持哈希调度策略的lvs调度方法、设备及存储介质 |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2018233372A1 true WO2018233372A1 (zh) | 2018-12-27 |
Family
ID=60194360
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2018/084470 Ceased WO2018233372A1 (zh) | 2017-06-22 | 2018-04-25 | 支持哈希调度策略的lvs调度方法、设备、装置及存储介质 |
Country Status (2)
| Country | Link |
|---|---|
| CN (1) | CN107329827A (zh) |
| WO (1) | WO2018233372A1 (zh) |
Families Citing this family (7)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN107329827A (zh) * | 2017-06-22 | 2017-11-07 | 平安科技(深圳)有限公司 | 支持哈希调度策略的lvs调度方法、设备及存储介质 |
| CN110968419A (zh) * | 2018-09-30 | 2020-04-07 | 北京国双科技有限公司 | 数据接收方法及装置 |
| CN109388351B (zh) * | 2018-12-18 | 2024-11-26 | 平安科技(深圳)有限公司 | 一种分布式数据存储的方法及相关装置 |
| CN111683036B (zh) * | 2020-02-29 | 2022-05-27 | 新华三信息安全技术有限公司 | 数据存储方法、装置以及报文识别方法和装置 |
| CN114579558B (zh) * | 2020-11-28 | 2025-11-14 | 华为云计算技术有限公司 | 哈希表的管理方法、装置及系统、计算机存储介质 |
| CN113395183B (zh) * | 2021-08-18 | 2021-12-07 | 南京赛宁信息技术有限公司 | 网络仿真平台vlan互联的虚拟节点调度方法与系统 |
| CN119051975B (zh) * | 2024-10-21 | 2025-12-02 | 北京天融信网络安全技术有限公司 | 策略管理方法、电子设备、可读介质、程序产品 |
Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN104780201A (zh) * | 2015-03-02 | 2015-07-15 | 新浪网技术(中国)有限公司 | 一种ipvs集群中的数据包处理方法及装置 |
| CN104852934A (zh) * | 2014-02-13 | 2015-08-19 | 阿里巴巴集团控股有限公司 | 基于前端调度实现流量分配的方法、装置和系统 |
| CN106856505A (zh) * | 2016-12-26 | 2017-06-16 | 成都康赛信息技术有限公司 | 基于hash算法的服务器均衡方法 |
| CN107329827A (zh) * | 2017-06-22 | 2017-11-07 | 平安科技(深圳)有限公司 | 支持哈希调度策略的lvs调度方法、设备及存储介质 |
Family Cites Families (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN103747060B (zh) * | 2013-12-26 | 2017-12-08 | 惠州华阳通用电子有限公司 | 一种基于流媒体服务集群的分布式监控系统及方法 |
| CN106503139A (zh) * | 2016-10-20 | 2017-03-15 | 上海携程商务有限公司 | 动态数据存取方法及系统 |
-
2017
- 2017-06-22 CN CN201710481690.0A patent/CN107329827A/zh active Pending
-
2018
- 2018-04-25 WO PCT/CN2018/084470 patent/WO2018233372A1/zh not_active Ceased
Patent Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN104852934A (zh) * | 2014-02-13 | 2015-08-19 | 阿里巴巴集团控股有限公司 | 基于前端调度实现流量分配的方法、装置和系统 |
| CN104780201A (zh) * | 2015-03-02 | 2015-07-15 | 新浪网技术(中国)有限公司 | 一种ipvs集群中的数据包处理方法及装置 |
| CN106856505A (zh) * | 2016-12-26 | 2017-06-16 | 成都康赛信息技术有限公司 | 基于hash算法的服务器均衡方法 |
| CN107329827A (zh) * | 2017-06-22 | 2017-11-07 | 平安科技(深圳)有限公司 | 支持哈希调度策略的lvs调度方法、设备及存储介质 |
Also Published As
| Publication number | Publication date |
|---|---|
| CN107329827A (zh) | 2017-11-07 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| WO2018233372A1 (zh) | 支持哈希调度策略的lvs调度方法、设备、装置及存储介质 | |
| WO2014081266A1 (en) | Packet format and communication method of network node for ip routing compatibility and network node therefor | |
| WO2013137573A1 (en) | Apparatus and method for managing content for cloud computing | |
| WO2018161478A1 (zh) | 多区块链的分片处理方法、装置、服务器和存储介质 | |
| WO2020147396A1 (zh) | 服务域名的动态配置方法、装置、设备及存储介质 | |
| WO2013117104A1 (zh) | Bt离线数据下载系统及方法、计算机存储介质 | |
| WO2020224246A1 (zh) | 基于区块链的数据管理方法、装置、设备和存储介质 | |
| GB2497196A (en) | Enabling co-existence of hosts or virtual machines with identical addresses across a network | |
| WO2016190476A1 (ko) | 클라우드 서비스를 위한 암호화 키 관리 방법 및 그 장치 | |
| WO2012057581A4 (ko) | 클라우드 컴퓨팅 시스템 및 그의 데이터 동기화 방법 | |
| CN102857438A (zh) | 同步负载平衡器组件间的状态 | |
| US10956501B2 (en) | Network-wide, location-independent object identifiers for high-performance distributed graph databases | |
| WO2017185925A1 (zh) | 一种访问网站的方法、客户端及局域网内服务器 | |
| WO2018227771A1 (zh) | 基于保单服务的区域划分方法、系统、服务器和存储介质 | |
| WO2015006970A1 (zh) | 交换设备、控制器、交换设备配置、报文处理方法及系统 | |
| WO2018094809A1 (zh) | 一种资源共享方法及装置 | |
| WO2018036168A1 (zh) | 数据处理任务执行方法、装置、执行服务器和存储介质 | |
| WO2014142553A1 (ko) | 워크 로드에 따라 동적 자원 할당 가능한 상호 연결 패브릭 스위칭 장치 및 방법 | |
| WO2019189963A1 (ko) | 분산 클러스터 관리 시스템 및 그 방법 | |
| WO2017054445A1 (zh) | 一种文件管理方法、服务器及网络附属存储设备 | |
| US11140224B2 (en) | Moving storage volumes across network boundaries | |
| WO2013176431A1 (ko) | 단말을 서버에 할당하고 단말로의 효율적인 메시징을 위한 시스템 및 방법 | |
| WO2020153797A1 (en) | Method and apparatus for managing data in a network based on swarm intelligence | |
| WO2015068929A1 (ko) | 컨텐츠 중심 네트워크에서 패킷 특성을 고려하는 노드의 동작 방법 및 노드 | |
| WO2022139055A1 (ko) | 분산 메시징 시스템을 이용한 데이터 처리 시스템 및 그 정보 처리 방법 |
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: 18820374 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: 18820374 Country of ref document: EP Kind code of ref document: A1 |
|
| 32PN | Ep: public notification in the ep bulletin as address of the adressee cannot be established |
Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 17.03.2020) |
|
| 122 | Ep: pct application non-entry in european phase |
Ref document number: 18820374 Country of ref document: EP Kind code of ref document: A1 |