CN111104266A - Access resource allocation method and device, storage medium and electronic equipment - Google Patents

Access resource allocation method and device, storage medium and electronic equipment Download PDF

Info

Publication number
CN111104266A
CN111104266A CN201911342232.4A CN201911342232A CN111104266A CN 111104266 A CN111104266 A CN 111104266A CN 201911342232 A CN201911342232 A CN 201911342232A CN 111104266 A CN111104266 A CN 111104266A
Authority
CN
China
Prior art keywords
server
access
database
state
detection
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201911342232.4A
Other languages
Chinese (zh)
Inventor
张彪
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Dami Technology Co Ltd
Original Assignee
Beijing Dami Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Dami Technology Co Ltd filed Critical Beijing Dami Technology Co Ltd
Priority to CN201911342232.4A priority Critical patent/CN111104266A/en
Publication of CN111104266A publication Critical patent/CN111104266A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/16Error detection or correction of the data by redundancy in hardware
    • G06F11/20Error detection or correction of the data by redundancy in hardware using active fault-masking, e.g. by switching out faulty elements or by switching in spare elements
    • G06F11/202Error detection or correction of the data by redundancy in hardware using active fault-masking, e.g. by switching out faulty elements or by switching in spare elements where processing functionality is redundant
    • G06F11/2023Failover techniques
    • G06F11/2028Failover techniques eliminating a faulty processor or activating a spare
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2201/00Indexing scheme relating to error detection, to error correction, and to monitoring
    • G06F2201/80Database-specific techniques

Abstract

The embodiment of the invention discloses a method and a device for allocating access resources, a storage medium and electronic equipment. The method and the device for accessing the first server in the database cluster acquire the access state of the first server in the predetermined database cluster, and when the access state of the first server is abnormal, at least one second server can be determined according to the available state of each database server in the predetermined database cluster, so that the access connection with the first server is disconnected, and the access connection with the second server is established, so that the access resources of the first server are distributed to the second server. In the embodiment of the invention, if the first server generates access abnormity, the access resource of the first server can be distributed to at least one second server, and the subsequent database access request sent by the user can be received and processed by the second server, so that the influence of the abnormity of the first server on the database access of the user is effectively reduced.

Description

