CN118295816A - Method for realizing load balance of driving layer - Google Patents

Method for realizing load balance of driving layer Download PDF

Info

Publication number
CN118295816A
CN118295816A CN202410603355.3A CN202410603355A CN118295816A CN 118295816 A CN118295816 A CN 118295816A CN 202410603355 A CN202410603355 A CN 202410603355A CN 118295816 A CN118295816 A CN 118295816A
Authority
CN
China
Prior art keywords
working node
connection
drive
load balancing
working
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.)
Pending
Application number
CN202410603355.3A
Other languages
Chinese (zh)
Inventor
曹茜
欧亚莅
吴启洋
陈英杰
李文彬
魏琦
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Chengdu Xugu Weiye Technology Co ltd
Original Assignee
Chengdu Xugu Weiye Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Chengdu Xugu Weiye Technology Co ltd filed Critical Chengdu Xugu Weiye Technology Co ltd
Priority to CN202410603355.3A priority Critical patent/CN118295816A/en
Publication of CN118295816A publication Critical patent/CN118295816A/en
Pending legal-status Critical Current

Links

Landscapes

  • Computer And Data Communications (AREA)

Abstract

The invention discloses a method for realizing load balancing at a drive layer, which comprises the steps of configuring a database working node IP on a connection string interface of an application server accessing a database server, configuring the database server working node IP into a drive connection string, and sequentially using the working node IP when the application server is connected with the database server through a drive, thereby realizing load balancing. The invention only needs to add the configuration item in the application access connection string parameter, does not need to additionally configure and operate and maintain the load balancing equipment, and saves the additional labor cost of configuration and operation and maintenance.

Description

