CN117472656A - Authority transfer method, device, equipment and storage medium of hot standby service cluster - Google Patents
Authority transfer method, device, equipment and storage medium of hot standby service cluster Download PDFInfo
- Publication number
- CN117472656A CN117472656A CN202311501646.3A CN202311501646A CN117472656A CN 117472656 A CN117472656 A CN 117472656A CN 202311501646 A CN202311501646 A CN 202311501646A CN 117472656 A CN117472656 A CN 117472656A
- Authority
- CN
- China
- Prior art keywords
- server
- standby
- monitor
- data
- main server
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
- 238000000034 method Methods 0.000 title claims abstract description 61
- 238000012546 transfer Methods 0.000 title claims abstract description 46
- 230000004044 response Effects 0.000 claims abstract description 92
- 239000013589 supplement Substances 0.000 claims description 5
- 238000012544 monitoring process Methods 0.000 claims description 3
- 238000004891 communication Methods 0.000 description 36
- 230000006870 function Effects 0.000 description 20
- 238000012545 processing Methods 0.000 description 18
- 238000010586 diagram Methods 0.000 description 11
- 230000005540 biological transmission Effects 0.000 description 10
- 230000008569 process Effects 0.000 description 9
- 238000005516 engineering process Methods 0.000 description 5
- 238000007726 management method Methods 0.000 description 4
- 230000007246 mechanism Effects 0.000 description 4
- 230000003287 optical effect Effects 0.000 description 4
- 238000011084 recovery Methods 0.000 description 4
- 230000005236 sound signal Effects 0.000 description 4
- 238000012790 confirmation Methods 0.000 description 3
- 238000013500 data storage Methods 0.000 description 3
- 230000003993 interaction Effects 0.000 description 3
- 230000001133 acceleration Effects 0.000 description 2
- 230000004913 activation Effects 0.000 description 2
- 230000008859 change Effects 0.000 description 2
- 230000000295 complement effect Effects 0.000 description 2
- 230000001502 supplementing effect Effects 0.000 description 2
- 230000006978 adaptation Effects 0.000 description 1
- 238000003491 array Methods 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 238000001514 detection method Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 238000003384 imaging method Methods 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 238000012423 maintenance Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000010606 normalization Methods 0.000 description 1
- 230000002093 peripheral effect Effects 0.000 description 1
- 230000003068 static effect Effects 0.000 description 1
- 230000001960 triggered effect Effects 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/07—Responding to the occurrence of a fault, e.g. fault tolerance
- G06F11/16—Error detection or correction of the data by redundancy in hardware
- G06F11/20—Error 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/202—Error 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/2023—Failover techniques
- G06F11/2033—Failover techniques switching over of hardware resources
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/30—Monitoring
- G06F11/3003—Monitoring arrangements specially adapted to the computing system or computing system component being monitored
- G06F11/3006—Monitoring arrangements specially adapted to the computing system or computing system component being monitored where the computing system is distributed, e.g. networked systems, clusters, multiprocessor systems
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/30—Monitoring
- G06F11/3055—Monitoring arrangements for monitoring the status of the computing system or of the computing system component, e.g. monitoring if the computing system is on, off, available, not available
-
- Y—GENERAL 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
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE 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/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- Quality & Reliability (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Computing Systems (AREA)
- Mathematical Physics (AREA)
- Hardware Redundancy (AREA)
Abstract
The application discloses a permission transfer method, a permission transfer device, electronic equipment and a computer readable storage medium of a hot standby service cluster, comprising the following steps: acquiring a starting signal generated by the main server during restarting through a monitor of the main server; transmitting a request signal to a monitor of the standby server through the monitor of the main server in response to the start signal; receiving response signals fed back by the monitor of the standby server according to the request signals, and counting the number of the received response signals; and under the condition that the counted number of the response signals is larger than a target value, determining the external port of the hot standby service cluster as an output port of the main server. The method solves the problem that after the main server of the hot standby service cluster is stopped and restarted, the standby server is stopped and the main server cannot be called, so that the network service cannot be used continuously.
Description
Technical Field
The application belongs to the field of internet, and particularly relates to a permission transfer method, a permission transfer device, electronic equipment and a computer readable storage medium of a hot standby service cluster.
Background
The rapid development of the fields of the internet, electronic commerce, social networks and the like has put higher demands on the storage and processing of data. Therefore, the selection of a highly reliable database system is an important aspect of these fields.
At present, the main stream architecture realizes the stability of service by using a containerized dual-machine hot standby mode, namely, a main server and a standby server are respectively deployed on two servers, the running state of the other side is monitored in real time between the two servers through a heartbeat detection mechanism, and when one server fails, the other server can be automatically switched to the main server and continue to provide service.
However, when the standby server is started, although the main server is restarted, the running server is still the standby server at this time, and after the standby server is stopped, the main server cannot be successfully called, so that the network service cannot be continuously used.
Disclosure of Invention
The application aims to provide a permission transfer method, a permission transfer device, electronic equipment and a computer readable storage medium of a hot standby service cluster, and at least solves the problem that after a main server of the hot standby service cluster is stopped and restarted, the main server cannot be called, so that network service cannot be used continuously.
In a first aspect, an embodiment of the present application discloses a rights transfer method of a hot standby service cluster, which is applied to a main server, where the hot standby service cluster includes a main server and a standby server that operate simultaneously; the main server and the standby server respectively comprise at least one monitor, and the number of monitors of the main server is smaller than that of the standby server; the method comprises the following steps: acquiring a starting signal generated by the main server during restarting through a monitor of the main server; transmitting a request signal to a monitor of the standby server through the monitor of the main server in response to the start signal; the request signal is used for the standby server to feed back a response signal; receiving response signals fed back by the monitor of the standby server according to the request signals, and counting the number of the received response signals; the response signals are in one-to-one correspondence with monitors of the standby server; under the condition that the counted number of the response signals is larger than a target value, determining an external port of the hot standby service cluster as an output port of a main server; the target value is half of the total number of monitors in the hot standby service cluster.
In a second aspect, the embodiment of the application also discloses a permission transfer method of the hot standby service cluster, which is used for a standby server, wherein the hot standby service cluster comprises a main server and a standby server which run simultaneously; the main server and the standby server respectively comprise at least one monitor, and the number of monitors of the main server is smaller than that of the standby server; the method comprises the following steps: acquiring a request signal sent by a monitor of a main server through the monitor of the standby server; the request signal is generated by a monitor of the main server according to the acquired starting signal generated by the main server during restarting; transmitting a response signal to the monitor of the main server through the monitor of the standby server in response to the request signal; the answer signal is used for being received by the monitor of the main server and counting the number, so that the external port of the hot standby server cluster is determined to be the output port of the main server under the condition that the number of the answer signal is larger than a target value; the target value is half of the total number of monitors in the hot standby service cluster.
In a third aspect, the embodiment of the application also discloses a rights transfer device of a hot standby service cluster, which is applied to a main server, wherein the hot standby service cluster comprises the main server and a standby server which run simultaneously; the main server and the standby server respectively comprise at least one monitor, and the number of monitors of the main server is smaller than that of the standby server; the device comprises: the starting monitoring module is used for acquiring a starting signal generated by the main server during restarting through a monitor of the main server; the request sending module is used for responding to the starting signal and sending a request signal to the monitor of the standby server through the monitor of the main server; the request signal is used for the standby server to feed back a response signal; the response statistics module is used for receiving response signals fed back by the monitor of the standby server according to the request signals and counting the number of the received response signals; the response signals are in one-to-one correspondence with monitors of the standby server; the permission acquisition module is used for determining an external port of the hot standby service cluster as an output port of the main server under the condition that the counted number of the response signals is larger than a target value; the target value is half of the total number of monitors in the hot standby service cluster.
In a fourth aspect, the embodiment of the application also discloses a rights transfer device of a hot standby service cluster, which is used for a standby server, wherein the hot standby service cluster comprises a main server and a standby server which run simultaneously; the main server and the standby server respectively comprise at least one monitor, and the number of monitors of the main server is smaller than that of the standby server; the device comprises: the request receiving module is used for acquiring a request signal sent by the monitor of the main server through the monitor of the standby server; the request signal is generated by a monitor of the main server according to the acquired starting signal generated by the main server during restarting; the response feedback module is used for responding to the request signal and sending a response signal to the monitor of the main server through the monitor of the standby server; the answer signal is used for being received by the monitor of the main server and counting the number, so that the external port of the hot standby server cluster is determined to be the output port of the main server under the condition that the number of the answer signal is larger than a target value; the target value is half of the total number of monitors in the hot standby service cluster.
In a fifth aspect, embodiments of the present application also disclose an electronic device comprising a processor and a memory, the memory storing a program or instructions executable on the processor, the program or instructions implementing the steps of the method according to the first or second aspect when executed by the processor.
In a sixth aspect, embodiments of the present application also disclose a readable storage medium having stored thereon a program or instructions which, when executed by a processor, implement the steps of the method according to the first or second aspect.
In summary, in the embodiment of the present application, a monitor of a main server acquires a start signal generated when the main server is restarted, and sends a request signal to a monitor of a standby server, so that the standby server can timely feed back a response signal; and receiving and counting the number of the response signals through a monitor of the main server to judge whether the target value is reached or not, thereby determining that the external port of the hot standby service cluster is an output port of the main server. Therefore, according to the method of the embodiment of the application, when the main server is stopped, and the external business process is transferred to the standby server, the monitor of the main server is triggered to respectively send the request signals when the monitor of the main server acquires the starting information of the main server at the moment due to the restarting of the main server, so that the response signals corresponding to the request signals are obtained; after the main server obtains the response signals, the number of monitors of the standby server exceeds the number of monitors of the main server, so that the number of the response signals obtained by the monitors of the main server is half of the number of monitors in the standby server, the main server can be ensured to meet the condition of obtaining the authority, the main server can regain the authority of the authority to the external output interface, interaction between the main server and the standby server is realized, the authority transfer of the external output interface of the hot standby service cluster can be realized, the problem that the external output interface cannot be obtained actively after the standby server is stopped, and network service cannot be used continuously after the standby server is stopped is solved, the reliability and the stability of the hot standby service cluster are improved, the manual output interface transfer is not needed, and the time and the cost for fault recovery are reduced.
Drawings
In the drawings:
fig. 1 is a flowchart of a method for transferring rights of a hot standby service cluster according to the present embodiment;
FIG. 2 is a flowchart illustrating a method for transferring rights in a hot standby service cluster according to an embodiment of the present application;
FIG. 3 is a flowchart illustrating a method for transferring rights in another hot standby service cluster according to an embodiment of the present disclosure;
fig. 4 is a program logic diagram of a rights transferring method of a hot standby service cluster according to an embodiment of the present application during incremental data synchronization;
fig. 5 is a program logic diagram of a rights transferring method of a hot standby service cluster according to an embodiment of the present application during full data synchronization;
FIG. 6 is a network configuration diagram of a hot standby service cluster according to an embodiment of the present disclosure when providing network services;
FIG. 7 is a schematic diagram of a hot standby service cluster provided in an embodiment of the present application;
FIG. 8 is a block diagram of a rights transfer apparatus for a hot standby service cluster according to an embodiment of the present application;
FIG. 9 is a block diagram of a rights transfer apparatus for a hot standby service cluster according to an embodiment of the present application;
FIG. 10 is a block diagram of an electronic device of one embodiment provided by embodiments of the present application;
Fig. 11 is a block diagram of an electronic device of another embodiment provided by an embodiment of the present application.
Detailed Description
The following description of the embodiments of the present application will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are some, but not all, of the embodiments of the present application. All other embodiments, which can be made by one of ordinary skill in the art without undue burden from the present disclosure, are within the scope of the present disclosure.
The terms first, second and the like in the description and in the claims, are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged, as appropriate, such that embodiments of the present application may be implemented in sequences other than those illustrated or described herein, and that the objects identified by "first," "second," etc. are generally of a type and not limited to the number of objects, e.g., the first object may be one or more. Furthermore, in the description and claims, "and/or" means at least one of the connected objects, and the character "/", generally means that the associated object is an "or" relationship.
The hot standby service cluster is network service equipment with a plurality of complete servers built therein, wherein each server can independently complete data storage and simultaneously operate; in the process of storing data from an external port, each server is independent in parallel; in the process of outputting data to an external network, the data is realized only through one of the servers, and when the server which is realizing the external output is in system error downtime, the port is rapidly switched, so that the service continuity is realized. In order to realize the availability of the system, the priority of the external port is set for each server in the server cluster, when the main service with high priority is down, the standby server with low priority enables the external port, and this leads to that the transfer of the data port is always from the main server to the standby server under normal conditions, so that in the case that the standby server is already operated, if the standby server is down, the standby server has no server with lower authority can be transferred, and therefore, the authority of the external port must be transferred back to the main server in time in the period that both the standby server and the main server are normally operated.
Fig. 1 is a schematic diagram of a method for transferring authority of a hot standby service cluster, which is provided in an embodiment of the present application, and is applied to a main server, where the hot standby service cluster includes a main server and a standby server that operate simultaneously; the main server and the standby server respectively comprise at least one monitor, and the number of monitors of the main server is smaller than that of the standby server;
the method may comprise the steps of:
step 101, acquiring a starting signal generated by the main server during restarting through a monitor of the main server.
In some embodiments of the present application, since the restart of the primary server may be caused by a fault or maintenance, etc., the monitor of the primary server may be utilized to timely know the operation state of the primary server.
For example, the monitor of the main server may include a generator of a start signal, which may be a hardware circuit or a software program, and its function is to generate a specific start signal, such as a digital code or a character string, according to a preset rule or condition when the main server is restarted, where the start signal may include information of identification information, restart time, restart reason, etc. of the main server, and send the start signal to the monitor of the main server, so that the monitor of the main server may determine the operation state of the main server according to the start signal and make corresponding feedback.
Step 102, responding to the starting signal, and sending a request signal to a monitor of the standby server through a monitor of the main server; the request signal is used for the standby server to feed back a response signal.
In some embodiments of the present application, in order to implement rights transfer for a hot standby service cluster, a monitor of a primary server needs to communicate with a monitor of a standby server to obtain feedback information of the standby server. Therefore, the monitor of the main server may send a request signal to the monitor of the standby server after receiving the start signal, and ask the monitor of the standby server to return a response signal to indicate the operation state and willingness of the standby server.
For example, a transmitter of a request signal may be disposed in the monitor of the main server, where the transmitter may be a hardware circuit or a software program, and its function is to generate a specific request signal, for example, a digital code or a character string, according to a preset rule or condition after the monitor of the main server receives the start signal, where the request signal may include information of identification information, a request type, a request time, etc. of the main server, and send the request signal to the monitor of the standby server through a network or other communication modes, so that the monitor of the standby server may determine the request content of the main server according to the request signal and make corresponding feedback.
Step 103, receiving response signals fed back by the monitor of the standby server according to the request signals, and counting the number of the received response signals; the response signals are in one-to-one correspondence with monitors of the standby server.
In some embodiments of the present application, in order to implement rights transfer for a hot standby service cluster, the monitor of the primary server needs to count feedback situations of the monitors of the standby servers. Therefore, after the monitor of the main server sends the request signal, the monitor of the standby server can receive the response signal returned by the monitor of the standby server and record the number of the received response signals to judge whether the target value is reached or not, so that the external port of the hot standby service cluster is determined to be the output port of the main server.
The monitor of the primary server comprises, for example, a receiver of the response signal and a counter, which may be a hardware circuit or a software program, the function of which is to receive the response signal returned by the monitor of the standby server after the monitor of the primary server has sent the request signal and store it in a buffer, while the value of the counter is incremented by one, indicating that a response signal has been received. When the number of received response signals is equal to or greater than the target value, the monitor of the primary server may determine that the monitor of the backup server has agreed to switch the external port to the output port of the primary server, and perform a corresponding operation.
Step 104, determining the external port of the hot standby service cluster as the output port of the main server under the condition that the counted number of the response signals is larger than a target value; the target value is half of the total number of monitors in the hot standby service cluster.
In some embodiments of the present application, in order to implement rights transfer of the hot standby service cluster, the monitor of the primary server needs to determine that the external port of the hot standby service cluster is the output port of the primary server. Therefore, the monitor of the main server can modify the network configuration of the hot standby service cluster under the condition that the number of the counted response signals is larger than the target value, and switch the external port from the output port of the standby server to the output port of the main server, so that the main server recovers the capability of providing service to the outside; meanwhile, as the number of monitors of the main server is smaller than that of the standby servers, the response signals obtained by the main server are larger than half of the total number of monitors in the hot standby service cluster, so that the main server authority can be ensured to be obtained.
The monitor of the main server includes a network configurator, which may be a hardware circuit or a software program, and functions to send an instruction to the load balancer or the reverse proxy of the hot standby service cluster through a network or other communication modes, where the number of response signals counted by the monitor of the main server is greater than a target value, to switch the external port from the output port of the standby server to the output port of the main server, so that the main server becomes a working machine of the hot standby service cluster, and the standby server becomes a backup machine of the hot standby service cluster.
In summary, in the embodiment of the present application, a monitor of a main server acquires a start signal generated when the main server is restarted, and sends a request signal to a monitor of a standby server, so that the standby server can timely feed back a response signal; and receiving and counting the number of the response signals through a monitor of the main server to judge whether the target value is reached or not, thereby determining that the external port of the hot standby service cluster is an output port of the main server. Therefore, according to the method, after the main server is stopped and restarted, the permission transfer of the hot standby service cluster can be realized, the problem that the main server cannot be called after the standby server is stopped, and network service cannot be continuously used is avoided, the reliability and stability of the hot standby service cluster are improved, and the time and cost of fault recovery are reduced.
As shown in fig. 2, corresponding to steps 101 to 104, the embodiment of the present application further provides a rights transferring method of a hot standby service cluster, which is used for a standby server, where the hot standby service cluster includes a main server and a standby server that operate simultaneously; the main server and the standby server respectively comprise at least one monitor, and the number of monitors of the main server is smaller than that of the standby server;
The method may comprise the steps of:
step 201, obtaining a request signal sent by a monitor of a main server through the monitor of the standby server; the request signal is generated by a monitor of the main server according to the acquired starting signal generated by the main server during restarting.
In some embodiments of the present application, in order to implement rights transfer for a hot standby service cluster, a monitor of a standby server needs to acquire a request signal sent by a monitor of a primary server. Therefore, the monitor of the standby server may monitor the output of the monitor of the main server through a network or other communication means, so as to capture the request signal sent by the monitor of the main server in time.
For example, the monitor of the standby server may include a receiver of the request signal, where the receiver may be a hardware circuit or a software program, and its function is to connect, through a network or other communication means, to an output port of the monitor of the main server after the monitor of the standby server is started, so as to receive the request signal sent by the monitor of the main server. When the monitor of the standby server receives the request signal, the request type and the request time of the monitor of the main server can be judged according to the content of the request signal, and corresponding feedback is made.
Step 202, responding to the request signal, and sending a response signal to the monitor of the main server through the monitor of the standby server; the answer signal is used for being received by the monitor of the main server and counting the number, so that the external port of the hot standby server cluster is determined to be the output port of the main server under the condition that the number of the answer signal is larger than a target value; the target value is half of the total number of monitors in the hot standby service cluster.
In some embodiments of the present application, in order to implement rights transfer for a hot standby service cluster, the monitor of the standby server needs to send a reply signal to the monitor of the primary server. Therefore, after receiving the request signal sent by the monitor of the main server, the monitor of the standby server can generate a specific response signal according to the running state and wish of the monitor of the main server, and send the response signal to the monitor of the main server through a network or other communication modes, so that the monitor of the main server can receive and count the number of the response signals to judge whether the number reaches the target value or not, thereby determining that the external port of the standby service cluster is the output port of the main server.
For example, the monitor of the standby server may include a transmitter of a response signal, where the transmitter may be a hardware circuit or a software program, and its function is to generate a specific response signal, such as a digital code or a character string, according to a preset rule or condition after the monitor of the standby server receives the request signal, where the response signal may include information of identification information, response type, response time, etc. of the standby server, and send the response signal to the monitor of the main server through a network or other communication modes, so that the monitor of the main server may determine a feedback condition of the monitor of the standby server according to the response signal, and perform a corresponding operation.
Corresponding to the process of transferring rights on the side of the main server, the monitor on the side of the standby server can be designed to be identical to the operating mechanism of the monitor on the side of the main server, and the mechanism does not affect the process of transferring rights, because: the number of monitors on the main server side is different from that of monitors on the standby server side, and the number of monitors on the main server side is smaller than that of monitors on the standby server side, and the design mechanism can ensure that response signals acquired by the monitors on the main server side always exceed half of the total monitors in the standby cluster, so that the condition of server output port permission transfer caused by restarting of the standby server in the running state of the main server is not generated.
FIG. 3 is a schematic diagram of another authority transfer method of a hot standby service cluster according to an embodiment of the present application, where the hot standby service cluster is applied to a primary server, and includes a primary server and a standby server that operate simultaneously; the main server and the standby server respectively comprise at least one monitor, and the number of monitors of the main server is smaller than that of the standby server;
step 301, acquiring a starting signal generated by the main server during restarting through a monitor of the main server.
The method shown in this step is already described in step 101, and will not be described here again.
Step 302, responding to the starting signal, and sending a request signal to a monitor of the standby server through a monitor of the main server; the request signal is used for the standby server to feed back a response signal.
The method shown in this step is already described in step 102, and will not be described here again.
Optionally, the step 302 includes the following sub-steps:
sub-step 3021, determining a network address of a monitor of the standby server.
In some embodiments of the present application, in order to enable rights transfer for a hot standby service cluster, the monitor of the primary server needs to know the network address of the monitor of the standby server in order to send a request signal thereto. Thus, the monitor of the primary server may send a query signal to the monitor of the backup server at startup or periodically via a network or other communication means, asking it to return information about its own network address, e.g., physical address, port number, etc.
The monitor of the main server includes a transmitter of a query signal and a receiver of a network address, which may be a hardware circuit or a software program, and functions to generate a specific query signal, such as a digital code or a character string, according to a preset rule or condition when the monitor of the main server is started, where the query signal may include information of identification information, query type, query time, etc. of the main server, and send the query signal to the monitor of the standby server through a network or other communication modes, so that the monitor of the standby server may determine the query content of the monitor of the main server according to the query signal and make corresponding feedback. When the monitor of the primary server receives the network address returned by the monitor of the backup server, it can be stored in a buffer for use when needed.
Sub-step 3022, sending a request signal to each of said monitors of the standby server, respectively, based on said network address.
In some embodiments of the present application, in order to implement rights transfer for a hot standby service cluster, the monitor of the primary server needs to send a request signal to each monitor of the standby server separately. Therefore, after determining the network address of the monitor of the standby server, the monitor of the main server may generate a corresponding number of request signals according to the number of network addresses, and send each request signal to the monitor of the corresponding standby server through a network or other communication modes, so that each monitor of the standby server may determine the request content of the monitor of the main server according to the received request signals, and make corresponding feedback.
For example, the monitor of the main server may include a generator of a request signal and a distributor of the request signal, where the generator and the distributor may be a hardware circuit or a software program, and the function of the generator and the distributor is to generate a corresponding number of request signals, such as a digital code or a character string, according to the number of network addresses after the monitor of the main server determines the network addresses of the monitors of the standby server, where each request signal may include identification information of the main server, a request type, a request time, and other information, and send each request signal to the corresponding monitor of the standby server through a network or other communication modes, so that each monitor of the standby server may determine the request content of the monitor of the main server according to the received request signal and make corresponding feedback.
Step 303, receiving response signals fed back by the monitor of the standby server according to the request signals, and counting the number of the received response signals; the response signals are in one-to-one correspondence with monitors of the standby server.
The method shown in this step is already described in step 103, and will not be described here again.
Step 304, obtaining backup data from the backup database.
In some embodiments of the present application, to enable rights transfer for a hot standby service cluster, a monitor of a primary server needs to obtain standby data from a standby database. Thus, the monitor of the primary server may send a data acquisition signal to the standby database via a network or other communication means requesting it to return all of the standby data, i.e., all of the data stored in the standby database, before the update of the data in the primary database is completed.
The monitor of the main server includes a transmitter of a data acquisition signal and a receiver of backup data, which may be a hardware circuit or a software program, and functions to generate a specific data acquisition signal, such as a digital code or a character string, before the monitor of the main server completes updating the data in the main database, where the data acquisition signal may include information such as identification information, data acquisition type, data acquisition time, etc. of the main server, and send the data acquisition signal to the backup database through a network or other communication modes, so that the backup database may determine the data acquisition content of the monitor of the main server according to the data acquisition signal, and make corresponding feedback. When the monitor of the primary server receives all the backup data returned by the backup database, it may be stored in a buffer for subsequent processing.
And step 305, updating the data in the main database by using the standby data so as to supplement the main database with missing data which is missing due to the restarting of the main server.
In some embodiments of the present application, to enable rights transfer for a hot standby service cluster, a monitor of a primary server needs to update data in a primary database with standby data. Therefore, after determining that the external port of the hot standby service cluster is the output port of the main server, the monitor of the main server can acquire standby data from the monitor of the standby server and write the standby data into the main database so as to supplement data missing due to restarting of the main server.
The monitor of the primary server includes a backup data acquirer and a data updater, which may be a hardware circuit or a software program, and the functions of the acquirer and the updater are to send a data request signal to the monitor of the backup server through a network or other communication modes after the monitor of the primary server determines that the external port of the hot backup service cluster is the output port of the primary server, so as to request the backup data to be returned, for example, record information of a transaction executed on the backup server, data snapshot on the backup server, and the like. When the monitor of the main server receives the standby data, the standby data can be stored in a buffer area, and then the standby data is written into the main database through the data updater so as to supplement the data missing due to restarting of the main server.
Optionally, step 305 further comprises the sub-steps of:
and step 3051, determining historical data stored in a main database and a time range corresponding to the missing data in the main database.
In some embodiments of the present application, in order to implement rights transfer for a hot standby service cluster, a monitor of a primary server needs to determine historical data stored in a primary database and a time range corresponding to missing data in the primary database. Thus, the monitor of the primary server may send a query signal to the primary database over a network or other communication means, requiring a time stamp of its return history data, and a point in time when the primary server restarted, before acquiring the backup data.
The monitor of the main server includes a generator of a query signal and a receiver of time information, which may be a hardware circuit or a software program, and functions to generate a specific query signal, such as a digital code or a character string, according to a preset rule or condition before the monitor of the main server acquires the standby data, where the query signal may include information of identification information, query type, query time, etc. of the main server, and send the query signal to the main database through a network or other communication modes, so that the main database may determine the query content of the monitor of the main server according to the query signal, and make corresponding feedback. After the monitor of the main server receives the time information returned by the main database, the time information can be stored in a buffer zone, and then the time information is analyzed into a time stamp of the historical data and a time point when the main server is restarted by the receiver of the time information, so that the historical data stored in the main database and a time range corresponding to the missing data in the main database are determined.
Sub-step 3052, obtaining missing data corresponding to the time range from the backup data stored in the backup database.
In some embodiments of the present application, in order to implement rights transfer of a hot standby service cluster, a monitor of a primary server needs to obtain missing data corresponding to a time range from standby data stored in a standby database. Therefore, after the monitor of the main server acquires the standby data returned by the monitor of the standby server, the standby data corresponding to the missing data in the main database can be screened out according to the determined time range and stored in a buffer area so as to be written into the main database later.
The monitor of the primary server includes a data filter and a data storage, which may be a hardware circuit or a software program, and functions to filter out the backup data corresponding to the missing data in the primary database, for example, a record file of a transaction executed on the backup server, a data snapshot on the backup server, and so on, and store the information in a buffer area for subsequent writing into the primary database, according to a determined time range, for example, a time point when the primary server is restarted and a time stamp of the latest history data in the primary database.
Substep 3053 concatenates the missing data after the historical data to complete the update of the data in the master database.
In some embodiments of the present application, to implement rights transfer for a hot standby service cluster, a monitor of a primary server needs to splice missing data after historical data to complete updating of data in the primary database. Therefore, the monitor of the main server can splice the missing data in the history data according to the data format in the main database after acquiring the missing data corresponding to the time range from the standby data stored in the standby database, form a complete data record and write the complete data record into the main database so as to complete the updating of the data in the main database.
The monitor of the main server includes a data splicer and a data writer, which may be a hardware circuit or a software program, and functions to splice the missing data after the historical data according to the data format in the main database to form a complete data record after the missing data is acquired from the standby data stored in the standby database by the monitor of the main server, and store the complete data record in a buffer area, and then write the data record into the main database through the data writer to complete updating of the data in the main database.
The sub-steps 3051 to 3053 complete the incremental synchronization process from the standby server to the main server, the running logic of the program is as shown in fig. 4, and after the cluster service module issues the task and passes through the file service manager and the service module of the main server and the standby server respectively, the steps S11 to S12 are executed to modify or delete the data; or steps S11 to S13 to realize the new addition of data.
Optionally, after the substep 3053, further includes:
a substep 3054, obtaining external input data continuously received after the restart completion time of the main server; the external input data is data sent by an external network environment to the service cluster.
In some embodiments of the present application, in order to implement rights transfer for a hot standby service cluster, a monitor of a primary server needs to obtain external input data that is continuously received after a restart completion time of the primary server. Therefore, after the data in the main database is updated, the monitor of the main server can send a data receiving signal to the external port of the hot standby service cluster through a network or other communication modes, so as to require the data receiving signal to forward external input data, namely, data sent to the service cluster by an external network environment.
The monitor of the main server includes a transmitter of a data receiving signal and a receiver of external input data, where the transmitter and the receiver may be a hardware circuit or a software program, and their functions are to generate a specific data receiving signal, such as a digital code or a character string, according to a preset rule or condition after the monitor of the main server completes updating the data in the main database, where the data receiving signal may include information of identification information of the main server, a data receiving type, a data receiving time, etc., and send the data receiving signal to an external port of the hot standby service cluster through a network or other communication modes, so that the external port of the hot standby service cluster may determine the data receiving content of the monitor of the main server according to the data receiving signal and make a corresponding forwarding. When the monitor of the main server receives the external input data forwarded by the external port of the hot standby service cluster, the external input data can be stored in a buffer zone for subsequent processing.
Substep 3055 concatenates the external input data after the missing data in the master database.
In some embodiments of the present application, to implement rights transfer for a hot standby service cluster, a monitor of a primary server needs to splice external input data after missing data in a primary database. Therefore, after the monitor of the main server acquires the external input data which is continuously received after the restart completion time of the main server, the monitor of the main server splices the external input data into the main database according to the data format in the main database to form a complete data record after the data is deleted in the main database, and writes the complete data record into the main database to update the data in the main database.
The monitor of the main server includes a data splicer and a data writer, which may be a hardware circuit or a software program, and functions to splice external input data into the main database according to the data format in the main database after the monitor of the main server acquires the external input data, form a complete data record, store the complete data record in a buffer zone, and then write the data record into the main database through the data writer to update the data in the main database.
Optionally, step 305 further comprises the sub-steps of:
substep 3056, replacing all historical data in the primary database with all backup data of the backup database.
In some embodiments of the present application, to implement rights transfer for a hot standby service cluster, the monitor of the primary server needs to replace all of the historical data in the primary database with all of the standby data of the standby database. Thus, the monitor of the primary server may send a data replacement signal to the standby database via a network or other communication means after the update of the data in the primary database is completed, requiring it to return all the standby data, i.e., all the data stored in the standby database.
The monitor of the main server includes a transmitter of a data replacement signal and a receiver of backup data, which may be a hardware circuit or a software program, and functions to generate a specific data replacement signal, such as a digital code or a character string, according to a preset rule or condition after the monitor of the main server completes updating the data in the main database, where the data replacement signal may include information such as identification information, data replacement type, data replacement time, etc. of the main server, and send the data replacement signal to the backup database through a network or other communication modes, so that the backup database may determine the data replacement content of the monitor of the main server according to the data replacement signal, and make corresponding feedback. When the monitor of the primary server receives all the backup data returned by the backup database, it may be stored in a buffer for subsequent processing.
Sub-step 3056 completes the full synchronization process from the standby server to the main server, the running logic of the program is as shown in fig. 5, and after the cluster service module issues the task and passes through the file service manager and the service module of the main server and the standby server respectively, the steps S21 to S25 are executed to realize the full replacement of the data.
Step 306, determining the external port of the hot standby service cluster as the output port of the main server under the condition that the counted number of the response signals is larger than a target value; the target value is half of the total number of monitors in the hot standby service cluster.
The method shown in this step is already described in step 104, and will not be described here again.
Step 307, obtaining an external port of the hot standby service cluster.
In some embodiments of the present application, in order to implement rights transfer for a hot standby service cluster, a monitor of a primary server needs to obtain an external port of the hot standby service cluster. Therefore, after the monitor of the main server completes updating the data in the main database, the monitor can send a port query signal to the load balancer or the reverse proxy of the hot standby service cluster through a network or other communication modes, so as to request the monitor to return information of an external port, such as information of a network address, a port number and the like.
The monitor of the main server includes a transmitter of a port query signal and a receiver of an external port, where the transmitter and the receiver may be a hardware circuit or a software program, and the functions of the transmitter and the receiver are to generate a specific port query signal, such as a digital code or a character string, according to a preset rule or a preset condition after the monitor of the main server completes updating data in the main database, where the port query signal may include identification information of the main server, a port query type, a port query time, and other information, and send the port query signal to a load balancer or a reverse proxy of the hot standby service cluster through a network or other communication modes, so that the load balancer or the reverse proxy of the hot standby service cluster may determine port query content of the monitor of the main server according to the port query signal, and make corresponding feedback. When the monitor of the main server receives the information of the external port returned by the load equalizer or the reverse proxy of the hot standby service cluster, the information can be stored in a buffer area for subsequent use.
And step 308, determining a database in the active state of the hot standby service cluster according to the external port.
In some embodiments of the present application, in order to implement rights transfer of the hot standby service cluster, the monitor of the primary server needs to determine, according to the external port, a database in the active state of the hot standby service cluster. Therefore, after obtaining the information of the external port of the hot standby service cluster, the monitor of the main server can query the network addresses and states of the main database and the standby database according to the network addresses and port numbers of the external port so as to judge which database is the database in the current active state, namely the database which is processing the service.
The monitor of the main server includes a database inquirer and a database determiner, which may be a hardware circuit or a software program, and the function of the inquirer and the determiner is to send a database inquiry signal to the main database and the standby database through a network or other communication modes according to the network address and the port number of the external port after the monitor of the main server obtains the information of the external port of the hot standby service cluster, so as to request the monitor to return the information of the network address and the state, such as the network address, the port number, the activation state, and the like. When the monitor of the main server receives the network address and the state returned by the main database and the standby database, the network address and the state can be stored in a buffer zone, and then the database determiner determines which database is the database in the current active state, namely the database which is processing the service according to the comparison of the network address and the state.
And 309, transmitting data to the outside of the hot standby service cluster through the database in the active state.
In some embodiments of the present application, in order to implement rights transfer for a hot standby service cluster, a monitor of a primary server needs to transmit data to the outside of the hot standby service cluster through a database in an active state. Therefore, after determining the database in the active state of the hot standby service cluster, the monitor of the main server may send a data transmission signal to the external port of the hot standby service cluster through a network or other communication modes, so as to require the data in the database in the active state to be sent to an external network environment, such as a client, other servers, and the like.
The monitor of the main server includes a transmitter and a data transmitter of a data transmission signal, where the transmitter and the transmitter may be a hardware circuit or a software program, and their functions are to generate a specific data transmission signal, such as a digital code or a character string, according to a preset rule or condition after the monitor of the main server determines that the database is in the active state of the hot standby service cluster, where the data transmission signal may include information such as identification information of the main server, a data transmission type, a data transmission time, and the like, and send the data transmission signal to an external port of the hot standby service cluster through a network or other communication modes, so that the external port of the hot standby service cluster may determine the data transmission content of the monitor of the main server according to the data transmission signal, and make a corresponding forwarding. When the monitor of the main server receives the data transmission signal forwarded by the hot standby service cluster to the external port, the data in the database in the active state can be sent to an external network environment, such as a client, other servers and the like through the data transmitter.
Optionally, step 304 is preceded by the following steps:
and step 310, renaming the data in the main database and the standby database according to a preset format.
In some embodiments of the present application, in order to implement rights transfer of a hot standby service cluster, a monitor of a primary server needs to rename data in a primary database and a standby database according to a preset format to implement file normalization. Therefore, before the data in the main database is updated, the monitor of the main server may send a data renaming signal to the main database and the standby database through a network or other communication modes, so as to require that the data file and the file group respectively be renamed into a uniform format according to a preset rule or condition, for example, prefix or suffix is added, or extension is modified, etc.
The monitor of the primary server includes a transmitter of a data renaming signal and a data renamer, which may be a hardware circuit or a software program, and functions to generate a specific data renaming signal, such as a digital code or a character string, before the monitor of the primary server completes updating the data in the primary database, where the data renaming signal may include information such as identification information of the primary server, a data renaming type, a data renaming time, and send the data renaming signal to the primary database and the backup database through a network or other communication modes, so that the primary database and the backup database may determine the data renaming content of the monitor of the primary server according to the data renaming signal, and make corresponding feedback. After the monitor of the main server receives the data renaming results returned by the main database and the standby database, the data files and file groups in the main database and the standby database can be renamed into a uniform format according to preset rules or conditions through the data renamer, for example, prefix or suffix is added, or extension names are modified.
As shown in fig. 6, in the network structure when the hot standby service cluster provides network services, an external device, such as an office terminal, accesses the hot standby server cluster through an external network interface, and the hot standby server obtains shared storage to complete data access of a local server, and the specific process of rights transfer of the hot standby server can refer to the architecture of fig. 7.
As shown in fig. 7, a hot standby service cluster is established according to the method of the embodiment of the present application, where the cluster includes a main server and a standby server, and the main server includes a monitor, and the standby server includes two monitors, where the main server and the standby server respectively include a plurality of databases and a management system for managing the servers and the databases respectively; when the main server stops, the external business process, such as data input or output, is transferred to the standby server, and then the main server is restarted, and when the monitor of the main server acquires the starting information of the main server, a request signal is respectively sent to two monitors of the standby server, so that the monitors of the standby server respectively feed back a response signal; after the main server obtains the two response signals, the main server regains authority because the total obtained number is two and is more than half of the total number of monitors in the cluster.
In summary, in the embodiment of the present application, a monitor of a main server acquires a start signal generated when the main server is restarted, and sends a request signal to a monitor of a standby server, so that the standby server can timely feed back a response signal; and receiving and counting the number of the response signals through a monitor of the main server to judge whether the target value is reached or not, thereby determining that the external port of the hot standby service cluster is an output port of the main server. Therefore, according to the method, after the main server is stopped and restarted, the permission transfer of the hot standby service cluster can be realized, the problem that the main server cannot be called after the standby server is stopped, and network service cannot be continuously used is avoided, the reliability and stability of the hot standby service cluster are improved, and the time and cost of fault recovery are reduced.
Referring to fig. 8, a rights transferring apparatus 40 of a hot standby service cluster is shown and provided in an embodiment of the present application, where the hot standby service cluster is applied to a primary server, and the hot standby service cluster includes a primary server and a standby server that operate simultaneously; the main server and the standby server respectively comprise at least one monitor, and the number of monitors of the main server is smaller than that of the standby server;
The device comprises:
the starting monitoring module 401 is configured to obtain, by using a monitor of the main server, a starting signal generated when the main server is restarted;
a request sending module 402, configured to send, in response to the start signal, a request signal to a monitor of the standby server through a monitor of the primary server; the request signal is used for the standby server to feed back a response signal;
a response statistics module 403, configured to receive response signals fed back by the monitor of the standby server according to the request signals, and count the number of received response signals; the response signals are in one-to-one correspondence with monitors of the standby server;
the permission acquisition module 404 is configured to determine an external port of the hot standby service cluster as an output port of the primary server if the counted number of response signals is greater than a target value; the target value is half of the total number of monitors in the hot standby service cluster.
Optionally, the request sending module 402 includes the following sub-modules:
an address confirmation sub-module, configured to determine a network address of a monitor of the standby server;
and the request sending sub-module is used for respectively sending a request signal to each monitor of the standby server according to the network address.
Optionally, the main server further comprises a main database; the standby server also comprises a standby database; the apparatus further comprises:
the standby data acquisition module is used for acquiring standby data from the standby database;
and the main data updating module is used for updating the data in the main database by utilizing the standby data so as to supplement the missing data which is missing due to the restarting of the main server in the main database.
Optionally, the main data updating module includes the following sub-modules:
the historical data confirmation sub-module is used for determining historical data stored in a main database and a time range corresponding to the missing data in the main database;
the missing data acquisition sub-module is used for acquiring missing data corresponding to the time range from the standby data stored in the standby database;
and the data supplementing sub-module is used for splicing the missing data after the historical data so as to finish updating the data in the main database.
Optionally, the apparatus further comprises the following modules:
the data complement module is used for acquiring external input data which is continuously received after the restarting completion time of the main server; the external input data is data sent to the service cluster by an external network environment;
And the complement data supplementing module is used for splicing the external input data after the missing data in the main database.
Optionally, the main data updating module includes the following sub-modules:
and the global replacement sub-module is used for replacing all the historical data in the main database with all the standby data of the standby database.
Optionally, the apparatus further includes:
and the renaming module is used for renaming the data in the main database and the standby database according to a preset format.
Optionally, the apparatus further includes:
an external port obtaining module, configured to obtain an external port of the hot standby service cluster;
the database confirmation module is used for determining a database in the hot standby service cluster activation state according to the external port;
and the data output module is used for transmitting data to the outside of the hot standby service cluster through the database in the activated state.
Referring to fig. 9, there is shown a rights transferring apparatus 41 of a hot standby service cluster provided in an embodiment of the present application, for a standby server, where the hot standby service cluster includes a primary server and a standby server that operate simultaneously; the main server and the standby server respectively comprise at least one monitor, and the number of monitors of the main server is smaller than that of the standby server;
The device comprises:
a request receiving module 411, configured to obtain, by using a monitor of the standby server, a request signal sent by a monitor of a main server; the request signal is generated by a monitor of the main server according to the acquired starting signal generated by the main server during restarting;
a response feedback module 412, configured to send a response signal to the monitor of the primary server through the monitor of the standby server in response to the request signal; the answer signal is used for being received by the monitor of the main server and counting the number, so that the external port of the hot standby server cluster is determined to be the output port of the main server under the condition that the number of the answer signal is larger than a target value; the target value is half of the total number of monitors in the hot standby service cluster.
In summary, in the embodiment of the present application, a monitor of a main server acquires a start signal generated when the main server is restarted, and sends a request signal to a monitor of a standby server, so that the standby server can timely feed back a response signal; and receiving and counting the number of the response signals through a monitor of the main server to judge whether the target value is reached or not, thereby determining that the external port of the hot standby service cluster is an output port of the main server. Therefore, according to the method, after the main server is stopped and restarted, the permission transfer of the hot standby service cluster can be realized, the problem that the main server cannot be called after the standby server is stopped, and network service cannot be continuously used is avoided, the reliability and stability of the hot standby service cluster are improved, and the time and cost of fault recovery are reduced.
Referring to fig. 10, an electronic device 500 may include one or more of the following components: a processing component 502, a memory 505, a power component 506, a multimedia component 508, an audio component 510, an input/output (I/O) interface 512, a sensor component 514, and a communication component 516.
The processing component 502 generally controls overall operation of the electronic device 500, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations. The processing component 502 may include one or more processors 520 to execute instructions to perform all or part of the steps of the methods described above. Further, the processing component 502 can include one or more modules that facilitate interactions between the processing component 502 and other components. For example, the processing component 502 can include a multimedia module to facilitate interaction between the multimedia component 508 and the processing component 502.
The memory 504 is used to store various types of data to support operations at the electronic device 500. Examples of such data include instructions for any application or method operating on the electronic device 500, contact data, phonebook data, messages, pictures, multimedia, and so forth. The memory 504 may be implemented by any type or combination of volatile or nonvolatile memory devices such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disk.
The power supply component 506 provides power to the various components of the electronic device 500. The power components 506 may include a power management system, one or more power sources, and other components associated with generating, managing, and distributing power for the electronic device 500.
The multimedia component 508 includes an interface between the electronic device 500 and a user that provides an output interface. In some embodiments, the interface may include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the interface includes a touch panel, the interface may be implemented as a touch screen to receive input signals from a user. The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensor may not only sense demarcations of touch or sliding actions, but also detect durations and pressures associated with touch or sliding operations. In some embodiments, the multimedia component 508 includes a front-facing camera and/or a rear-facing camera. When the electronic device 500 is in an operational mode, such as a shooting mode or a multimedia mode, the front camera and/or the rear camera may receive external multimedia data. Each front camera and rear camera may be a fixed optical lens system or have focal length and optical zoom capabilities.
The audio component 510 is for outputting and/or inputting audio signals. For example, the audio component 510 includes a Microphone (MIC) for receiving external audio signals when the electronic device 500 is in an operational mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signals may be further stored in the memory 504 or transmitted via the communication component 516. In some embodiments, the audio component 510 further comprises a speaker for outputting audio signals.
Input/output I/O interface 512 provides an interface between processing component 502 and peripheral interface modules, which may be keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to: homepage button, volume button, start button, and lock button.
The sensor assembly 514 includes one or more sensors for providing status assessment of various aspects of the electronic device 500. For example, the sensor assembly 515 may detect an on/off state of the electronic device 500, a relative positioning of the components, such as a display and keypad of the electronic device 500, the sensor assembly 514 may also detect a change in position of the electronic device 500 or a component of the electronic device 500, the presence or absence of a user's contact with the electronic device 500, an orientation or acceleration/deceleration of the electronic device 500, and a change in temperature of the electronic device 500. The sensor assembly 514 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor assembly 515 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 514 may also include an acceleration sensor, a gyroscopic sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
The communication component 516 is employed to facilitate communication between the electronic device 500 and other devices, either in a wired or wireless manner. The electronic device 500 may access a wireless network based on a communication standard, such as WiFi, an operator network (e.g., 2G, 3G, 4G, or 5G), or a combination thereof. In one exemplary embodiment, the communication component 516 receives broadcast signals or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 516 further includes a Near Field Communication (NFC) module to facilitate short range communications. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID) technology, infrared data association (IrDA) technology, ultra Wideband (UWB) technology, bluetooth (BT) technology, and other technologies.
In an exemplary embodiment, the electronic device 500 may be implemented by one or more Application Specific Integrated Circuits (ASICs), digital Signal Processors (DSPs), digital Signal Processing Devices (DSPDs), programmable Logic Devices (PLDs), field Programmable Gate Arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic elements for implementing a display control method as provided by embodiments of the present application.
In an exemplary embodiment, a non-transitory computer readable storage medium is also provided, such as memory 504, including instructions executable by processor 520 of electronic device 500 to perform the above-described method. For example, the non-transitory storage medium may be ROM, random Access Memory (RAM), CD-ROM, magnetic tape, floppy disk, optical data storage device, etc.
Fig. 11 is a block diagram of an electronic device 600 in accordance with another embodiment of the invention. For example, the electronic device 600 may be provided as a server. Referring to fig. 11, the electronic device 600 includes a processing component 622 that further includes one or more processors and memory resources represented by a memory 632 for storing instructions, such as application programs, executable by the processing component 622. The application programs stored in memory 632 may include one or more modules each corresponding to a set of instructions. In addition, the processing component 622 is configured to execute instructions to perform a display control method provided by embodiments of the present application.
The electronic device 600 may also include a power component 626 configured to perform power management of the electronic device 600, a wired or wireless network interface 650 configured to connect the electronic device 600 to a network, and an input/output (I/O) interface 658. The electronic device 600 may operate based on an operating system stored in memory 632, such as WindowsServerTM, macOSXTM, unixTM, linuxTM, freeBSDTM or the like.
Other embodiments of the present application will be apparent to those skilled in the art from consideration of the specification and practice of the application disclosed herein. This application is intended to cover any variations, uses, or adaptations of the application following, in general, the principles of the application and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the application being indicated by the following claims.
It is to be understood that the present application is not limited to the precise arrangements and instrumentalities shown in the drawings, which have been described above, and that various modifications and changes may be effected without departing from the scope thereof. The scope of the application is limited only by the appended claims.
Claims (13)
1. The authority transfer method of the hot standby service cluster is characterized by being applied to a main server, wherein the hot standby service cluster comprises the main server and a standby server which run simultaneously; the main server and the standby server respectively comprise at least one monitor, and the number of monitors of the main server is smaller than that of the standby server;
the method comprises the following steps:
acquiring a starting signal generated by the main server during restarting through a monitor of the main server;
transmitting a request signal to a monitor of the standby server through the monitor of the main server in response to the start signal; the request signal is used for the standby server to feed back a response signal;
receiving response signals fed back by the monitor of the standby server according to the request signals, and counting the number of the received response signals; the response signals are in one-to-one correspondence with monitors of the standby server;
Under the condition that the counted number of the response signals is larger than a target value, determining an external port of the hot standby service cluster as an output port of a main server; the target value is half of the total number of monitors in the hot standby service cluster.
2. The method of claim 1, wherein the sending, by the monitor of the primary server, a request signal to the monitor of the backup server in response to the start signal comprises:
determining a network address of a monitor of the standby server;
and respectively sending a request signal to each monitor of the standby server according to the network address.
3. The method of claim 1, wherein the primary server further comprises a primary database; the standby server also comprises a standby database; before determining the external port of the hot standby server cluster as the output port of the primary server, the method further comprises:
obtaining standby data from the standby database;
and updating the data in the main database by using the standby data so as to supplement the main database with missing data which is missing due to the restarting of the main server.
4. The method of claim 3, wherein updating the data in the primary database with the backup data such that missing data missing from restarting the primary server is complemented in the primary database comprises:
determining historical data stored in a main database and a time range corresponding to the missing data in the main database;
acquiring missing data corresponding to the time range from the standby data stored in the standby database;
splicing the missing data after the historical data to finish updating the data in the main database.
5. The method of claim 4, wherein the splicing the missing data after the history data to complete the update to the data in the master database further comprises:
obtaining external input data which is continuously received after the restarting completion time of the main server; the external input data is data sent to the service cluster by an external network environment;
and splicing the external input data after missing data in the main database.
6. The method of claim 3, wherein updating the data in the primary database with the backup data such that missing data missing from restarting the primary server is complemented in the primary database comprises:
And replacing all historical data in the main database with all standby data of the standby database.
7. The method of claim 3, wherein prior to said obtaining backup data from said backup database, said method further comprises:
and renaming the data in the main database and the standby database according to a preset format.
8. The method of claim 1, wherein the method further comprises:
obtaining an external port of the hot standby service cluster;
determining a database in the active state of the hot standby service cluster according to the external port;
and transmitting data to the outside of the hot standby service cluster through the database in the activated state.
9. The authority transfer method of the hot standby service cluster is characterized by comprising a main server and a standby server which run simultaneously; the main server and the standby server respectively comprise at least one monitor, and the number of monitors of the main server is smaller than that of the standby server;
the method comprises the following steps:
acquiring a request signal sent by a monitor of a main server through the monitor of the standby server; the request signal is generated by a monitor of the main server according to the acquired starting signal generated by the main server during restarting;
Transmitting a response signal to the monitor of the main server through the monitor of the standby server in response to the request signal; the answer signal is used for being received by the monitor of the main server and counting the number, so that the external port of the hot standby server cluster is determined to be the output port of the main server under the condition that the number of the answer signal is larger than a target value; the target value is half of the total number of monitors in the hot standby service cluster.
10. The authority transfer device of the hot standby service cluster is characterized by being applied to a main server, wherein the hot standby service cluster comprises the main server and a standby server which run simultaneously; the main server and the standby server respectively comprise at least one monitor, and the number of monitors of the main server is smaller than that of the standby server;
the device comprises:
the starting monitoring module is used for acquiring a starting signal generated by the main server during restarting through a monitor of the main server;
the request sending module is used for responding to the starting signal and sending a request signal to the monitor of the standby server through the monitor of the main server; the request signal is used for the standby server to feed back a response signal;
The response statistics module is used for receiving response signals fed back by the monitor of the standby server according to the request signals and counting the number of the received response signals; the response signals are in one-to-one correspondence with monitors of the standby server;
the permission acquisition module is used for determining an external port of the hot standby service cluster as an output port of the main server under the condition that the counted number of the response signals is larger than a target value; the target value is half of the total number of monitors in the hot standby service cluster.
11. The authority transfer device of the hot standby service cluster is characterized by being used for a standby server, wherein the hot standby service cluster comprises a main server and a standby server which run simultaneously; the main server and the standby server respectively comprise at least one monitor, and the number of monitors of the main server is smaller than that of the standby server;
the device comprises:
the request receiving module is used for acquiring a request signal sent by the monitor of the main server through the monitor of the standby server; the request signal is generated by a monitor of the main server according to the acquired starting signal generated by the main server during restarting;
The response feedback module is used for responding to the request signal and sending a response signal to the monitor of the main server through the monitor of the standby server; the answer signal is used for being received by the monitor of the main server and counting the number, so that the external port of the hot standby server cluster is determined to be the output port of the main server under the condition that the number of the answer signal is larger than a target value; the target value is half of the total number of monitors in the hot standby service cluster.
12. An electronic device, comprising: a processor, a memory for storing instructions executable by the processor;
wherein the processor is configured to execute the instructions to implement the method of any one of claims 1 to 9.
13. A computer readable storage medium, characterized in that instructions in the computer readable storage medium, when executed by a processor of an electronic device, enable the electronic device to perform the method of any one of claims 1 to 9.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311501646.3A CN117472656B (en) | 2023-11-10 | 2023-11-10 | Authority transfer method, device, equipment and storage medium of hot standby service cluster |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311501646.3A CN117472656B (en) | 2023-11-10 | 2023-11-10 | Authority transfer method, device, equipment and storage medium of hot standby service cluster |
Publications (2)
Publication Number | Publication Date |
---|---|
CN117472656A true CN117472656A (en) | 2024-01-30 |
CN117472656B CN117472656B (en) | 2024-06-14 |
Family
ID=89637716
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202311501646.3A Active CN117472656B (en) | 2023-11-10 | 2023-11-10 | Authority transfer method, device, equipment and storage medium of hot standby service cluster |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN117472656B (en) |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107819605A (en) * | 2016-09-14 | 2018-03-20 | 北京百度网讯科技有限公司 | Method and apparatus for the switching server in server cluster |
US20180365944A1 (en) * | 2017-06-20 | 2018-12-20 | Chongqing Yufeng Xinxin Wire & Cable Technology Co., Ltd. | Networking communication method for multi-slave cable anti-theft monitoring system |
US20190140888A1 (en) * | 2017-11-08 | 2019-05-09 | Line Corporation | Computer readable media, methods, and computer apparatuses for network service continuity management |
WO2020253314A1 (en) * | 2019-06-19 | 2020-12-24 | 中兴通讯股份有限公司 | Transaction monitoring method, apparatus and system for distributed database, and storage medium |
CN113312321A (en) * | 2021-05-31 | 2021-08-27 | 中国民航信息网络股份有限公司 | Abnormal monitoring method for traffic and related equipment |
-
2023
- 2023-11-10 CN CN202311501646.3A patent/CN117472656B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107819605A (en) * | 2016-09-14 | 2018-03-20 | 北京百度网讯科技有限公司 | Method and apparatus for the switching server in server cluster |
US20180365944A1 (en) * | 2017-06-20 | 2018-12-20 | Chongqing Yufeng Xinxin Wire & Cable Technology Co., Ltd. | Networking communication method for multi-slave cable anti-theft monitoring system |
US20190140888A1 (en) * | 2017-11-08 | 2019-05-09 | Line Corporation | Computer readable media, methods, and computer apparatuses for network service continuity management |
WO2020253314A1 (en) * | 2019-06-19 | 2020-12-24 | 中兴通讯股份有限公司 | Transaction monitoring method, apparatus and system for distributed database, and storage medium |
CN113312321A (en) * | 2021-05-31 | 2021-08-27 | 中国民航信息网络股份有限公司 | Abnormal monitoring method for traffic and related equipment |
Non-Patent Citations (1)
Title |
---|
赵勇;: "服务器集群在发射台平台系统中的应用", 广播电视信息, no. 08, 15 August 2016 (2016-08-15), pages 101 - 104 * |
Also Published As
Publication number | Publication date |
---|---|
CN117472656B (en) | 2024-06-14 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
EP3937426B1 (en) | Master-slave server switching method, apparatus and storage medium | |
CN112671897B (en) | Access method, device, storage medium, equipment and product of distributed system | |
CN111241134B (en) | Data processing method and device | |
CN109684112B (en) | Program file operation method, device, terminal and storage medium | |
CN112131135B (en) | Ciphertext operation debugging method and system and device for ciphertext operation debugging | |
CN117472656B (en) | Authority transfer method, device, equipment and storage medium of hot standby service cluster | |
CN112068876A (en) | Process management method, device and system | |
CN116248483A (en) | Node abnormal fusing method and device, electronic equipment and storage medium | |
CN114218187A (en) | Data online migration method and device, electronic equipment and storage medium | |
CN110995767A (en) | Request processing method and device | |
CN114237497B (en) | Distributed storage method and device | |
CN113157604B (en) | Data acquisition method and device based on distributed system and related products | |
CN112804098B (en) | Domain name fault line switching method and device, terminal equipment and storage medium | |
CN116016090B (en) | Network card cluster management method and device, electronic equipment and readable storage medium | |
CN115134231B (en) | Communication method, device and device for communication | |
CN111984865B (en) | Method and device for inquiring account number, electronic equipment and storage medium | |
CN115297144B (en) | Node data interaction method and device | |
CN113312264B (en) | Service system testing method, device, equipment, medium and product | |
CN116909760B (en) | Data processing method, device, readable storage medium and electronic equipment | |
CN115037595B (en) | Network recovery method, device, equipment and storage medium | |
CN116996499A (en) | File processing method, device and equipment | |
CN116501515A (en) | Information synchronization method, device, electronic equipment and storage medium | |
CN116383199A (en) | Cluster data storage method and device, electronic equipment and storage medium | |
CN117076059A (en) | Transaction processing method, device, computer equipment and storage medium | |
CN116266801A (en) | Device access method, node device, 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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant |