CN110928684B - Method and system for realizing connection pool under multi-HiveServer 2 server scene - Google Patents

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

Info

Publication number
CN110928684B
CN110928684B CN201911113512.8A CN201911113512A CN110928684B CN 110928684 B CN110928684 B CN 110928684B CN 201911113512 A CN201911113512 A CN 201911113512A CN 110928684 B CN110928684 B CN 110928684B
Authority
CN
China
Prior art keywords
server
list
hiveserver
connection
user request
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201911113512.8A
Other languages
Chinese (zh)
Other versions
CN110928684A (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.)
Suning Cloud Computing 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

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

Abstract

The application discloses a method and a system for realizing a connection pool under a multi-HiveServer 2 server scene, wherein the method comprises the following steps: constructing a HiveServer2 server state list, wherein the HiveServer2 servers in the list correspond to the working states thereof one by one; receiving a user request; and executing load balancing distribution on the multi-HiveServer 2 server, and returning connection or connection error information of the user request and the HiveServer2 server. The system comprises: the system 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 the computer program. The application can realize the management of the files such as HDFS by the multi-HiveServer 2 server, wherein the proposed load balancing and distributing strategy can realize the load balancing, fault detection, alarm, automatic recovery and the like of the multi-HiveServer 2 server, improves the efficiency and effect of executing the user request task, saves and fully utilizes the resources of the HiveServer2 server, and has high expandability.

Description

