CN110334150A - Monitor method, monitor terminal and the system of master-slave database synchronizing relay - Google Patents
Monitor method, monitor terminal and the system of master-slave database synchronizing relay Download PDFInfo
- Publication number
- CN110334150A CN110334150A CN201910487706.8A CN201910487706A CN110334150A CN 110334150 A CN110334150 A CN 110334150A CN 201910487706 A CN201910487706 A CN 201910487706A CN 110334150 A CN110334150 A CN 110334150A
- Authority
- CN
- China
- Prior art keywords
- master
- field
- monitor terminal
- time
- value
- 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
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/30—Monitoring
- G06F11/3003—Monitoring arrangements specially adapted to the computing system or computing system component being monitored
- G06F11/3034—Monitoring arrangements specially adapted to the computing system or computing system component being monitored where the computing system component is a storage system, e.g. DASD based or network based
-
- 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/23—Updating
- G06F16/2365—Ensuring data consistency and integrity
-
- 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
- G06F16/273—Asynchronous replication or reconciliation
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- Databases & Information Systems (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Computing Systems (AREA)
- Data Mining & Analysis (AREA)
- Computer Security & Cryptography (AREA)
- Mathematical Physics (AREA)
- Quality & Reliability (AREA)
- Telephonic Communication Services (AREA)
Abstract
This application involves database synchronization fields, a kind of method for monitoring master-slave database synchronizing relay are provided, this method comprises: the time field in master library monitoring table is updated to present system time according to prefixed time interval;Determine that corresponding present system time is S1 when ID value is i in master library monitoring table;Inquire from library monitoring period table id value be i when corresponding field field value S2;According to the value of S1 and S2, primary database and the delay duration between database are calculated;Judge whether to need to generate warning information according to delay duration.Implement this method can accurate measurements master-slave database part data synchronizing relay.
Description
Technical field
This application involves database synchronization field more particularly to a kind of methods for monitoring master-slave database synchronizing relay, prison
Control terminal and system.
Background technique
Nowadays the database of large-scale website is usually principal and subordinate's configuration of mysql, read and write abruption is realized, to mitigate database pressure
Power.When realizing data base read-write separation, judge that master library is mainly used for write operation by service logic, from library for reading behaviour
Make, guarantees the consistency of data between principal and subordinate library by the duplication of principal and subordinate's data.But leader follower replication needs the regular hour, therefore deposits
The master-slave database synchronizing relay the problem of.
In the prior art, mysql included monitoring is based on the time point for having read master library binlog position position
The time difference is done with the time point on the position position for having executed binlog on master library from library, it can not accurately be anti-
The true gap for answering principal and subordinate to be delayed.The case where such as encountering big affairs, execution time itself and transmission time cannot be calculated in master
Out of delay time, thus create a deceitful impression synchronize it is no-delay, Seconds_Behind_Maste be 0 the phenomenon that.
Summary of the invention
The embodiment of the present application provides a kind of method, monitor terminal and system for monitoring master-slave database synchronizing relay, can
With the data synchronizing relay of accurate measurements master-slave database part.
In a first aspect, the embodiment of the present application provides a kind of method for monitoring master-slave database synchronizing relay, the method
Applied to master-slave database synchronization system, the system comprises a master libraries, one or more from library, time server and monitoring
Terminal, which comprises the time field in master library monitoring table is updated to by the monitor terminal according to prefixed time interval
Present system time;Wherein, the master library monitoring table includes N number of id field and the corresponding current system of each id field
Time field, N are nonnegative number;Determine that corresponding present system time is S1 when ID value is i in the master library monitoring table;Wherein,
The i is 0 any one integer into N-1;Inquire from library monitoring period table id value be i when corresponding field field value S2;
According to the value of S1 and S2, the primary database and the delay duration between database are calculated;When according to the delay
Length judges whether to need to generate warning information.
Implement the embodiment of the present application, can accurately judge the data synchronizing relay between mysql master-slave database.Pass through
Keep mysql master-slave database server all synchronous using unified time server, it is ensured that system time is unified, root
The latency issue between mysql master-slave database is more intuitively shown according to the judgement of system time.
In one possible implementation, the monitor terminal according to prefixed time interval by master library monitor table in when
Between field be updated to before present system time S1, the method also includes: the monitor terminal creates the master library and monitors table.
It is described to be judged whether to need to issue alarm letter according to the delay duration in the implementation of another possibility
If breath includes: that the delay duration is more than preset threshold, the warning information is issued.
In the implementation of another possibility, the delay duration is 60 seconds.
In the implementation of another possibility, the prefixed time interval is 1 second.
Second aspect, the embodiment of the present application provide a kind of monitor terminal, and the monitor terminal is same for master-slave database
Step system, the system comprises a master libraries, one or more from library, time server and the monitor terminal, the monitoring
Terminal includes: updating unit, for the time field in master library monitoring table to be updated to current system according to prefixed time interval
Time;Wherein, the master library monitoring table includes N number of id field and the corresponding present system time field of each id field,
N is nonnegative number;Determination unit, corresponding present system time is S1 when for determining that ID value is i in the master library monitoring table;Its
In, the i is 0 any one integer into N-1;Query unit corresponds to when i for inquiry from library monitoring period table id value
The field value S2 of field;Computing unit calculates the primary database and it from database for the value according to S1 and S2
Between delay duration;Judging unit, for judging whether to need to generate warning information according to the delay duration.
Implement the embodiment of the present application, can accurately judge the data synchronizing relay between mysql master-slave database.Pass through
Keep mysql master-slave database server all synchronous using unified time server, it is ensured that system time is unified, root
The latency issue between mysql master-slave database is more intuitively shown according to the judgement of system time.
In one possible implementation, the monitor terminal further include: creating unit, in the updating unit
Before the time field in master library monitoring table is updated to present system time according to prefixed time interval, the master library prison is created
Control table.
In the implementation of another possibility, the judging unit is specifically used for: if the delay duration is more than pre-
If threshold value, then the warning information is issued.
In the implementation of another possibility, the delay duration is 60 seconds.
In the implementation of another possibility, the time interval is 1 second.
The third aspect, the embodiment of the present application provide a kind of master-slave database synchronization system, and the master-slave database is synchronous
System includes a master library, one or more from library, time server and the monitor terminal;Wherein, the monitor terminal is
The monitor terminal that any one implementation of the embodiment of the present application second aspect or second aspect provides.
Fourth aspect, the embodiment of the present application provide another monitor terminal, the monitor terminal may include memory,
Processor;Wherein:
Memory is for storing computer program instructions;
Processor is for calling the computer program instructions, so that the monitor terminal executes the embodiment of the present application first
The method for the monitoring master-slave database synchronizing relay that any one of aspect or first aspect implementation provide.
5th aspect, the embodiment of the present application provides a kind of computer program product, when the computer program product exists
When being run in monitoring device, so that the monitoring device executes any one of the embodiment of the present application first aspect or first aspect
The method for the monitoring master-slave database synchronizing relay that implementation provides.
6th aspect, the embodiment of the present application provide a kind of computer readable storage medium, including instruction, work as described instruction
When being run in monitoring device, so that the monitoring device executes any one of the embodiment of the present application first aspect or first aspect
The method for the monitoring master-slave database synchronizing relay that kind implementation provides.
Detailed description of the invention
Fig. 1 is the network architecture diagram of master-slave database synchronization system provided by the embodiments of the present application;
Fig. 2 is the method flow diagram of monitoring master-slave database synchronizing relay provided by the embodiments of the present application;
Fig. 3 is that master library provided by the embodiments of the present application monitoring indicates to be intended to;
Fig. 4 is the method flow diagram for the monitoring master-slave database synchronizing relay that another embodiment of the application provides;
Fig. 5 is monitor terminal structural schematic diagram provided by the embodiments of the present application;
Fig. 6 is the monitor terminal structural schematic diagram that another embodiment of the application provides.
Specific embodiment
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, complete
Site preparation description, it is clear that the described embodiment is only a part of the embodiment of the present invention, instead of all the embodiments.Based on this
Embodiment in invention, every other reality obtained by those of ordinary skill in the art without making creative efforts
Example is applied, shall fall within the protection scope of the present invention.
Description and claims of this specification and term " first " in above-mentioned attached drawing, " second ", " third " etc. are
For distinguishing different objects, it is not use to describe a particular order.In addition, term " includes " and " having " and their any changes
Shape, it is intended that cover and non-exclusive include.Such as contain the process, method of a series of steps or units, system, product or
Equipment is not limited to listed step or unit, but optionally further comprising the step of not listing or unit or optional
Ground further includes other step or units intrinsic for these process, methods, product or equipment.
Firstly, introducing master-slave database synchronizing relay system provided by the embodiments of the present application in conjunction with Fig. 1.
As shown in Figure 1, master-slave database synchronizing relay system 10 may include: a 100 (following embodiment of primary database
Middle abbreviation master library), it is one or more from database 200 (referred to as from library in following embodiment), monitor terminal 300 and time clothes
Business device 400.Wherein, master library 100 and from library 200 can be server, specifically can be, but not limited to be application server, monitoring eventually
End is also possible to server.Master library 100 can be connect with one or more from library 200, and master library 100 can be used for writing data, from
Library 200 can be used for reading the input in master library 100.Monitor terminal 300 can be connect with master library 100 and from library 200, for supervising
Controlling master library 100 can be from the data synchronization delayed time between library 200.Time server 400 can be connect with master library 100 and from library 200,
For make master library 100 with from library 200 all using unified time server it is synchronous, it is ensured that system time be it is unified, from
And judge that master library 100 can be from the data synchronizing relay between library 200 according to system time.
Next monitoring provided by the embodiments of the present application is introduced in conjunction with Fig. 1 master-slave database synchronizing relay system 10 provided
The method of master-slave database synchronization delayed time, this method can be executed by monitor terminal.
As shown in Fig. 2, the method for monitoring master-slave database synchronization delayed time at least may include following steps:
S201: the time field in master library monitoring table is updated to present system time according to prefixed time interval.
Wherein, master library monitoring table includes N number of id field and the corresponding present system time field of each id field, and N is non-
Negative.
Specifically, the value of N can be, but not limited to be 60.When N is 60, master control monitors table can be as shown in Figure 3.It can from Fig. 3
To find out, the value of ID successively can get 59 from 0.Check_time field is the system time that time server 400 provides.System
The seconds value of system time is ID value.
Specifically, above-mentioned prefixed time interval can be, but not limited to be 1 second.2 seconds, 5 seconds etc..
S202: determine that corresponding present system time is S1 when ID value is i in master library monitoring table.
Wherein, the i is 0 any one integer into N-1.
For example, if i=6, S1=2019-04-17 17:29:06.
S203: inquire from library monitoring period table id value be i when corresponding field field value S2.
Specifically, the data of master library 100 can be read from library 200.The ID in master library monitoring table can be read from library 200
As the value of the check_time field from the monitoring period table of library at the time of being worth, and the ID value will be read.For example, reading ID value is
It is 2019-04-17 17:29:35 at the time of 6, then from the monitoring period table of library when ID=6, the field value S2=of corresponding field
2019-04-17 17:29:35。
Specifically, the value of S2 can be switched into timestamp, be temporarily stored in the memory of monitor terminal 30.
S204: according to the value of S1 and S2, primary database is calculated and from the delay duration between database.
Specifically, if when ID=6, S1=2019-04-17 17:29:06, S2=2019-04-17 17:29:35.Then lead
Database and from delay duration Δ s=S2-S1=29 seconds between database.
S205: judge whether to need to generate warning information according to delay duration.
Specifically, the sending method of above-mentioned warning information can be arranged on monitor terminal 30 by monitoring personnel.Specifically
Sending method can be, but not limited to be short message, mail, phone etc..
For example, the sending method that warning information can be arranged in monitoring personnel on monitor terminal 30 is short message, and filling in can
Receive the number of short message.Then after monitor terminal 30 is judged to need to produce warning information according to delay duration, alarm letter is generated
Breath, and the warning information is sent to the number that monitoring personnel is pre-filled with.So as to monitoring personnel find in time primary database with
From the data synchronizing relay duration between database.
The data synchronizing relay between mysql master-slave database can accurately be judged by implementing the embodiment of the present application.Pass through
Keep mysql master-slave database server all synchronous using unified time server, it is ensured that system time is unified, root
The latency issue between mysql master-slave database is more intuitively shown according to the judgement of system time.In addition, by updating master library
Time field success or not in monitoring table may determine that whether master library can be used, and play the work of real-time monitoring master library available mode
With convenient for the available implementations of monitor terminal analysis mysql database.
The embodiment of the present application also provides a kind of specific method of monitoring master-slave database synchronization delayed time, this method can be with
It is executed by monitor terminal.
As shown in figure 4, the method for monitoring master-slave database synchronization delayed time at least may include following steps:
S401: creation master library monitors table.
Specifically, master library monitoring table includes N number of id field and the corresponding present system time field of each id field, N are
Nonnegative number.
Specifically, it after creation master library monitoring table, fills in each id field in master library monitoring table and the id field is corresponding
Check_time field.Wherein, check_time field is the system time that time server 400 provides.System time
Seconds value is ID value.
S402: the time field in master library monitoring table is updated to present system time according to prefixed time interval.
Specifically, the value of N can be, but not limited to be 60.When N is 60, master control monitors table can be as shown in Figure 3.It can from Fig. 3
To find out, the value of ID successively can get 59 from 0.Check_time field is the system time that time server 400 provides.System
The seconds value of system time is ID value.
Specifically, above-mentioned prefixed time interval can be, but not limited to be 1 second.2 seconds, 5 seconds etc..
S403: determine that corresponding present system time is S1 when ID value is i in master library monitoring table.
Wherein, the i is 0 any one integer into N-1.
For example, if i=6, S1=2019-04-17 17:29:06.
S404: inquire from library monitoring period table id value be i when corresponding field field value S2.
Specifically, the data of master library 100 can be read from library 200.The ID in master library monitoring table can be read from library 200
As the value of the check_time field from the monitoring period table of library at the time of being worth, and the ID value will be read.For example, reading ID value is
It is 2019-04-17 17:29:35 at the time of 6, then from the monitoring period table of library when ID=6, the field value S2=of corresponding field
2019-04-17 17:29:35。
S405: according to the value of S1 and S2, primary database is calculated and from the delay duration between database.
Specifically, if when ID=6, S1=2019-04-17 17:29:06, S2=2019-04-17 17:29:35.Then lead
Database and from delay duration Δ s=S2-S1=29 seconds between database.
S406: if delay duration is more than preset threshold, the warning information is issued.
Specifically, above-mentioned preset threshold can be, but not limited to be 30 seconds, 45 seconds, 60 seconds, 90 seconds etc..
It is assumed that above-mentioned preset threshold is 60 seconds, then when the value of above-mentioned Δ s is greater than 60 seconds, monitor terminal 30 can be issued
Warning information.
Specifically, the sending method of above-mentioned warning information can be arranged on monitor terminal 30 by monitoring personnel.Specifically
Sending method can be, but not limited to be short message, mail, phone etc..
For example, the sending method that warning information can be arranged in monitoring personnel on monitor terminal 30 is short message, and filling in can
Receive the number of short message.Then after monitor terminal 30 is judged to need to produce warning information according to delay duration, alarm letter is generated
Breath, and the warning information is sent to the number that monitoring personnel is pre-filled with.So as to monitoring personnel find in time primary database with
From the data synchronizing relay duration between database.
The data synchronizing relay between mysql master-slave database can accurately be judged by implementing the embodiment of the present application.Pass through
Keep mysql master-slave database server all synchronous using unified time server, it is ensured that system time is unified, root
The latency issue between mysql master-slave database is more intuitively shown according to the judgement of system time.In addition, by updating master library
Time field success or not in monitoring table may determine that whether master library can be used, and play the work of real-time monitoring master library available mode
With convenient for the available implementations of monitor terminal analysis mysql database.
The method of monitoring master-slave database synchronization delayed time provided by the embodiments of the present application, the application are real in order to better understand
It applies example and additionally provides a kind of monitor terminal.
As shown in figure 5, monitor terminal 50 may include: updating unit 510, determination unit 520, query unit 530, calculate
Unit 540 and judging unit 550.Wherein:
Updating unit 510 is currently for being updated to the time field in master library monitoring table according to prefixed time interval
It unites the time.
Wherein, master library monitoring table includes N number of id field and the corresponding present system time field of each id field, and N is non-
Negative.
Specifically, the value of N can be, but not limited to be 60.When N is 60, master control monitors table can be as shown in Figure 3.It can from Fig. 3
To find out, the value of ID successively can get 59 from 0.Check_time field is the system time that time server 400 provides.System
The seconds value of system time is ID value.
Specifically, above-mentioned prefixed time interval can be, but not limited to be 1 second.2 seconds, 5 seconds etc..
Determination unit 520, corresponding present system time is S1 when for determining that ID value is i in the master library monitoring table.
Wherein, the i is 0 any one integer into N-1.
For example, if i=6, S1=2019-04-17 17:29:06.
Query unit 530, for inquire from library monitoring period table id value be i when corresponding field field value S2.
Specifically, the data of master library 100 can be read from library 200.The ID in master library monitoring table can be read from library 200
As the value of the check_time field from the monitoring period table of library at the time of being worth, and the ID value will be read.For example, reading ID value is
It is 2019-04-17 17:29:35 at the time of 6, then from the monitoring period table of library when ID=6, the field value S2=of corresponding field
2019-04-17 17:29:35。
Specifically, the value of S2 can be switched into timestamp, be temporarily stored in the memory of monitor terminal 30.
Computing unit 540 calculates the primary database and described between database for the value according to S1 and S2
Delay duration.
Specifically, if when ID=6, S1=2019-04-17 17:29:06, S2=2019-04-17 17:29:35.Then lead
Database and from delay duration Δ s=S2-S1=29 seconds between database.
Judging unit 550, for judging whether to need to generate warning information according to the delay duration.
Specifically, the sending method of above-mentioned warning information can be arranged on monitor terminal 30 by monitoring personnel.Specifically
Sending method can be, but not limited to be short message, mail, phone etc..
For example, the sending method that warning information can be arranged in monitoring personnel on monitor terminal 30 is short message, and filling in can
Receive the number of short message.Then after monitor terminal 30 is judged to need to produce warning information according to delay duration, alarm letter is generated
Breath, and the warning information is sent to the number that monitoring personnel is pre-filled with.So as to monitoring personnel find in time primary database with
From the data synchronizing relay duration between database.
In some embodiments, monitor terminal 50 can also include creating unit, for the updating unit 510 according to
Before time field in master library monitoring table is updated to present system time by prefixed time interval, the master library monitoring is created
Table.
In some embodiments, judging unit 30 is specifically used for: if the delay duration is more than preset threshold, issuing institute
State warning information.
Specifically, above-mentioned preset threshold can be, but not limited to be 30 seconds, 45 seconds, 60 seconds, 90 seconds etc..
It is assumed that above-mentioned preset threshold is 60 seconds, then when the value of above-mentioned Δ s is greater than 60 seconds, monitor terminal 30 can be issued
Warning information.
The data synchronizing relay between mysql master-slave database can accurately be judged by implementing the embodiment of the present application.Pass through
Keep mysql master-slave database server all synchronous using unified time server, it is ensured that system time is unified, root
The latency issue between mysql master-slave database is more intuitively shown according to the judgement of system time.In addition, by updating master library
Time field success or not in monitoring table may determine that whether master library can be used, and play the work of real-time monitoring master library available mode
With convenient for the available implementations of monitor terminal analysis mysql database.
The embodiment of the present application also provides another monitor terminals.As shown in fig. 6, monitor terminal 60 may include: to
A few processor 601, such as CPU, at least one network interface 604, user interface 603, memory 605, at least one is logical
Believe that bus 602 can also include optionally display screen 606.Wherein, communication bus 602 is for realizing the company between these components
Connect letter.Wherein, user interface 603 may include touch screen, keyboard or mouse etc..Network interface 604 optionally can wrap
Standard wireline interface and wireless interface (such as WI-FI interface) is included, communication link can be established with server by network interface 604
It connects.Memory 605 can be high speed RAM memory, be also possible to non-labile memory (non-volatile
Memory), a for example, at least magnetic disk storage, memory 605 include the flash in the embodiment of the present invention.Memory 605 can
Choosing can also be that at least one is located remotely from the storage system of aforementioned processor 601.As shown in fig. 6, as a kind of computer
It may include operating system, network communication module, Subscriber Interface Module SIM and program instruction in the memory 605 of storage medium.
It should be noted that network interface 604 can connect receiver, transmitter or other communication modules, other communications
Module can include but is not limited to WiFi module, bluetooth module etc., it will be understood that image processing apparatus in the embodiment of the present invention
It may include receiver, transmitter and other communication modules etc..
Processor 601 can be used for calling the program instruction stored in memory 605, and it is following to execute monitor terminal 60
Operation:
The time field in master library monitoring table is updated to present system time according to prefixed time interval;Wherein, described
Master library monitoring table includes N number of id field and the corresponding present system time field of each id field, and N is nonnegative number;
Determine that corresponding present system time is S1 when ID value is i in the master library monitoring table;Wherein, the i is 0 to N-
Any one integer in 1;
Inquire from library monitoring period table id value be i when corresponding field field value S2;
According to the value of S1 and S2, the primary database and the delay duration between database are calculated;
Judge whether to need to generate warning information according to the delay duration.
In some embodiments, master library is monitored the time field in table according to prefixed time interval and updated by monitor terminal 60
Before present system time S1, also executes: creating the master library monitoring table.
In some embodiments, monitor terminal 60 judges whether to need to issue warning information packet according to the delay duration
It includes: if the delay duration is more than preset threshold, issuing the warning information.
In some embodiments, the delay duration is 60 seconds.
In some embodiments, the prefixed time interval is 1 second.
The data synchronizing relay between mysql master-slave database can accurately be judged by implementing the embodiment of the present application.Pass through
Keep mysql master-slave database server all synchronous using unified time server, it is ensured that system time is unified, root
The latency issue between mysql master-slave database is more intuitively shown according to the judgement of system time.In addition, by updating master library
Time field success or not in monitoring table may determine that whether master library can be used, and play the work of real-time monitoring master library available mode
With convenient for the available implementations of monitor terminal analysis mysql database.
Those of ordinary skill in the art will appreciate that realizing all or part of the process in above-described embodiment method, being can be with
Relevant hardware is instructed to complete by computer program, the program can be stored in a computer-readable storage medium
In, the program is when being executed, it may include such as the process of the embodiment of above-mentioned each method.Wherein, the storage medium can be magnetic
Dish, CD, read-only memory (Read-Only Memory, ROM) or random access memory (Random Access
Memory, RAM) etc..
The steps in the embodiment of the present invention can be sequentially adjusted, merged and deleted according to actual needs.
Module in the device of that embodiment of the invention can be combined, divided and deleted according to actual needs.
The above, the above embodiments are merely illustrative of the technical solutions of the present invention, rather than its limitations;Although referring to before
Stating embodiment, invention is explained in detail, those skilled in the art should understand that: it still can be to preceding
Technical solution documented by each embodiment is stated to modify or equivalent replacement of some of the technical features;And these
It modifies or replaces, the range for technical solution of various embodiments of the present invention that it does not separate the essence of the corresponding technical solution.
Claims (10)
1. a kind of method for monitoring master-slave database synchronizing relay, which is characterized in that it is same that the method is applied to master-slave database
Step system, the system comprises a master libraries, one or more from library, time server and monitor terminal, which comprises
Time field in master library monitoring table is updated to present system time according to prefixed time interval by the monitor terminal;Its
In, the master library monitoring table includes N number of id field and the corresponding present system time field of each id field, and N is non-negative
Number;
Determine that corresponding present system time is S1 when ID value is i in the master library monitoring table;Wherein, the i is 0 into N-1
Any one integer;
Inquire from library monitoring period table id value be i when corresponding field field value S2;
According to the value of S1 and S2, the primary database and the delay duration between database are calculated;
Judge whether to need to generate warning information according to the delay duration.
2. the method as described in claim 1, which is characterized in that the monitor terminal monitors master library according to prefixed time interval
Time field in table is updated to before present system time S1, the method also includes: the monitor terminal creates the master
Library monitors table.
3. method according to claim 1 or 2, which is characterized in that described to judge whether to need to send out according to the delay duration
If it is more than preset threshold that warning information, which includes: the delay duration, out, the warning information is issued.
4. method as claimed in claim 3, which is characterized in that the delay duration is 60 seconds.
5. method according to any of claims 1-4, which is characterized in that the prefixed time interval is 1 second.
6. a kind of monitor terminal, which is characterized in that the monitor terminal is used for master-slave database synchronization system, the system comprises
From library, time server and the monitor terminal, the monitor terminal includes: for one master library, one or more
Updating unit, for the time field in master library monitoring table to be updated to present system time according to prefixed time interval;
Wherein, the master library monitoring table includes N number of id field and the corresponding present system time field of each id field, and N is non-
Negative;
Determination unit, corresponding present system time is S1 when for determining that ID value is i in the master library monitoring table;Wherein, institute
Stating i is 0 any one integer into N-1;
Query unit, for inquire from library monitoring period table id value be i when corresponding field field value S2;
Computing unit, for the value according to S1 and S2, when calculating the primary database and the delay between database
It is long;
Judging unit, for judging whether to need to generate warning information according to the delay duration.
7. monitor terminal as claimed in claim 6, which is characterized in that the monitor terminal further include: creating unit is used for
Before time field in master library monitoring table is updated to present system time according to prefixed time interval by the updating unit, wound
Build the master library monitoring table.
8. monitor terminal as claimed in claims 6 or 7, which is characterized in that the judging unit is specifically used for: if the delay
Duration is more than preset threshold, then issues the warning information.
9. monitor terminal as claimed in claim 8, which is characterized in that the delay duration is 60 seconds.
10. monitor terminal as claim in any one of claims 6-9, which is characterized in that the time interval is 1 second.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910487706.8A CN110334150A (en) | 2019-06-05 | 2019-06-05 | Monitor method, monitor terminal and the system of master-slave database synchronizing relay |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910487706.8A CN110334150A (en) | 2019-06-05 | 2019-06-05 | Monitor method, monitor terminal and the system of master-slave database synchronizing relay |
Publications (1)
Publication Number | Publication Date |
---|---|
CN110334150A true CN110334150A (en) | 2019-10-15 |
Family
ID=68140758
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910487706.8A Pending CN110334150A (en) | 2019-06-05 | 2019-06-05 | Monitor method, monitor terminal and the system of master-slave database synchronizing relay |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110334150A (en) |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110430091A (en) * | 2019-07-09 | 2019-11-08 | 上海易点时空网络有限公司 | Suitable for the principal and subordinate's time delay monitoring method and device of redis, storage medium |
CN111506560A (en) * | 2020-04-22 | 2020-08-07 | 北京次元引擎科技有限公司 | Database master-slave switching method, terminal and storage medium |
CN111581238A (en) * | 2020-04-01 | 2020-08-25 | 北京奇艺世纪科技有限公司 | Information query method and device, electronic equipment and computer readable storage medium |
CN113760872A (en) * | 2020-09-02 | 2021-12-07 | 北京沃东天骏信息技术有限公司 | Database monitoring method and device and computer readable storage medium |
CN113836160A (en) * | 2021-09-28 | 2021-12-24 | 上海市大数据股份有限公司 | Data flow state monitoring and warning system based on master-slave synchronization |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103019875A (en) * | 2012-12-19 | 2013-04-03 | 北京世纪家天下科技发展有限公司 | Method and device for realizing double main reconstruction of database |
CN103365873A (en) * | 2012-03-28 | 2013-10-23 | 阿里巴巴集团控股有限公司 | Push method and device for business data |
CN106453297A (en) * | 2016-09-30 | 2017-02-22 | 努比亚技术有限公司 | Master and slave time delay detection method, device and system |
CN109241165A (en) * | 2018-08-30 | 2019-01-18 | 联动优势科技有限公司 | A kind of the determination method, apparatus and equipment of database synchronization delay |
-
2019
- 2019-06-05 CN CN201910487706.8A patent/CN110334150A/en active Pending
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103365873A (en) * | 2012-03-28 | 2013-10-23 | 阿里巴巴集团控股有限公司 | Push method and device for business data |
CN103019875A (en) * | 2012-12-19 | 2013-04-03 | 北京世纪家天下科技发展有限公司 | Method and device for realizing double main reconstruction of database |
CN106453297A (en) * | 2016-09-30 | 2017-02-22 | 努比亚技术有限公司 | Master and slave time delay detection method, device and system |
CN109241165A (en) * | 2018-08-30 | 2019-01-18 | 联动优势科技有限公司 | A kind of the determination method, apparatus and equipment of database synchronization delay |
Cited By (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110430091A (en) * | 2019-07-09 | 2019-11-08 | 上海易点时空网络有限公司 | Suitable for the principal and subordinate's time delay monitoring method and device of redis, storage medium |
CN111581238A (en) * | 2020-04-01 | 2020-08-25 | 北京奇艺世纪科技有限公司 | Information query method and device, electronic equipment and computer readable storage medium |
CN111581238B (en) * | 2020-04-01 | 2023-10-24 | 北京奇艺世纪科技有限公司 | Information query method and device, electronic equipment and computer readable storage medium |
CN111506560A (en) * | 2020-04-22 | 2020-08-07 | 北京次元引擎科技有限公司 | Database master-slave switching method, terminal and storage medium |
CN113760872A (en) * | 2020-09-02 | 2021-12-07 | 北京沃东天骏信息技术有限公司 | Database monitoring method and device and computer readable storage medium |
CN113836160A (en) * | 2021-09-28 | 2021-12-24 | 上海市大数据股份有限公司 | Data flow state monitoring and warning system based on master-slave synchronization |
CN113836160B (en) * | 2021-09-28 | 2024-01-23 | 上海市大数据股份有限公司 | Data stream state monitoring alarm system based on master-slave synchronization |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110334150A (en) | Monitor method, monitor terminal and the system of master-slave database synchronizing relay | |
CN111181801B (en) | Node cluster testing method and device, electronic equipment and storage medium | |
CN105338078B (en) | Date storage method and device for storage system | |
CN108469989A (en) | A kind of reaction type based on clustering performance scalable appearance method and system automatically | |
CN107908469B (en) | Task scheduling method and system | |
CN113037545A (en) | Network simulation method, device, equipment and storage medium | |
CN109783573A (en) | The method of data synchronization and terminal of multichannel push | |
CN115357662A (en) | Data synchronization method, device and medium | |
CN110445667B (en) | Link delay detection method, device, storage medium and terminal | |
CN113742174B (en) | Cloud mobile phone application monitoring method and device, electronic equipment and storage medium | |
CN110022323A (en) | A kind of method and system of the cross-terminal real-time, interactive based on WebSocket and Redux | |
CN109800124A (en) | CPU usage monitoring method, device, electronic equipment and storage medium | |
CN110430091A (en) | Suitable for the principal and subordinate's time delay monitoring method and device of redis, storage medium | |
CN110245120A (en) | The daily record data processing method of streaming computing system and streaming computing system | |
CN114553970A (en) | Distributed message processing method based on Kafka and data bus system | |
CN114827967A (en) | Software updating method, Bluetooth device and storage medium | |
CN115391158A (en) | Time delay determination method, system and device and electronic equipment | |
CN113220554A (en) | Method and apparatus for detecting performance of program code | |
CN113973060A (en) | Internet of things simulation method, device and system and storage medium | |
CN109284158A (en) | Long-range drag operation contents synchronization system, method, equipment and storage medium | |
CN116743617B (en) | Method, computing device, and storage medium for network testing | |
CN114970479B (en) | Chart generation method and device | |
CN117349384B (en) | Database synchronization method, system and equipment | |
CN116662276B (en) | Data processing method, device, electronic equipment and storage medium | |
CN117113942B (en) | Model synchronization method and device, electronic equipment and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20191015 |