CN110928684A - Method and system for realizing connection pool in multi-HiveServer 2 server scene - Google Patents

Method and system for realizing connection pool in multi-HiveServer 2 server scene Download PDF

Info

Publication number
CN110928684A
CN110928684A CN201911113512.8A CN201911113512A CN110928684A CN 110928684 A CN110928684 A CN 110928684A CN 201911113512 A CN201911113512 A CN 201911113512A CN 110928684 A CN110928684 A CN 110928684A
Authority
CN
China
Prior art keywords
server
list
connection
servers
available
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.)
Granted
Application number
CN201911113512.8A
Other languages
Chinese (zh)
Other versions
CN110928684B (en
Inventor
杨延威
汪目明
孙迁
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Jiangsu Suning Cloud Computing Co ltd
SuningCom Co ltd
Original Assignee
Suning Cloud Computing 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 Suning Cloud Computing Co Ltd filed Critical Suning Cloud Computing Co Ltd
Priority to CN201911113512.8A priority Critical patent/CN110928684B/en
Publication of CN110928684A publication Critical patent/CN110928684A/en
Application granted granted Critical
Publication of CN110928684B publication Critical patent/CN110928684B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
    • G06F9/505Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals considering the load
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/18File system types
    • G06F16/182Distributed file systems
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Debugging And Monitoring (AREA)
  • Computer And Data Communications (AREA)

Abstract

The invention discloses a method and a system for realizing a connection pool under a scene of multiple HiveServer2 servers, wherein the method comprises the following steps: constructing a HiveServer2 server state list, wherein HiveServer2 servers in the list correspond to the working states one by one; receiving a user request; and performing load balancing distribution on the plurality of HiveServer2 servers, and returning connection or connection error information of the user request and the HiveServer2 server. The system comprises: the device comprises a multi-HiveServer 2 server management module, an information interaction module and a response module. The computer device and the storage medium can implement the above-described method processes by executing a computer program. The invention can realize the management of files such as HDFS by the multi-HiveServer 2 server, wherein the proposed load balancing distribution strategy can realize the load balancing, fault detection, alarm, automatic recovery and the like of the multi-HiveServer 2 server, thereby improving the efficiency and effect of executing the task requested by the user, saving and fully utilizing the resources of the HiveServer2 server, and having high expandability of the load balancing distribution strategy.

Description

Method and system for realizing connection pool in multi-HiveServer 2 server scene
Technical Field
The invention relates to the field of big data storage management, in particular to a method and a system for realizing a connection pool under a scene of multiple HiveServer2 servers.
Background
The Hadoop frame is the most elegant, most basic and most widely applied frame for storing and calculating big data in the field of big data. The method realizes an excellent Distributed File System (Hadoop Distributed File System), which is called HDFS for short. If the big data is directly crossed by the HDFS, the learning cost is too high, and the development logic is too complex. Therefore, Hive comes about, the Hive interface adopts SQL-like grammar, learning cost is low, development logic is simple, and expandability, extensibility and fault tolerance are achieved. Hive realizes mapping of the HDFS file, management of the HDFS file can be completed through connection of Hive, and servers behind the Hive2.X version are deployed and are generally called as HiverServer2 servers. It is common in the industry today to connect to a single HiverServer2 server or to connect to multiple HiverServer2 servers using virtual IP, all of which suffer from significant drawbacks, such as single function, inflexible configuration, high hardware cost, and the need for separate server deployment.
Disclosure of Invention
The invention aims to provide a method, a system, computer equipment and a storage medium for realizing a connection pool under a multi-HiveServer 2 server scene, which can realize load balancing, fault detection, alarm, automatic recovery and the like of a multi-HiveServer 2 server.
The technical solution for realizing the purpose of the invention is as follows: a method for implementing a connection pool in a multi-HiveServer 2 server scenario includes:
constructing a HiveServer2 server state list, wherein HiveServer2 servers in the list correspond to the working states one by one;
receiving a user request;
and performing load balancing distribution on the plurality of HiveServer2 servers, and returning connection information or connection error information of the user request and the HiveServer2 server.
Further, the working state of the HiveServer2 server includes the number of times the HiveServer2 server executes a user request, the time consumed for executing the user request, whether the user request is currently being executed, and whether a failure occurs.
Further, the performing load balancing distribution on the multiple HiveServer2 servers includes the following processes:
detecting whether each HiveServer2 server in the HiveServer2 server state list fails or not, and constructing an available HiveServer2 server list by all HiveServer2 servers which do not fail;
for each HiveServer2 server in the list of available HiveServer2 servers, collecting the operating state of the HiveServer2 server from the HiveServer2 server state list;
arranging the priorities of all HiveServer2 servers in the available HiveServer2 server list according to the collected working state, thereby constructing an available HiveServer2 server ordered list;
and sequentially traversing the ordered list of available HiveServer2 servers until the user requests to successfully establish connection with a certain HiveServer2 server or the traversal is finished.
Further, the detecting whether each HiveServer2 server fails is specifically realized by an independent single thread a, and the single thread a detects whether each HiveServer2 server fails in real time in the running process of the method for realizing the connection pool under the multi-HiveServer 2 server scenario, and updates the state list of the HiveServer2 server in real time.
Further, in the sequentially traversing the ordered list of available HiveServer2 servers:
aiming at the currently traversed HiveServer2 server which is not connected with the user request, collecting abnormal connection information, and changing the working state of the HiveServer2 server in the HiveServer2 server state list into temporary abnormality;
judging whether the connection abnormal information is contained in an abnormal library set by a user, if so, feeding the connection abnormal information back to the user, and processing the connection abnormal information by the user; otherwise, continuously traversing the next HiveServer2 server, detecting whether the HiveServer2 server with the working state changed to be temporarily abnormal fails through another independent single thread B, if so, removing the HiveServer2 server from the available HiveServer2 server ordered list, sending alarm information, changing the working state of the HiveServer2 server in the HiveServer2 server state list to be failed, and otherwise, changing the working state to be normal.
A system for implementing connection pools in a multi-hieveserver 2 server scenario, the system comprising:
the multi-HiveServer 2 server management module is used for constructing a HiveServer2 server state list, and HiveServer2 servers in the list correspond to the working states one by one;
the information interaction module is used for receiving a user request;
and the response module is used for executing load balancing distribution on the plurality of HiveServer2 servers and returning the connection or connection error information of the user request and the HiveServer2 server.
Further, the response module includes:
a failure detection unit, configured to detect whether each HiveServer2 server in the HiveServer2 server state list fails;
the usable HiveServer2 server list construction unit is used for constructing a usable HiveServer2 server list by using all the non-failed HiveServer2 servers detected by the fault detection unit;
an available HiveServer2 server information collecting unit, configured to collect, from the HiveServer2 server state list, a working state of each HiveServer2 server in the available HiveServer2 server list;
an available HiveServer2 server ordered list construction unit, configured to arrange priorities of all HiveServer2 servers in the available HiveServer2 server list according to the working state acquired by the available HiveServer2 server information acquisition unit, thereby constructing an available HiveServer2 server ordered list;
and traversing the HiveServer2 server unit, wherein the HiveServer2 server unit is used for sequentially traversing the available HiveServer2 server ordered list until the user request successfully establishes connection with a certain HiveServer2 server or the traversal is finished.
Further, the traversing the HiveServer2 server unit includes:
the connection abnormal information acquisition subunit is used for acquiring the connection abnormal information of the currently traversed HiveServer2 server which is not connected with the user request, and changing the working state of the HiveServer2 server in the HiveServer2 server state list into a temporary abnormal state;
the abnormal connection information judging subunit is used for judging whether the abnormal connection information is contained in an abnormal library set by a user, if so, the abnormal connection information is fed back to the user and is processed by the user; otherwise, continuously traversing the next HiveServer2 server, detecting whether the HiveServer2 server with the working state changed to be temporarily abnormal fails, if so, removing the HiveServer2 server from the available HiveServer2 server ordered list, sending alarm information, changing the working state of the HiveServer2 server in the HiveServer2 server state list to be a failure, and otherwise, changing the working state to be normal.
A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the following steps when executing the computer program:
constructing a HiveServer2 server state list, wherein HiveServer2 servers in the list correspond to the working states one by one;
receiving a user request;
and performing load balancing distribution on the plurality of HiveServer2 servers, and returning connection or connection error information of the user request and the HiveServer2 server.
A computer-readable storage medium, on which a computer program is stored which, when executed by a processor, carries out the steps of:
constructing a HiveServer2 server state list, wherein HiveServer2 servers in the list correspond to the working states one by one;
receiving a user request;
and performing load balancing distribution on the plurality of HiveServer2 servers, and returning connection or connection error information of the user request and the HiveServer2 server.
Compared with the prior art, the invention has the following remarkable advantages: 1) the proposed load balancing distribution strategy solves the problem of load balancing of multiple HiveServer2 servers; 2) the proposed load balancing distribution strategy can distribute the user request task executed by the HiveServer2 server to other HiveServer2 servers when a certain HiveServer2 server fails, so that the user task is ensured to be timely and effectively executed, and the efficiency of executing the user task is improved; 3) the proposed load balancing distribution strategy is combined with an independent single thread A, so that the work of the repaired HiveServer2 server can be automatically recovered, and the resource of the HiveServer2 server is saved and fully utilized; 4) the proposed load balancing distribution strategy is easy to realize and can be realized through interface functions and classes, and the load balancing distribution strategy can be changed only by realizing the interface functions, so that the expandability of the load balancing distribution strategy is high.
The present invention is described in further detail below with reference to the attached drawing figures.
Drawings
FIG. 1 is a schematic diagram of an embodiment of an application environment of the present invention.
FIG. 2 is a flowchart illustrating a method for implementing a connection pool in a multi-HiveServer 2 server scenario, according to an embodiment.
FIG. 3 is a flowchart illustrating a method for implementing connection pools in a multiple HiveServer2 server scenario, according to an embodiment.
Fig. 4 is a block diagram of a system for implementing a connection pool in a multi-hieveserver 2 server scenario in an embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
The method for realizing the connection pool in the multi-HiveServer 2 server scene can be applied to the application environment shown in FIG. 1, and can realize the management of files such as HDFS by the multi-HiveServer 2 server.
In one embodiment, in combination with fig. 2, there is provided a method for implementing a connection pool in a multi-hieveserver 2 server scenario, including the following steps:
s01, constructing a HiveServer2 server state list, wherein HiveServer2 servers in the list correspond to the working states one by one;
here, the order of the HiveServer2 servers in the HiveServer2 server status list is arbitrarily set without limitation. The operating status includes all information that the HiveServer2 server is operating.
Step S02, receiving a user request;
here, the request specifically refers to a user task connection request.
And step S03, performing load balancing distribution on the plurality of HiveServer2 servers, and returning the connection or connection error information of the user request and the HiveServer2 servers.
It should be noted that steps S01 to S03 may be executed in a sequential order, or may be executed simultaneously.
In the method for realizing the connection pool under the multi-HiveServer 2 server scene, a HiveServer2 server state list is firstly constructed, and HiveServer2 servers in the list correspond to the working states one by one; then receiving a user request; load balancing distribution is then performed on the multiple HiveServer2 servers, returning user requests for connections or connection error information with the HiveServer2 servers. Therefore, the connection pool under the scene of multiple HiveServer2 servers can be realized under the condition of not adopting virtual IP, and further, the management of files such as HDFS by multiple HiveServer2 servers is realized.
Further, in one embodiment, the operating status of the HiveServer2 server includes the number of times the HiveServer2 server executes the user request, the time consumed for executing the user request, whether the user request is currently being executed, whether the user request fails, and the like.
Here, the higher the priority when the HiveServer2 server performs a user request the less times, performs a user request the less time consuming, does not currently perform a user request, does not fail.
By adopting the scheme of the embodiment, the optimal HiveServer2 server can be selected to establish connection with the user request, and the efficiency and the effect of executing the user task request are improved.
Further, in one embodiment, in conjunction with fig. 3, the above-described performing load balancing distribution on multiple HiveServer2 servers includes the following processes:
detecting whether each HiveServer2 server in the HiveServer2 server state list fails or not, and constructing an available HiveServer2 server list by all HiveServer2 servers which do not fail;
for each HiveServer2 server in the available HiveServer2 server list, collecting the working state of the HiveServer2 server from the HiveServer2 server state list;
arranging the priorities of all HiveServer2 servers in the available HiveServer2 server list according to the collected working state, thereby constructing an available HiveServer2 server ordered list;
and sequentially traversing the ordered list of available HiveServer2 servers until the user requests to successfully establish connection with a certain HiveServer2 server or the traversal is finished.
By adopting the scheme of the embodiment, the problem of load balancing of the plurality of HiveServer2 servers can be solved, and the efficiency and the effect of the HiveServer2 server for executing the user task request are improved. The scheme of the embodiment is easy to implement, can be implemented through interface functions and classes, and the load balancing allocation strategy can be changed only by implementing the interface functions, so that the expandability of the load balancing allocation strategy is high.
Further, in one embodiment, with reference to fig. 3, the detecting whether each HiveServer2 server fails is specifically implemented by an independent single thread checkallserver thread, which detects whether each HiveServer2 server fails in real time during the operation of the method for implementing a connection pool in the multi-HiveServer 2 server scenario of the present invention, and updates the HiveServer2 server state list in real time.
By adopting the scheme of the embodiment, the working state of the HiveServer2 server can be detected in real time by combining a load balancing distribution strategy and an independent single-thread CheckAllServer thread, and the fault HiveServer2 server can automatically recover after being repaired, so that resources are saved and fully utilized, the sustainable reutilization property of the HiveServer2 server is improved, and the resource consumption and waste are reduced.
Further, in one embodiment, in conjunction with fig. 3, in traversing the ordered list of available HiveServer2 servers in turn, the above process:
aiming at the currently traversed HiveServer2 server which is not connected with the user request, collecting abnormal connection information, and changing the working state of the HiveServer2 server in the HiveServer2 server state list into temporary abnormality;
judging whether the connection abnormal information is contained in an abnormal library set by a user, if so, feeding the connection abnormal information back to the user, and processing the connection abnormal information by the user; otherwise, continuously traversing the next HiveServer2 server, detecting whether the HiveServer2 server with the working state changed to be temporarily abnormal fails through another independent single thread CheckAliveThread, if so, removing the HiveServer2 server from the available HiveServer2 server ordered list, sending alarm information, changing the working state of the HiveServer2 server in the HiveServer2 server state list to be failed, and otherwise, changing the working state to be normal.
By adopting the scheme of the embodiment, the connection abnormity introduced by the user side and the connection abnormity introduced by the fault of the HiveServer2 server can be better distinguished, so that the fault check of the HiveServer2 server when the connection abnormity is introduced by the user side is avoided, and the time and resource cost are saved. In addition, whether the HiveServer2 server breaks down is judged through multiple detection, the accuracy of the detection result is improved, the false detection rate is reduced, and when a certain HiveServer2 server breaks down, the user request task executed by the HiveServer2 server can be distributed to other HiveServer2 servers, so that the user request task can be timely and accurately executed.
In one embodiment, in conjunction with fig. 4, there is provided a system for implementing connection pools in a multi-hieveserver 2 server scenario, the system including:
the multi-HiveServer 2 server management module 101 is used for constructing a HiveServer2 server state list, and HiveServer2 servers in the list correspond to the working states thereof one by one;
the information interaction module 102 is used for receiving a user request;
and the response module 103 is used for performing load balancing distribution on the multiple HiveServer2 servers and returning connection or connection error information of the user request and the HiveServer2 server.
Further, in one embodiment, the operating status includes the number of times the HiveServer2 server executes the user request, the time it takes to execute the user request, whether the user request is currently being executed, whether it is failed, and the like.
Further, in one embodiment, the response module includes:
the system comprises a fault detection unit, a fault detection unit and a fault detection unit, wherein the fault detection unit is used for detecting whether each HiveServer2 server in a HiveServer2 server state list fails;
the usable HiveServer2 server list construction unit is used for constructing a usable HiveServer2 server list by using all the non-failed HiveServer2 servers detected by the fault detection unit;
the available HiveServer2 server information acquisition unit is used for acquiring the working state of each HiveServer2 server in the available HiveServer2 server list from the HiveServer2 server state list;
the usable HiveServer2 server ordered list construction unit is used for arranging the priorities of all the HiveServer2 servers in the usable HiveServer2 server list according to the working state acquired by the usable HiveServer2 server information acquisition unit, thereby constructing the usable HiveServer2 server ordered list;
and traversing the HiveServer2 server unit, wherein the HiveServer2 server unit is used for sequentially traversing the available HiveServer2 server ordered list until the user requests to successfully establish connection with a certain HiveServer2 server or the traversal is finished.
Further, in one embodiment, the traversing the HiveServer2 server unit includes:
the connection abnormal information acquisition subunit is used for acquiring the connection abnormal information of the currently traversed HiveServer2 server which is not connected with the user request, and changing the working state of the HiveServer2 server in the HiveServer2 server state list into temporary abnormality;
the abnormal connection information judging subunit is used for judging whether the abnormal connection information is contained in an abnormal library set by a user in a user-defined mode, if so, the abnormal connection information is fed back to the user and is processed by the user; otherwise, continuously traversing the next HiveServer2 server, detecting whether the HiveServer2 server with the working state changed to be temporarily abnormal fails, if so, removing the HiveServer2 server from the available HiveServer2 server ordered list, sending alarm information, changing the working state of the HiveServer2 server in the HiveServer2 server state list to be a failure, and otherwise, changing the working state to be normal.
For specific limitations of the system for implementing the connection pool in the multi-HiveServer 2 server scenario, reference may be made to the above limitations of the method for implementing the connection pool in the multi-HiveServer 2 server scenario, and details are not described here again. The modules in the system for implementing the connection pool in the multi-HiveServer 2 server scenario can be implemented in whole or in part by software, hardware and a combination thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
In one embodiment, a computer device is provided, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, the processor implementing the following steps when executing the computer program:
constructing a HiveServer2 server state list, wherein HiveServer2 servers in the list correspond to the working states one by one;
receiving a user request;
and performing load balancing distribution on the plurality of HiveServer2 servers, and returning connection or connection error information of the user request and the HiveServer2 server.
Further, in one embodiment, the processor executes a computer program to implement load balancing distribution for multiple HiveServer2 servers, including the following processes:
detecting whether each HiveServer2 server in the HiveServer2 server state list fails or not, and constructing an available HiveServer2 server list by all HiveServer2 servers which do not fail;
for each HiveServer2 server in the available HiveServer2 server list, collecting the working state of the HiveServer2 server from the HiveServer2 server state list;
arranging the priorities of all HiveServer2 servers in the available HiveServer2 server list according to the collected working state, thereby constructing an available HiveServer2 server ordered list;
and sequentially traversing the ordered list of available HiveServer2 servers until the user requests to successfully establish connection with a certain HiveServer2 server or the traversal is finished.
Further, in one embodiment, the processor executes the computer program to detect whether each HiveServer2 server fails, specifically implemented by an independent single thread checkallserver thread, which detects whether each HiveServer2 server fails in real time during the operation of the method for implementing the connection pool in the multi-HiveServer 2 server scenario, and updates the HiveServer2 server state list in real time.
Further, in one embodiment, the processor executes the computer program to perform the steps of, in sequence, traversing the ordered list of available HiveServer2 servers:
aiming at the currently traversed HiveServer2 server which is not connected with the user request, collecting abnormal connection information, and changing the working state of the HiveServer2 server in the HiveServer2 server state list into temporary abnormality;
judging whether the connection abnormal information is contained in an abnormal library set by a user, if so, feeding the connection abnormal information back to the user, and processing the connection abnormal information by the user; otherwise, continuously traversing the next HiveServer2 server, detecting whether the HiveServer2 server with the working state changed to be temporarily abnormal fails through another independent single thread CheckAliveThread, if so, removing the HiveServer2 server from the available HiveServer2 server ordered list, sending alarm information, changing the working state of the HiveServer2 server in the HiveServer2 server state list to be failed, and otherwise, changing the working state to be normal.
In one embodiment, a computer-readable storage medium is provided, having a computer program stored thereon, which when executed by a processor, performs the steps of:
constructing a HiveServer2 server state list, wherein HiveServer2 servers in the list correspond to the working states one by one;
receiving a user request;
and performing load balancing distribution on the plurality of HiveServer2 servers, and returning connection or connection error information of the user request and the HiveServer2 server.
Further, in one embodiment, the computer program executed by the processor implements load balancing distribution for multiple HiveServer2 servers, comprising the processes of:
detecting whether each HiveServer2 server in the HiveServer2 server state list fails or not, and constructing an available HiveServer2 server list by all HiveServer2 servers which do not fail;
for each HiveServer2 server in the available HiveServer2 server list, collecting the working state of the HiveServer2 server from the HiveServer2 server state list;
arranging the priorities of all HiveServer2 servers in the available HiveServer2 server list according to the collected working state, thereby constructing an available HiveServer2 server ordered list;
and sequentially traversing the ordered list of available HiveServer2 servers until the user requests to successfully establish connection with a certain HiveServer2 server or the traversal is finished.
Further, in one embodiment, the implementation of the computer program executed by the processor to detect whether each HiveServer2 server fails is specifically implemented by an independent single thread checkallserver thread, which detects whether each HiveServer2 server fails in real time during the operation of the implementation method of the connection pool in the scenario of multiple hiveservers 2 servers, and updates the state list of the hiveservers 2 server in real time.
Further, in one embodiment, the computer program is executed by the processor to perform the process of traversing the ordered list of available HiveServer2 servers in turn:
aiming at the currently traversed HiveServer2 server which is not connected with the user request, collecting abnormal connection information, and changing the working state of the HiveServer2 server in the HiveServer2 server state list into temporary abnormality;
judging whether the connection abnormal information is contained in an abnormal library set by a user, if so, feeding the connection abnormal information back to the user, and processing the connection abnormal information by the user; otherwise, continuously traversing the next HiveServer2 server, detecting whether the HiveServer2 server with the working state changed to be temporarily abnormal fails through another independent single thread CheckAliveThread, if so, removing the HiveServer2 server from the available HiveServer2 server ordered list, sending alarm information, changing the working state of the HiveServer2 server in the HiveServer2 server state list to be failed, and otherwise, changing the working state to be normal.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in the embodiments provided herein may include non-volatile and/or volatile memory, among others. Non-volatile memory can include read-only memory (ROM), Programmable ROM (PROM), Electrically Programmable ROM (EPROM), Electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced SDRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), Rambus Direct RAM (RDRAM), direct bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (10)

