CN113961398A - Business processing method, device, system, equipment, storage medium and product - Google Patents

Business processing method, device, system, equipment, storage medium and product Download PDF

Info

Publication number
CN113961398A
CN113961398A CN202111328371.9A CN202111328371A CN113961398A CN 113961398 A CN113961398 A CN 113961398A CN 202111328371 A CN202111328371 A CN 202111328371A CN 113961398 A CN113961398 A CN 113961398A
Authority
CN
China
Prior art keywords
virtual server
queue manager
main virtual
abnormal
current
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111328371.9A
Other languages
Chinese (zh)
Inventor
苏鸣
左永平
郑雯杰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Construction Bank Corp
Original Assignee
China Construction Bank Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China Construction Bank Corp filed Critical China Construction Bank Corp
Priority to CN202111328371.9A priority Critical patent/CN113961398A/en
Publication of CN113961398A publication Critical patent/CN113961398A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1446Point-in-time backing up or restoration of persistent data
    • G06F11/1448Management of the data involved in backup or backup restore
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3065Monitoring arrangements determined by the means or processing involved in reporting the monitored data
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/546Message passing systems or structures, e.g. queues
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/06Management of faults, events, alarms or notifications
    • H04L41/0654Management of faults, events, alarms or notifications using network fault recovery
    • H04L41/0663Performing the actions predefined by failover planning, e.g. switching to standby network elements
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/06Management of faults, events, alarms or notifications
    • H04L41/0654Management of faults, events, alarms or notifications using network fault recovery
    • H04L41/0668Management of faults, events, alarms or notifications using network fault recovery by dynamic selection of recovery network elements, e.g. replacement by the most appropriate element after failure
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45562Creating, deleting, cloning virtual machine instances

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Quality & Reliability (AREA)
  • Hardware Redundancy (AREA)

Abstract

The utility model provides a service processing method, a device, a system, equipment, a storage medium and a product, which relate to the technical field of virtualization, and the method comprises the following steps: acquiring a service request to be processed; judging whether the current main virtual server is abnormal or not according to the state log of the queue manager; if the current main virtual server is abnormal, selecting one from the standby virtual servers as a new main virtual server; and acquiring a file lock of the queue manager from the current main virtual server and sending the file lock to the new main virtual server so that the message middleware on the new main virtual server acquires the authority of the queue manager, thereby processing the service request based on the queue manager. The method judges whether the current main virtual server is abnormal or not through the working state of the queue manager, and can release the file lock held by the message middleware on the current main virtual server and transfer the file lock to the newly selected main virtual server when the current main virtual server is abnormal, so that the hot standby of the message middleware on the virtual server is realized.

Description

Business processing method, device, system, equipment, storage medium and product
Technical Field
The present invention relates to the field of virtualization technologies, and in particular, to a method, an apparatus, a system, a device, a storage medium, and a product for processing a service.
Background
When data exchange and business exchange are carried out between the enterprise internal network and the enterprise external network, the reliability of the information transmission process is ensured through the message middleware. And in order to avoid single-point risks, message middleware hot standby needs to be configured to realize high availability.
In the prior art, an AIX (Advanced Interactive execution) small-sized machine and a Storage Area Network (Storage Area Network) Storage shared message queue based on a fiber channel are adopted to realize hot standby of a message middleware. The AIX physical machine is naturally adaptive to the message middleware, the automatic switching of the host machine and the standby machine in failure can be realized by using a hot standby tool carried by the AIX physical machine only through simple configuration, and the AIX physical machine is matched with SAN storage and is as safe and efficient as using a local disk.
However, the cost of the AIX physical machine and the SAN memory device is high, and the control difficulty is high. In an increasingly large system structure, in order to enhance the control capability of the service and more conveniently distribute, manage and recycle the servers, and also in order to save the investment cost, it is a necessary trend of development to adopt the virtual server instead of the physical machine. In view of this, the present invention provides a method, an apparatus, a system, a device, a storage medium, and a product for processing a service, so as to implement hot standby of a message middleware on a virtual machine, ensure security of business traffic between an intranet and an intranet, and reduce hot standby cost of the message middleware.
Disclosure of Invention
In view of the foregoing problems in the prior art, an object of the present disclosure is to provide a method, an apparatus, a system, a device, a storage medium, and a product for processing a service, so as to solve the problems of high device cost and unsuitability for a development trend caused by using a physical machine and a SAN disk to implement hot standby of a message middleware in the prior art.
In order to solve the technical problems, the specific technical scheme is as follows:
in a first aspect, a method for service processing is provided herein, including:
acquiring a service request to be processed;
judging whether the current main virtual server is abnormal or not according to the state log of the queue manager;
if the current main virtual server is abnormal, selecting one from the standby virtual servers as a new main virtual server;
and acquiring a file lock of the queue manager from the current main virtual server and sending the file lock to the new main virtual server so that the message middleware on the new main virtual server acquires the authority of the queue manager, thereby processing the service request based on the queue manager.
Specifically, the status log of the queue manager includes:
a device name of a primary virtual server, an operating state tag of the queue manager, and a timestamp.
Further, the determining whether the current primary virtual server is abnormal according to the status log of the queue manager includes:
judging whether the time difference between the timestamp in the latest state log and the current time node is less than or equal to a preset time period or not;
if not, determining that the current main virtual server is abnormal;
if yes, judging whether the working state label of the queue manager is in a stop state or not;
and if the working state label of the queue manager is in a stop state, determining that the current main virtual server is abnormal.
Further, the determining whether the current primary virtual server is abnormal according to the status log of the queue manager further includes:
and if the working state label of the queue manager is in a running state, determining that the current main virtual server is normal.
Further, if the working state label of the queue manager is a running state, after determining that the current primary virtual server is normal, the method further includes:
the current master virtual server is kept unchanged.
Specifically, the selecting one of the slave virtual servers as a new master virtual server includes:
when more than one standby virtual server exists, selecting a new main virtual server according to the priority order of the standby virtual servers; or
And selecting one of the standby virtual servers as a new main virtual server in a polling mode.
Specifically, after selecting one of the slave virtual servers as a new master virtual server, the method further includes:
and drifting the virtual IP address of the current main virtual server to the new main virtual server.
Specifically, after selecting one of the slave virtual servers as a new master virtual server, the method further includes:
judging whether the current main virtual server has an incomplete service request;
and if the current main virtual server has an incomplete service request, transferring the incomplete service request to a new main virtual server for processing.
Preferably, after selecting one of the slave virtual servers as a new master virtual server, the method further includes:
and sending the fault alarm of the fault virtual server.
In a second aspect, there is provided a traffic processing apparatus, comprising:
the first acquisition module is used for acquiring a service request to be processed;
the judging module is used for judging whether the current main virtual server is abnormal or not according to the state log of the queue manager;
the selection module is used for selecting one of the standby virtual servers as a new main virtual server if the current main virtual server is abnormal;
and the second acquisition module is used for acquiring the file lock of the queue manager from the current main virtual server and sending the file lock to the new main virtual server so that the message middleware on the new main virtual server acquires the authority of the queue manager, and the service request is processed based on the queue manager.
In a third aspect, this document also provides a service processing method, including:
the service processing device acquires a service request to be processed; analyzing whether the current main virtual server is abnormal or not according to the state log of the queue manager, and if the current main virtual server is abnormal, selecting one of the standby virtual servers as a new main virtual server; acquiring a file lock of a queue manager from a current main virtual server and sending the file lock to a new main virtual server;
and the message middleware on the new main virtual server acquires the authority of the queue manager according to the file lock and processes the service request based on the queue manager.
In a fourth aspect, a service processing system is also provided herein, which includes a service processing apparatus and at least two virtual servers;
the service processing device is used for acquiring a service request to be processed and judging whether the main virtual server is abnormal or not according to the state log of the queue manager; if the main virtual server is abnormal, selecting one of the standby virtual servers as a new main virtual server, acquiring a file lock of the queue manager from the current main virtual server and sending the file lock to the new main virtual server;
the virtual server comprises a main virtual server and a standby virtual server; the main virtual server is used for acquiring the authority to the queue manager according to the file lock so as to process the service request based on the queue manager; and the standby virtual server is used for acquiring the file lock released from the main virtual server to replace the main virtual server to process the service request when the main virtual server is abnormal.
In a fifth aspect, this document also provides a computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing a method as provided in the above technical solution when executing the computer program.
In a sixth aspect, a computer-readable storage medium is provided, which stores a computer program, which when executed by a processor implements a method as provided in the above technical solution.
In a seventh aspect, this document also provides a computer program product including at least one instruction or at least one program, which is loaded and executed by a processor to implement the method provided in the above technical solution.
By adopting the technical scheme, the business processing method, the business processing device, the business processing system, the business processing equipment, the business processing storage medium and the business processing product are characterized in that whether the current main virtual server is abnormal or not is judged through the state log of the queue manager, and when the current main virtual server is abnormal, the file lock of the queue manager, which is authorized by the message middleware on the current main virtual server, can be released and transferred to the newly selected main virtual server, so that the hot standby of the message middleware on the virtual server is realized, and the equipment investment cost of the hot standby of the message middleware is greatly reduced.
In order to make the aforementioned and other objects, features and advantages of the present invention comprehensible, preferred embodiments accompanied with figures are described in detail below.
Drawings
In order to more clearly illustrate the embodiments or technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art that other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a schematic view illustrating an application scenario of a service processing method provided in an embodiment of the present disclosure;
fig. 2 shows a first flowchart of a service processing method provided in an embodiment of the present disclosure;
fig. 3 shows a second flow chart of a service processing method provided in an embodiment of the present disclosure;
fig. 4 shows a third flow chart of a traffic processing method provided in an embodiment of the present disclosure;
fig. 5 is a schematic structural diagram illustrating a service processing apparatus provided in an embodiment of the present disclosure;
fig. 6 is a flowchart illustrating another service processing method provided in an embodiment of the present disclosure;
fig. 7 is a schematic structural diagram illustrating a service processing system provided in an embodiment of the present disclosure;
fig. 8 shows a schematic structural diagram of a computer device provided in an embodiment herein.
Description of the symbols of the drawings:
51. a first acquisition module;
52. a judgment module;
53. a selection module;
54. a second acquisition module;
71. a service processing device;
72. a primary virtual server;
73. preparing a virtual server;
802. a computer device;
804. a processor;
806. a memory;
808. a drive mechanism;
810. an input/output module;
812. an input device;
814. an output device;
816. a presentation device;
818. a graphical user interface;
820. a network interface;
822. a communication link;
824. a communication bus.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments herein without making any creative effort, shall fall within the scope of protection.
It should be noted that the terms "first," "second," and the like in the description and claims herein and in the above-described drawings are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments herein described are capable of operation in sequences other than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, apparatus, article, or device that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or device.
In a network area between an intranet and an extranet, an isolation Zone (DMZ) is usually provided, and a message middleware for processing business traffic is provided in the isolation Zone, so that the security and reliability of business traffic between the intranet and the extranet can be more effectively guaranteed.
In an increasingly large system structure, in order to enhance the control capability of services, more conveniently distribute, manage and recycle servers, and save investment cost, an original hot standby mode of implementing message middleware by using an AIX minicomputer and a SAN storage shared message queue needs to be improved.
In order to solve the above problem, embodiments herein provide a service processing method, apparatus, system, device, storage medium, and product, which can implement hot standby of a message middleware on a virtual server, and reduce investment cost while ensuring that the message middleware is highly available. Fig. 1 is a schematic view of an application scenario of a business processing method provided in an embodiment of the present specification, and fig. 2 is a schematic view of a step of the business processing method, where the present specification provides method operation steps as described in the embodiment or the flowchart, but more or less operation steps may be included based on conventional or non-creative labor. The order of steps recited in the embodiments is merely one manner of performing the steps in a multitude of orders and does not represent the only order of execution. When an actual system or apparatus product executes, it can execute sequentially or in parallel according to the method shown in the embodiment or the figures. Specifically, as shown in fig. 2, the method may include:
s210: and acquiring a service request to be processed.
As shown in fig. 1, the service requests received by the virtual server in the isolation area include a service request from the internal network and a service request from the external network.
S220: and judging whether the current main virtual server is abnormal or not according to the state log of the queue manager.
In the embodiment of the present specification, the status log of the queue manager is generated at a preset time period. And may store the status log on a shared storage unit. For example, a crontab timing task may be set to time generate a status log of the queue manager. Illustratively, the preset time period may be 5s, 10s, 15s, and the like. The time interval can be set according to specific actual use conditions, and the shorter the time period is, the more detailed the monitoring of the working state of the queue manager is, but the more the generated state logs are, the certain influence is also caused on the storage space.
In this embodiment of the present disclosure, the shared Storage unit may be a Network Attached Storage (NAS) disk, where the NAS disk is a device that is connected to a Network and has an information Storage function, and the NAS disk may implement centralized management of data, release bandwidth, and improve performance.
After the queue manager is established on the NAS disk, the shared queue may be established and managed, for example: and executing the step of generating the state log. The shared queue can be generally established according to a source process address, a target process address, locally stored route distribution information and the like in a message carried by the service request, and the message middleware performs corresponding processing on the service request after obtaining the shared queue.
In the embodiment of the present specification, the working condition of each virtual server is represented by the state log of the queue manager, that is, the queue manager is executed by each virtual server, so as to solve the problems that it is difficult to obtain the working condition of the virtual server and to determine whether the virtual server is abnormal in the prior art.
S230: and if the current main virtual server is abnormal, selecting one from the standby virtual servers as a new main virtual server.
When the main virtual server is down or fails, the work of the main virtual server can be switched to the standby virtual server, so that the high availability of the system is realized.
In the application scenario shown in fig. 1, the number of the virtual servers is three, and after one of the virtual servers is the main virtual server, the remaining two virtual servers are standby virtual servers. Of course, the virtual servers may be provided in other numbers, that is, there may be other numbers of virtual servers. However, the excessive number of the standby virtual servers causes the excessive investment cost of equipment, so that the number of the standby virtual servers can be set according to actual requirements in an actual application scene.
S240: and acquiring a file lock of the queue manager from the current main virtual server and sending the file lock to the new main virtual server so that the message middleware on the new main virtual server acquires the authority of the queue manager, thereby processing the service request based on the queue manager.
Only the virtual server acquiring the file lock can start the queue manager, and the service request is processed by answering, transmitting, interacting and the like after the queue manager is started. The file lock may be a token formed with a predetermined string. The file lock needs to be released from the current primary virtual server and handed over to the new primary virtual server.
In the service processing method provided in the embodiment of the present specification, whether the current master virtual server is abnormal is determined through the status log of the queue manager, and when the current master virtual server is abnormal, the file lock of the queue manager, which is authorized by the message middleware on the current master virtual server, can be released and handed over to the newly selected master virtual server, so that the message middleware on the master virtual server and only the message middleware on the master virtual server can respond to the service request, thereby implementing hot standby of the message middleware on the virtual server, and greatly reducing the equipment investment cost of the message middleware in a manner of shared storage by the virtual server and the NAS.
It should be noted that, in this embodiment of the present specification, the message middleware may specifically be IBM message middleware. The IBM message middleware has a unique security mechanism, a simple and quick programming style, good stability, expandability and cross-platform type, and strong transaction processing capability and message communication capability, and is one of the most widely applied message middleware.
In this embodiment, keepalive may be set on each virtual server to assist the switching between the master virtual server and the standby virtual server. When the main virtual server becomes the standby virtual server, the stop script of the queue manager is called to actively release the file lock, and when the standby virtual server becomes the main virtual server, the start script of the queue manager is called to acquire the file lock. But keepalived can only realize the active-standby switching of the virtual server, but cannot control the file lock release and transfer obtained by the message middleware on the virtual server.
Therefore, when the master virtual server is abnormal and cannot release the file lock, the new master virtual server cannot acquire the file lock, and at this time, even if the master-slave switching of the virtual servers is realized, the new master virtual server cannot acquire the file lock and cannot have the authority on the queue manager, that is, cannot process the service request.
In addition, when keepalived fails, switching between the primary virtual server and the standby virtual server cannot be realized, that is, switching between message middleware arranged on the primary virtual server and the standby virtual server cannot be realized, and severe influence is generated on processing and response of a service request in severe cases.
Therefore, in the embodiment of the present specification, when a new master virtual server is selected to replace an abnormal current master virtual server, the file lock may be forcibly released from the current master virtual server to avoid the problem that the new master virtual server does not have the queue manager authority and does not have the capacity to process the service request. In some possible embodiments, the file lock of the message middleware on the failed virtual server may be enforced by compression, backup, decompression, etc.
In this embodiment of this specification, the status log of the queue manager includes: the device name of the main virtual server, the working state tag of the queue manager and a timestamp, wherein the timestamp refers to the time when the state log is generated.
Further, the status log comprises: the device name of the current main virtual server, the working state label and the timestamp of the queue manager under the control of the current main virtual server;
the method can also comprise the following steps: the device name of the standby virtual server, the working state label and the time stamp of the queue manager relative to the standby virtual server.
Preferably, the status logs of the queue manager with respect to the virtual servers are generated simultaneously.
Illustratively, a current primary virtual server is taken as a, virtual servers B and C are standby virtual servers, and status logs of the queue manager include the following:
the first method comprises the following steps: when the working state label of the queue manager is in a running state and the virtual server controlling the running of the queue manager is a main virtual server A, a state log can be generated: a + run (job state label representing queue manager is running state) + timestamp (where timestamp is the time node that generated the job state, not the time that queue manager was started by the a virtual server).
At this time, for virtual server B and virtual server C, the queue manager is not started by it, and logs may also be generated: b + stop + timestamp; c + stop + timestamp.
And the second method comprises the following steps: when the working state label of the queue manager is in a stop state and the running of the queue manager is controlled to be the main virtual server, it indicates that the main virtual server a does not successfully start the queue manager, that is, at this time, the main virtual server a may have a fault, and a state log may be generated: a + stop + warning (i.e. sending a malfunction alarm) + timestamp. The virtual server B and the virtual server C are both in a stop state, and a state log is also generated: b + stop + timestamp; c + stop + timestamp.
And the third is that: when the working state label of the queue manager is in a running state and the virtual server controlling the running of the queue manager is a standby virtual server (for example, virtual server B), it indicates that the queue manager is switched from the primary virtual server a to the standby virtual server B, and a log can be generated: a + stop + timestamp, and B + run + timestamp; a log may also be generated: c + stop + timestamp. Then correspondingly, at this time, the virtual server a should be downgraded to a standby virtual server or a culling system, and the virtual server B should be used as a new primary virtual server.
In some preferred embodiments, the status log may be used to create a folder with the device name of the virtual server as the folder name, that is, the status log of the queue manager is classified based on the same virtual server, so as to facilitate analysis of the operating status of each virtual server.
In the embodiment of the present specification, a state log of a primary virtual server is indirectly represented by generating the state log of a queue manager, and whether the primary virtual server is in a normal working state or not can be determined; in addition, the state logs corresponding to the standby virtual servers are also obtained, so that the working state of the standby virtual servers can be checked in advance, and the problem that when the standby virtual servers need to be switched from the main virtual server to the standby virtual servers, the standby virtual servers are in a failure state caused by downtime or other conditions, so that switching failure or switching response efficiency is low is solved.
According to the state logs, a working state corresponding table of the queue manager and each virtual server can be obtained, and the working state corresponding table is shown in the following table 1:
TABLE 1
Figure BDA0003347777520000101
In table 1, "√" indicates an operative state, and "X" indicates a non-operative state.
If the state corresponding to the sequence number 1 is a normal state (opposite to the first state log), the master virtual server a acquires the file lock of the queue manager, and starts the queue manager; the state corresponding to the sequence number 2 is a state of switching from the primary virtual server a to the standby virtual server B (opposite to the third state log), the virtual server B acquires a file lock of the queue manager, and the virtual server C does not work; the state corresponding to the sequence number 3 is a state in which the primary virtual server a has failed and fails to switch to the standby virtual server (as opposed to the second state log described above), and the primary virtual server a still maintains the file lock of the queue manager.
In summary, in the embodiments of the present disclosure, whether each virtual server is abnormal or not can be represented according to the status log of the queue manager, that is, the execution status of the queue manager by each virtual server. Specifically, as shown in fig. 3, in the embodiment of the present specification, step S220: judging whether the current main virtual server is abnormal according to the state log of the queue manager, wherein the judging step comprises the following steps:
s310: judging whether the time difference between the timestamp in the latest state log and the current time node is less than or equal to a preset time period or not;
namely, whether the state log of the queue manager is generated and recorded regularly is judged.
S320: if not (namely the state log of the queue manager is not generated regularly), determining that the current main virtual server is abnormal;
when the status log of the queue manager is not recorded on time, the fact that the starting condition of the main virtual server to the queue manager is not obtained, and the starting condition of other standby virtual servers to the queue manager is not obtained, it is determined that the current main virtual server (namely, the virtual server where the message middleware with the file lock is located) has a fault, and the current main virtual server is not successfully switched to the standby virtual server.
S330: if so (namely, a state log of the queue manager is generated regularly), judging whether a working state label of the queue manager is in a stop state;
namely, when the state log records normally, whether the current main virtual server is abnormal is judged according to whether the queue manager is in a running state or a stopped state.
S331: and if the working state label of the queue manager is in a stop state, determining that the current main virtual server is abnormal.
That is, when the situation corresponding to the sequence number 3 in table 1 occurs, it is determined that the current master virtual server is abnormal.
Further, the method further comprises:
s332: and if the working state label of the queue manager is in a running state, determining that the current main virtual server is normal.
That is, corresponding to the case of serial number 1 in table 1, it is determined that the current primary virtual server is normal; corresponding to the case of serial number 2 in table 1, the currently executed queue manager operates as the standby virtual server, but actually is the newly selected main virtual server, that is, the "current main virtual server", and at this time, it is determined that the newly selected main virtual server is normal.
Further, at step S332: if the working state label of the queue manager is in a running state, after the current main virtual server is determined to be normal, the method further comprises the following steps:
the current master virtual server is kept unchanged.
That is, in the case corresponding to the sequence number 1, the message middleware on the main virtual server a still processes the service request; corresponding to the case of sequence number 2, the message middleware on virtual server B (and in fact the current master virtual server) is still enabled for the processing of the service request.
In some embodiments, in step S230: selecting one of the standby virtual servers as a new main virtual server, specifically comprising:
judging whether the number of the standby virtual servers is more than one;
if the number of standby virtual servers is greater than one (for example, in the embodiment of the present specification, two standby virtual servers including virtual server B and virtual server C are included), a new primary virtual server may be selected according to the priority order of the standby virtual servers; or
And selecting one of the standby virtual servers as a new main virtual server in a polling mode.
As shown in fig. 4, in the present embodiment, in step S230: after selecting one of the standby virtual servers as a new primary virtual server, the method further comprises the following steps:
s410: and drifting the virtual IP address of the current main virtual server to the new main virtual server.
Specifically, the virtual IP address can be migrated from the current main virtual server with the fault to the newly selected main virtual server through keepalive, so that the host and standby virtual servers (for the initiator of the service request) can be switched imperceptibly.
Besides, the method also comprises the following steps:
s420: judging whether the current main virtual server has an incomplete service request; and if the current main virtual server has an incomplete service request, transferring the incomplete service request to a new main virtual server for processing.
S430: and sending the fault alarm of the current main virtual server. And reminding operation and maintenance personnel to repair the fault virtual server.
When the fault of the current main virtual server is repaired, the main virtual server can be used as a standby virtual server to be added into the virtual server group.
Preferably, in step S240: before acquiring a file lock of a queue manager from a current master virtual server and sending the file lock to a new master virtual server, so that a message middleware on the new master virtual server acquires authority over the queue manager, and processing the service request based on the queue manager, the method further comprises:
and judging whether the new main virtual server is normal or not.
That is, when the current master virtual server is abnormal and needs to be switched, each function of the newly selected master virtual server should be normal, and normal processing of the service request is prevented from being influenced by multiple times of switching.
By the method, the queue manager can be in a running state all the time (there can be a situation that the message middleware of the virtual server which starts the running of the queue manager needs to be switched), so that the message middleware on the virtual server can respond to and process the service request according to the situation.
In practical applications, the queue manager is in a stopped state at the beginning of the establishment of the queue manager, and at this time, there is no current primary virtual server. The current main virtual server can be determined according to the preset priority sequence among the three virtual servers or a polling mode, and the file of the queue manager is locked to the main virtual server so that the message middleware on the main virtual server can respond to and process the service request.
To sum up, in the service processing method provided in the embodiments of the present specification, whether a current primary virtual server is abnormal is determined through a status log of a queue manager, and if the current primary virtual server is abnormal, the current primary virtual server is forced to release a file lock and transfer the file lock to a newly selected primary virtual server, and the primary virtual server is matched with a keepalive to implement switching of a virtual server and a service on the virtual server, so that a message middleware on the new primary virtual server has the authority of the queue manager to process a service request, thereby implementing high availability of the message middleware on the virtual server, reducing hot standby cost, and improving service processing efficiency of the message middleware.
As shown in fig. 5, an embodiment of this specification further provides a service processing apparatus, including:
a first obtaining module 51, configured to obtain a service request to be processed;
a judging module 52, configured to judge whether the current primary virtual server is abnormal according to the status log of the queue manager;
a selecting module 53, configured to select one of the standby virtual servers as a new primary virtual server if the current primary virtual server is abnormal;
a second obtaining module 54, configured to obtain a file lock of the queue manager from the current master virtual server and send the file lock to the new master virtual server, so that the message middleware on the new master virtual server obtains the authority of the queue manager, so as to process the service request based on the queue manager.
The advantages achieved by the device provided by the embodiment of the specification are consistent with those achieved by the method, and are not described in detail herein.
As shown in fig. 6, an embodiment of the present specification further provides a service processing method, including:
s601: the service processing device acquires a service request to be processed; analyzing whether the current main virtual server is abnormal or not according to the state log of the queue manager; if the current main virtual server is abnormal, selecting one of the standby virtual servers as a new main virtual server, acquiring a file lock of the queue manager from the current main virtual server and sending the file lock to the new main virtual server;
s602: and the message middleware on the new main virtual server acquires the authority of the queue manager according to the file lock and processes the service request based on the queue manager.
As shown in fig. 7, an embodiment of the present specification further provides a service processing system, which includes a service processing apparatus 71 and at least two virtual servers;
the service processing device 71 is configured to obtain a service request to be processed, and determine whether the primary virtual server 72 is abnormal according to a status log of the queue manager; if the primary virtual server 72 is abnormal, selecting one of the standby virtual servers 73 as a new primary virtual server, acquiring a file lock of the queue manager from the current primary virtual server and sending the file lock to the new primary virtual server;
the virtual servers include a primary virtual server 72 and a standby virtual server 73; the primary virtual server 72 is configured to obtain the authority to the queue manager according to the file lock, so as to process the service request based on the queue manager; the standby virtual server 73 is configured to obtain a file lock released from the primary virtual server 72 to process a service request instead of the primary virtual server when the primary virtual server 72 is abnormal.
As shown in fig. 8, for a computer device provided for embodiments herein, the computer device 802 may include one or more processors 804, such as one or more Central Processing Units (CPUs), each of which may implement one or more hardware threads. The computer device 802 may also include any memory 806 for storing any kind of information, such as code, settings, data, etc. For example, and without limitation, memory 806 may include any one or more of the following in combination: any type of RAM, any type of ROM, flash memory devices, hard disks, optical disks, etc. More generally, any memory may use any technology to store information. Further, any memory may provide volatile or non-volatile retention of information. Further, any memory may represent fixed or removable components of computer device 802. In one case, when the processor 804 executes the associated instructions, which are stored in any memory or combination of memories, the computer device 802 can perform any of the operations of the associated instructions. The computer device 802 also includes one or more drive mechanisms 808, such as a hard disk drive mechanism, an optical disk drive mechanism, etc., for interacting with any memory.
Computer device 802 may also include an input/output module 810(I/O) for receiving various inputs (via input device 812) and for providing various outputs (via output device 814). One particular output mechanism may include a presentation device 816 and an associated graphical user interface 818 (GUI). In other embodiments, input/output module 810(I/O), input device 812, and output device 814 may also be excluded, as just one computer device in a network. Computer device 802 may also include one or more network interfaces 820 for exchanging data with other devices via one or more communication links 822. One or more communication buses 824 couple the above-described components together.
Communication link 822 may be implemented in any manner, such as over a local area network, a wide area network (e.g., the Internet), a point-to-point connection, etc., or any combination thereof. The communication link 822 may include any combination of hardwired links, wireless links, routers, gateway functions, name servers, etc., governed by any protocol or combination of protocols.
Corresponding to the methods in fig. 2 to 4 and 6, the embodiments herein also provide a computer-readable storage medium having stored thereon a computer program, which, when executed by a processor, performs the steps of the above-described method.
Embodiments herein also provide computer readable instructions, wherein when executed by a processor, a program thereof causes the processor to perform the method as in fig. 2-4 and 6.
Embodiments herein also provide a computer program product comprising at least one instruction or at least one program, which is loaded and executed by a processor to implement the method as in fig. 2 to 4 and 6.
It should be understood that, in various embodiments herein, the sequence numbers of the above-mentioned processes do not mean the execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments herein.
It should also be understood that, in the embodiments herein, the term "and/or" is only one kind of association relation describing an associated object, meaning that three kinds of relations may exist. For example, a and/or B, may represent: a exists alone, A and B exist simultaneously, and B exists alone. In addition, the character "/" herein generally indicates that the former and latter related objects are in an "or" relationship.
Those of ordinary skill in the art will appreciate that the elements and algorithm steps of the examples described in connection with the embodiments disclosed herein may be embodied in electronic hardware, computer software, or combinations of both, and that the components and steps of the examples have been described in a functional general in the foregoing description for the purpose of illustrating clearly the interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present disclosure.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the several embodiments provided herein, it should be understood that the disclosed system, apparatus, and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units is only one logical division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may also be an electric, mechanical or other form of connection.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purposes of the embodiments herein.
In addition, functional units in the embodiments herein may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the present invention may be implemented in a form of a software product, which is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the methods described in the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
The principles and embodiments of this document are explained herein using specific examples, which are presented only to aid in understanding the methods and their core concepts; meanwhile, for the general technical personnel in the field, according to the idea of this document, there may be changes in the concrete implementation and the application scope, in summary, this description should not be understood as the limitation of this document.

