CN104765798A - System and method for achieving Mysql remote synchronous fault tolerance enhancement - Google Patents

System and method for achieving Mysql remote synchronous fault tolerance enhancement Download PDF

Info

Publication number
CN104765798A
CN104765798A CN201510137651.XA CN201510137651A CN104765798A CN 104765798 A CN104765798 A CN 104765798A CN 201510137651 A CN201510137651 A CN 201510137651A CN 104765798 A CN104765798 A CN 104765798A
Authority
CN
China
Prior art keywords
client
server
queue
data
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.)
Granted
Application number
CN201510137651.XA
Other languages
Chinese (zh)
Other versions
CN104765798B (en
Inventor
王海
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Interconnected Co Ltd Of Section Of Shenzhen One
Original Assignee
Interconnected Co Ltd Of Section Of Shenzhen One
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Interconnected Co Ltd Of Section Of Shenzhen One filed Critical Interconnected Co Ltd Of Section Of Shenzhen One
Priority to CN201510137651.XA priority Critical patent/CN104765798B/en
Publication of CN104765798A publication Critical patent/CN104765798A/en
Application granted granted Critical
Publication of CN104765798B publication Critical patent/CN104765798B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The invention discloses a system and method for achieving Mysql remote synchronous fault tolerance enhancement. The system comprises a main server, an array server and a client which adopt Mysql independent operation modes, wherein the array service adopts the message array technology and is connected with the client through RESTful HTTP protocol. The method comprises the steps of (1) acquiring CRUD information of task data through the main server, and storing to the array server; (2) performing the message array technology for the array server, and distributing to each client; (3) acquiring the CRUD data from the array server through the client and then implementing through the local computer.

Description

Mysql strange land synchronously strengthens the system that realizes and the implementation method of fault-tolerance
Technical field
The present invention relates to Mysql database, particularly a kind of Mysql strange land synchronously strengthens the system that realizes and the implementation method of fault-tolerance.
Background technology
Mysql is a kind of database server software that Master/Slave disposes of can supporting, but when strange land network connection state instability, the Position of database can be caused to misplace, slave data are different with master, and consume the Bin-log file of a large amount of disk space store M ysql, cause system unavailable.
Due to by the restriction of different operators, China Netcom, telecommunication user data base consistency(-tance), stability requirement when using network application is higher, and existing best solution is exactly strange land vlan special line, carrys out Deterministic service device and so on data interaction.But machine room, bandwidth cost is very expensive, is not suitable for small-sized Internet firm and uses.
Summary of the invention
For above-mentioned deficiency of the prior art, a kind of Mysql strange land is the object of the present invention is to provide synchronously to strengthen the system that realizes and the implementation method of fault-tolerance, it can realize consistance and the stability of strange land data with less cost, can be applicable to small-sized Internet firm.
In order to achieve the above object, the present invention is achieved by the following technical solutions.
What Mysql strange land synchronously strengthened fault-tolerance realizes system, and this system comprises: master server, queue server and client;
Master server, queue server and client adopt the independent operation mode of Mysql; Described queue server adopts message queue technology, and queue server and client adopt RESTful http protocol mode to dock.
Mysql strange land synchronously strengthens the implementation method of fault-tolerance, it is characterized in that, the method comprises following steps:
(1) the CRUD information of master server acquisition tasks data, and be stored into queue server;
The database manipulation order that database manipulation relates to by master server, is stored into queue server according to time order and function, forms command queue, and command queue adopts message queue mode to store;
(2) queue server adopts message queue technology, is distributed to each client;
The database command message queue of the formation in step (1) is adopted function call-back manner by queue server, be distributed to each client one by one, queue server and client adopt RESTful http protocol mode to dock, if client executing success, can notify master server state, carry out the execution of next command again, if unsuccessful, then do not destroy task, all data of rollback;
(3) client obtains CRUD data and performs to the machine from queue server;
Queue server controls the abnormal information of all clients, quick rollback abnormal data, ensures that the data of all client databases are definitely consistent.
Further: in above-mentioned implementation method, master server is transferred to queuing data after client port performs, if there is abnormal appearance, can clears up queuing message, return exception, if client operation success, then return queuing message and be written to master server.
The present invention has outstanding substantive distinguishing features and significant effect compared to existing technology:
In the present invention, the database manipulation order (SQL) that database manipulation relates to by local master server (master), is stored into queue server according to time order and function, forms command queue, command queue adopts message queue mode to store, and effectiveness of performance is very efficient;
In the present invention, the database command message queue formed is adopted " function call-back manner " by queue server, be distributed to each client (SLAVE) one by one, queue server and client adopt RESTful http protocol mode to dock, if client executing success, can notify master server state, carry out the execution of next command again, if unsuccessful, then do not destroy task, the all data of rollback, so both ensure that the consistance of each client data, also ensure that the security of data;
In the present invention, queue server can control the abnormal information of all clients, quick rollback abnormal data, ensures that the data of all client databases are definitely consistent, what adopt due to each client data is independent operation mode, so stability is greatly improved.
Accompanying drawing explanation
Below in conjunction with the drawings and specific embodiments, the present invention is described in further details.
Fig. 1 is system architecture schematic diagram of the present invention;
Fig. 2 is that implementation method of the present invention performs schematic flow sheet.
Embodiment
The present invention realizes structure and realization flow is described as embodiment using concrete.
As shown in Figure 1, what Mysql strange land synchronously strengthened fault-tolerance realizes system, and this system comprises: master server, queue server and client;
Master server, queue server and client adopt the independent operation mode of Mysql; Described queue server adopts message queue technology, and queue server and client adopt RESTful http protocol mode to dock.
As shown in Figure 2, Mysql strange land synchronously strengthens the implementation method of fault-tolerance, comprises following steps:
(1) the CRUD information of master server image data, and be stored into queue server;
The database manipulation order (SQL) that database manipulation relates to by local master server (master), queue server is stored into according to time order and function, form command queue, command queue adopts message queue mode to store, effectiveness of performance is very efficient, and traditional Mysql (bin-log) mode adopts text log mode, very frequent to the IO read-write of disk, cause performance very low.
(2) queue server adopts message queue technology, is distributed to each client;
The database command message queue of the formation in step (1) is adopted " function call-back manner " by queue server, be distributed to each client (SLAVE) one by one, queue server and client adopt RESTful http protocol mode to dock, if client executing success, can notify master server state, carry out the execution of next command again, if unsuccessful, then do not destroy task, the all data of rollback, so both ensure that the consistance of each client data, also ensure that the security of data.And traditional communication modes socket from master to slave agreement be inconvenient to debug, and exception catching is simple, does not also have rollback mechanism, client often can stop accepting synchronous, or receives incorrect data.
(3) client obtains CRUD data and performs to the machine from queue server;
Queue server can control the abnormal information of all clients, quick rollback abnormal data, and the data ensureing all client databases are definitely consistent, and what adopt due to each client data is independent operation mode, so stability is greatly improved.
Application case: micro-trade is led to, one-stop foreign trade band operation platform, it is an overseas b2b platform of serving Chinese foreign trade enterprise, this platform adopts SAAS mode to rent to foreign trade enterprise, for client sets up overseas multilingual b2b web station system, domestic foreign trade enterprise completes the issue work of all product data at middle domestic server, overseas foreign trade client is by overseas disk-based web site access b2b website data, and send inquiry to domestic foreign trade enterprise, current enterprise number 2000, product information 3000W, SEO keyword 200,000,000.There is following obviously problem in this case: 1. big data quantity strange land is synchronous; 2. network is obstructed both at home and abroad, and unstable, packet loss is serious; 3. data information coherence request is high, can not occur the situation that multiple spot is inconsistent.Whole project adopts the present invention, the storage of domestic data this locality, accelerate the efficiency that domestic enterprise's business datum is safeguarded, incremental data order (SQL) is written to message queue simultaneously, be transferred to overseas each server by HTTP mode to perform, and feedback readjustment result, if there is legacy, then rollback data.Thus ensure that the stability of system, fault-tolerance, high availability.
Preferably, as shown in Figure 2, after master server is transferred to client port execution queuing data, if there is abnormal appearance, can queuing message be cleared up, return exception, if client operation success, return queuing message again and be written to master server, such write sequence can ensure all customer inquiries to data be all consistent.
By reference to the accompanying drawings the preferred embodiment for the present invention is explained in detail above, but the invention is not restricted to above-mentioned embodiment, in the ken that those of ordinary skill in the art possess, can also make a variety of changes under the prerequisite not departing from present inventive concept.
Those of ordinary skill in the art do not depart from the spirit and scope of the present invention can make other changes many and remodeling.Should be appreciated that and the invention is not restricted to specific embodiment, scope of the present invention is defined by the following claims.

Claims (3)

  1. What 1.Mysql strange land synchronously strengthened fault-tolerance realizes system, and it is characterized in that, this system comprises: master server, queue server and client;
    Master server, queue server and client adopt the independent operation mode of Mysql; Described queue server adopts message queue technology, and queue server and client adopt RESTful http protocol mode to dock.
  2. 2.Mysql strange land synchronously strengthens the implementation method of fault-tolerance, it is characterized in that, the method comprises following steps:
    (1) the CRUD information of master server acquisition tasks data, and be stored into queue server;
    The database manipulation order that database manipulation relates to by master server, is stored into queue server according to time order and function, forms command queue, and command queue adopts message queue mode to store;
    (2) queue server adopts message queue technology, is distributed to each client;
    The database command message queue of the formation in step (1) is adopted function call-back manner by queue server, be distributed to each client one by one, queue server and client adopt RESTful http protocol mode to dock, if client executing success, can notify master server state, carry out the execution of next command again, if unsuccessful, then do not destroy task, all data of rollback;
    (3) client obtains CRUD data and performs to the machine from queue server;
    Queue server controls the abnormal information of all clients, quick rollback abnormal data, ensures that the data of all client databases are definitely consistent.
  3. 3. Mysql strange land as claimed in claim 2 synchronously strengthens the implementation method of fault-tolerance, it is characterized in that, after master server is transferred to client port execution queuing data, if there is abnormal appearance, queuing message can be cleared up, return exception, if client operation success, then return queuing message and be written to master server.
CN201510137651.XA 2015-03-26 2015-03-26 The strange lands Mysql synchronize the realization system and implementation method of enhancing fault-tolerance Active CN104765798B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510137651.XA CN104765798B (en) 2015-03-26 2015-03-26 The strange lands Mysql synchronize the realization system and implementation method of enhancing fault-tolerance

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510137651.XA CN104765798B (en) 2015-03-26 2015-03-26 The strange lands Mysql synchronize the realization system and implementation method of enhancing fault-tolerance

Publications (2)

Publication Number Publication Date
CN104765798A true CN104765798A (en) 2015-07-08
CN104765798B CN104765798B (en) 2018-08-07

Family

ID=53647629

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510137651.XA Active CN104765798B (en) 2015-03-26 2015-03-26 The strange lands Mysql synchronize the realization system and implementation method of enhancing fault-tolerance

Country Status (1)

Country Link
CN (1) CN104765798B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106201666A (en) * 2016-06-24 2016-12-07 浪潮软件股份有限公司 A kind of distributed transaction implementation method
CN108664315A (en) * 2017-03-30 2018-10-16 北京京东尚科信息技术有限公司 Method, electronic equipment and the readable storage medium storing program for executing of multithreading dynamic processing business
CN113609199A (en) * 2021-07-27 2021-11-05 远景智能国际私人投资有限公司 Database system, server, and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110283045A1 (en) * 2010-04-12 2011-11-17 Krishnan Manavalan Event processing in a flash memory-based object store
CN102611642A (en) * 2012-02-27 2012-07-25 杭州闪亮科技有限公司 System for processing nonsynchronous message and method for system to send message and monitor processing task
CN102761617A (en) * 2012-07-02 2012-10-31 北京京北方信息技术有限公司 Workflow queue server and workflow scheduling system and method
CN103019879A (en) * 2013-01-07 2013-04-03 北京奇虎科技有限公司 Method and system for processing crash information of browser

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110283045A1 (en) * 2010-04-12 2011-11-17 Krishnan Manavalan Event processing in a flash memory-based object store
CN102611642A (en) * 2012-02-27 2012-07-25 杭州闪亮科技有限公司 System for processing nonsynchronous message and method for system to send message and monitor processing task
CN102761617A (en) * 2012-07-02 2012-10-31 北京京北方信息技术有限公司 Workflow queue server and workflow scheduling system and method
CN103019879A (en) * 2013-01-07 2013-04-03 北京奇虎科技有限公司 Method and system for processing crash information of browser

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106201666A (en) * 2016-06-24 2016-12-07 浪潮软件股份有限公司 A kind of distributed transaction implementation method
CN108664315A (en) * 2017-03-30 2018-10-16 北京京东尚科信息技术有限公司 Method, electronic equipment and the readable storage medium storing program for executing of multithreading dynamic processing business
CN113609199A (en) * 2021-07-27 2021-11-05 远景智能国际私人投资有限公司 Database system, server, and storage medium
CN113609199B (en) * 2021-07-27 2023-09-12 远景智能国际私人投资有限公司 Database system, server, and storage medium

Also Published As

Publication number Publication date
CN104765798B (en) 2018-08-07

Similar Documents

Publication Publication Date Title
US11444849B2 (en) Remote emulation of a storage system
US10394611B2 (en) Scaling computing clusters in a distributed computing system
CN105025053A (en) Distributed file upload method based on cloud storage technology and system
WO2016191620A1 (en) System and method for transparent context aware filtering of data requests
CN102033912A (en) Distributed-type database access method and system
CN102710763B (en) The method and system of a kind of distributed caching pond, burst and Failure Transfer
CN103605698A (en) Cloud database system used for distributed heterogeneous data resource integration
CN104361030A (en) Distributed cache architecture with task distribution function and cache method
CN104899274B (en) A kind of memory database Efficient Remote access method
CN102262680A (en) Distributed database proxy system based on massive data access requirement
CN102761528A (en) System and method for data management
CN103226598A (en) Method and device for accessing database and data base management system
CN103279386A (en) Method for achieving high availability of computer operation scheduling system
CN103473328A (en) MYSQL (my structured query language)-based database cloud and construction method for same
CN104050248A (en) File storage system and storage method
CN102137161B (en) File-level data sharing and storing system based on fiber channel
CN105681426B (en) Heterogeneous system
CN104765798A (en) System and method for achieving Mysql remote synchronous fault tolerance enhancement
CN103414764A (en) Cloud platform elastic storage system and elastic storage achieving method thereof
CN103838781A (en) Database access method and system
CN106888264B (en) A kind of method for interchanging data and device
CN102820998A (en) Dual-fault-tolerant service system applicable to office applications and data storage method of dual-fault-tolerant service system
CN105376307A (en) Asynchronous backup method among data centers
CN115510072A (en) Main data engine based on multi-tenant SaaS application platform
CN111294383B (en) Internet of things service management system

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
CB02 Change of applicant information

Address after: 518000 Guangdong city of Shenzhen province Nanshan District science and Technology Park Keyuan Road Kexing Science Park building B1 room 902

Applicant after: A Shenzhen branch interconnect Co., Ltd.

Address before: 518000 Guangdong city of Shenzhen province Nanshan District science and Technology Park Keyuan Road Kexing Science Park building B1 room 902

Applicant before: Interconnected company limited of section of Shenzhen one

COR Change of bibliographic data
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
CP02 Change in the address of a patent holder
CP02 Change in the address of a patent holder

Address after: 518000 unit 16, 4th floor, phase 4, halo Plaza, No.260, Taoyuan Road, Sunxi community, Sungang street, Luohu District, Shenzhen City, Guangdong Province

Patentee after: A Shenzhen branch interconnect Co.,Ltd.

Address before: 518000 room 902, building B1, Kexing Science Park, Keyuan North Road, Science Park, Nanshan District, Shenzhen, Guangdong Province

Patentee before: A Shenzhen branch interconnect Co.,Ltd.