1. A method for realizing a connection pool in a multi-HiveServer 2 server scene is characterized by comprising the following steps:
constructing a HiveServer2 server state list, wherein HiveServer2 servers in the list correspond to the working states one by one;
receiving a user request;
and performing load balancing distribution on the plurality of HiveServer2 servers, and returning connection information or connection error information of the user request and the HiveServer2 server.
2. The method for implementing the connection pool in the multi-HiveServer 2 server scenario, in which the working status of the HiveServer2 server includes the number of times the HiveServer2 server executes the user request, the time consumed for executing the user request, whether the user request is currently being executed, and whether there is a failure.
3. The method for implementing connection pool in multi-HiveServer 2 server scenario according to claim 1 or 2, wherein the performing load balancing distribution for multi-HiveServer 2 servers includes the following procedures:
detecting whether each HiveServer2 server in the HiveServer2 server state list fails or not, and constructing an available HiveServer2 server list by all HiveServer2 servers which do not fail;
for each HiveServer2 server in the list of available HiveServer2 servers, collecting the operating state of the HiveServer2 server from the HiveServer2 server state list;
arranging the priorities of all HiveServer2 servers in the available HiveServer2 server list according to the collected working state, thereby constructing an available HiveServer2 server ordered list;
and sequentially traversing the ordered list of available HiveServer2 servers until the user requests to successfully establish connection with a certain HiveServer2 server or the traversal is finished.
4. The method for implementing the connection pool under the multi-HiveServer 2 server scenario, as claimed in claim 3, wherein the detecting whether each HiveServer2 server in the HiveServer2 server state list fails is specifically implemented by an independent single thread A, which detects whether each HiveServer2 server fails in real time during the operation of the implementation method of the connection pool under the multi-HiveServer 2 server scenario, and updates the HiveServer2 server state list in real time.
5. The method for implementing a connection pool in a multi-HiveServer 2 server scenario as claimed in claim 3, wherein in said sequentially traversing said ordered list of available HiveServer2 servers:
aiming at the currently traversed HiveServer2 server which is not connected with the user request, collecting abnormal connection information, and changing the working state of the HiveServer2 server in the HiveServer2 server state list into temporary abnormality;
judging whether the connection abnormal information is contained in an abnormal library set by a user, if so, feeding the connection abnormal information back to the user, and processing the connection abnormal information by the user; otherwise, continuously traversing the next HiveServer2 server, detecting whether the HiveServer2 server with the working state changed to be temporarily abnormal fails through another independent single thread B, if so, removing the HiveServer2 server from the available HiveServer2 server ordered list, sending alarm information, changing the working state of the HiveServer2 server in the HiveServer2 server state list to be failed, and otherwise, changing the working state to be normal.
6. A system for implementing connection pool under multi-HiveServer 2 server scene is characterized in that the system comprises:
the multi-HiveServer 2 server management module is used for constructing a HiveServer2 server state list, and HiveServer2 servers in the list correspond to the working states one by one;
the information interaction module is used for receiving a user request;
and the response module is used for executing load balancing distribution on the plurality of HiveServer2 servers and returning the connection or connection error information of the user request and the HiveServer2 server.
7. The system of claim 6, wherein the response module comprises:
a failure detection unit, configured to detect whether each HiveServer2 server in the HiveServer2 server state list fails;
the usable HiveServer2 server list construction unit is used for constructing a usable HiveServer2 server list by using all the non-failed HiveServer2 servers detected by the fault detection unit;
an available HiveServer2 server information collecting unit, configured to collect, from the HiveServer2 server state list, a working state of each HiveServer2 server in the available HiveServer2 server list;
an available HiveServer2 server ordered list construction unit, configured to arrange priorities of all HiveServer2 servers in the available HiveServer2 server list according to the working state acquired by the available HiveServer2 server information acquisition unit, thereby constructing an available HiveServer2 server ordered list;
and traversing the HiveServer2 server unit, wherein the HiveServer2 server unit is used for sequentially traversing the available HiveServer2 server ordered list until the user request successfully establishes connection with a certain HiveServer2 server or the traversal is finished.
8. The system of claim 6, wherein traversing the HiveServer2 server cells comprises:
the connection abnormal information acquisition subunit is used for acquiring the connection abnormal information of the currently traversed HiveServer2 server which is not connected with the user request, and changing the working state of the HiveServer2 server in the HiveServer2 server state list into a temporary abnormal state;
the abnormal connection information judging subunit is used for judging whether the abnormal connection information is contained in an abnormal library set by a user, if so, the abnormal connection information is fed back to the user and is processed by the user; otherwise, continuously traversing the next HiveServer2 server, detecting whether the HiveServer2 server with the working state changed to be temporarily abnormal fails, if so, removing the HiveServer2 server from the available HiveServer2 server ordered list, sending alarm information, changing the working state of the HiveServer2 server in the HiveServer2 server state list to be a failure, and otherwise, changing the working state to be normal.
9. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the steps of the method of any of claims 1 to 5 are implemented when the computer program is executed by the processor.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 5.
CN201911113512.8A 2019-11-14 2019-11-14 Method and system for realizing connection pool under multi-HiveServer 2 server scene Active CN110928684B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911113512.8A CN110928684B (en) 2019-11-14 2019-11-14 Method and system for realizing connection pool under multi-HiveServer 2 server scene

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911113512.8A CN110928684B (en) 2019-11-14 2019-11-14 Method and system for realizing connection pool under multi-HiveServer 2 server scene

Publications (2)

Publication Number Publication Date
CN110928684A true CN110928684A (en) 2020-03-27
CN110928684B CN110928684B (en) 2023-08-22

Family

ID=69852938

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911113512.8A Active CN110928684B (en) 2019-11-14 2019-11-14 Method and system for realizing connection pool under multi-HiveServer 2 server scene

Country Status (1)

Country Link
CN (1) CN110928684B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112087404A (en) * 2020-09-22 2020-12-15 陕西千山航空电子有限责任公司 SOC-based RapidIO switch error processing method

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101083517A (en) * 2006-05-30 2007-12-05 华为技术有限公司 Apparatus and method for providing terminal-to-terminal service quality guaranty in service network
CN102132255A (en) * 2008-05-29 2011-07-20 思杰系统有限公司 Systems and methods for load balancing via a plurality of virtual servers upon failover using metrics from a backup virtual server
CN102301677A (en) * 2008-11-25 2011-12-28 思杰系统有限公司 Systems And Methods For Gslb Site Persistence

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101083517A (en) * 2006-05-30 2007-12-05 华为技术有限公司 Apparatus and method for providing terminal-to-terminal service quality guaranty in service network
CN102132255A (en) * 2008-05-29 2011-07-20 思杰系统有限公司 Systems and methods for load balancing via a plurality of virtual servers upon failover using metrics from a backup virtual server
CN102301677A (en) * 2008-11-25 2011-12-28 思杰系统有限公司 Systems And Methods For Gslb Site Persistence

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112087404A (en) * 2020-09-22 2020-12-15 陕西千山航空电子有限责任公司 SOC-based RapidIO switch error processing method
CN112087404B (en) * 2020-09-22 2023-04-07 陕西千山航空电子有限责任公司 SOC-based RapidIO switch error processing method

Also Published As

Publication number Publication date
CN110928684B (en) 2023-08-22

Similar Documents

Publication Publication Date Title
US10095576B2 (en) Anomaly recovery method for virtual machine in distributed environment
CN108710673B (en) Method, system, computer device and storage medium for realizing high availability of database
CN103970564A (en) Automatic repairing and upgrading method of embedded operating system and embedded operating system with automatic repairing and upgrading functions
CN111209110A (en) Task scheduling management method, system and storage medium for realizing load balance
US9183139B2 (en) Mainboard and method of backing up of baseboard management controller
CN109901998B (en) Resource recovery method, device, system, computer equipment and storage medium
CN115373799A (en) Cluster management method and device and electronic equipment
CN110928684A (en) Method and system for realizing connection pool in multi-HiveServer 2 server scene
CN114615310A (en) Method and device for maintaining TCP connection and electronic equipment
CN114168071A (en) Distributed cluster capacity expansion method, distributed cluster capacity expansion device and medium
CN111651350B (en) Test case processing method, device, equipment and computer readable storage medium
CN117313012A (en) Fault management method, device, equipment and storage medium of service orchestration system
CN111966461A (en) Virtual machine cluster node guarding method, device, equipment and storage medium
CN108984602B (en) Database control method and database system
US8203937B2 (en) Global detection of resource leaks in a multi-node computer system
CN115981919A (en) Management control method, device, equipment and storage medium for database cluster
CN114564153A (en) Volume mapping removing method, device, equipment and storage medium
CN115291891A (en) Cluster management method and device and electronic equipment
CN114816656A (en) Container group migration method, electronic device and storage medium
CN111427718B (en) File backup method, file recovery method and file recovery device
CN116028263A (en) Database data backup method and device, computing equipment and storage medium
CN112612652A (en) Distributed storage system abnormal node restarting method and system
CN109034768B (en) Financial reconciliation method, apparatus, computer device and storage medium
CN108599982B (en) Data recovery method and related equipment
CN114328374A (en) Snapshot method, device, related equipment and database system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
CP03 Change of name, title or address
CP03 Change of name, title or address

Address after: No.1-1 Suning Avenue, Xuzhuang Software Park, Xuanwu District, Nanjing, Jiangsu Province, 210000

Patentee after: Jiangsu Suning cloud computing Co.,Ltd.

Country or region after: China

Address before: No.1-1 Suning Avenue, Xuzhuang Software Park, Xuanwu District, Nanjing, Jiangsu Province, 210000

Patentee before: Suning Cloud Computing Co.,Ltd.

Country or region before: China

TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20240507

Address after: 210000, 1-5 story, Jinshan building, 8 Shanxi Road, Nanjing, Jiangsu.

Patentee after: SUNING.COM Co.,Ltd.

Country or region after: China

Address before: No.1-1 Suning Avenue, Xuzhuang Software Park, Xuanwu District, Nanjing, Jiangsu Province, 210000

Patentee before: Jiangsu Suning cloud computing Co.,Ltd.

Country or region before: China