Claims (15)

1. A method for processing a service, comprising:
acquiring a service request to be processed;
judging whether the current main virtual server is abnormal or not according to the state log of the queue manager;
if the current main virtual server is abnormal, selecting one from the standby virtual servers as a new main virtual server;
and acquiring a file lock of the queue manager from the current main virtual server and sending the file lock to the new main virtual server so that the message middleware on the new main virtual server acquires the authority of the queue manager, thereby processing the service request based on the queue manager.
2. The method of claim 1, wherein the status log of the queue manager comprises: a device name of a primary virtual server, an operating state tag of the queue manager, and a timestamp.
3. The method of claim 2, wherein determining whether the current primary virtual server is abnormal according to the status log of the queue manager comprises:
judging whether the time difference between the timestamp in the latest state log and the current time node is less than or equal to a preset time period or not;
if not, determining that the current main virtual server is abnormal;
if yes, judging whether the working state label of the queue manager is in a stop state or not;
and if the working state label of the queue manager is in a stop state, determining that the current main virtual server is abnormal.
4. The method of claim 3, wherein determining whether the current primary virtual server is abnormal according to the status log of the queue manager further comprises:
and if the working state label of the queue manager is in a running state, determining that the current main virtual server is normal.
5. The method of claim 4, wherein if the working status flag of the queue manager is running, determining that the current primary virtual server is normal, further comprising:
the current master virtual server is kept unchanged.
6. The method of claim 1, wherein selecting one of the slave virtual servers as a new master virtual server comprises:
when more than one standby virtual server exists, selecting a new main virtual server according to the priority order of the standby virtual servers; or
And selecting one of the standby virtual servers as a new main virtual server in a polling mode.
7. The method of claim 1, wherein after selecting one of the standby virtual servers as a new primary virtual server, further comprising:
and drifting the virtual IP address of the current main virtual server to the new main virtual server.
8. The method of claim 1, wherein after selecting one of the standby virtual servers as a new primary virtual server, further comprising:
judging whether the current main virtual server has an incomplete service request;
and if the current main virtual server has an incomplete service request, transferring the incomplete service request to a new main virtual server for processing.
9. The method of claim 1, wherein after selecting one of the standby virtual servers as a new primary virtual server, further comprising:
and sending the fault alarm of the current main virtual server.
10. A traffic processing apparatus, comprising:
the first acquisition module is used for acquiring a service request to be processed;
the judging module is used for judging whether the current main virtual server is abnormal or not according to the state log of the queue manager;
the selection module is used for selecting one of the standby virtual servers as a new main virtual server if the current main virtual server is abnormal;
and the second acquisition module is used for acquiring the file lock of the queue manager from the current main virtual server and sending the file lock to the new main virtual server so that the message middleware on the new main virtual server acquires the authority of the queue manager, and the service request is processed based on the queue manager.
11. A method for processing a service, comprising:
the service processing device acquires a service request to be processed; analyzing whether the current main virtual server is abnormal or not according to the state log of the queue manager; if the current main virtual server is abnormal, selecting one of the standby virtual servers as a new main virtual server, acquiring a file lock of the queue manager from the current main virtual server and sending the file lock to the new main virtual server;
and the message middleware on the new main virtual server acquires the authority of the queue manager according to the file lock and processes the service request based on the queue manager.
12. A business processing system is characterized by comprising a business processing device and at least two virtual servers;
the service processing device is used for acquiring a service request to be processed and judging whether the main virtual server is abnormal or not according to the state log of the queue manager; if the main virtual server is abnormal, selecting one of the standby virtual servers as a new main virtual server, acquiring a file lock of the queue manager from the current main virtual server and sending the file lock to the new main virtual server;
the virtual server comprises a main virtual server and a standby virtual server; the main virtual server is used for acquiring the authority to the queue manager according to the file lock so as to process the service request based on the queue manager; and the standby virtual server is used for acquiring the file lock released from the main virtual server to replace the main virtual server to process the service request when the main virtual server is abnormal.
13. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor implements the method according to any of claims 1 to 9 when executing the computer program.
14. A computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program which, when executed by a processor, implements the method of any one of claims 1 to 9.
15. A computer program product comprising at least one instruction or at least one program which is loaded and executed by a processor to implement the method according to any of claims 1-9.
CN202111328371.9A 2021-11-10 2021-11-10 Business processing method, device, system, equipment, storage medium and product Pending CN113961398A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111328371.9A CN113961398A (en) 2021-11-10 2021-11-10 Business processing method, device, system, equipment, storage medium and product

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111328371.9A CN113961398A (en) 2021-11-10 2021-11-10 Business processing method, device, system, equipment, storage medium and product