Method for realizing load balance of driving layer
Technical Field
The invention relates to the technical field of databases, in particular to a method for realizing load balancing on a driving layer.
Background
Load balancing is generally adopted for initiating a request to a database by the front-end application at present, load tasks are balanced and distributed to a plurality of operation units to run, such as an FTP server, a Web server, an enterprise core application server, other main task servers and the like, so that work tasks are completed cooperatively. There are 2 ways of current load balancing, the first is to implement the software load at the software level, and the second is to purchase the F5 implementation at the hardware level.
The load realized on the software layer has the main advantages of simplicity and easiness in realization, is suitable for various application scenes, and has the defects that an additional hardware server is needed, and when the server performance difference is large, the dynamic adjustment cannot be performed according to the load condition of the server. The load on the hardware level has the main advantages of being capable of being directly realized through an intelligent switch, being higher in processing capacity, and the defects of high cost, high equipment price and redundancy configuration.
Load balancing using software and hardware requires additional hardware to be purchased for deployment, adding additional hardware expenditures and operational costs.
Disclosure of Invention
The invention aims to provide a method for realizing load balancing on a driving layer, which aims to solve the technical problem of how to reduce the load balancing cost.
The invention aims at adopting the following technical scheme: a method for realizing load balance at a drive layer includes configuring database working nodes IP on a connection string interface of an application server accessing a database server, configuring the database server working nodes IP into a drive connection string, and sequentially using the working nodes IP when the application server is connected with the database server through a drive, so that load balance is realized.
Further, the method for realizing load balancing at the driving layer comprises the following steps:
S1: setting a working node IP and configuring;
s2: and sequentially using the working nodes IP to realize load balancing.
Further, step S1 includes the following sub-steps:
S11: configuring a database working node IP on a connection serial interface of an application server for accessing a database server;
s12: the database server worker node IP is configured into a drive connection string.
Further, the step S2 specifically includes: when the application server is connected with the database server through the drive, the established first connection uses the first working node IP configured by the drive and is connected in sequence until the connection is completed, wherein the number of the connections established by each working node is the total number of the connections divided by the number of the configured working nodes, so that load balancing is realized.
Further, the method also comprises an IP (Internet protocol) probe activity step, wherein whether the working node survives or not is detected through the drive so as to allocate the connection between the drive and the working node.
Further, when the driver detects that a working node is down and cannot establish a connection, the driver skips the working node, uses the next working node, and distributes the connection to the remaining surviving working nodes.
Further, when connection cannot be established with the working node within the preset times, the drive removes the working node IP, and subsequent connection does not use the working node IP to establish connection; after running for a preset time, the working node IP is connected again, and if the working node IP is still unable to be connected, the working node IP is kept in an unable connection state.
Further, the working node IP is reconnected through configuration information including IP, port, repository name, user name and password.
Further, when the driver detects that the working node survives and the connection is established successfully, the connection request in the existing connection pool is distributed to the survived working node.
The invention has the beneficial effects that:
1. hardware is not required to be purchased, and hardware cost is saved.
2. The configuration is simple and convenient, and configuration items are only required to be added in the application access connection string parameters, so that additional configuration and operation and maintenance of load balancing equipment are not required, and additional labor cost of configuration and operation and maintenance is saved.
3. Load balancing is carried out on the access connection strings, IP (Internet protocol) probing is supported, and dynamic distribution of load requests is supported.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and other drawings may be obtained according to the structures shown in these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a schematic diagram of a drive normal connection;
FIG. 2 is a schematic diagram of automatic distribution connection driven after a certain working node is down;
fig. 3 is a schematic diagram of the automatic distribution connection of the new nodes.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present invention more apparent, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention, and it is apparent that the described embodiments are some embodiments of the present invention, but not all embodiments of the present invention. The components of the embodiments of the present invention generally described and illustrated in the figures herein may be arranged and designed in a wide variety of different configurations.
It should be noted that: like reference numerals and letters denote like items in the following figures, and thus once an item is defined in one figure, no further definition or explanation thereof is necessary in the following figures.
Some embodiments of the present invention are described in detail below with reference to the accompanying drawings. The following embodiments and features of the embodiments may be combined with each other without conflict.
Referring to fig. 1, a method for implementing load balancing by a driving layer, without adding additional hardware servers, only needs to configure a database working node IP on a connection string interface of an application server accessing a database server, and configures the database server working node IP into a driving connection string, and when the application server is connected with the database server by driving, the working node IP is sequentially used, thereby implementing load balancing.
In this embodiment, the method for implementing load balancing at the driving layer includes the following steps:
S1: setting a working node IP and configuring;
s2: and sequentially using the working nodes IP to realize load balancing.
In this embodiment, step S1 is specifically: and configuring a database working node IP on a connection string interface of the application access database, and configuring the database server working node IP into the drive connection string.
In this embodiment, step S2 specifically includes: when the application is connected with the database through the drive, the first connection is established by using the first working node IP of the drive configuration, the second connection is established by using the second working node IP of the drive configuration, and so on, the number of the connections established by each working node is the total number of the connections divided by the number of the configured working nodes, so that the number of the connections established by each working node is approximately the same, and the load balancing is realized.
Referring to fig. 2, in this embodiment, the driver layer supports an IP discovery function, when a hardware problem occurs and is down and inaccessible, for example, when a first working node IP configured by the driver is used for a first connection to be established, the node is down, so that the connection cannot be established successfully, the driver skips the working node IP, uses the next working node IP, distributes a request IP connection to the remaining surviving working nodes, and when 3 times of connection establishment are not successful, the working nodes cannot be established successfully, the driver removes the IP, and the subsequent connection is no longer established by using the IP. After the application runs for a certain time, the IP which cannot be connected before the connection is disconnected through the configured IP, port, library name, user name and password, and if the connection is unsuccessful, the IP is kept in an unconnected state.
Referring to fig. 3, when after hardware is restored, after the application runs for a certain time, the drive detects that the node survives, and connection establishment is successful, a connection request in the existing connection pool is distributed to the restored working node.
Based on the above embodiments, the present invention has at least the following technical effects:
the invention has the beneficial effects that:
1. hardware is not required to be purchased, and hardware cost is saved.
2. The configuration is simple and convenient, and configuration items are only required to be added in the application access connection string parameters, so that additional configuration and operation and maintenance of load balancing equipment are not required, and additional labor cost of configuration and operation and maintenance is saved.
3. Load balancing is carried out on the access connection strings, IP (Internet protocol) probing is supported, and dynamic distribution of load requests is supported.
It should be noted that, for simplicity of description, the foregoing embodiments are all described as a series of acts, but it should be understood by those skilled in the art that the present application is not limited by the order of acts, as some steps may be performed in other orders or concurrently in accordance with the present application. Further, it should be understood by those skilled in the art that the embodiments described in the specification are preferred embodiments and that the actions involved are not necessarily required for the present application.
In the above embodiments, the basic principle and main features of the present invention and advantages of the present invention are described. It will be appreciated by persons skilled in the art that the present invention is not limited by the foregoing embodiments, but rather is shown and described in what is considered to be illustrative of the principles of the invention, and that modifications and changes can be made by those skilled in the art without departing from the spirit and scope of the invention, and therefore, is within the scope of the appended claims.

Claims (9)