Method and system for realizing connection pool under multi-HiveServer 2 server scene
Technical Field
The application relates to the field of big data storage management, in particular to a method and a system for realizing a connection pool under a multi-HiveServer 2 server scene.
Background
The Hadoop framework is the most excellent, basic and widely applied framework for storing and calculating big data in the big data field. It implements an excellent distributed file system (Hadoop Distributed File System), HDFS for short. If the HDFS is used to make a lane with big data directly, the learning cost is too high, and the development logic is too complex. Therefore, hive has been generated, the Hive interface adopts SQL-like grammar, has low learning cost and simple development logic, and has expandability, extensibility and fault tolerance. Hive realizes mapping to the HDFS file, and management to the HDFS file can be completed by connecting Hive, and a server after Hive2.X version is deployed, which is commonly called HiverServer2 server. The current common industry is that a single HiverServer2 server is directly connected or a virtual IP mode is used for connecting with a plurality of HiverServer2 servers, and the method has the defects of single function, inflexible configuration, high hardware cost, independent server deployment and the like.
Disclosure of Invention
The application 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, wherein the method, the system, the computer equipment and the storage medium can realize load balancing, fault detection, alarm, automatic recovery and the like of the multi-HiveServer 2 server.
The technical solution for realizing the purpose of the application is as follows: a method for implementing a connection pool in a multi-HiveServer 2 server scenario, the method comprising:
constructing a HiveServer2 server state list, wherein the HiveServer2 servers in the list correspond to the working states thereof one by one;
receiving a user request;
and executing load balancing distribution on the multi-HiveServer 2 server, and returning the connection information or the 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 the user request, the time consumed for executing the user request, whether the user request is currently being executed, and whether the user request fails.
Further, the load balancing allocation is executed on the multi-HiveServer 2 server, which comprises the following steps:
detecting whether each HiveServer2 server in the HiveServer2 server state list is faulty or not, and constructing an available HiveServer2 server list by all the HiveServer2 servers which are not faulty;
collecting the working state of the HiveServer2 server from the HiveServer2 server state list aiming at each HiveServer2 server in the available HiveServer2 server list;
arranging the priority 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 traversing the available HiveServer2 server ordered list in turn until the user request and a certain HiveServer2 server are successfully connected or the traversing is finished.
Further, the detecting whether each HiveServer2 server fails is specifically implemented by an independent single thread a, and the single thread a detects whether each HiveServer2 server fails in real time and updates the state list of the HiveServer2 server in real time in the running process of the implementation method of the connection pool under the scenario of the multi-HiveServer 2 servers.
Further, in the process of traversing the ordered list of available HiveServer2 servers in turn:
aiming at a HiveServer2 server which is currently traversed and is not connected with a user request, acquiring connection abnormality information, and changing the working state of the HiveServer2 server in a HiveServer2 server state list into temporary abnormality;
judging whether the connection abnormal information is contained in an abnormal library which is set by a user in a self-defining way, if so, feeding the connection abnormal information back to the user, and processing the connection abnormal information by the user; otherwise, continuing to traverse the next HiveServer2 server, detecting whether the HiveServer2 server with the working state changed into temporary abnormality is faulty through another independent single thread B, if so, removing the HiveServer2 server from the available HiveServer2 server ordered list, simultaneously sending alarm information, changing the working state of the HiveServer2 server in the HiveServer2 server state list into the fault, and otherwise, changing the working state into normal.
A system for implementing a connection pool in a multi-HiveServer 2 server scenario, the system comprising:
the multi-HiveServer 2 server management module is used for constructing a HiveServer2 server state list, wherein the HiveServer2 servers in the list are in one-to-one correspondence with the working states of the HiveServer2 servers;
the information interaction module is used for receiving a user request;
and the response module is used for executing load balancing distribution on the multi-HiveServer 2 server and returning the connection or connection error information between the user request and the HiveServer2 server.
Further, the response module includes:
the fault detection unit is used for detecting whether each HiveServer2 server in the HiveServer2 server state list is faulty or not;
the available HiveServer2 server list construction unit is used for constructing an available HiveServer2 server list by utilizing all the HiveServer2 servers which are not failed and detected by the failure 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 available HiveServer2 server ordered list construction unit is used for arranging the 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 traversing HiveServer2 server unit is used for traversing the available HiveServer2 server ordered list in turn until the user request and a certain HiveServer2 server are successfully connected or the traversing is finished.
Further, the traversing HiveServer2 server unit includes:
the connection abnormality information acquisition subunit is used for acquiring connection abnormality information of the HiveServer2 server which is currently traversed and 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 connection abnormal information judging subunit is used for judging whether the connection abnormal information is contained in an abnormal library which is set by a user in a user-defined mode, if yes, the connection abnormal information is fed back to the user, and the user processes the connection abnormal information; otherwise, continuing to traverse the next HiveServer2 server, detecting whether the HiveServer2 server with the working state changed into temporary abnormality fails, if so, removing the HiveServer2 server from an available HiveServer2 server ordered list, simultaneously sending alarm information, changing the working state of the HiveServer2 server in the HiveServer2 server state list into failure, otherwise, changing the working state into 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 the HiveServer2 servers in the list correspond to the working states thereof one by one;
receiving a user request;
and executing load balancing distribution on the multi-HiveServer 2 server, and returning connection or connection error information of the user request and the HiveServer2 server.
A computer readable storage medium having stored thereon a computer program which when executed by a processor performs the steps of:
constructing a HiveServer2 server state list, wherein the HiveServer2 servers in the list correspond to the working states thereof one by one;
receiving a user request;
and executing load balancing distribution on the multi-HiveServer 2 server, and returning connection or connection error information of the user request and the HiveServer2 server.
Compared with the prior art, the application has the remarkable advantages that: 1) The proposed load balancing and distributing strategy solves the problem of load balancing of the multi-HiveServer 2 server; 2) The proposed load balancing allocation strategy can allocate the user request task executed by a HiveServer2 server to other HiveServer2 servers when a certain HiveServer2 server fails, so that the user task is ensured to be executed effectively in time, 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 fault HiveServer2 server can automatically recover to work after being repaired, and the resources of the HiveServer2 server are saved and fully utilized; 4) The load balancing distribution strategy is easy to realize, can be realized through interface functions and classes, can be changed only by realizing the interface functions, and has high expandability.
The application is described in further detail below with reference to the accompanying drawings.
Drawings
FIG. 1 is a schematic view of an application environment of the present application in one embodiment.
FIG. 2 is a flow chart of a method for implementing a connection pool in a multi-HiveServer 2 server scenario, under one embodiment.
FIG. 3 is a flow chart of a method for implementing a connection pool in a multi-HiveServer 2 server scenario, under one embodiment.
FIG. 4 is a block diagram of a connection pool implementation system in a multi-HiveServer 2 server scenario, under one embodiment.
Detailed Description
The present application will be described in further detail with reference to the drawings and examples, in order to make the objects, technical solutions and advantages of the present application more apparent. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the application.
The method for realizing the connection pool under the scene of the multi-HiveServer 2 server can be applied to the application environment shown in the figure 1, and can realize the management of the files such as HDFS by the multi-HiveServer 2 server.
In one embodiment, in conjunction with fig. 2, a method for implementing a connection pool in a multi-HiveServer 2 server scenario is provided, including the following steps:
step S01, a HiveServer2 server state list is constructed, wherein the HiveServer2 servers in the list correspond to the working states thereof one by one;
here, the order of the HiveServer2 servers in the HiveServer2 server state list is set at will, without limitation. The operational 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 S03, carrying out load balancing distribution on the multi-HiveServer 2 server, and returning connection or connection error information of the user request and the HiveServer2 server.
The steps S01 to S03 may be executed not only in the above order, but also simultaneously.
In the method for realizing the connection pool under the scene of the multi-HiveServer 2 server, a HiveServer2 server state list is firstly constructed, and the HiveServer2 servers in the list correspond to the working states thereof one by one; then receiving a user request; and then load balancing distribution is carried out on the multi-HiveServer 2 server, and connection or connection error information of the user request and the HiveServer2 server is returned. Therefore, the connection pool under the scene of the multi-HiveServer 2 server can be realized under the condition that virtual IP is not adopted, and further, the management of files such as HDFS and the like by the multi-HiveServer 2 server is realized.
Further, in one embodiment, the working state of the HiveServer2 includes the number of times the HiveServer2 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 so on.
Here, the higher the priority the HiveServer2 server performs the user request the fewer times, the less time it takes to perform the user request, the current user request is not performed, and no failure occurs.
By adopting the scheme of the embodiment, the optimal HiveServer2 server can be selected to be connected with the user request, and the efficiency and the effect of executing the user task request are improved.
Further, in one embodiment, in connection with fig. 3, the above-mentioned load balancing allocation is performed on the multi-HiveServer 2 server, which includes the following procedures:
detecting whether each HiveServer2 server in the HiveServer2 server status list is faulty or not, and constructing an available HiveServer2 server list by all the HiveServer2 servers which are not faulty;
collecting the working state of the HiveServer2 server from the HiveServer2 server state list aiming at each HiveServer2 server in the available HiveServer2 server list;
arranging the priority 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 traversing the available HiveServer2 server ordered list in turn until the user requests to successfully establish connection with a certain HiveServer2 server or the traversing is finished.
By adopting the scheme of the embodiment, the problem of load balancing of the HiveServer2 servers can be solved, and the efficiency and the effect of executing the user task request by the HiveServer2 servers are improved. The scheme of the embodiment is easy to realize, can be realized through the interface function and the class, and can change the load balance distribution strategy only by realizing the interface function, and the load balance distribution strategy has high expandability.
Further, in one embodiment, referring to fig. 3, the above-mentioned detection of whether each HiveServer2 server fails is specifically implemented by a single-thread checkallrerverthread, and the thread checkallrerverthread detects whether each HiveServer2 server fails in real time and updates the status list of the HiveServer2 server in real time during the running process of the implementing method of the connection pool under the scenario of multiple hiveservers 2 of the present application.
By adopting the scheme of the embodiment, the working state of the HiveServer2 server can be detected in real time by combining a load balance distribution strategy and an independent single-thread checkAllServerthread, and the fault HiveServer2 server can automatically recover after being repaired, so that resources are saved and fully utilized, the sustainable reusability of the HiveServer2 server is improved, and the resource consumption and waste are reduced.
Further, in one embodiment, in conjunction with FIG. 3, the above is in the process of traversing the ordered list of available HiveServer2 servers in turn:
aiming at a HiveServer2 server which is currently traversed and is not connected with a user request, acquiring connection abnormality information, and changing the working state of the HiveServer2 server in a HiveServer2 server state list into temporary abnormality;
judging whether the connection abnormal information is contained in an abnormal library which is set by a user in a self-defining way, if so, feeding the connection abnormal information back to the user, and processing the connection abnormal information by the user; otherwise, continuing to traverse the next HiveServer2 server, detecting whether the HiveServer2 server with the working state changed into temporary abnormality is in fault or not through another independent single-thread checkAlveThread, if so, removing the HiveServer2 server from the available HiveServer2 server ordered list, simultaneously sending alarm information, changing the working state of the HiveServer2 server in the HiveServer2 server state list into fault, and otherwise, changing the working state into normal.
By adopting the scheme of the embodiment, the connection abnormality introduced by the user side and the connection abnormality introduced by the fault of the HiveServer2 server can be better distinguished, so that the fault detection of the HiveServer2 server when the connection abnormality is introduced by the user side is avoided, and the time and the resource cost are saved. In addition, whether the HiveServer2 server fails or not is judged through multiple detection, the accuracy of a detection result is improved, the false detection rate is reduced, and when a certain HiveServer2 server fails, user request tasks executed by the HiveServer2 server can be distributed to other HiveServer2 servers, so that the user request tasks are guaranteed to be executed timely and accurately.
In one embodiment, in connection with fig. 4, there is provided a system for implementing a connection pool in a multi-HiveServer 2 server scenario, where the system includes:
the multi-HiveServer 2 server management module 101 is configured to construct a HiveServer2 server status list, where the HiveServer2 servers in the list are in one-to-one correspondence with their working statuses;
an information interaction module 102, configured to receive a user request;
and the response module 103 is used for executing load balancing distribution on the multi-HiveServer 2 server and returning connection or connection error information of the user request and the HiveServer2 server.
Further, in one embodiment, the working states include the number of times the HiveServer2 server executes the user request, the time consumed to execute the user request, whether the user request is currently being executed, whether the user request is faulty, and so on.
Further, in one embodiment, the response module includes:
the fault detection unit is used for detecting whether each HiveServer2 server in the HiveServer2 server state list has a fault or not;
the available HiveServer2 server list construction unit is used for constructing an available HiveServer2 server list by utilizing all the HiveServer2 servers which are not failed and detected by the failure 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 available HiveServer2 server ordered list construction unit is used for arranging the priorities of all HiveServer2 servers in the available HiveServer2 server list according to the working states 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 traversing HiveServer2 server unit is used for traversing the available ordered list of HiveServer2 servers in turn until the user requests to successfully establish connection with a certain HiveServer2 server or the traversing is finished.
Further, in one embodiment, the traversing HiveServer2 server unit includes:
the connection abnormality information acquisition subunit is used for acquiring connection abnormality information of the HiveServer2 server which is currently traversed and 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 connection abnormal information judging subunit is used for judging whether the connection abnormal information is contained in an abnormal library which is set by a user in a self-defining way, if so, the connection abnormal information is fed back to the user and is processed by the user; otherwise, continuing to traverse the next HiveServer2 server, detecting whether the HiveServer2 server with the working state changed into the temporary abnormality fails, if so, removing the HiveServer2 server from the available HiveServer2 server ordered list, simultaneously sending alarm information, changing the working state of the HiveServer2 server in the HiveServer2 server state list into the failure, otherwise, changing the working state into the normal state.
For specific limitation of the implementation system of the connection pool in the multi-HiveServer 2 server scenario, reference may be made to the limitation of the implementation method of the connection pool in the multi-HiveServer 2 server scenario hereinabove, and the description thereof is omitted herein. All or part of the modules in the system for realizing the connection pool under the multi-HiveServer 2 server scene can be realized by software, hardware and the combination thereof. The above modules may be embedded in hardware or may be independent of a processor in the computer device, or may be stored in software in a memory in the computer device, so that the processor may call and execute operations corresponding to the above 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 steps of when executing the computer program:
constructing a HiveServer2 server state list, wherein the HiveServer2 servers in the list correspond to the working states thereof one by one;
receiving a user request;
and executing load balancing distribution on the multi-HiveServer 2 server, and returning connection or connection error information of the user request and the HiveServer2 server.
Further, in one embodiment, the execution of the computer program by the processor implements load balancing distribution to the multi-HiveServer 2 server, comprising the following processes:
detecting whether each HiveServer2 server in the HiveServer2 server status list is faulty or not, and constructing an available HiveServer2 server list by all the HiveServer2 servers which are not faulty;
collecting the working state of the HiveServer2 server from the HiveServer2 server state list aiming at each HiveServer2 server in the available HiveServer2 server list;
arranging the priority 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 traversing the available HiveServer2 server ordered list in turn until the user requests to successfully establish connection with a certain HiveServer2 server or the traversing is finished.
Further, in one embodiment, the processor executes a computer program to implement detecting whether each HiveServer2 server fails, specifically by implementing a single-thread checkallrerverthread, where the thread checkallrerverthread detects whether each HiveServer2 server fails in real time during the running of the implementation method of the connection pool in the scenario of multiple hiveservers 2 servers, and updates the HiveServer2 server status list in real time.
Further, in one embodiment, the processor executes the computer program to implement the process of traversing the ordered list of available HiveServer2 servers in sequence:
aiming at a HiveServer2 server which is currently traversed and is not connected with a user request, acquiring connection abnormality information, and changing the working state of the HiveServer2 server in a HiveServer2 server state list into temporary abnormality;
judging whether the connection abnormal information is contained in an abnormal library which is set by a user in a self-defining way, if so, feeding the connection abnormal information back to the user, and processing the connection abnormal information by the user; otherwise, continuing to traverse the next HiveServer2 server, detecting whether the HiveServer2 server with the working state changed into temporary abnormality is in fault or not through another independent single-thread checkAlveThread, if so, removing the HiveServer2 server from the available HiveServer2 server ordered list, simultaneously sending alarm information, changing the working state of the HiveServer2 server in the HiveServer2 server state list into fault, and otherwise, changing the working state into 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 the HiveServer2 servers in the list correspond to the working states thereof one by one;
receiving a user request;
and executing load balancing distribution on the multi-HiveServer 2 server, and returning connection or connection error information of the user request and the HiveServer2 server.
Further, in one embodiment, the execution of the computer program by the processor implements load balancing distribution to the multi-HiveServer 2 server, including the following procedures:
detecting whether each HiveServer2 server in the HiveServer2 server status list is faulty or not, and constructing an available HiveServer2 server list by all the HiveServer2 servers which are not faulty;
collecting the working state of the HiveServer2 server from the HiveServer2 server state list aiming at each HiveServer2 server in the available HiveServer2 server list;
arranging the priority 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 traversing the available HiveServer2 server ordered list in turn until the user requests to successfully establish connection with a certain HiveServer2 server or the traversing is finished.
Further, in one embodiment, the computer program is executed by the processor to implement detecting whether each HiveServer2 server fails, specifically by implementing a single-thread CheckAllServerThread, where the thread CheckAllServerThread detects whether each HiveServer2 server fails in real time during the running of the implementation method of the connection pool in the scenario of multiple hiveservers 2 servers, and updates the HiveServer2 server status list 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 sequence:
aiming at a HiveServer2 server which is currently traversed and is not connected with a user request, acquiring connection abnormality information, and changing the working state of the HiveServer2 server in a HiveServer2 server state list into temporary abnormality;
judging whether the connection abnormal information is contained in an abnormal library which is set by a user in a self-defining way, if so, feeding the connection abnormal information back to the user, and processing the connection abnormal information by the user; otherwise, continuing to traverse the next HiveServer2 server, detecting whether the HiveServer2 server with the working state changed into temporary abnormality is in fault or not through another independent single-thread checkAlveThread, if so, removing the HiveServer2 server from the available HiveServer2 server ordered list, simultaneously sending alarm information, changing the working state of the HiveServer2 server in the HiveServer2 server state list into fault, and otherwise, changing the working state into normal.
Those skilled in the art will appreciate that implementing all or part of the above described methods may be accomplished by way of a computer program stored on a non-transitory computer readable storage medium, which when executed, may comprise the steps of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in embodiments provided herein may include non-volatile and/or volatile memory. The nonvolatile 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), memory bus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), among others.
The technical features of the above embodiments may be arbitrarily combined, and all possible combinations of the technical features in the above embodiments are not described for brevity of description, however, as long as there is no contradiction between the combinations of the technical features, they should be considered as the scope of the description.
The above examples illustrate only a few embodiments of the application, which are described in detail and are not to be construed as limiting the scope of the application. It should be noted that it will be apparent to those skilled in the art that several variations and modifications can be made without departing from the spirit of the application, which are all within the scope of the application. Accordingly, the scope of protection of the present application is to be determined by the appended claims.

