CN111092754B - Real-time access service system and implementation method thereof - Google Patents
Real-time access service system and implementation method thereof Download PDFInfo
- Publication number
- CN111092754B CN111092754B CN201911199798.6A CN201911199798A CN111092754B CN 111092754 B CN111092754 B CN 111092754B CN 201911199798 A CN201911199798 A CN 201911199798A CN 111092754 B CN111092754 B CN 111092754B
- Authority
- CN
- China
- Prior art keywords
- service
- time access
- real
- node
- mysql
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 63
- 230000002159 abnormal effect Effects 0.000 claims abstract description 53
- 238000012544 monitoring process Methods 0.000 claims description 17
- 238000004590 computer program Methods 0.000 claims description 8
- 238000004891 communication Methods 0.000 description 13
- 230000008569 process Effects 0.000 description 9
- 238000010586 diagram Methods 0.000 description 6
- 230000007246 mechanism Effects 0.000 description 4
- 238000012545 processing Methods 0.000 description 4
- 230000004083 survival effect Effects 0.000 description 4
- 230000005540 biological transmission Effects 0.000 description 3
- 230000006870 function Effects 0.000 description 3
- 230000008859 change Effects 0.000 description 2
- 238000010276 construction Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000003287 optical effect Effects 0.000 description 2
- 230000005856 abnormality Effects 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000015556 catabolic process Effects 0.000 description 1
- 238000006731 degradation reaction Methods 0.000 description 1
- 230000000593 degrading effect Effects 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 238000012423 maintenance Methods 0.000 description 1
- 238000011084 recovery Methods 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L41/00—Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
- H04L41/06—Management of faults, events, alarms or notifications
- H04L41/0654—Management of faults, events, alarms or notifications using network fault recovery
- H04L41/0668—Management 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
-
- 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/2002—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 interconnections or communication control functionality are redundant
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/27—Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/46—Multiprogramming arrangements
- G06F9/50—Allocation of resources, e.g. of the central processing unit [CPU]
- G06F9/5083—Techniques for rebalancing the load in a distributed system
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/10—Protocols in which an application is distributed across nodes in the network
- H04L67/1001—Protocols in which an application is distributed across nodes in the network for accessing one among a plurality of replicated servers
- H04L67/1034—Reaction to server failures by a load balancer
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Physics & Mathematics (AREA)
- Software Systems (AREA)
- Signal Processing (AREA)
- Computer Networks & Wireless Communication (AREA)
- Databases & Information Systems (AREA)
- Quality & Reliability (AREA)
- Computing Systems (AREA)
- Data Mining & Analysis (AREA)
- Hardware Redundancy (AREA)
Abstract
The embodiment of the invention provides a real-time access service system and an implementation method thereof, wherein the implementation method comprises the following steps: according to the service requirements and cluster types of Mysql real-time access services, deploying a plurality of sets of Mysql real-time access services under different service systems, and respectively deploying a plurality of service nodes under each Mysql real-time access service; determining distributed reliable coordination service, and constructing mutually standby service logic between each service node of the Mysql real-time access service based on the distributed reliable coordination service, so as to distribute tasks in any service node to other service nodes of any Mysql real-time access service when any service node of the Mysql real-time access service is abnormal. The embodiment of the invention can effectively improve the stability of Mysql real-time access service and avoid unnecessary loss.
Description
Technical Field
The present invention relates to the field of data communication technologies, and in particular, to a real-time access service system and an implementation method thereof.
Background
In the Mysql real-time access service, EPX analyzes the Mysql Binlog log in real time, converts and filters the analyzed content according to the user configuration, and finally outputs the content to the data pipeline used by the service party in Kafka. However, the existing EPX can only meet the basic functional requirements, i.e., push Mysql real-time changes to Kafka. For the problem of single point failure of Mysql and service, namely when Mysql or a server has a problem, Mysql real-time access service cannot be used, even downstream business is seriously affected, for example, second-hand room search is abnormal, and the existing EPX cannot avoid the problem.
The existing developed load balancing method can avoid the single-point fault problem as much as possible, for example, the four-layer load balancing method avoids the single-point fault problem by acting on the transport layer of the OSI, receiving a request by using a virtual IP + port, and then distributing a task to a real server. The seven-layer load balance is established on the basis of the four-layer load balance, and the stability of the service is realized by taking the application layer into consideration and acting on the OSI application layer.
However, the load balancing methods are all directed to tasks related to web services, and cannot meet the requirements of Mysql real-time access services. Therefore, how to develop a highly available system suitable for Mysql real-time access service to improve the stability of Mysql real-time access service is a problem to be solved in the present industry.
Disclosure of Invention
In order to overcome the above problems or at least partially solve the above problems, embodiments of the present invention provide a real-time access service system and an implementation method thereof, so as to effectively improve stability of Mysql real-time access service and avoid unnecessary loss.
In a first aspect, an embodiment of the present invention provides a method for implementing a real-time access service system, including:
according to service requirements and cluster types of Mysql real-time access services, deploying a plurality of sets of Mysql real-time access services under different service systems, and deploying a plurality of service nodes under each Mysql real-time access service respectively;
Determining distributed reliable coordination service, and constructing mutually standby service logic between each service node of the Mysql real-time access service based on the distributed reliable coordination service, so as to distribute tasks in any service node to other service nodes of any Mysql real-time access service when any service node of the Mysql real-time access service is abnormal.
Optionally, the Zookeeper service is specifically determined as the distributed reliable coordination service.
Optionally, the step of constructing a mutually standby service logic between the service nodes of the Mysql real-time access service specifically includes:
recording node directories related to each service node by using the Zookeeper service, creating a temporary child node directory of any service node in the Zookeeper service after any service node is started, and enabling any service node to monitor the node directories in the Zookeeper service;
if the abnormal condition of any service node is detected, enabling the Zookeeper service to destroy the temporary child node directory of any service node, and sending a Zookeeper notification to other service nodes, wherein the Zookeeper notification carries the node information of any service node;
And according to the zookeeper notification, distributing the task in any service node to the service node receiving the zookeeper notification.
Further, the method for implementing real-time access to the service system in the embodiment of the present invention further includes: based on the distributed reliable coordination service, mutually standby business logic is constructed among the Mysql real-time access services, so that when any Mysql real-time access service is abnormal, tasks in any Mysql real-time access service are distributed to Mysql real-time access services except any Mysql real-time access service.
Optionally, the step of allocating the task in any service node to the service node that receives the zookeeper notification specifically includes: and according to the task in any service node, carrying out load balancing operation among the service nodes receiving the zookeeper notification, and according to the operation result, distributing the task in any service node to the service nodes receiving the zookeeper notification in a balanced manner.
Further, the method for implementing real-time access to the service system in the embodiment of the present invention further includes: and according to the service characteristics of Mysql real-time access service, setting an abnormal monitoring and alarming unit at least one of a thread task for analyzing the Binlog, a thread task for sending kafka information and a thread task for synchronizing the Zookeeper locus.
Optionally, the number of service nodes deployed under each Mysql real-time access service is not less than 3.
In a second aspect, an embodiment of the present invention provides an electronic device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor executes the computer program to implement the steps of the method for implementing a real-time access service system according to the first aspect.
In a third aspect, an embodiment of the present invention provides a non-transitory computer readable storage medium, on which computer instructions are stored, and when the computer instructions are executed by a computer, the computer instructions implement the steps of the method for implementing a real-time access service system as described in the first aspect.
In a fourth aspect, an embodiment of the present invention provides a real-time access service system, including: the service logic comprises a plurality of sets of Mysql real-time access services deployed under different service systems of the Mysql real-time access services, a plurality of service nodes respectively deployed under each Mysql real-time access service and mutual standby service logic among the service nodes under the Mysql real-time access services;
the Mysql real-time access services and the service nodes are deployed according to service requirements and cluster types of the Mysql real-time access services, and the mutually standby service logic is constructed by determining distributed reliable coordination services and based on the distributed reliable coordination services and is used for distributing tasks in any service node to other service nodes of any Mysql real-time access service when any service node of any Mysql real-time access service is abnormal.
Optionally, the mutually standby service logic is specifically constructed based on a Zookeeper service.
Optionally, the building process of the mutually standby service logic includes: recording node directories related to each service node by using the Zookeeper service, creating a temporary child node directory of any service node in the Zookeeper service after any service node is started, and enabling any service node to monitor the node directories in the Zookeeper service; if the abnormal condition of any service node is detected, enabling the Zookeeper service to destroy the temporary child node directory of any service node, and sending a Zookeeper notification to other service nodes, wherein the Zookeeper notification carries the node information of any service node; and according to the zookeeper notification, distributing the task in any service node to the service node receiving the zookeeper notification.
Further, the real-time access service system of the embodiment of the present invention further includes mutually standby service logic between each Mysql real-time access service, and is configured to allocate a task in any Mysql real-time access service to a Mysql real-time access service other than any Mysql real-time access service when any Mysql real-time access service is abnormal.
Optionally, in the process of constructing the mutually-standby service logic, the step of allocating the task in any service node to the service node that receives the notice of zookeeper specifically includes: and according to the task in any service node, carrying out load balancing operation among the service nodes receiving the zookeeper notification, and according to the operation result, distributing the task in any service node to the service nodes receiving the zookeeper notification in a balanced manner.
Further, the real-time access service system of the embodiment of the present invention further includes an exception monitoring and alarming unit, where the exception monitoring and alarming unit is configured to analyze at least one of a thread task of the Binlog, a thread task of sending the kafka message, and a thread task of synchronizing the Zookeeper site according to the service characteristics of the Mysql real-time access service.
Optionally, the number of service nodes under each Mysql real-time access service is not less than 3.
According to the real-time access service system and the implementation method thereof provided by the embodiment of the invention, a plurality of sets of mutually standby Mysql real-time access services are deployed under different business systems of Mysql real-time access services, and a plurality of sets of mutually standby service nodes are further deployed under each Mysql real-time access service, so that when any Mysql real-time access service or service node is abnormal, tasks in the Mysql real-time access service can be automatically distributed to normal service nodes through load balancing, thereby effectively improving the stability of the Mysql real-time access service and avoiding unnecessary loss.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the 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 some embodiments of the present invention, and those skilled in the art can also obtain other drawings according to the drawings without creative efforts.
Fig. 1 is a schematic flowchart of a method for implementing a real-time access service system according to an embodiment of the present invention;
fig. 2 is a schematic structural diagram of an apparatus for implementing a real-time access service system according to an embodiment of the present invention;
fig. 3 is a schematic physical structure diagram of an electronic device according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of a real-time access service system according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, 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 some, but not all, embodiments of the present invention. All other embodiments obtained by persons of ordinary skill in the art based on the embodiments of the present invention without any creative efforts belong to the protection scope of the embodiments of the present invention.
The embodiment of the invention aims to solve the problems that single-point failure abnormity and poor stability easily occur in the prior art, and aims to improve the high availability of the real-time access of Mysql to the Kafka function, ensure the quick switching under the conditions of Mysql abnormity, service abnormity, sudden increase of service and the like, stop loss in time and ensure that the service function of the service is not influenced.
Specifically, a plurality of sets of mutually standby Mysql real-time access services are deployed under different business systems of the Mysql real-time access services, and a plurality of sets of mutually standby service nodes are further deployed under each Mysql real-time access service, so that when any Mysql real-time access service or service node is abnormal, tasks in the Mysql real-time access service can be automatically distributed to normal service nodes through load balancing, and therefore the stability of the Mysql real-time access services can be effectively improved, and unnecessary loss is avoided. Embodiments of the present invention will be described and illustrated with reference to various embodiments.
Fig. 1 is a schematic flowchart of a method for implementing a real-time access service system according to an embodiment of the present invention, and as shown in fig. 1, the method includes:
s101, according to service requirements and cluster types of Mysql real-time access services, a plurality of sets of Mysql real-time access services are deployed under different service systems, and a plurality of service nodes are respectively deployed under each Mysql real-time access service.
In this step, it can be understood that, in consideration of the problem of poor stability of the EPX when performing the Mysql real-time access service, according to the importance of the service of the Mysql real-time access service and the cluster type of the Mysql real-time access service, multiple sets of Mysql real-time access services are deployed simultaneously under different service systems of the Mysql real-time access service in the embodiment of the present invention. For example, for important services, a set of Mysql real-time access service is deployed under each service system, and for general services, the Mysql real-time access service is deployed under an individual service system. One of the service systems may be a service-related computer room. For the cluster type of Mysql real-time access service, due to business needs, a plurality of different business clusters are usually adopted on line at the same time, and data synchronization of the plurality of clusters needs to cross a data center, which causes large network consumption. In order to reduce delay, it is necessary to ensure that the EPX service, Mysql service, and user service are deployed to the same data center as much as possible.
That is to say, the Mysql database of the service may be in the service cluster a or the service cluster B, and the EPX-Mysql real-time access service of the embodiment of the present invention is responsible for accessing binlog generated by Mysql to the service in real time, and then pushing the service to the service party after processing according to a certain rule. Therefore, on one hand, because the cross-machine-room service data transmission delay is high, more network bandwidth can be occupied, and in order to ensure that the cross-machine-room delay is avoided to the maximum extent, the embodiment of the invention deploys the EPX service and the monitored Mysql database in the same machine room, that is, deploys the EPX service and the Mysql database in the same service cluster. On the other hand, at least 3 EPX service working nodes are respectively deployed in each machine room, that is, in the service cluster. Therefore, when the node in the service cluster is abnormal, dynamic load balancing switching is carried out through the zookeeper, and the service can still be used.
Similarly, for a set of Mysql real-time access services, the working node, i.e. the service node, also has a problem, which results in the unavailability of the service. Therefore, in the embodiment of the invention, a plurality of service nodes are respectively deployed under each set of Mysql real-time access service. Optionally, the number of service nodes deployed under each Mysql real-time access service is not less than 3.
S102, determining the distributed reliable coordination service, and constructing mutually standby service logics among service nodes of the Mysql real-time access service based on the distributed reliable coordination service so as to distribute tasks in any service node to other service nodes of any Mysql real-time access service when any service node of the Mysql real-time access service is abnormal.
In this step, it can be understood that after the Mysql real-time access service and the service node are deployed, a mutual backup relationship between them needs to be established, so that when any one of them is abnormal and unavailable, the service task of the abnormal point can be continuously completed by the remaining backup items. Specifically, the embodiment of the invention determines to adopt a distributed management mode to uniformly manage the deployed Mysql real-time access service and service nodes.
Therefore, firstly, a distributed reliable coordination service needs to be determined, and then, according to a management mechanism of the distributed reliable coordination service, a mutual standby service logic is constructed between service nodes of each Mysql real-time access service, where the service logic is used to implement: when any service node of any Mysql real-time access service is abnormal, tasks in the service node are distributed to other service nodes of the Mysql real-time access service.
The distributed reliable coordination service can be selected as a Zookeeper service realized based on a ZAB protocol or a distributed coordination service system Chubby realized based on a Paxos protocol. Chubby provides coarse-grained lock services, and the main functions are to realize synchronization among clusters and achieve consensus on the environment and resources of the whole system. Zookeeper is an open-source, scalable, high-throughput, distributed coordination system.
According to the method for realizing the real-time access service system, provided by the embodiment of the invention, a plurality of sets of mutually standby Mysql real-time access services are deployed under different service systems of the Mysql real-time access services, and a plurality of sets of mutually standby service nodes are further deployed under each Mysql real-time access service, so that when any Mysql real-time access service or service node is abnormal, tasks in the Mysql real-time access service can be automatically distributed to normal service nodes through load balancing, the Mysql real-time access service stability can be effectively improved, the influence of EPX stability on normal use of a user is eliminated, high reliability is achieved, Mysql change data is accessed into a big data service in real time, the power is supplied to a service party, and unnecessary loss is avoided.
Optionally, according to the foregoing embodiments, the step of constructing a mutually standby service logic between service nodes that access services in Mysql in real time specifically includes: recording node directories related to each service node by using the Zookeeper service, creating a temporary child node directory of any service node in the Zookeeper service after any service node is started, and enabling any service node to monitor the node directory in the Zookeeper service; if any service node is detected to be abnormal, enabling the Zookeeper service to destroy the temporary child node directory of any service node, and sending a Zookeeper notification to other service nodes, wherein the Zookeeper notification carries node information of any service node; and according to the zookeeper notification, distributing the task in any service node to the service node receiving the zookeeper notification.
It can be understood that, in the embodiment of the present invention, the node directory of the Zookeeper service may be monitored in real time, including modification of data stored in the directory and change of the child node directory, and once the node directory changes, the client that is configured with monitoring may be notified. When the embodiment of the invention constructs the mutual standby service logic among the service nodes, the service logic comprising the following processing procedures is constructed:
Firstly, a Zookeeper service is used for recording a node directory related to each service node, and the service node accessed in the Mysql real-time access service monitors a specified directory in the node directory. Specifically, the method comprises the steps of monitoring the starting condition of each service node in Mysql real-time access service, if any service node is detected to be started, creating a temporary child node directory of the service node in the Zookeeper service, and enabling the service node to monitor the node directory in the Zookeeper service.
And then, in the running process of Mysql real-time access service, monitoring the running condition of each service node, and if any service node is abnormal or even stops working due to failure, indicating the Zookeeper service to immediately destroy the temporary child node directory of the service node. At this time, other service nodes monitoring the node directory in the Zookeeper service will immediately receive a Zookeeper notification, where the Zookeeper notification carries node information of the abnormal service node, including, for example, a node number, a located Mysql real-time access service, specific abnormal information, and the like.
And finally, analyzing the node information of the abnormal service node according to the zookeeper notification, and distributing the service tasks of the abnormal service node to other service nodes receiving the zookeeper notification according to the analysis content. It is to be understood that the service nodes capable of receiving the zookeeper notification are generally service nodes in a normal working state, and tasks in the abnormal service nodes are distributed to the service nodes, so that normal availability of services can be ensured.
The embodiment of the invention uses a monitoring node mechanism of Zookeeper to realize load balance and automatic switching of abnormal conditions of Mysql real-time access service. Distributed management is carried out on the deployed multiple sets of Mysql real-time access services through the zookeeper service, when the Mysql real-time access services are down, other working nodes can immediately receive zookeeper notifications, tasks of abnormal working nodes can be distributed to normal working nodes, and the Mysql real-time access services are not affected when the services are down.
Optionally, according to the foregoing embodiments, the step of allocating the task in any service node to the service node that receives the zookeeper notification specifically includes: and according to the task in any service node, carrying out load balancing operation among the service nodes receiving the zookeeper notification, and according to the operation result, distributing the task in any service node to the service nodes receiving the zookeeper notification in a balanced manner.
It can be understood that, when the task of the abnormal service node is distributed to other service nodes which normally work, according to the task condition to be executed in the abnormal service node and the working conditions of other normal service nodes, the embodiment of the present invention performs load balancing operation on the task to be executed in the abnormal service node among the normal service nodes to obtain a theoretical load balancing result, that is, determines which normal service nodes continue to execute the tasks and the task content which each normal service node needs to be responsible for, thereby realizing load balancing of the task to be executed in the abnormal service node among other normal service nodes.
The embodiment of the invention can realize load balancing according to the magnitude of the accessed service nodes, and can automatically balance to other live servers when the machine is down.
Further, the method for implementing real-time access to the service system in the embodiment of the present invention further includes: based on the distributed reliable coordination service, mutually standby service logics are constructed among the Mysql real-time access services, so that when any Mysql real-time access service is abnormal, tasks in any Mysql real-time access service are distributed to Mysql real-time access services except any Mysql real-time access service.
It can be understood that, similar to the above-mentioned establishment of mutual standby service logic between different service nodes, the embodiment of the present invention may also establish mutual standby service logic between multiple sets of different Mysql real-time access services. Specifically, a distributed management mode is determined to be adopted to perform unified management on the deployed Mysql real-time access service. Firstly, a distributed reliable coordination service needs to be determined, and then, according to a management mechanism of the distributed reliable coordination service, a mutual standby service logic is constructed among various sets of Mysql real-time access services, and the service logic is used for realizing: when any Mysql real-time access service is abnormal, distributing the task in the Mysql real-time access service to other Mysql real-time access services except the Mysql real-time access service.
In addition, on the basis of the foregoing embodiments, the method for implementing real-time access to a service system according to an embodiment of the present invention further includes: and according to the service characteristics of Mysql real-time access service, setting an exception monitoring and alarming unit at least one of a thread task for analyzing the Binlog, a thread task for sending the kafka message and a thread task for synchronizing the Zookeeper site.
It can be understood that, in view of the problem that the service exception time length cannot be controlled because the service exception cannot be known only by contacting a service party after the service exception occurs due to the fact that the service exception cannot be found in time by the existing EPX, the embodiment of the present invention further sets an exception monitoring and alarm unit in the service system on the basis of the above embodiments.
Specifically, according to the service characteristics of the service, a set of monitoring and alarming unit is added for the Mysql real-time access service so as to monitor and alarm the abnormality of the Mysql real-time access service such as Binlog analysis, flow, delay, node survival, Kafka survival and the like. That is, the Mysql monitors the possible problem places in the service in real time, such as thread task of parsing Binlog, thread task of sending kafka message, thread task of synchronizing Zookeeper site, etc., to perform exception monitoring processing. Therefore, when the abnormity occurs, the abnormity situation can be timely sensed, the loss stopping recovery is timely processed according to the pre-customized processing and degrading scheme, the normal service is ensured, and the downstream service is not influenced.
The Mysql abnormal degradation scheme can be set as follows: EPX will monitor two Mysql nodes at the same time, wherein one node operates normally and one node is used as a standby node. When the running node of the Mysql monitored by the EPX has a problem, the EPX switches the task of the monitored Mysql from the node with the problem to a standby node, and the service is ensured to be normally available.
Based on the same inventive concept, the embodiments of the present invention provide an apparatus for implementing a real-time access service system according to the above embodiments, where the apparatus is used to implement the real-time access service system in the above embodiments. Therefore, the description and definition in the method for implementing the real-time access service system in the embodiments above may be used for understanding each execution module in the embodiments of the present invention, and reference may be specifically made to the embodiments above, which are not described herein again.
According to an embodiment of the present invention, a structure of an apparatus for implementing a real-time access service system is shown in fig. 2, which is a schematic structural diagram of an apparatus for implementing a real-time access service system provided in the embodiment of the present invention, and the apparatus may be used for implementing a real-time access service system in each of the above method embodiments, and the apparatus includes: a deployment module 201 and a build module 202. Wherein:
The deployment module 201 is used for deploying a plurality of sets of Mysql real-time access services under different service systems according to service requirements and cluster types of the Mysql real-time access services, and deploying a plurality of service nodes under each Mysql real-time access service respectively; the building module 202 is configured to determine a distributed reliable coordination service, and build mutually standby service logics among service nodes of Mysql real-time access services based on the distributed reliable coordination service, so that when any service node of any Mysql real-time access service is abnormal, a task in any service node is allocated to the rest service nodes of any Mysql real-time access service.
Specifically, the deployment module 201 deploys multiple sets of Mysql real-time access services simultaneously under different service systems of the Mysql real-time access service according to the importance of the service of the Mysql real-time access service and the cluster type of the Mysql real-time access service. Meanwhile, the deployment module 201 also deploys a plurality of service nodes under each set of Mysql real-time access service. Optionally, the number of service nodes deployed under each Mysql real-time access service is not less than 3.
Then, the building module 202 first determines a distributed reliable coordination service, and then builds a mutually standby service logic between service nodes of each Mysql real-time access service according to a management mechanism of the distributed reliable coordination service, where the service logic is used to implement: when any service node of any Mysql real-time access service is abnormal, tasks in the service node are distributed to other service nodes of the Mysql real-time access service. The distributed reliable coordination service may be selected as the Zookeeper service.
The device for realizing the real-time access service system provided by the embodiment of the invention is characterized in that a plurality of sets of mutually standby Mysql real-time access services are deployed under different business systems of the Mysql real-time access services by arranging the corresponding execution modules, and a plurality of sets of mutually standby service nodes are further deployed under each Mysql real-time access service, so that when any Mysql real-time access service or service node is abnormal, the tasks in the Mysql real-time access service can be automatically distributed to normal service nodes through load balancing, thereby effectively improving the stability of the Mysql real-time access service and avoiding unnecessary loss.
It is understood that, in the embodiment of the present invention, each relevant program module in the apparatus of each of the above embodiments may be implemented by a hardware processor (hardware processor). Moreover, the apparatus for implementing a real-time access service system according to the embodiments of the present invention can implement the process for implementing a real-time access service system according to the above-mentioned method embodiments by using the above-mentioned program modules, and when the apparatus is used for implementing a real-time access service system according to the above-mentioned method embodiments, the beneficial effects produced by the apparatus according to the embodiments of the present invention are the same as those of the corresponding above-mentioned method embodiments, and reference may be made to the above-mentioned method embodiments, and details are not described here again.
As a further aspect of the embodiments of the present invention, the present embodiment provides an electronic device according to the above embodiments, where the electronic device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and when the processor executes the computer program, the steps of the method for implementing a real-time access service system according to the above embodiments are implemented.
Further, the electronic device of the embodiment of the present invention may further include a communication interface and a bus. Referring to fig. 3, an entity structure diagram of an electronic device provided in an embodiment of the present invention includes: at least one memory 301, at least one processor 302, a communication interface 303, and a bus 304.
The memory 301, the processor 302 and the communication interface 303 complete mutual communication through the bus 304, and the communication interface 303 is used for information transmission between the electronic device and the Mysql real-time access service device; the memory 301 stores a computer program that can be executed on the processor 302, and the processor 302 executes the computer program to implement the steps of the method for implementing the real-time access service system according to the embodiments.
It is understood that the electronic device at least comprises a memory 301, a processor 302, a communication interface 303 and a bus 304, and the memory 301, the processor 302 and the communication interface 303 form a mutual communication connection through the bus 304, and can complete mutual communication, for example, the processor 302 reads program instructions and the like for implementing a method for accessing a service system in real time from the memory 301. In addition, the communication interface 303 may also implement communication connection between the electronic device and the Mysql real-time access service device, and may complete mutual information transmission, for example, implement reading of Mysql real-time access service information through the communication interface 303.
When the electronic device is running, the processor 302 calls the program instructions in the memory 301 to execute the methods provided by the above-mentioned method embodiments, including for example: according to the service requirements and cluster types of Mysql real-time access services, deploying a plurality of sets of Mysql real-time access services under different service systems, and respectively deploying a plurality of service nodes under each Mysql real-time access service; determining distributed reliable coordination service, and constructing mutual standby service logic among service nodes of Mysql real-time access service based on the distributed reliable coordination service, so that when any service node of any Mysql real-time access service is abnormal, tasks in any service node are distributed to other service nodes of any Mysql real-time access service, and the like.
The program instructions in the memory 301 may be implemented in the form of software functional units and stored in a computer readable storage medium when sold or used as a stand-alone product. Alternatively, all or part of the steps for implementing the method embodiments may be implemented by hardware related to program instructions, where the program may be stored in a computer-readable storage medium, and when executed, the program performs the steps including the method embodiments; and the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
Embodiments of the present invention further provide a non-transitory computer readable storage medium according to the above embodiments, on which computer instructions are stored, and when the computer instructions are executed by a computer, the computer instructions implement the steps of the method for implementing a real-time access service system according to the above embodiments, for example, the method includes: according to the service requirements and cluster types of Mysql real-time access services, deploying a plurality of sets of Mysql real-time access services under different service systems, and respectively deploying a plurality of service nodes under each Mysql real-time access service; determining distributed reliable coordination service, and constructing mutual standby service logic among service nodes of Mysql real-time access service based on the distributed reliable coordination service, so that when any service node of any Mysql real-time access service is abnormal, tasks in any service node are distributed to other service nodes of any Mysql real-time access service, and the like.
In the electronic device and the non-transitory computer readable storage medium provided by the embodiments of the present invention, by performing the steps of the method for implementing a real-time access service system described in each of the embodiments, a plurality of sets of mutually standby Mysql real-time access services are deployed under different service systems of the Mysql real-time access service, and further a plurality of sets of mutually standby service nodes are deployed under each Mysql real-time access service, so that when any Mysql real-time access service or service node is abnormal, a task in the Mysql real-time access service can be automatically allocated to a normal service node through load balancing, thereby effectively improving the stability of the Mysql real-time access service and avoiding unnecessary loss.
As another aspect of the embodiments of the present invention, the present embodiment provides a real-time access service system according to the foregoing embodiments, and as shown in fig. 4, an architecture diagram of the real-time access service system provided in the embodiments of the present invention includes: a plurality of sets of Mysql real-time access services deployed under different service systems of the Mysql real-time access service, a plurality of service nodes deployed under each Mysql real-time access service, service nodes between each Mysql real-time access service not shown in FIG. 4, and service nodes between Mysql real-time access services are mutually standby service logics.
The Mysql real-time access services and the service nodes are deployed according to the service requirements and the cluster types of the Mysql real-time access services, mutually standby service logics are established by determining distributed reliable coordination services and based on the distributed reliable coordination services, and tasks in any service node are distributed to the rest service nodes of any Mysql real-time access service when any service node of any Mysql real-time access service is abnormal, or tasks in any Mysql real-time access service are distributed to Mysql real-time access services except any Mysql real-time access service when any Mysql real-time access service is abnormal.
It can be understood that, as shown in fig. 4, in the real-time access service system according to the embodiment of the present invention, multiple sets of Mysql real-time access services are deployed in different service systems (in different machine rooms) of the Mysql real-time access service, and multiple service nodes are respectively deployed in each Mysql real-time access service. That is to say, because there is machine room rectification and maintenance, the network between machine rooms occasionally has jitter problem, and each Mysql service machine room is deployed with a set of Mysql real-time access service. In addition, each Mysql real-time access service working node sometimes has a problem, at least a plurality of nodes, such as 3 nodes, are arranged in each machine room, and when one node has a problem, the task of the node with the problem is automatically distributed to other surviving nodes, so that the real-time stability of the service is ensured.
Meanwhile, in order to realize Mysql real-time access service load balancing and automatic switching of abnormal conditions, the real-time access service system of the embodiment of the invention further comprises service logics for mutual standby between Mysql real-time access services and between service nodes under the Mysql real-time access services.
And each Mysql real-time access service and each service node are deployed in advance according to the service requirement and the cluster type of the Mysql real-time access service. And mutually standby service logics among Mysql real-time access services and among service nodes under the Mysql real-time access services are established by determining the distributed reliable coordination service and then based on the distributed reliable coordination service. For example, it may be constructed based on the Zookeeper service, the construction process including:
Recording node directories related to each service node by using the Zookeeper service, creating a temporary child node directory of any service node in the Zookeeper service after any service node is started, and simultaneously monitoring the node directory in the Zookeeper service by any service node;
if any service node is detected to be abnormal, enabling the Zookeeper service to destroy the temporary child node directory of any service node, and sending a Zookeeper notification to other service nodes, wherein the Zookeeper notification carries node information of any service node;
and according to the zookeeper notification, allocating the task in any service node to the service node receiving the zookeeper notification.
In the construction process of the mutually standby service logic, the step of allocating the task in any service node to the service node receiving the zookeeper notification specifically comprises the following steps: and according to the task in any service node, carrying out load balancing operation among the service nodes receiving the zookeeper notification, and according to the operation result, distributing the task in any service node to the service nodes receiving the zookeeper notification in a balanced manner.
And for the mutually standby service logic among the Mysql real-time access services, the mutually standby service logic is used for distributing the task in any Mysql real-time access service to Mysql real-time access services except any Mysql real-time access service when any Mysql real-time access service is abnormal. For the mutually standby service logic among the service nodes under the Mysql real-time access service, the mutually standby service logic is used for distributing the task in any service node to the rest service nodes of any Mysql real-time access service when any service node of any Mysql real-time access service is abnormal.
According to the real-time access service system provided by the embodiment of the invention, a plurality of sets of mutually standby Mysql real-time access services are deployed under different business systems of Mysql real-time access services, and a plurality of sets of mutually standby service nodes are further deployed under each Mysql real-time access service, so that when any Mysql real-time access service or service node is abnormal, tasks in the Mysql real-time access service can be automatically distributed to normal service nodes through load balancing, and thus the stability of Mysql real-time access services can be effectively improved, and unnecessary loss is avoided.
Further, as shown in fig. 4, the real-time access service system according to the embodiment of the present invention further includes an abnormal monitoring and warning unit. The abnormity monitoring and alarming unit is arranged at least one of a thread task for analyzing the Binlog, a thread task for sending the Kafka message and a thread task for synchronizing the Zookeeper locus, and is used for monitoring and alarming the abnormity of Binlog analysis, flow, delay, node survival, Kafka survival and the like of Mysql real-time access service.
In addition, considering that the existing EPX cannot realize load balancing dynamic expansion due to limited Mysql real-time access service capacity. As more and more services are accessed and the services do not support dynamic expansion, a service performance bottleneck is reached, and the services are not available. The embodiment of the invention can well solve the problem by adding Mysql real-time access service and service nodes.
It is to be understood that the above-described embodiments of the apparatus, the electronic device and the storage medium are merely illustrative, and that elements described as separate components may or may not be physically separate, may be located in one place, or may be distributed on different network elements. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware. Based on such understanding, the technical solutions mentioned above may be embodied in the form of a software product, which may be stored in a computer-readable storage medium, such as a usb disk, a removable hard disk, a ROM, a RAM, a magnetic or optical disk, etc., and includes several instructions for causing a computer device (such as a personal computer, a server, or a network device, etc.) to execute the methods described in the method embodiments or some parts of the method embodiments.
In addition, it should be understood by those skilled in the art that in the specification of the embodiments of the present invention, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in the process, method, article, or apparatus that comprises the element.
In the description of the embodiments of the invention, numerous specific details are set forth. It is understood, however, that embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures and techniques have not been shown in detail in order not to obscure an understanding of this description. Similarly, it should be appreciated that in the foregoing description of exemplary embodiments of the invention, various features of the embodiments of the invention are sometimes grouped together in a single embodiment, figure, or description thereof for the purpose of streamlining the disclosure and aiding in the understanding of one or more of the various inventive aspects.
Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the embodiments of the present invention, and not to limit the same; although embodiments of the present invention have been described in detail with reference to the foregoing embodiments, it should be understood by those skilled in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims (8)
1. A method for implementing a real-time access service system, comprising:
according to the service requirements and cluster types of Mysql real-time access services, deploying a plurality of sets of Mysql real-time access services under different service systems, and respectively deploying a plurality of service nodes under each Mysql real-time access service;
determining distributed reliable coordination service, and constructing mutually standby service logic between each service node of the Mysql real-time access service based on the distributed reliable coordination service, so as to distribute tasks in any service node to other service nodes of any Mysql real-time access service when any service node of the Mysql real-time access service is abnormal; wherein Mysql is a relational database management system; specifically determining a Zookeeper service as the distributed reliable coordination service; wherein, Zookeeper is a distributed coordination system; the step of constructing a mutually standby service logic between the service nodes of the Mysql real-time access service specifically includes:
Recording node directories related to each service node by using the Zookeeper service, creating a temporary child node directory of any service node in the Zookeeper service after any service node is started, and enabling any service node to monitor the node directories in the Zookeeper service;
if the abnormal condition of any service node is detected, enabling the Zookeeper service to destroy the temporary child node directory of any service node, and sending a Zookeeper notification to other service nodes, wherein the Zookeeper notification carries the node information of any service node;
and according to the zookeeper notification, distributing the task in any service node to the service node receiving the zookeeper notification.
2. The method for implementing a real-time access service system according to claim 1, further comprising:
based on the distributed reliable coordination service, mutually standby business logic is constructed among the Mysql real-time access services, so that when any Mysql real-time access service is abnormal, tasks in any Mysql real-time access service are distributed to Mysql real-time access services except any Mysql real-time access service.
3. The method for accessing the service system in real time according to claim 1, wherein the step of allocating the task in any service node to the service node that receives the zookeeper notification specifically includes:
and according to the task in any service node, carrying out load balancing operation among the service nodes receiving the zookeeper notification, and according to the operation result, distributing the task in any service node to the service nodes receiving the zookeeper notification in a balanced manner.
4. The method for implementing a real-time access service system according to claim 1, further comprising:
according to the service characteristics of Mysql real-time access service, an abnormal monitoring and alarming unit is arranged at least one of a thread task for analyzing the Binlog, a thread task for sending kafka information and a thread task for synchronizing the Zookeeper locus; wherein, the Binlog is a binary log file; kafka is a distributed publish-subscribe messaging system.
5. The method of claim 1, wherein the number of service nodes deployed under each Mysql real-time access service is not less than 3.
6. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the steps of the method for implementing a real-time access service system according to any one of claims 1 to 5 when executing the computer program.
7. A non-transitory computer readable storage medium having stored thereon computer instructions, wherein the computer instructions, when executed by a computer, implement the steps of the method of implementing a real-time access service system according to any one of claims 1 to 5.
8. A real-time access service system, comprising: the service logic comprises a plurality of sets of Mysql real-time access services deployed under different service systems of the Mysql real-time access services, a plurality of service nodes respectively deployed under each Mysql real-time access service and mutual standby service logic among the service nodes under the Mysql real-time access services;
the Mysql real-time access services and the service nodes are deployed according to service requirements and cluster types of the Mysql real-time access services, and the mutually standby service logic is constructed by determining distributed reliable coordination services and based on the distributed reliable coordination services and is used for distributing tasks in any service node to other service nodes of any Mysql real-time access service when any service node of any Mysql real-time access service is abnormal; wherein Mysql is a relational database management system; the Zookeeper service is used as the distributed reliable coordination service; wherein, Zookeeper is a distributed coordination system; constructing a mutually standby service logic between each service node of the Mysql real-time access service comprises the following steps: recording node directories related to each service node by using the Zookeeper service, creating a temporary child node directory of any service node in the Zookeeper service after any service node is started, and enabling any service node to monitor the node directory in the Zookeeper service; if any service node is detected to be abnormal, enabling the Zookeeper service to destroy the temporary child node directory of any service node, and sending a Zookeeper notification to other service nodes, wherein the Zookeeper notification carries node information of any service node; and according to the zookeeper notification, distributing the task in any service node to the service node receiving the zookeeper notification.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911199798.6A CN111092754B (en) | 2019-11-29 | 2019-11-29 | Real-time access service system and implementation method thereof |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911199798.6A CN111092754B (en) | 2019-11-29 | 2019-11-29 | Real-time access service system and implementation method thereof |
Publications (2)
Publication Number | Publication Date |
---|---|
CN111092754A CN111092754A (en) | 2020-05-01 |
CN111092754B true CN111092754B (en) | 2022-07-29 |
Family
ID=70393270
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201911199798.6A Active CN111092754B (en) | 2019-11-29 | 2019-11-29 | Real-time access service system and implementation method thereof |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111092754B (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111669327A (en) * | 2020-06-16 | 2020-09-15 | 珠海麦宁科技有限公司 | Service providing system, method, storage medium and service node |
CN112698992B (en) * | 2021-03-23 | 2021-06-25 | 腾讯科技(深圳)有限公司 | Disaster recovery management method and related device for cloud cluster |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102158540A (en) * | 2011-02-18 | 2011-08-17 | 广州从兴电子开发有限公司 | System and method for realizing distributed database |
CN105915405A (en) * | 2016-03-29 | 2016-08-31 | 深圳市中博科创信息技术有限公司 | Large-scale cluster node performance monitoring system |
CN106610871A (en) * | 2016-12-30 | 2017-05-03 | 郑州云海信息技术有限公司 | Cloud operating system architecture |
WO2018019023A1 (en) * | 2016-07-27 | 2018-02-01 | 腾讯科技(深圳)有限公司 | Data disaster recovery method, apparatus and system |
CN110247954A (en) * | 2019-05-15 | 2019-09-17 | 南京苏宁软件技术有限公司 | A kind of dispatching method and system of distributed task scheduling |
-
2019
- 2019-11-29 CN CN201911199798.6A patent/CN111092754B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102158540A (en) * | 2011-02-18 | 2011-08-17 | 广州从兴电子开发有限公司 | System and method for realizing distributed database |
CN105915405A (en) * | 2016-03-29 | 2016-08-31 | 深圳市中博科创信息技术有限公司 | Large-scale cluster node performance monitoring system |
WO2018019023A1 (en) * | 2016-07-27 | 2018-02-01 | 腾讯科技(深圳)有限公司 | Data disaster recovery method, apparatus and system |
CN106610871A (en) * | 2016-12-30 | 2017-05-03 | 郑州云海信息技术有限公司 | Cloud operating system architecture |
CN110247954A (en) * | 2019-05-15 | 2019-09-17 | 南京苏宁软件技术有限公司 | A kind of dispatching method and system of distributed task scheduling |
Also Published As
Publication number | Publication date |
---|---|
CN111092754A (en) | 2020-05-01 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US20220303234A1 (en) | Method and system for providing resiliency in interaction servicing across data centers | |
US10609159B2 (en) | Providing higher workload resiliency in clustered systems based on health heuristics | |
CN112671882B (en) | Same-city double-activity system and method based on micro-service | |
Bailis et al. | The network is reliable: An informal survey of real-world communications failures | |
TWI755417B (en) | Computing task allocation method, execution method of stream computing task, control server, stream computing center server cluster, stream computing system and remote multi-active system | |
CN103873279B (en) | Server management method and server management device | |
CN105450757A (en) | Service management method and system | |
CN111130835A (en) | Data center dual-active system, switching method, device, equipment and medium | |
CN104408071A (en) | Distributive database high-availability method and system based on cluster manager | |
CN105939389A (en) | Load balancing method and device | |
CN111092754B (en) | Real-time access service system and implementation method thereof | |
CN108984320A (en) | A kind of anti-fissure method and device of message queue cluster | |
CN106021070A (en) | Method and device for server cluster monitoring | |
CN112217847A (en) | Micro service platform, implementation method thereof, electronic device and storage medium | |
CN114900526B (en) | Load balancing method and system, computer storage medium and electronic equipment | |
CN112437145A (en) | Server cluster management method and device and related components | |
CN114338670B (en) | Edge cloud platform and network-connected traffic three-level cloud control platform with same | |
CN117492944A (en) | Task scheduling method and device, electronic equipment and readable storage medium | |
CN113326100B (en) | Cluster management method, device, equipment and computer storage medium | |
CN109474694A (en) | A kind of management-control method and device of the NAS cluster based on SAN storage array | |
US20170141950A1 (en) | Rescheduling a service on a node | |
CN113254245A (en) | Fault detection method and system for storage cluster | |
CN116302716A (en) | Cluster deployment method and device, electronic equipment and computer readable medium | |
CN116032932A (en) | Cluster management method, system, equipment and medium for edge server | |
CN114756396A (en) | Container service fault repairing method and device |
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 |