1. A method for realizing load balancing at a drive layer is characterized in that a database working node IP is configured on a connection string interface of an application server accessing a database server, and the database server working node IP is configured in a drive connection string, and when the application server is connected with the database server through a drive, the working nodes IP are sequentially used, so that load balancing is realized.
2. A method for implementing load balancing at a drive level as claimed in claim 1, comprising the steps of:
S1: setting a working node IP and configuring;
s2: and sequentially using the working nodes IP to realize load balancing.
3. A method for implementing load balancing at a driving level according to claim 2, characterized in that step S1 comprises the sub-steps of:
S11: configuring a database working node IP on a connection serial interface of an application server for accessing a database server;
s12: the database server worker node IP is configured into a drive connection string.
4. The method for implementing load balancing on a driving layer according to claim 2, wherein step S2 specifically comprises: when the application server is connected with the database server through the drive, the established first connection uses the first working node IP configured by the drive and is connected in sequence until the connection is completed, wherein the number of the connections established by each working node is the total number of the connections divided by the number of the configured working nodes, so that load balancing is realized.
5. A method for implementing load balancing at a drive level as claimed in claim 2, further comprising the step of IP probing by the drive to detect whether a working node is alive to allocate a connection of the drive to the working node.
6. The method of claim 5, wherein when the driver detects that a working node is down and a connection cannot be established, the driver skips the working node and uses the next working node and distributes the connection to the remaining surviving working nodes.
7. The method for implementing load balancing on a driving plane as claimed in claim 6, wherein when no connection can be established with a working node within a preset number of times, driving to remove the working node IP, and the subsequent connection no longer uses the working node IP to establish a connection; after running for a preset time, the working node IP is connected again, and if the working node IP is still unable to be connected, the working node IP is kept in an unable connection state.
8. The method of claim 7, wherein the work node IP is reconnected by configuration information, the configuration information including IP, port, repository name, user name and password.
9. The method of claim 5, wherein when the driver detects that the working node is alive and the connection is established successfully, the connection request in the existing connection pool is distributed to the surviving working node.
CN202410603355.3A 2024-05-15 2024-05-15 Method for realizing load balance of driving layer Pending CN118295816A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202410603355.3A CN118295816A (en) 2024-05-15 2024-05-15 Method for realizing load balance of driving layer

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410603355.3A CN118295816A (en) 2024-05-15 2024-05-15 Method for realizing load balance of driving layer

Publications (1)

Publication Number Publication Date
CN118295816A true CN118295816A (en) 2024-07-05

Family

ID=91679840

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202410603355.3A Pending CN118295816A (en) 2024-05-15 2024-05-15 Method for realizing load balance of driving layer

Country Status (1)

Country Link
CN (1) CN118295816A (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104462488A (en) * 2014-12-19 2015-03-25 北京奇虎科技有限公司 Database high reliability solution method and device
CN105389371A (en) * 2015-11-16 2016-03-09 天津南大通用数据技术股份有限公司 Method and system for establishing connection with high availability for database cluster
CN107016087A (en) * 2017-04-05 2017-08-04 杭州铭师堂教育科技发展有限公司 Hierarchical database high-availability system based on sentry's model

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104462488A (en) * 2014-12-19 2015-03-25 北京奇虎科技有限公司 Database high reliability solution method and device
CN105389371A (en) * 2015-11-16 2016-03-09 天津南大通用数据技术股份有限公司 Method and system for establishing connection with high availability for database cluster
CN107016087A (en) * 2017-04-05 2017-08-04 杭州铭师堂教育科技发展有限公司 Hierarchical database high-availability system based on sentry's model

Similar Documents

Publication Publication Date Title
US10735345B2 (en) Orchestrating computing resources between different computing environments
US10178045B2 (en) Dynamic discovery and management of microservices for multi-cluster computing platforms
RU2417416C2 (en) Solution deployment in server farm
EP1192545B1 (en) Internet server session backup apparatus
US7558864B2 (en) Method, system and product for identifying, reserving, and logically provisioning resources in provisioning data processing systems
US7246174B2 (en) Method and system for accessing and managing virtual machines
US7093120B2 (en) Method, apparatus, and program for performing boot, maintenance, or install operations on a storage area network
US7856496B2 (en) Information gathering tool for systems administration
US8620926B2 (en) Using a hashing mechanism to select data entries in a directory for use with requested operations
WO2004036344A2 (en) System and method for the optimization of database
JP2000029814A (en) System and method for improving server performance
JP2005539298A (en) Method and system for remotely and dynamically configuring a server
WO2008052892A2 (en) Method, system and program product for determining a number of concurrent users accessing a system
JP2015508207A (en) Apparatus, computer-implemented method, and manufactured product for managing capacity on demand in server cloud (management of capacity on demand in server cloud)
CN100559790C (en) Safeguard the method and system of high availability processing environment
CN106095483A (en) The Automation arranging method of service and device
US7120704B2 (en) Method and system for workload balancing in a network of computer systems
US9176719B2 (en) Resolving prerequisites for a client device in an open service gateway initiative (OSGI) framework
JPH11122244A (en) Managing device for large scaled network
CN118295816A (en) Method for realizing load balance of driving layer
US10841163B2 (en) Autoinitialization of clustered storage
JP2003330826A (en) Communication server system and communication method using it
US10466984B2 (en) Identifying and associating computer assets impacted by potential change to a particular computer asset
CN111935296B (en) System for high-availability infinite MQTT message service capacity expansion
CN113485828A (en) Distributed task scheduling system and method based on quartz

Legal Events

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