Claims (5)

1. The method for realizing the connection pool in the scene of the multi-HiveServer 2 server is characterized by comprising the following steps:
constructing a HiveServer2 server state list, wherein the HiveServer2 servers in the list correspond to the working states thereof one by one;
receiving a user request;
load balancing distribution is carried out on the multi-HiveServer 2 server, and connection information or connection error information of the user request and the HiveServer2 server is returned; the load balancing distribution is executed on the multi-HiveServer 2 server, which comprises the following steps:
detecting whether each HiveServer2 server in the HiveServer2 server state list is faulty or not, and constructing an available HiveServer2 server list by all the HiveServer2 servers which are not faulty; the detecting whether each HiveServer2 server in the HiveServer2 server state list has a fault or not is specifically realized by an independent single thread A, and the single thread A detects whether each HiveServer2 server has a fault or not in real time in the running process of the realization method of the connection pool under the multi-HiveServer 2 server scene and updates the HiveServer2 server state list in real time;
collecting the working state of the HiveServer2 server from the HiveServer2 server state list aiming at each HiveServer2 server in the available HiveServer2 server list;
arranging the priority 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 traversing the available HiveServer2 server ordered list in turn until the user request and a certain HiveServer2 server are successfully connected or the traversing is finished.
2. The method for implementing a connection pool in a multi-HiveServer 2 server scenario according to claim 1, wherein the working state of the HiveServer2 server includes the number of times the HiveServer2 server performs the user request, the time consumed for performing the user request, whether the user request is currently being performed, and whether the user request is failed.
3. The method for implementing a connection pool in a multi-HiveServer 2 server scenario according to claim 1, wherein, in the process of traversing the ordered list of available HiveServer2 servers in turn:
aiming at a HiveServer2 server which is currently traversed and is not connected with a user request, acquiring connection abnormality information, and changing the working state of the HiveServer2 server in a HiveServer2 server state list into temporary abnormality;
judging whether the connection abnormal information is contained in an abnormal library which is set by a user in a self-defining way, if so, feeding the connection abnormal information back to the user, and processing the connection abnormal information by the user; otherwise, continuing to traverse the next HiveServer2 server, detecting whether the HiveServer2 server with the working state changed into temporary abnormality is faulty through another independent single thread B, if so, removing the HiveServer2 server from the available HiveServer2 server ordered list, simultaneously sending alarm information, changing the working state of the HiveServer2 server in the HiveServer2 server state list into the fault, and otherwise, changing the working state into normal.
4. 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 processor implements the steps of the method according to any one of claims 1 to 3 when the computer program is executed by the processor.
5. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the steps of the method of any of claims 1 to 3.
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 CN110928684A (en) 2020-03-27
CN110928684B true 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)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112087404B (en) * 2020-09-22 2023-04-07 陕西千山航空电子有限责任公司 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

