CN106850759A - MySQL database clustering methods and its processing system - Google Patents

MySQL database clustering methods and its processing system Download PDF

Info

Publication number
CN106850759A
CN106850759A CN201611266752.8A CN201611266752A CN106850759A CN 106850759 A CN106850759 A CN 106850759A CN 201611266752 A CN201611266752 A CN 201611266752A CN 106850759 A CN106850759 A CN 106850759A
Authority
CN
China
Prior art keywords
database
mysql database
lvs
mysql
services device
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201611266752.8A
Other languages
Chinese (zh)
Inventor
陈俊
丁速滨
郑中斌
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangzhou Qinjiayuan Technology Industrial Co Ltd
Original Assignee
Guangzhou Qinjiayuan Technology Industrial Co Ltd
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 Guangzhou Qinjiayuan Technology Industrial Co Ltd filed Critical Guangzhou Qinjiayuan Technology Industrial Co Ltd
Priority to CN201611266752.8A priority Critical patent/CN106850759A/en
Publication of CN106850759A publication Critical patent/CN106850759A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1001Protocols in which an application is distributed across nodes in the network for accessing one among a plurality of replicated servers
    • H04L67/1031Controlling of the operation of servers by a load balancer, e.g. adding or removing servers that serve requests
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2458Special types of queries, e.g. statistical queries, fuzzy queries or distributed queries
    • G06F16/2471Distributed queries
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1001Protocols in which an application is distributed across nodes in the network for accessing one among a plurality of replicated servers
    • H04L67/1036Load balancing of requests to servers for services different from user content provisioning, e.g. load balancing across domain name servers

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Probability & Statistics with Applications (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Computational Linguistics (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Fuzzy Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

A kind of MySQL database clustering methods and its processing system, the method include:In the first step, MySQL database cluster includes a main MySQL database for being used for write-in and multiple for inquiring about from MySQL database, and user accesses the MySQL database cluster by web;In the second step, when web is accessed as write-in, renewal or removal request, the main MySQL database responds the request, when web is accessed as inquiry request, after load equalizer (LVS) including main LVS and from LVS receives inquiry request, whether virtual ip address (VIP) monitors main LVS and be can use from LVS;In third step, whether Keepalived module monitors be can use from the corresponding database enquiry services device of MySQL database, and database enquiry services device of problems is kicked out of cluster automatically, and according to predetermined weight distribution query task;In four steps, receive the database enquiry services device inquiry of the query task and Query Result is returned into user.

Description

MySQL database clustering methods and its processing system
Technical field
The invention belongs to the communications field, more particularly to a kind of MySQL database clustering methods and MySQL database Cluster processing system.
Background technology
With the arrival in big data epoch, the continuous growth of the scale of data, the demand of data query is more and more frequent.With Family is more and more stronger to the continual requirement that data query speed and data query are serviced, it is undesirable to access queries data when The time stand-by period is long, or even the situation for seeing " query timeout " or " database is busy ".Single database is to prop up The storage supportted factor data rapid growth and queries rapid growth and bring and the corresponding quick increase for calculating intensity.In this feelings Under condition, if the new price of purchase is more expensive, the more preferable database server of performance does upgrades and washes in a pan existing database server profit Eliminate, then will must be a kind of profligacy to existing hardware resource, no matter how powerful the performance of separate unit database server is, also must It is so the lifting that cannot meet continuous data volume and queries, the upgrade cost again and again of hardware and each expense put into To be the endless wasting of resources, cause legacy data storehouse extension cost too high, or even develop into not expansible system, need The predicament to be made a new start.
Patent document CN102594697 A disclose a kind of load-balancing method, and the load-balancing method is applied to control The open flow network for forwarding separate, including:Being set up with open flows controller of receiving that the first open flows switch send connects The request message for connecing;The open flows control of the minimum number being connected is set up in selection with open flows switch from link information database Used as the first open flows controller, the link information database preserves at least two open flows controllers mark to device processed, and Preserve at least two open flows controller and identify the number that corresponding open flows controller is connected with open flows switch foundation Amount;The request message for setting up connection is forwarded to first open flows controller;New information is received, the company is updated Connect the first open flows controller described in information database and the quantity being connected is set up with open flows switch.The patent is in open flows In the case of there are multiple open flows controllers in network, load balancing between open flows controller, but the patent can be realized Cannot be write for data, updated, removal request is processed respectively with the inquiry requests for accounting for most access, it is impossible to solved The scalability of data query ability, it is impossible to prevent the Single Point of Faliure of itself from causing the whole cluster cannot to provide service, does not possess High availability, extends flexibility, low extension cost.
It is a kind of disclosed in patent document CN104036025 A to be based on distributed massive logs acquisition system by target Agent processes are installed, text, application program, database log information to destination host carry out selectively fixed on main frame To the unified access interface for being pushed to server cluster, server end employs distributed caching and processes framework skill with real-time streams Art;The system includes data active layer, distributed caching layer, distributed storage and computation layer, Business treatment, visual presentation layer With United Dispatching and management module;Data active layer, by data acquisition components (producer) module to the text above each node, Application program, database are acquired, and are pushed to distributed caching layer;Distributed caching layer, is disappeared by LVS to each node Breath queue element carries out load balancing, there is provided a unified interface pushes the number for coming to receive and write data source nodes According to wait distributed storage reads with the data acquisition components (consumer) of computation layer;Distributed storage and computation layer, there is provided Storage and the function of calculating, including data acquisition components (consumer) module, off-line calculation module, real-time computing module, distribution Formula is stored and search engine;Wherein, data acquisition components (consumer) module is responsible for carrying out digital independent to distributed caching layer; Off-line calculation module is made up of Hadoop and its ecosystem;Real-time computing module is made up of Storm;Business treatment, there is provided The function of statistical analysis and data mining and service, are called by upper strata;Visual presentation layer, there is provided general query, full text Retrieval, form such as show, import and export at the function;United Dispatching and management module, unified scheduling is carried out to above-mentioned 5 layers with pipe Reason, based on workflow, automatic business processing.The patent has used Storm real-time streams to process framework technology, therefore, it can near real-time Ground is processed and classified to the message in Kafka distributed cachings, but the patent structure step is complicated and cannot be directed to data Write-in, is updated, and removal request is processed respectively with the inquiry requests for accounting for most access, it is impossible to solve data query ability Scalability, it is impossible to prevent the Single Point of Faliure of itself from causing the whole cluster cannot to provide service, do not possess high availability, extend Flexibility, low extension cost.
A kind of open net based on improved linux virtual servers framework disclosed in patent document CN1560742 A Network calculating platform, the calculating platform includes server system (20) and contribution based on improved linux virtual servers framework Aspiration machine system (21) of idle computing resources;Server system (20) includes FEP (6) and m platforms sky space server (7.1 ... ..., 7.m), m is positive integer;Aspiration machine system (21) volunteers machine (8.1 ... ..., 8.n) including n platforms sky space, and n is for just Integer;FEP (6) includes load balancing module (18) and FEP backup module (19);Wherein, load balancing module (18) When vast and boundless space aspiration machine sends the requests to FEP, forward requests in the scheduler module (13) of vast and boundless space server;Front end Machine backup module (19) is set up according to adaptive strategy and safeguards the backup relation vector table between vast and boundless space server, and this is standby Part relation vector table is sent to server backup module (12);Vast and boundless space server (7) includes storage system (9), application module (10), monitoring module (11), server backup module (12) and scheduler module (13), wherein, storage system includes data base set System and file system;Application is divided into the small task of amount of calculation by application module (10) for receiving the application of client's submission, Application message and mission bit stream are stored in by Database Systems, the binary code of application and the data file of task by order again It is stored in file system;Monitoring module (11) is shown for the information in reading database system after treatment, to monitor vast and boundless space The operational situation of server;Server backup module (12) believes the database in storage system according to backup relation vector table Breath and fileinfo are backuped on corresponding server;Scheduler module (13) is asked when the communication module (16) in vast and boundless space aspiration machine During calculating task, according to the mission bit stream in application module (10) write into Databasce system, United Dispatching task, by vast and boundless space will Communication module (16) in hope machine distributes to the execution of aspiration machine;It is additionally operable to after communication module (16) returns to result of calculation, will Destination file is stored in file system, and changes the mission bit stream in Database Systems;Vast and boundless space volunteers machine (8) including volunteer Interface module (14), control module (15), communication module (16) and computing module (17);Wherein, volunteer's interface module (14) For monitoring and performing the order that volunteer sends in real time, according to corresponding item in order modification configuration file;Control module (15) circulation, when the condition for starting calculating meets, starts communication module (16), to vast and boundless space service according to the setting of configuration file Device asks calculating task, after scheduler module (13) returns to calculating task, starts computing module (17), is calculated with lowest priority Task, communication module (16) periodically sends " alive " information to scheduler module (13) in calculating process, and is tied calculating Fruit returns to scheduler module (13) by communication module (16).The patent has all good characteristics of LVS framework, but the patent Configuration steps are complicated and cannot be write for data, update, and removal request is divided with the inquiry requests for accounting for most access Manage in other places, it is impossible to prevent the Single Point of Faliure of itself from causing the whole cluster cannot to provide service, do not possess extension flexibility and low expansion Transform into this.
The content of the invention
On the technical problems to be solved by the invention, its real needs is as follows:For data write-in, update, deleting please The inquiry request that summation accounts for most access is processed respectively, solves the scalability of data query ability, prevents itself Single Point of Faliure cause the whole cluster cannot to provide service, possess high availability, extend flexibility, low extension cost.
Disclosed above- mentioned information is used only for understanding of the enhancing to background of the present invention in the background section, it is thus possible to Information comprising prior art known to a person of ordinary skill in the art in not constituting home.
The purpose of the present invention is to be achieved by the following technical programs.
According to an aspect of the present invention, a kind of MySQL database clustering methods are comprised the following steps:
In the first step, MySQL database cluster includes that a main MySQL database and multiple for being used for write-in is used for Inquiry from MySQL database, user accesses the MySQL database cluster by web.
In the second step, when web is accessed as write-in, renewal or removal request, the main MySQL database response should Request, when web is accessed as inquiry request, including after main LVS and the load equalizer from LVS receive inquiry request, virtually Whether IP address monitors main LVS and be can use from LVS.
In third step, Keepalived module monitors are from the corresponding database enquiry services device of MySQL database It is no available, database enquiry services device of problems is kicked out of cluster automatically, and according to predetermined weight distribution query task.
In four steps, receive the database enquiry services device inquiry of the query task and return to Query Result User.
Preferably, in third step, whether the main LVS of Keepalived module monitors can use, then Keepalived moulds Scheduler in block is dynamically selected a data base querying server according to the loading condition of each database enquiry services device, The destination-mac address of the data frame of request message is changed to the MAC Address of the database enquiry services device.
Preferably, in third step, when the database enquiry services device receives request, Target IP is described virtual IP address, the then database enquiry services device respond request, the packet that will be responded according to its routing iinformation afterwards sends Back to user, and source IP address is virtual ip address.
Preferably, in the second step, load equalizer is DNS mixed loads balanced device, VS/TUN or VS/DR.
Preferably, in third step, after database enquiry services device of problems is working properly, Keepalived Module adds it to MySQL database cluster automatically.
Preferably, it is multiple for inquiring about from main MySQL database described in MySQL database real-time synchronization.
Preferably, in third step, the database enquiry services device is cloud server.
According to another aspect of the present invention, the MySQL data of the MySQL database clustering methods described in a kind of implementation Storehouse cluster processing system includes server zone, load equalizer and Keepalived modules, and the server zone is included for holding The master server and multiple database enquiry services devices for carrying from MySQL database of main MySQL database are carried, load is equal Weighing apparatus includes main LVS and is provided with scheduler from LVS, Keepalived modules.
Preferably, processing system is included for exectorial processor, for the communication bus for communicating and storage order Memory.
Preferably, the processor is general processor, digital signal processor, application-specific integrated circuit ASIC, and scene can Programming gate array FPGA, analog circuit or digital circuit, the memory include one or more read only memory ROMs, random Access memory RAM, flash memory or Electrical Erasable programmable read only memory EEPROM.
Described above is only the general introduction of technical solution of the present invention, in order to cause technological means of the invention clearer Understand, reach the degree that those skilled in the art can be practiced according to the content of specification, and in order to allow the present invention Above and other objects, features and advantages can become apparent, illustrated with specific embodiment of the invention below Explanation.
Brief description of the drawings
By reading the detailed description in hereafter preferred embodiment, the present invention various other advantage and benefit Will be clear understanding for those of ordinary skill in the art.Figure of description is only used for showing the purpose of preferred embodiment, And it is not considered as limitation of the present invention.It should be evident that drawings discussed below is only some embodiments of the present invention, For those of ordinary skill in the art, on the premise of not paying creative work, can also be obtained according to these accompanying drawings Other accompanying drawings.And in whole accompanying drawing, identical part is presented with like reference characters.
In the accompanying drawings:
The step of Fig. 1 is MySQL database clustering methods according to an embodiment of the invention schematic diagram;
Fig. 2 is the logical flow chart of implementation MySQL database clustering methods according to an embodiment of the invention;
Fig. 3 is the workflow diagram of implementation MySQL database clustering methods according to an embodiment of the invention.
Fig. 4 is the MySQL database collection of implementation MySQL database clustering methods according to an embodiment of the invention The structural representation of group's processing system.
Fig. 5 is the MySQL database collection of implementation MySQL database clustering methods according to an embodiment of the invention The network topological diagram of group's processing system.
The present invention is further explained below in conjunction with drawings and Examples.
Specific embodiment
Specific embodiment of the invention is more fully described below with reference to accompanying drawings.Although being shown in accompanying drawing of the invention Specific embodiment, it being understood, however, that may be realized in various forms the present invention without that should be limited by embodiments set forth here System.Conversely, there is provided these embodiments are able to be best understood from the present invention, and can be complete by the scope of the present invention Convey to those skilled in the art.
It should be noted that having used some vocabulary to censure specific components in the middle of specification and claim.Ability Field technique personnel it would be appreciated that, technical staff may call same component with different nouns.This specification and right It is required that not in the way of the difference of noun is used as distinguishing component, but the difference with component functionally is used as what is distinguished Criterion.As the "comprising" in specification in the whole text and claim mentioned in or " including " be an open language, therefore should solve It is interpreted into " include but be not limited to ".Specification subsequent descriptions to implement better embodiment of the invention, so the description be with For the purpose of the rule of specification, the scope of the present invention is not limited to.Protection scope of the present invention is when regarding appended right It is required that defined person is defined.
For ease of the understanding to the embodiment of the present invention, done by taking several specific embodiments as an example further below in conjunction with accompanying drawing Explanation, and each accompanying drawing does not constitute the restriction to the embodiment of the present invention.
The step of Fig. 1 is the MySQL database clustering methods of one embodiment of the present of invention schematic diagram, the present invention is real Applying example will be specifically described with reference to Fig. 1.
As shown in figure 1, An embodiment provides a kind of MySQL database clustering methods, MySQL numbers Comprised the following steps according to storehouse clustering methods:
In first step S1, MySQL database cluster includes that a main MySQL database for being used to write is used with multiple In inquiry from MySQL database, user accesses the MySQL database cluster by web.
In second step S2, when web is accessed as write-in, renewal or removal request, the main MySQL database response The request, when web is accessed as inquiry request, including after main LVS and the load equalizer LVS from LVS receive inquiry request, Whether virtual ip address VIP monitors main LVS and be can use from LVS.
In third step S3, Keepalived module monitors are from the corresponding database enquiry services device of MySQL database Whether can use, database enquiry services device of problems is kicked out of cluster automatically, and appoint according to predetermined weight distribution inquiry Business.
In the fourth step s 4, receive the database enquiry services device inquiry of the query task and return to Query Result To user.
In one embodiment, MySQL database clustering methods of the invention are realizing Linux virtual server LVS+keeplived load balancing data mysql O&Ms, inquire about according to web request trigger data, are distributed to the database of rear end Mysql inquires about server cluster processing data query task.Master-slave database mysql inquiry LVS are mutual by keepalived Make health monitoring, receive corresponding inquiry request, distribution query task to the data of rear end is set by the weight of keepalived Corresponding server in storehouse mysql inquiry clusters.The shape of server is inquired about the database mysql of rear end by keepalived State, if a database mysql inquiry server crashes, or work is broken down, and Keepalived will be detected, and will Faulty server is kicked from LVS systems and removed, while the work of the server is replaced using other server generations, when the database After mysql inquiry servers recover normal, database mysql inquiry servers are automatically added to this by Keepalived automatically In LVS systems, these work are all automatically performed, it is not necessary to which artificial interference is, it is necessary to the artificial simply offline reparation failure done Server.MySQL is a Relational DBMS, and MySQL is a kind of associated data base management system, associated data Storehouse is saved the data in different tables, is placed in a big warehouse rather than by all data, which adds speed simultaneously Improve flexibility.The sql like language that MySQL is used is the most frequently used standardized language for accessing database.MySQL can be adopted Use double authorization policies, because its small volume, speed are fast, the total cost of ownership is low, especially this feature of open source code, it is general in The exploitation of microsite all selects MySQL as site databases.Because its performance is remarkable, arrange in pairs or groups PHP and Apache, Nginx Good development environment can be constituted.
Fig. 2 is the logical flow chart of implementation MySQL database clustering methods according to an embodiment of the invention, step Rapid 1:User is asked by web access triggers data base querying.Step 2:The VIP of load balancing can mutual monitoring and inquiry storehouse master Whether LVS can use with inquiry storehouse from LVS.Step 3:What either the main LVS in inquiry storehouse still inquired about storehouse is connected to user from LVS Inquiry request after, can all health monitoring be done to the database mysql of rear end inquiry server, automatically problematic database Mysql inquiry servers kick out of cluster, and the weight distribution query task set according to keepalived.Step 4:Database Query Result is returned to user by mysql inquiry servers.
It is of the invention preferred embodiment in, in third step S3, whether the main LVS of Keepalived module monitors may be used With then the scheduler in Keepalived modules is dynamically selected one according to the loading condition of each database enquiry services device Platform data base querying server, the database enquiry services device is changed to by the destination-mac address of the data frame of request message MAC Address.
It is of the invention preferred embodiment in, in third step S3, the database enquiry services device receive please When asking, Target IP is the virtual ip address VIP, then the database enquiry services device respond request, afterwards according to its road The packet of response is sent back to user by information, and source IP address is virtual ip address VIP.
It is of the invention preferred embodiment in, in second step S2, load equalizer LVS be DNS mixed loads it is equal Weighing apparatus, VS/TUN or VS/DR.
It is of the invention preferred embodiment in, in third step S3, when database enquiry services device of problems After working properly, Keepalived modules add it to MySQL database cluster automatically.
It is of the invention preferred embodiment in, multiple is for inquiring about from main described in MySQL database real-time synchronization MySQL database.
It is of the invention preferred embodiment in, in third step S3, the database enquiry services device be high in the clouds clothes Business device.
Fig. 3 is the workflow diagram of implementation MySQL database clustering methods according to an embodiment of the invention.Such as Shown in Fig. 3, in one embodiment, target real server is given by message direct routing.In DR patterns, first with Whether the healthy high availability for making Lvs of Lvs of the health monitoring mechanism monitoring master of Keepalived modules 2, then passes through , according to the loading condition of each real server, connection number is how many etc. for keepalived schedulers, is dynamically selected a service Device, target ip address and target port are not changed, do not encapsulate IP messages yet, but by the Destination MAC of the data frame of request message Address is changed to the MAC Address of real server.Then the data frame changed is sent on the LAN of server group again.Because The MAC Address of data frame is the MAC Address of real server, and again in same LAN.So according to the logical of LAN News principle, true reset is can necessarily to receive the packet sent by LVS+KEEPALIVED.Real server is received please When seeking packet, it is VIP to untie the Target IP that IP packet header views, now only have the IP of oneself to meet Target IP just meeting Receive, so we need to configure VIP on local winding excuse.Separately:ARP can be carried out due to network interface wide Broadcast response, but the other machines of cluster has the lo interfaces of this VIP, and all responses will conflict.So we are needed true The arp response of the lo interfaces of server closes.Then real server makes request response, afterwards the route letter according to oneself This response data packet is sent back to client, and source IP address or VIP by breath.
The whole flow process of data flow is as follows:
1st, forwarding is realized by changing the target MAC (Media Access Control) address of packet on scheduler LVS+KEEPALIVED.Note source Address is still CIP, and destination address is still VIP addresses.
2nd, the message of request is by scheduler, and the message after RS responses treatment needs not move through scheduler LVS+ KEEPALIVED, therefore service efficiency is very high when concurrently visit capacity is big.
3rd, because DR patterns are to realize forwarding by MAC Address rewrite mechanism, therefore all RS nodes and scheduler LVS+ KEEPALIVED can only be inside a LAN.
4th, RS main frames need binding VIP addresses on LO interfaces, and need configuration ARP to suppress.
5th, the default gateway of RS nodes is not required to will be configured to LVS+KEEPALIVED, but is directly configured to higher level's route Gateway, RS can be allowed directly to go out net just can be with.
6th, because the scheduler of DR patterns only does the rewriting of MAC Address, so scheduler LVS+KEEPALIVED cannot Rewrite target port, then RS servers must provide service using with VIP identicals port.
Fig. 4 is the MySQL database collection of implementation MySQL database clustering methods according to an embodiment of the invention The structural representation of group's processing system.Implement the MySQL database cluster treatment of described MySQL database clustering methods System includes server zone 1, load equalizer LVS and Keepalived module 2, and the server zone 1 is included for carrying master The master server 3 of MySQL database and multiple database enquiry services devices 4 for carrying from MySQL database, load balancing Device LVS includes main LVS5 and scheduler 7 is provided with from LVS6, Keepalived modules 2.
It is of the invention preferred embodiment in, processing system include for exectorial processor, for communicate Communication bus and the memory of storage order.
It is of the invention preferred embodiment in, Keepalived modules mainly preserve the height of link using VRRP agreements Availability.And VRRP (Virtual Router Redundancy Protocol) agreement is in itself for realizing router redundancy Agreement.
It is of the invention preferred embodiment in, the processor is general processor, digital signal processor, special collection Into circuit ASIC, on-site programmable gate array FPGA, analog circuit or digital circuit, the memory includes one or more only Read memory ROM, random access memory ram, flash memory or Electrical Erasable programmable read only memory EEPROM.
For a further understanding of the present invention, Fig. 5 is at implementation MySQL database cluster according to an embodiment of the invention The network topological diagram of the MySQL database cluster processing system of reason method.As shown in figure 5, user sends inquiry request, load is equal Weighing apparatus layer includes load equalizer LVS and Keepalived module 2, and load balancing layer can also include the load equalizer of backup Inquiry request is connected to data base querying layer, database by LVS and Keepalived modules 2, load balancing layer by interchanger Inquiry layer may include multiple from MySQL database.
The present invention solves many data write-ins of mysql databases first, updates, and deletes, and inquires about consistent with data Sex chromosome mosaicism.Next solves the scalability of data query ability, while the single-point event in order to prevent LVS load equalizers itself Barrier causes whole " mysql- inquiries " cluster cannot to provide service, therefore must realize LVS loads using Keepalived modules The high availability of balanced device, load balancing can sufficiently utilize existing network structure, expand on the basis of network structure The bandwidth and the network equipment of opening up " mysql- inquiries " cluster, availability and rapidity, the raising data query of strengthening data query Disposal ability, so that there is provided a kind of cheap effectively transparent method, making mysql- inquire about cluster has high availability, extension spirit Activity, extends the low feature of cost.
Although being described to embodiment of the present invention above in association with accompanying drawing, the invention is not limited in above-mentioned Specific embodiments and applications field, above-mentioned specific embodiment is only schematical, guiding, rather than restricted 's.One of ordinary skill in the art is under the enlightenment of this specification and is not departing from the scope that the claims in the present invention are protected In the case of, the form of many kinds can also be made, these belong to the row of protection of the invention.

Claims (10)

1. a kind of MySQL database clustering methods, it is comprised the following steps:
In first step (S1), MySQL database cluster includes that a main MySQL database and multiple for being used for write-in is used for Inquiry from MySQL database, user accesses the MySQL database cluster by web;
In second step (S2), when web is accessed as write-in, renewal or removal request, the main MySQL database response should Request, when web is accessed as inquiry request, including after main LVS and the load equalizer (LVS) from LVS receive inquiry request, Whether virtual ip address (VIP) monitors main LVS and be can use from LVS;
In third step (S3), Keepalived module monitors are from the corresponding database enquiry services device of MySQL database It is no available, database enquiry services device of problems is kicked out of cluster automatically, and according to predetermined weight distribution query task;
In four steps (S4), receive the database enquiry services device inquiry of the query task and return to Query Result User.
2. MySQL database clustering methods according to claim 1, it is characterised in that:
In third step (S3), whether the main LVS of Keepalived module monitors can use, then the tune in Keepalived modules Degree device is dynamically selected a data base querying server according to the loading condition of each database enquiry services device, and request is reported The destination-mac address of the data frame of text is changed to the MAC Address of the database enquiry services device.
3. MySQL database clustering methods according to claim 2, it is characterised in that:
In third step (S3), when the database enquiry services device receives request, Target IP is the virtual ip address (VIP), the then database enquiry services device respond request, afterwards sends back the packet of response according to its routing iinformation To user, and source IP address is virtual ip address (VIP).
4. MySQL database clustering methods according to claim 1, it is characterised in that:
In second step (S2), load equalizer (LVS) is DNS mixed loads balanced device, VS/TUN or VS/DR.
5. MySQL database clustering methods according to claim 2, it is characterised in that:
In third step (S3), after database enquiry services device of problems is working properly, Keepalived modules are certainly It is dynamic to add it to MySQL database cluster.
6. MySQL database clustering methods according to claim 1, it is characterised in that:
Multiple is for inquiring about from main MySQL database described in MySQL database real-time synchronization.
7. MySQL database clustering methods according to claim 1, it is characterised in that:
In third step (S3), the database enquiry services device is cloud server.
8. a kind of MySQL data for implementing MySQL database clustering methods according to any one of claim 1-7 Storehouse cluster processing system, processing system includes server zone (1), load equalizer (LVS) and Keepalived modules (2), its It is characterised by:The server zone (1) is including the master server (3) for carrying main MySQL database and multiple for carrying From the database enquiry services device (4) of MySQL database, load equalizer (LVS) includes main LVS (5) and from LVS (6), Scheduler (7) is provided with Keepalived modules (2).
9. MySQL database cluster processing system according to claim 8, it is characterised in that:Processing system includes being used for Exectorial processor, communication bus and the memory of storage order for communicating.
10. MySQL database cluster processing system according to claim 9, it is characterised in that:The processor is general Processor, digital signal processor, application-specific integrated circuit ASIC, on-site programmable gate array FPGA, analog circuit or numeral electricity Road, the memory can including one or more read only memory ROMs, random access memory ram, flash memory or electronics Erasable programmable read-only memory (EPROM) EEPROM.
CN201611266752.8A 2016-12-31 2016-12-31 MySQL database clustering methods and its processing system Pending CN106850759A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201611266752.8A CN106850759A (en) 2016-12-31 2016-12-31 MySQL database clustering methods and its processing system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201611266752.8A CN106850759A (en) 2016-12-31 2016-12-31 MySQL database clustering methods and its processing system

Publications (1)

Publication Number Publication Date
CN106850759A true CN106850759A (en) 2017-06-13

Family

ID=59116787

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201611266752.8A Pending CN106850759A (en) 2016-12-31 2016-12-31 MySQL database clustering methods and its processing system

Country Status (1)

Country Link
CN (1) CN106850759A (en)

Cited By (19)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107707654A (en) * 2017-09-30 2018-02-16 中国联合网络通信集团有限公司 The management method of container mirror image data, apparatus and system
CN108306955A (en) * 2018-01-24 2018-07-20 北京万得嘉瑞汽车技术有限公司 A kind of car-mounted terminal interconnects cluster method on a large scale
CN108763300A (en) * 2018-04-19 2018-11-06 北京奇艺世纪科技有限公司 A kind of data query method and device
CN108960773A (en) * 2018-06-28 2018-12-07 腾讯科技(深圳)有限公司 Business management method, computer equipment and storage medium
CN109542874A (en) * 2018-11-15 2019-03-29 用友网络科技股份有限公司 Deriving method, guiding device, server, terminal and readable storage medium storing program for executing
CN109558417A (en) * 2018-11-28 2019-04-02 亚信科技(南京)有限公司 A kind of data processing method and platform
CN109614390A (en) * 2018-12-06 2019-04-12 无锡华云数据技术服务有限公司 Data base read-write separation method, device, service system, equipment and medium
CN109922151A (en) * 2019-03-12 2019-06-21 浪潮通用软件有限公司 A kind of data sharing method between micro services
CN110012111A (en) * 2019-04-16 2019-07-12 昆山丘钛微电子科技有限公司 A kind of data service group system and data processing method
CN110493071A (en) * 2018-05-15 2019-11-22 中国移动通信集团浙江有限公司 Message system resources balance device, method and apparatus
CN110879718A (en) * 2019-11-15 2020-03-13 北京浪潮数据技术有限公司 maridb upgrading method and device, electronic equipment and storage medium
CN111078802A (en) * 2019-12-31 2020-04-28 叮当快药科技集团有限公司 Database reading and writing method and related device
CN111131390A (en) * 2019-11-25 2020-05-08 深圳市瑞云科技有限公司 Storage caching method for improving cloud rendering concurrency number
CN111200637A (en) * 2019-12-20 2020-05-26 新浪网技术(中国)有限公司 Cache processing method and device
CN111339180A (en) * 2019-12-24 2020-06-26 沈阳通用软件有限公司 Universal database synchronization method
CN112416973A (en) * 2020-11-02 2021-02-26 网宿科技股份有限公司 Method, server and system for separating reading and writing of distributed database
CN112784136A (en) * 2019-11-05 2021-05-11 阿里巴巴集团控股有限公司 Data query method and device and electronic equipment
CN112817791A (en) * 2020-12-31 2021-05-18 西安合智宇信息科技有限公司 Mobile terminal monitoring method for mining state of working face cluster
CN114064414A (en) * 2021-11-25 2022-02-18 北京志凌海纳科技有限公司 High-availability cluster state monitoring method and system

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1928873A (en) * 2006-09-25 2007-03-14 华为技术有限公司 System and method for database access for implementing load sharing
CN101115016A (en) * 2007-08-23 2008-01-30 创新科存储技术(深圳)有限公司 Method and system for implementing application server load balancing
CN102254031A (en) * 2011-08-03 2011-11-23 无锡浙潮科技有限公司 Batch processing request-based Microsoft SQL server database cluster
CN105049244A (en) * 2015-07-02 2015-11-11 浪潮(北京)电子信息产业有限公司 Load balancing method and system
CN105959145A (en) * 2016-06-04 2016-09-21 广东中兴新支点技术有限公司 Method and system for parallel management server of high availability cluster
US20160283335A1 (en) * 2015-03-24 2016-09-29 Xinyu Xingbang Information Industry Co., Ltd. Method and system for achieving a high availability and high performance database cluster

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1928873A (en) * 2006-09-25 2007-03-14 华为技术有限公司 System and method for database access for implementing load sharing
CN101115016A (en) * 2007-08-23 2008-01-30 创新科存储技术(深圳)有限公司 Method and system for implementing application server load balancing
CN102254031A (en) * 2011-08-03 2011-11-23 无锡浙潮科技有限公司 Batch processing request-based Microsoft SQL server database cluster
US20160283335A1 (en) * 2015-03-24 2016-09-29 Xinyu Xingbang Information Industry Co., Ltd. Method and system for achieving a high availability and high performance database cluster
CN105049244A (en) * 2015-07-02 2015-11-11 浪潮(北京)电子信息产业有限公司 Load balancing method and system
CN105959145A (en) * 2016-06-04 2016-09-21 广东中兴新支点技术有限公司 Method and system for parallel management server of high availability cluster

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
栾羿鲁: "集群WEB应用下的负载均衡技术研究与应用", 《万方学术电子期刊数据库》 *

Cited By (28)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107707654B (en) * 2017-09-30 2019-05-14 中国联合网络通信集团有限公司 The management method of container mirror image data, apparatus and system
CN107707654A (en) * 2017-09-30 2018-02-16 中国联合网络通信集团有限公司 The management method of container mirror image data, apparatus and system
CN108306955A (en) * 2018-01-24 2018-07-20 北京万得嘉瑞汽车技术有限公司 A kind of car-mounted terminal interconnects cluster method on a large scale
CN108306955B (en) * 2018-01-24 2021-06-15 北京万得嘉瑞汽车技术有限公司 Large-scale interconnection clustering method for vehicle-mounted terminals
CN108763300A (en) * 2018-04-19 2018-11-06 北京奇艺世纪科技有限公司 A kind of data query method and device
CN108763300B (en) * 2018-04-19 2020-07-31 北京奇艺世纪科技有限公司 Data query method and device
CN110493071A (en) * 2018-05-15 2019-11-22 中国移动通信集团浙江有限公司 Message system resources balance device, method and apparatus
CN108960773B (en) * 2018-06-28 2021-12-14 腾讯科技(深圳)有限公司 Service management method, computer device, and storage medium
CN108960773A (en) * 2018-06-28 2018-12-07 腾讯科技(深圳)有限公司 Business management method, computer equipment and storage medium
CN109542874A (en) * 2018-11-15 2019-03-29 用友网络科技股份有限公司 Deriving method, guiding device, server, terminal and readable storage medium storing program for executing
CN109558417A (en) * 2018-11-28 2019-04-02 亚信科技(南京)有限公司 A kind of data processing method and platform
CN109558417B (en) * 2018-11-28 2023-08-08 亚信科技(南京)有限公司 Data processing method and system
CN109614390A (en) * 2018-12-06 2019-04-12 无锡华云数据技术服务有限公司 Data base read-write separation method, device, service system, equipment and medium
CN109922151A (en) * 2019-03-12 2019-06-21 浪潮通用软件有限公司 A kind of data sharing method between micro services
CN110012111A (en) * 2019-04-16 2019-07-12 昆山丘钛微电子科技有限公司 A kind of data service group system and data processing method
CN110012111B (en) * 2019-04-16 2022-04-15 昆山丘钛微电子科技股份有限公司 Data service cluster system and data processing method
CN112784136A (en) * 2019-11-05 2021-05-11 阿里巴巴集团控股有限公司 Data query method and device and electronic equipment
CN110879718A (en) * 2019-11-15 2020-03-13 北京浪潮数据技术有限公司 maridb upgrading method and device, electronic equipment and storage medium
CN111131390A (en) * 2019-11-25 2020-05-08 深圳市瑞云科技有限公司 Storage caching method for improving cloud rendering concurrency number
CN111131390B (en) * 2019-11-25 2022-06-21 深圳市瑞云科技有限公司 Storage caching method for improving cloud rendering concurrency number
CN111200637A (en) * 2019-12-20 2020-05-26 新浪网技术(中国)有限公司 Cache processing method and device
CN111339180A (en) * 2019-12-24 2020-06-26 沈阳通用软件有限公司 Universal database synchronization method
CN111339180B (en) * 2019-12-24 2024-03-29 三六零数字安全科技集团有限公司 Universal database synchronization method
CN111078802A (en) * 2019-12-31 2020-04-28 叮当快药科技集团有限公司 Database reading and writing method and related device
CN112416973A (en) * 2020-11-02 2021-02-26 网宿科技股份有限公司 Method, server and system for separating reading and writing of distributed database
CN112817791A (en) * 2020-12-31 2021-05-18 西安合智宇信息科技有限公司 Mobile terminal monitoring method for mining state of working face cluster
CN112817791B (en) * 2020-12-31 2024-04-26 西安合智宇信息科技有限公司 Mobile terminal monitoring method for working face cluster mining state
CN114064414A (en) * 2021-11-25 2022-02-18 北京志凌海纳科技有限公司 High-availability cluster state monitoring method and system

Similar Documents

Publication Publication Date Title
CN106850759A (en) MySQL database clustering methods and its processing system
US11736561B2 (en) Load balanced network file accesses
CN106815059B (en) Linux virtual server LVS automates O&M method and operational system
US10104010B2 (en) Method and apparatus for allocating resources
CN112087312A (en) Method, device and equipment for providing edge service
CN103581276B (en) Cluster management device, system, service customer end and correlation method
CN113596110B (en) Cloud primary micro-service platform oriented to heterogeneous cloud
CN103607424B (en) Server connection method and server system
CN107231221A (en) Job flow control method, apparatus and system between data center
US9847903B2 (en) Method and apparatus for configuring a communication system
CN112015544A (en) Load balancing method, device and equipment of k8s cluster and storage medium
CN105791402B (en) A kind of cloud computing platform network virtualization implementation method and corresponding plug-in unit and agency
CN105491150A (en) Load balance processing method based on time sequence and system
CN109040243A (en) A kind of message processing method and device
CN106547790A (en) A kind of relevant database service system
CN113014611A (en) Load balancing method and related equipment
CN109428820A (en) A kind of multi-line is by method and system
CN113612688B (en) Distributed software defined network control system and construction method thereof
CN112463755B (en) System and method for storing and reading big data of heterogeneous Internet of things based on HDFS
CN108809838B (en) Service discovery processing method and device based on tree structure
CN111352726A (en) Streaming data processing method and device based on containerized micro-service
CN109302302A (en) Service scalable method, system and the computer readable storage medium of network element
CN106021248A (en) System and method for downloading video file related to meta-search engine
CN111767225B (en) Third-party software testing system and method in cloud computing environment
WO2017023256A1 (en) Cloud provisioning for networks

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

Application publication date: 20170613

RJ01 Rejection of invention patent application after publication