Access resource allocation method and device, storage medium and electronic equipment
Technical Field
The invention relates to the technical field of computers, in particular to an allocation method and device of access resources, a storage medium and electronic equipment.
Background
With the continuous development of the computer technology field, the data scale is continuously increased. Huge-scale data is stored in a database, and users access the database to acquire the data, so that the access amount of the database is increased continuously. To alleviate the increasing access pressure of databases, operation and maintenance personnel usually build a database cluster, and store data through multiple databases in the database cluster. However, in an actual application process, any database server in the database cluster may have access abnormality and the like, so that a user cannot access and connect with a database corresponding to the database server, and database access of the user is affected.
Disclosure of Invention
In view of this, an object of the embodiments of the present invention is to provide an allocation method and apparatus for access resources, a storage medium, and an electronic device, which are used to allocate access resources of any server when the access of the server is abnormal, so as to effectively reduce the influence on the database access of a user.
According to a first aspect of the embodiments of the present invention, there is provided an allocation method for access resources, the method including:
acquiring an access state of a first server, wherein the first server belongs to a preset database cluster;
in response to the access state being abnormal, determining at least one second server according to the available state of each database server in the predetermined database cluster;
disconnecting access connection with the first server;
establishing an access connection with the second server to allocate access resources of the first server to the second server.
Preferably, the acquiring the access state of the first server includes:
sending a database access request to the first server;
and acquiring a response result of the database access request.
Preferably, the access status is an exception, specifically:
at least one of the response results is used to characterize that the request response time exceeds a predetermined threshold; or
A plurality of said response results in succession are each used to characterize an access failure.
Preferably, the determining at least one second server according to the availability status of each database server in the predetermined database cluster comprises:
determining the availability status of each database server;
determining at least one database server for which the availability status is available as the second server based on a predetermined scheduling algorithm.
Preferably, the method further comprises:
determining a detection state of the first server in a bypass mode;
and responding to the detection state being normal, establishing an access connection with the first server so as to allocate the access resource to the first server.
Preferably, the determining the detection state of the first server in the bypass mode includes:
acquiring a first detection result of the first server in the bypass state;
responsive to the first detection result being available, marking the first server as a detection point;
carrying out at least one detection on the detection point to obtain a corresponding second detection result;
the detection state is normal, specifically:
the second detection result is available; or
Each second said detection result is available.
Preferably, the method further comprises:
removing the detection point mark in response to the detection state being normal.
Preferably, the method further comprises:
in response to an access connection establishment failure, determining that an access status of the first server is abnormal.
Preferably, the method further comprises:
and responding to the abnormal access state, and sending the response result to a preset terminal.
According to a second aspect of the embodiments of the present invention, there is provided an apparatus for allocating access resources, the apparatus including:
an acquisition unit configured to acquire an access state of a first server, the first server belonging to a predetermined database cluster;
a determining unit, configured to determine, in response to the access status being abnormal, at least one second server according to an available status of each database server in the predetermined database cluster;
a disconnection unit configured to disconnect an access connection with the first server;
a connection unit, configured to establish an access connection with the second server, so as to allocate the access resource of the first server to the second server.
The method and the device for accessing the first server in the database cluster acquire the access state of the first server in the predetermined database cluster, and when the access state of the first server is abnormal, at least one second server can be determined according to the available state of each database server in the predetermined database cluster, so that the access connection with the first server is disconnected, and the access connection with the second server is established, so that the access resources of the first server are distributed to the second server. In the embodiment of the invention, if the first server generates access abnormity, the access resource of the first server can be distributed to at least one second server, and the subsequent database access request sent by the user can be received and processed by the second server, so that the influence of the abnormity of the first server on the database access of the user is effectively reduced.
Drawings
The above and other objects, features and advantages of the present invention will become more apparent from the following description of the embodiments of the present invention with reference to the accompanying drawings, in which:
FIG. 1 is a schematic diagram of a hardware system architecture of an embodiment of the present invention;
FIG. 2 is a flowchart of an allocation method for access resources according to a first embodiment of the present invention;
fig. 3 is a flow chart of determining the detection status of the first server in an alternative implementation of the first embodiment of the invention;
FIG. 4 is a diagram illustrating an allocation method for accessing resources according to a first embodiment of the present invention;
FIG. 5 is a schematic diagram of an allocation apparatus for accessing resources according to a second embodiment of the present invention;
fig. 6 is a schematic view of an electronic device according to a third embodiment of the present invention.
Detailed Description
The present disclosure is described below based on examples, but the present disclosure is not limited to only these examples. In the following detailed description of the present disclosure, certain specific details are set forth. It will be apparent to those skilled in the art that the present disclosure may be practiced without these specific details. Well-known methods, procedures, components and circuits have not been described in detail so as not to obscure the present disclosure.
Further, those of ordinary skill in the art will appreciate that the drawings provided herein are for illustrative purposes and are not necessarily drawn to scale.
Unless the context clearly requires otherwise, throughout this specification, the words "comprise", "comprising", and the like are to be construed in an inclusive sense as opposed to an exclusive or exhaustive sense; that is, what is meant is "including, but not limited to".
In the description of the present disclosure, it is to be understood that the terms "first," "second," and the like are used for descriptive purposes only and are not to be construed as indicating or implying relative importance. In addition, in the description of the present disclosure, "a plurality" means two or more unless otherwise specified.
With the increasing data size and the increasing number of users, in order to relieve the increasing access pressure of the server, the operation and maintenance personnel usually build a database cluster to store the data. However, in an actual application process, when any database server in the database cluster encounters a condition such as downtime (a phenomenon that an operating system cannot recover from an in-eye system error or a system hardware level has a problem so that the system does not respond for a long time), a network abnormality, and the like, problems such as access abnormality may occur. During the abnormal access period of the database server, the user cannot access and connect with the database server and read the data stored in the database, so that the use of the user is greatly influenced.
FIG. 1 is a diagram of a hardware system architecture of an embodiment of the present invention. The system shown in fig. 1 is configured as a predetermined database cluster, where the predetermined database cluster includes at least one application server and a plurality of database servers for storing data, where the application server is configured to provide service logic (including performing the method according to the embodiment of the present invention) for an application program in the database cluster, and the database server is configured to receive a database access request sent by a user through a client to perform processing such as accessing data. Fig. 1 shows an application server: server 11 and two database servers: the first server 12 and the second server 13 are explained as an example. The server 11, the first server 12, and the second server 13 may be communicatively connected through a network. In the predetermined database cluster according to the embodiment of the present invention, the data stored in each database server is usually synchronized, and the database corresponding to the first server 12 serves as a main database to carry the database access request sent by the user through the client. The server may obtain the access status of the first server 12 at a first predetermined period. When the access state of the first server 12 is abnormal, the server 11 may determine at least one second server 12 according to the available state of each database server in the predetermined database, so as to disconnect the access connection with the first server 12 and establish the access connection with the second server 13, so as to allocate the access resource of the first server 12 to the second server 13. In the embodiment of the present invention, accessing a resource refers to the maximum access amount that a database server can simultaneously carry (or stably carry). If the database server has the remaining access resources at the current moment, the application server can forward the database access request to the database server when receiving the database access request sent by the client, so that the user can access the database.
In the embodiment of the present invention, a description is given by taking the first server as a master database server and taking the second server as a slave database server. However, it is easily understood by those skilled in the art that the method of the present embodiment may also be applied when the first server is a slave database server and the second server is a master database server.
Fig. 2 is a flowchart of an allocation method of access resources according to a first embodiment of the present invention. As shown in fig. 2, the method of the present embodiment includes the following steps:
step S100, an access state of the first server is obtained.
The first server in this embodiment is a database server, and belongs to a predetermined database cluster. The database cluster forms a virtual single server logic image by using a plurality of database servers, and can provide transparent data service for the client like a database system of a single database. In this embodiment, the first server serves as a master database server for receiving a database access request sent by a client.
In this embodiment, the application server (hereinafter, the server is referred to as the application server) may obtain the access status of the first server at a second predetermined period or according to actual requirements. Specifically, the server may send a database access request to the first server, and obtain a response result returned by the first server, thereby obtaining the access state of the first server according to the response result. The access status is used to characterize whether the first server can be accessed.
Step S200, responding to the abnormal access state, determining at least one second server according to the available state of each database server in the preset database cluster.
In an embodiment, if at least one response result is used for representing that the request response time of the database access request exceeds a predetermined threshold, or a plurality of response results are used for representing that the access of the first server fails, it may be indicated that the access state of the first server at the current stage is abnormal. In this embodiment, the request response time is used to characterize the time from the transmission of the database access request by the server to the reception of the response result.
In order to reduce the influence of the abnormality of the first server on the access of the user to the database, the server may obtain the availability status of each database server in the predetermined database cluster, and determine at least one second server according to the availability status of each database server. Optionally, if a database connection pool (one of the resource pools) exists in the predetermined database cluster, and is used for allocating, managing and releasing server connections, which can effectively improve performance of server operations, the server may determine an available state of at least one database server having established access connections in the database connection pool of the predetermined database cluster, so that an allocation process of access resources may be effectively simplified in the following, and allocation efficiency of the access resources is improved.
In particular, the server may determine the availability status of each database server. Alternatively, the server may measure the availability status of each server by the MTBF (Mean Time Between Failures) of each database server. The MTBF is the average time that a product or system (i.e. a database server in this embodiment) normally works in two adjacent failure periods, and generally, the higher the NTBF is, the lower the possibility that the database server will fail in the same time period is, and therefore, the higher the stability is. Alternatively, the server may determine an available state of the database server whose idle state is marked as idle in the database connection pool. In this embodiment, the idle state of the database server may be determined according to the state information of the database server.
If any database server is idle and available, the server may consider that the database server can better undertake the work of receiving the database access request, so that the database server is determined to be the second server based on the scheduling algorithm. In this embodiment, the scheduling algorithm may be Round Robin (Round Robin) or Random (Random). Taking a polling scheduling method as an example, the polling scheduling method is a calculation method for scheduling different servers (in this embodiment, also referred to as database servers) by sequentially resolving a domain name to a plurality of IP addresses in a polling manner. The round-robin scheduling method can determine the second server at a faster rate, assuming that all servers have the same processing performance.
Step S300, disconnecting the access connection with the first server.
After determining the at least one second server, in order to avoid that the client still sends a database access request to the first server when the user needs to access the database, the server may disconnect the access link with the first server in various existing ways. For example, the server may disconnect the access connection with the first server by changing a connection state of the first server with the client.
Step S400, establishing an access connection with the second server.
In this step, the server may establish an access connection with the second server through various existing manners, for example, establish an access connection with a Database corresponding to the second server through an ODBC (Open Database Connectivity) manner.
After the access connection with the second server is established, the second server can receive the database access request sent by the user through the client, so that the aim of allocating the access resource of the first server to the second server is fulfilled, and the influence on the database access of the user when the first server is abnormal is effectively reduced.
It is easy to understand that step S300 and step S400 may be executed simultaneously or sequentially, and this embodiment is not limited.
The first server, as a master database server, generally has a more reliable continuous operation capability and a more stable network communication capability. Therefore, optionally, the server may further detect a state of the first server, and restore the access connection of the first server to reallocate the access resource to the first server when the detected state satisfies a predetermined condition. Optionally, the method of this embodiment may further include the following steps:
step S500, determining a detection state of the first server in the bypass mode.
The ByPass Mode (ByPass Mode), i.e. ByPass Mode, refers to an operation Mode in which, in a system having at least one checking mechanism, when an exception that cannot be excluded in a period of time occurs in the checking mechanism, system operation can ByPass the checking mechanism and continue normal operation. When the first server is abnormal, the state of the first server cannot be detected through a normal checking mechanism, so that the server can determine the detection state of the first server in a bypass mode.
Fig. 3 is a flowchart for determining the detection status of the first server in an alternative implementation manner of the first embodiment of the present invention. As shown in fig. 3, in an alternative implementation manner of this embodiment, step S500 may include the following steps:
step S510, a first detection result of the first server in the bypass state is obtained.
The server may obtain a first detection result of the first server in the bypass state at a third predetermined period.
In step S520A, it is determined whether the first result is available.
If the first detection result is unavailable (i.e., not available), the server may return to perform step S510; if the first detection result is available, the server may execute step S520.
Step S520, mark the first server as a detection point.
The server may mark the first server as a detection point when the first detection result of the first server is available. When the first server is down, the data modified or not written into the file in the memory is lost. After the first server and the corresponding database are restarted, the first server may perform transaction replay (i.e., rollback) through the redo log to restore the database to the state before the crash, so that the database may be reused. The monitoring point, namely the checkpoint (checking), has the function of shortening the Crash Recovery (blast Recovery) time of the database. When the first database server is marked as the checkpoint, all log records do not need to be checked, and all the transaction lists (namely, database operation sequences) which are being executed at the moment of establishing the checkpoint and the log record addresses corresponding to all the transactions only need to be checked, so that the detection efficiency of the first server is improved.
Step S530, performing at least one detection on the detection point to obtain a corresponding second detection result.
In particular, the server may also perform at least one (high frequency) continuous detection of the detection point in the bypass mode, thereby obtaining at least one second detection result. It is easy to understand that, when detecting a detection point for multiple times, the multiple times of detection may also be continuous detection, and this embodiment is not limited.
Step S540A, determine whether at least one second detection result is available.
If the detection point is detected once and the second detection result is not available, or if the detection point is detected for multiple times and each second detection result is not uniform and available, the server may return to step S530; if the second detection results are all available, the server may execute step S540.
Step S540, removing the detection point mark.
When the detection state of the first server is normal, the server may remove the detection point mark of the first server, so that the first server is no longer detected in the bypass mode. Optionally, if the detection point is detected once and the second detection result is used to indicate that the first server is available, or if the detection point is detected multiple times and the second detection results are all used to indicate that the first server is available, the server may determine that the detection state of the first server is normal.
Step S600, an access connection with a first server is established.
When the detection state of the first server is normal, the first server may be considered to have released the abnormal state such as downtime, and the server may reestablish the access connection of the first server, so as to reallocate the access resources of the first server to the first server.
In this embodiment, if the reason for the abnormal access of the first server is caused by the abnormal network connection, the first server may not work normally even if the detection state of the first server is normal. Therefore, in another optional implementation manner of this embodiment, the following steps may also be included:
step S700, in response to the access connection establishment failure, determining that the access state of the first server is abnormal.
If the access connection of the first server fails to be established, it indicates that the first server still cannot normally receive the database access request sent by the client, so that the server can determine that the access state of the first server is abnormal.
Further, the method of this embodiment may further include the steps of:
and step S800, responding to the abnormal access state, and sending a response result to the preset terminal.
When the access state of the first server is abnormal, the server can also send a response result to the corresponding preset terminal so as to prompt the abnormality of the first server. Therefore, the user holding the preset terminal can check the abnormal condition in time, and the timeliness of the abnormal processing of the database server is improved.
Fig. 4 is a schematic diagram of an allocation method for access resources according to a first embodiment of the present invention. As shown in fig. 4, the application server may acquire the access state of the first server at a predetermined period. When the access state of the first server is a normal state (i.e., normal), the application server may maintain the access connection of the first server, and when the access state of the first server is an abnormal state (i.e., abnormal), the application server may obtain each database server in the resource pool 41: the available state of the server 1-server n (n is a predetermined integer of 1 or more) and determines that the server 2 is the second server 41A, thereby disconnecting the access connection with the first server and establishing the access connection with the second server 41A so that the second server 41A can normally operate. Meanwhile, the application server can detect that the first server obtains the detection state of the first server in a bypass mode, and if the detection state is an abnormal state, the second server is kept to normally work; and if the detection state is a normal state, restoring the access connection with the first server. If the access connection is successfully established, determining that the access state of the first server is a normal state, so that the first server can normally work; and if the access connection is failed to be established, determining that the access state of the first server is an abnormal state, and continuously keeping the second server to work normally.
In this embodiment, the access state of the first server in the predetermined database cluster is obtained, and when the access state of the first server is abnormal, at least one second server may be determined according to the available state of each database server in the predetermined database cluster, so that the access connection with the first server is disconnected, and the access connection with the second server is established, so that the access resource of the first server is allocated to the second server. In this embodiment, if the first server generates an access exception, the access resource of the first server may be allocated to at least one second server, and a subsequent database access request sent by the user may be received and processed by the second server, thereby effectively reducing an influence of the first server exception on the database access of the user.
Fig. 5 is a schematic diagram of an allocation apparatus for accessing resources according to a second embodiment of the present invention. As shown in fig. 5, the apparatus of the present embodiment includes an acquisition unit 51, a determination unit 52, a disconnection unit 53, and a connection unit 54.
The obtaining unit 51 is configured to obtain an access status of a first server, where the first server belongs to a predetermined database cluster. The determining unit 52 is configured to determine, in response to the access status being abnormal, at least one second server according to the available status of each server in the predetermined database cluster. The disconnecting unit 53 is configured to disconnect an access connection with the first server. The connection unit 54 is configured to establish an access connection with the second server to allocate the access resource of the first server to the second server.
In this embodiment, the access state of the first server in the predetermined database cluster is obtained, and when the access state of the first server is abnormal, at least one second server may be determined according to the available state of each database server in the predetermined database cluster, so that the access connection with the first server is disconnected, and the access connection with the second server is established, so that the access resource of the first server is allocated to the second server. In this embodiment, if the first server generates an access exception, the access resource of the first server may be allocated to at least one second server, and a subsequent database access request sent by the user may be received and processed by the second server, thereby effectively reducing an influence of the first server exception on the database access of the user.
Fig. 6 is a schematic view of an electronic device according to a third embodiment of the present invention. The electronic device shown in fig. 6 is a general-purpose data processing apparatus comprising a general-purpose computer hardware structure including at least a processor 61 and a memory 62. The processor 61 and the memory 62 are connected by a bus 63. The memory 62 is adapted to store instructions or programs executable by the processor 61. The processor 61 may be a stand-alone microprocessor or a collection of one or more microprocessors. Thus, the processor 61 implements the processing of data and the control of other devices by executing the commands stored in the memory 62 to execute the method flows of the embodiments of the present invention as described above. The bus 63 connects the above components together, and also connects the above components to a display controller 64 and a display device and an input/output (I/O) device 65. Input/output (I/O) devices 65 may be a mouse, keyboard, modem, network interface, touch input device, motion sensing input device, printer, and other devices known in the art. Typically, an input/output (I/O) device 65 is connected to the system through an input/output (I/O) controller 66.
The memory 62 may store, among other things, software components such as an operating system, communication modules, interaction modules, and application programs. Each of the modules and applications described above corresponds to a set of executable program instructions that perform one or more functions and methods described in embodiments of the invention.
The flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the invention described above illustrate various aspects of the invention. It will be understood that each block of the flowchart illustrations and/or block diagrams, and combinations of blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions/acts specified in the flowchart and/or block diagram block or blocks.
Also, as will be appreciated by one skilled in the art, aspects of embodiments of the present invention may be embodied as a system, method or computer program product. Accordingly, various aspects of embodiments of the invention may take the form of: an entirely hardware embodiment, an entirely software embodiment (including firmware, resident software, micro-code, etc.) or an embodiment combining software and hardware aspects that may all generally be referred to herein as a "circuit," module "or" system. Further, aspects of the invention may take the form of: a computer program product embodied in one or more computer readable media having computer readable program code embodied thereon.
Any combination of one or more computer-readable media may be utilized. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of embodiments of the present invention, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
A computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated signal may take any of a variety of forms, including, but not limited to: electromagnetic, optical, or any suitable combination thereof. The computer readable signal medium may be any of the following computer readable media: is not a computer readable storage medium and may communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Computer program code for carrying out operations for aspects of the present invention may be written in any combination of one or more programming languages, including: object oriented programming languages such as Java, Smalltalk, C + +, PHP, Python, and the like; and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package; executing in part on a user computer and in part on a remote computer; or entirely on a remote computer or server. In the latter scenario, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (12)