Also Published As

Publication number Publication date
CN110928684A (en) 2020-03-27

Similar Documents

Publication Publication Date Title
EP3142011B9 (en) Anomaly recovery method for virtual machine in distributed environment
CN102355369B (en) Virtual clustered system as well as processing method and processing device thereof
CN108881512B (en) CTDB virtual IP balance distribution method, device, equipment and medium
CN110389843B (en) Service scheduling method, device, equipment and readable storage medium
CN106844055B (en) Task execution method and device
CN112395140B (en) A decentralized task scheduling method apparatus, device and medium
CN112558997A (en) Method and device for deploying applications
CN109167681B (en) State monitoring method and device
CN111988240B (en) Data transmission method and device, electronic equipment and storage medium
CN110928653A (en) Cross-cluster task execution method and device, computer equipment and storage medium
US20160313715A1 (en) Method, Device and Computer Program Product for Programming a Plurality of Control Units
CN109325026B (en) Data processing method, device, equipment and medium based on big data platform
CN110928684B (en) Method and system for realizing connection pool under multi-HiveServer 2 server scene
CN112199240B (en) Method for switching nodes during node failure and related equipment
CN111538613B (en) Cluster system exception recovery processing method and device
CN105205160A (en) Data write-in method and device
CN111614701B (en) Distributed cluster and container state switching method and device
CN105450679A (en) Method and system for performing data cloud storage
CN114564153B (en) Volume mapping relieving method, device, equipment and storage medium
CN114816656A (en) Container group migration method, electronic device and storage medium
CN115291891A (en) Cluster management method and device and electronic equipment
CN115373799A (en) Cluster management method and device and electronic equipment
CN110650059B (en) Fault cluster detection method, device, computer equipment and storage medium
CN111934909A (en) Method and device for switching IP (Internet protocol) resources of host and standby machine, computer equipment and storage medium
CN111123779B (en) Number configuration method and device, electronic equipment and storage medium

Legal Events

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