Publications (1)

Publication Number Publication Date
CN113961398A true CN113961398A (en) 2022-01-21

Family

ID=79470080

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111328371.9A Pending CN113961398A (en) 2021-11-10 2021-11-10 Business processing method, device, system, equipment, storage medium and product

Country Status (1)

Country Link
CN (1) CN113961398A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115499295A (en) * 2022-07-29 2022-12-20 浪潮通信技术有限公司 Server fault reporting method and device, electronic equipment and storage medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115499295A (en) * 2022-07-29 2022-12-20 浪潮通信技术有限公司 Server fault reporting method and device, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
CN106331098B (en) Server cluster system
CN103460203B (en) cluster unique identifier
CN110807064B (en) Data recovery device in RAC distributed database cluster system
KR20110044858A (en) Maintain data indetermination in data servers across data centers
CN111460039A (en) Relational database processing system, client, server and method
CN103473328A (en) MYSQL (my structured query language)-based database cloud and construction method for same
CN104503861A (en) Abnormality handling method and system, agency device and control device
CN117130730A (en) Metadata management method for federal Kubernetes cluster
CN113961398A (en) Business processing method, device, system, equipment, storage medium and product
CN110069365B (en) Method for managing database and corresponding device, computer readable storage medium
CN113190620B (en) Method, device, equipment and storage medium for synchronizing data between Redis clusters
CN114554593A (en) Data processing method and device
JP5285045B2 (en) Failure recovery method, server and program in virtual environment
CN113438111A (en) Method for restoring RabbitMQ network partition based on Raft distribution and application
CN107181608B (en) Method for recovering service and improving performance and operation and maintenance management system
CN114124803B (en) Device management method and device, electronic device and storage medium
CN112787868B (en) Information synchronization method and device
JP2015114952A (en) Network system, monitoring control unit, and software verification method
CN111510336B (en) Network equipment state management method and device
CN115145782A (en) Server switching method, mooseFS system and storage medium
CN110336701B (en) High-density two-way server management method and system
CN116668269A (en) Arbitration method, device and system for dual-activity data center
EP3387533B1 (en) Disaster recovery of cloud resources
CN111258823A (en) Method and system for switching master server and slave server
CN105306256B (en) A kind of two-node cluster hot backup implementation method based on VxWorks equipment

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