1. A method for allocating access resources, the method comprising:
acquiring an access state of a first server, wherein the first server belongs to a preset database cluster;
in response to the access state being abnormal, determining at least one second server according to the available state of each database server in the predetermined database cluster;
disconnecting access connection with the first server;
establishing an access connection with the second server to allocate access resources of the first server to the second server.
2. The method of claim 1, wherein obtaining the access status of the first server comprises:
sending a database access request to the first server;
and acquiring a response result of the database access request.
3. The method according to claim 2, wherein the access status is an exception, specifically:
at least one of the response results is used to characterize that the request response time exceeds a predetermined threshold; or
A plurality of said response results in succession are each used to characterize an access failure.
4. The method of claim 1, wherein determining at least one second server based on the availability status of each database server in the predetermined database cluster comprises:
determining the availability status of each database server;
determining at least one database server for which the availability status is available as the second server based on a predetermined scheduling algorithm.
5. The method of claim 1, further comprising:
determining a detection state of the first server in a bypass mode;
and responding to the detection state being normal, establishing an access connection with the first server so as to allocate the access resource to the first server.
6. The method of claim 5, wherein determining the detected state of the first server in bypass mode comprises:
acquiring a first detection result of the first server in the bypass state;
responsive to the first detection result being available, marking the first server as a detection point;
carrying out at least one detection on the detection point to obtain a corresponding second detection result;
the detection state is normal, specifically:
the second detection result is available; or
Each second said detection result is available.
7. The method of claim 6, further comprising:
removing the detection point mark in response to the detection state being normal.
8. The method of claim 5, further comprising:
in response to an access connection establishment failure, determining that an access status of the first server is abnormal.
9. The method according to claim 2 or 5, characterized in that the method further comprises:
and responding to the abnormal access state, and sending a response result of the database access request to the preset terminal.
10. An apparatus for allocating access resources, the apparatus comprising:
an acquisition unit configured to acquire an access state of a first server, the first server belonging to a predetermined database cluster;
a determining unit, configured to determine, in response to the access status being abnormal, at least one second server according to an available status of each database server in the predetermined database cluster;
a disconnection unit configured to disconnect an access connection with the first server;
a connection unit, configured to establish an access connection with the second server, so as to allocate the access resource of the first server to the second server.
11. A computer-readable storage medium on which computer program instructions are stored, which, when executed by a processor, implement the method of any one of claims 1-9.
12. An electronic device comprising a memory and a processor, wherein the memory is configured to store one or more computer program instructions, wherein the one or more computer program instructions are executed by the processor to implement the method of any of claims 1-9.
CN201911342232.4A 2019-12-23 2019-12-23 Access resource allocation method and device, storage medium and electronic equipment Pending CN111104266A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911342232.4A CN111104266A (en) 2019-12-23 2019-12-23 Access resource allocation method and device, storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911342232.4A CN111104266A (en) 2019-12-23 2019-12-23 Access resource allocation method and device, storage medium and electronic equipment

Publications (1)

Publication Number Publication Date
CN111104266A true CN111104266A (en) 2020-05-05

Family

ID=70424000

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911342232.4A Pending CN111104266A (en) 2019-12-23 2019-12-23 Access resource allocation method and device, storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN111104266A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111770159A (en) * 2020-06-26 2020-10-13 中信银行股份有限公司 Service discovery system, method, first server and storage medium
CN113347250A (en) * 2021-05-31 2021-09-03 中国工商银行股份有限公司 Data access method, data access device, electronic equipment and readable storage medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101263699A (en) * 2005-07-14 2008-09-10 雅虎公司 System and method for provisioning user device
CN104091622A (en) * 2014-07-02 2014-10-08 中广核工程有限公司 Method and system for evaluating availability ratio of nuclear power plant digital control system
CN105915650A (en) * 2016-06-21 2016-08-31 腾讯科技(深圳)有限公司 Load balancing method and device
CN108206843A (en) * 2016-12-16 2018-06-26 北京金山云网络技术有限公司 A kind of cluster access method and device
CN108616394A (en) * 2018-04-25 2018-10-02 电子科技大学 A kind of backup of virtual network function and dispositions method
CN109508261A (en) * 2018-08-31 2019-03-22 云南电网有限责任公司信息中心 A kind of electric network data node standby method and standby system based on big data
CN110162424A (en) * 2019-05-23 2019-08-23 腾讯科技(深圳)有限公司 Fault handling method, system, device and storage medium

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101263699A (en) * 2005-07-14 2008-09-10 雅虎公司 System and method for provisioning user device
CN104091622A (en) * 2014-07-02 2014-10-08 中广核工程有限公司 Method and system for evaluating availability ratio of nuclear power plant digital control system
CN105915650A (en) * 2016-06-21 2016-08-31 腾讯科技(深圳)有限公司 Load balancing method and device
CN108206843A (en) * 2016-12-16 2018-06-26 北京金山云网络技术有限公司 A kind of cluster access method and device
CN108616394A (en) * 2018-04-25 2018-10-02 电子科技大学 A kind of backup of virtual network function and dispositions method
CN109508261A (en) * 2018-08-31 2019-03-22 云南电网有限责任公司信息中心 A kind of electric network data node standby method and standby system based on big data
CN110162424A (en) * 2019-05-23 2019-08-23 腾讯科技(深圳)有限公司 Fault handling method, system, device and storage medium

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111770159A (en) * 2020-06-26 2020-10-13 中信银行股份有限公司 Service discovery system, method, first server and storage medium
CN111770159B (en) * 2020-06-26 2023-08-22 中信银行股份有限公司 Service discovery system, method, first server and storage medium
CN113347250A (en) * 2021-05-31 2021-09-03 中国工商银行股份有限公司 Data access method, data access device, electronic equipment and readable storage medium
CN113347250B (en) * 2021-05-31 2023-04-07 中国工商银行股份有限公司 Data access method, data access device, electronic equipment and readable storage medium

Similar Documents

Publication Publication Date Title
CN105357038B (en) Monitor the method and system of cluster virtual machine
CN103201724B (en) Providing application high availability in highly-available virtual machine environments
US10462027B2 (en) Cloud network stability
US9342426B2 (en) Distributed system, server computer, distributed management server, and failure prevention method
CN103455368B (en) A kind of deadlock detection method, node and system
US11157373B2 (en) Prioritized transfer of failure event log data
CN100394394C (en) Fault tolerant duplex computer system and its control method
JP6387747B2 (en) Information processing apparatus, failure avoidance method, and computer program
US10353786B2 (en) Virtualization substrate management device, virtualization substrate management system, virtualization substrate management method, and recording medium for recording virtualization substrate management program
CN109308239B (en) Method and apparatus for outputting information
US9436539B2 (en) Synchronized debug information generation
US10102088B2 (en) Cluster system, server device, cluster system management method, and computer-readable recording medium
CN111104266A (en) Access resource allocation method and device, storage medium and electronic equipment
EP3301576A1 (en) Method and apparatus for monitoring logs of multi-tenant systems
CN113535474B (en) Method, system, medium and terminal for automatically repairing heterogeneous cloud storage cluster fault
US20050234919A1 (en) Cluster system and an error recovery method thereof
JP5999254B2 (en) Management apparatus, method and program
CN111526038B (en) Service request distribution method and device, computer equipment and readable storage medium
CN112261114A (en) Data backup system and method
US20160224444A1 (en) Distributed system, server computer, distributed management server, and failure prevention method
CN110837428A (en) Storage device management method and device
CN115237641A (en) Fault detection method and device, electronic equipment and readable medium
CN113254245A (en) Fault detection method and system for storage cluster
KR101883251B1 (en) Apparatus and method for determining failover in virtual system
CN113609199B (en) Database system, server, 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