CN106682199A - Method and device for achieving automatic expansion of Mongos cluster - Google Patents

Method and device for achieving automatic expansion of Mongos cluster Download PDF

Info

Publication number
CN106682199A
CN106682199A CN201611250080.1A CN201611250080A CN106682199A CN 106682199 A CN106682199 A CN 106682199A CN 201611250080 A CN201611250080 A CN 201611250080A CN 106682199 A CN106682199 A CN 106682199A
Authority
CN
China
Prior art keywords
mongos
dilatation
burst
cluster
server
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
CN201611250080.1A
Other languages
Chinese (zh)
Other versions
CN106682199B (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.)
Beijing Qihoo Technology Co Ltd
Original Assignee
Beijing Qihoo Technology 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 Beijing Qihoo Technology Co Ltd filed Critical Beijing Qihoo Technology Co Ltd
Priority to CN201611250080.1A priority Critical patent/CN106682199B/en
Publication of CN106682199A publication Critical patent/CN106682199A/en
Application granted granted Critical
Publication of CN106682199B publication Critical patent/CN106682199B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • 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/22Indexing; Data structures therefor; Storage structures
    • G06F16/2219Large Object storage; Management thereof
    • 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/25Integrating or interfacing systems involving database management systems

Abstract

The invention discloses a method and device for achieving the automatic expansion of a Mongos cluster. The method includes the following steps: deploying clients of initialized Mongos cluster shardings on all servers in a database system respectively; receiving business capacity expansion need information needing to use more Mongos cluster resources, and according to the business expansion need information, generating Mongos cluster capacity expansion tasks; selecting a certain number of available servers from the database system, and distributing the tasks to the clients of initialized Mongos cluster shardings on all of selected servers; according to the received Mongos cluster capacity expansion tasks, allowing the clients of initialized Mongos cluster shardings to conduct initialization on new shardings on the servers in which the clients are located, deleting non-system databases in the new shardings, and adding the new shardings in the Mongos cluster. According to the method and the device, capacity expansion of a database can be automatically completed, the database capacity expansion efficiency is improved, and the running stability of the database is ensured.

Description

A kind of method and apparatus for realizing the dilatation of Mongos clusters automatization
Technical field
The present invention relates to field of computer technology, and in particular to a kind of method for realizing the dilatation of Mongos clusters automatization and Device.
Background technology
With the substantial increase that data volume is stored, the data base for data storage is also required to continuous dilatation.So, face Dilatation/capacity reducing to each Database Systems, if carrying out artificial treatment, can cause inefficiency, and cost of labor is high, data base Resource is not fully utilized, and can also affect the stability of Database Systems overall operation.So, being badly in need of one kind can realize number Overcome the problems referred to above according to the method or apparatus of storehouse automatization dilatation.
The content of the invention
In view of the above problems, it is proposed that the present invention so as to provide one kind overcome the problems referred to above or at least in part solve on State the method and corresponding device of realizing the dilatation of Mongos clusters automatization of problem.
According to one aspect of the present invention, there is provided a kind of method for realizing the dilatation of Mongos clusters automatization, including:
Respectively deployment initializes the client of Mongos cluster bursts on each server in Database Systems;
Reception needs the business dilatation demand information for using more Mongos cluster resources, according to the business dilatation demand Information generates Mongos cluster dilatation tasks;
Available a number of server is selected from Database Systems, and the Mongos clusters dilatation task is divided Issue the client of the initialization Mongos cluster bursts on selected each server;
Wherein, the client for initializing Mongos cluster bursts is being located according to the Mongos cluster dilatation tasks for being received New burst is initialized on server, the nonsystematic storehouse in new burst is deleted, and new burst is added in Mongos clusters.
Alternatively, the reception needs to include using the business dilatation demand information of more Mongos cluster resources:
The interface for submitting business demand information to is provided in specified cloud platform, is needed using more by the interface The business dilatation demand information of Mongos cluster resources.
Alternatively, the Mongos clusters dilatation task includes:The quantity and deployment Mongos clusters of required service device The relevant parameter of burst;
It is described to select available a number of server to include from Database Systems:According to the quantity of required service device The available server of respective numbers is selected from Database Systems.
Alternatively, it is described to be included according to business dilatation demand information generation Mongos cluster dilatation tasks:
According to the business dilatation demand information, the quantity of required service device, and each service of institute's quantification are determined Role Information of the data base for disposing in burst is needed on device;
Role Information of the data base for disposing in burst is needed on each server according to institute's quantification, difference is generated The Mongos cluster dilatation tasks of institute's quantification of the correspondence Role Information.
Alternatively, available a number of server is selected in the Database Systems, and by the Mongos clusters The client of the initialization Mongos cluster bursts that dilatation task is distributed on selected each server includes:
Required service device data volume according to determining selects the server of corresponding data amount from Database Systems, and will divide Not Dui Ying the Role Information institute's quantification Mongos cluster dilatations task be distributed to correspondingly at random it is selected Respective numbers server on initialization Mongos cluster bursts client.
Alternatively, the method is further included:
Start the data migration operation of Mongos clusters, the migrating data in the new burst for adding.
Alternatively, the method is further included:
Receive the initialization result that the client of the initialization Mongos cluster bursts on selected each server is returned Information;
The initialization result information for being received is sent to into the submission business dilatation demand letter by specifying communications conduit The business side of breath.
Alternatively, the method is further included:
Dispose the offline client of burst of Mongos clusters on each server in Database Systems respectively;
Wherein, the offline client of burst determines the data base of the offline burst of institute's needs on the server, and to it is true The data base of the offline burst of fixed needs carries out offline process.
Alternatively, the offline client of the burst determines that the data base of the offline burst of institute's needs on the server wraps Include:
Expired time comprising dilatation burst in the business dilatation demand information, and in Mongos cluster dilatation tasks Also the expired time of dilatation burst is included;The offline client scan of the burst resource information on the server obtain dilatation The expired time of burst, determines that the corresponding burst that dilatation is disposed is to need offline dividing when the expired time of dilatation burst is reached Piece, the data base that the offline fragment packets of the needs contain is the offline data base of needs;
Or,
The offline client of the burst obtains the access information of the burst disposed on the server of place, by nearest one section Visit capacity is defined as needing offline burst, the data base that the offline fragment packets of the needs contain less than the burst of preset value in time To need offline data base.
Alternatively, the method is further included:
Dispose the burst migration client of Mongos clusters respectively on each server of Database Systems;
The information for specifying burst no longer available is received, the newly-built task of burst and burst migration task are generated according to the information;
Available a number of server is selected from Database Systems, the newly-built task of the burst is distributed to selected The client of the initialization Mongos cluster bursts on each server selected, and burst migration task is distributed to selected Burst migration client on each server selected;
Wherein, initialize Mongos cluster bursts client according to the newly-built task of burst for being received in place server The new burst of upper initialization, deletes the nonsystematic storehouse in new burst, and new burst is added in Mongos clusters;Burst is migrated Client is by the Data Migration in the disabled specified burst to new burst.
Alternatively, the method is further included:
After the Data Migration in the disabled specified burst is finished, delete described disabled from Mongos clusters Specified burst.
According to a further aspect in the invention, there is provided a kind of device for realizing the dilatation of Mongos clusters automatization, including:
Client deployment unit, is suitable on each server in Database Systems deployment initialization Mongos clusters respectively The client of burst;
Demand receiving unit, is suitable to receive the business dilatation demand information for needing to use more Mongos cluster resources;
Dilatation processing unit, is suitable to generate Mongos cluster dilatation tasks according to the business dilatation demand information;From number According to selecting available a number of server in the system of storehouse, and the Mongos clusters dilatation task is distributed to selected The client of the initialization Mongos cluster bursts on each server;
Wherein, the client for initializing Mongos cluster bursts is being located according to the Mongos cluster dilatation tasks for being received New burst is initialized on server, the nonsystematic storehouse in new burst is deleted, new burst is added in Mongos clusters.
Alternatively, the demand receiving unit, is suitable to be provided in specified cloud platform and submits connecing for business demand information to Mouthful, the business dilatation demand information for using more Mongos cluster resources is needed by the interface.
Alternatively, the Mongos clusters dilatation task includes:The quantity and deployment Mongos clusters of required service device The relevant parameter of burst;
The dilatation processing unit, is suitable to that respective numbers are selected from Database Systems according to the quantity of required service device Available server.
Alternatively, the dilatation processing unit, is suitable to, according to the business dilatation demand information, determine required service device Role Information of the data base for disposing in burst is needed in quantity, and each server of institute's quantification;According to being determined Role Information of the data base for disposing in burst is needed on each server of quantity, is generated and correspond to respectively the Role Information The Mongos cluster dilatation tasks of institute's quantification.
Alternatively, the dilatation processing unit, is suitable to according to the required service device data volume for determining from Database Systems The server of corresponding data amount is selected, and the Mongos clusters dilatation for corresponding to institute's quantification of the Role Information respectively is appointed Business is distributed to correspondingly at random the client of the initialization Mongos cluster bursts on the server of selected respective numbers End.
Alternatively, the dilatation processing unit, is further adapted for starting the data migration operation of Mongos clusters, to addition New burst in migrating data.
Alternatively, the dilatation processing unit, is further adapted for receiving the initialization on selected each server The initialization result information that the client of Mongos cluster bursts is returned;The initialization result information for being received is logical by specifying Letter channel is sent to the business side for submitting the business dilatation demand information to.
Alternatively, the client deployment unit, is further adapted for distinguishing portion on each server in Database Systems The offline client of burst of administration's Mongos clusters;
Wherein, the offline client of burst determines the data base of the offline burst of institute's needs on the server, and to it is true The data base of the offline burst of fixed needs carries out offline process.
Alternatively, the expired time comprising dilatation burst in the business dilatation demand information, and Mongos clusters expands Also the expired time of dilatation burst is included in appearance task;The offline client of the burst by scanning resource on the server The expired time of acquisition of information dilatation burst, determines that the corresponding burst that dilatation is disposed is when the expired time of dilatation burst is reached Offline burst is needed, the data base that the offline fragment packets of the needs contain is the offline data base of needs;
Or,
The offline client of the burst obtains the access information of the burst disposed on the server of place, by nearest one section Visit capacity is defined as needing offline burst, the data base that the offline fragment packets of the needs contain less than the burst of preset value in time To need offline data base.
Alternatively, the client deployment unit, is further adapted for being disposed respectively on each server of Database Systems The burst migration client of Mongos clusters;
The demand receiving unit, is further adapted for receiving the no longer available information of specified burst;
The dilatation processing unit, is further adapted for generating the newly-built task of burst and burst migration task according to the information; Available a number of server is selected from Database Systems, the newly-built task of the burst is distributed to into selected each clothes The client of the initialization Mongos cluster bursts on business device, and burst migration task is distributed to into selected each clothes Burst migration client on business device;
Wherein, initialize Mongos cluster bursts client according to the newly-built task of burst for being received in place server The new burst of upper initialization, deletes the nonsystematic storehouse in new burst, and new burst is added in Mongos clusters;Burst is migrated Client is by the Data Migration of the disabled specified burst to new burst.
Alternatively, the dilatation processing unit, is further adapted for when the Data Migration in the disabled specified burst After finishing, from Mongos clusters the disabled specified burst is deleted.
Technology according to the present invention scheme, is all deployed with initialization Mongos clusters on each server in Database Systems The client of burst, after the business dilatation demand information of the Mongos cluster resources for receiving business side, business dilatation is needed Ask information to generate dilatation business, and select a number of available server, dilatation task is sent to into the server of selection On initialization Mongos cluster bursts client, the client will according to dilatation task carry out its place server enter The initialization of the new burst of row, completes the dilatation of Mongos clusters.It can be seen that, the present invention can be automatically performed according to business dilatation demand The dilatation of data base, improves data-base capacity-enlarging efficiency, in the case where business demand is met, it is ensured that it is steady that Database Systems are run It is qualitative.
Described above is only the general introduction of technical solution of the present invention, in order to better understand the technological means of the present invention, And can be practiced according to the content of description, and in order to allow the above and other objects of the present invention, feature and advantage can Become apparent, below especially exemplified by the specific embodiment of the present invention.
Description of the drawings
By the detailed description for reading hereafter preferred implementation, various other advantages and benefit is common for this area Technical staff will be clear from understanding.Accompanying drawing is only used for illustrating the purpose of preferred implementation, and is not considered as to the present invention Restriction.And in whole accompanying drawing, it is denoted by the same reference numerals identical part.In the accompanying drawings:
Fig. 1 shows that the flow process of the method for realizing the dilatation of Mongos clusters automatization according to an embodiment of the invention is shown It is intended to;
Fig. 2 shows that the structure of the device for realizing the dilatation of Mongos clusters automatization according to an embodiment of the invention is shown It is intended to.
Specific embodiment
The exemplary embodiment of the disclosure is more fully described below with reference to accompanying drawings.Although showing the disclosure in accompanying drawing Exemplary embodiment, it being understood, however, that may be realized in various forms the disclosure and should not be by embodiments set forth here Limited.On the contrary, there is provided these embodiments are able to be best understood from the disclosure, and can be by the scope of the present disclosure Complete conveys to those skilled in the art.
Fig. 1 shows that the flow process of the method for realizing the dilatation of Mongos clusters automatization according to an embodiment of the invention is shown It is intended to;As shown in figure 1, the method includes:
Step S110, respectively deployment initializes the client of Mongos cluster bursts on each server in Database Systems End.
Mongos clusters are a kind of data-base clusters of distributed storage architecture, are adapted to the storage of mass data.Mongos Cluster includes several routing nodes, several burst nodes and some metadata nodes.Wherein, routing node is used to incite somebody to action The demand of business side is pointed in corresponding burst, and stored data position, burst node in each burst are recorded in metadata For storing substantial amounts of data.When user carries out data query, the storage location of corresponding data in metadata node can be passed through Carry out the inquiry of corresponding data.When the business dilatation demand in the face of more Mongos cluster resources, can be by increasing cluster In burst carry out the dilatation of whole Mongos clusters.
In order to realize the automatic dilatation of Mongos clusters, need to dispose one on each server in Database Systems The client of individual initialization Mongos cluster bursts, the client of initialization Mongos cluster bursts is for Mongos clusters The initialized client of burst, with finishing service demand in the dilatation to Mongos cluster bursts.
Step S120, reception needs the business dilatation demand information for using more Mongos cluster resources, is expanded according to business Hold demand information and generate Mongos cluster dilatation tasks.Wherein, the client of Mongos cluster bursts is initialized according to being received Mongos cluster dilatation tasks initializing new burst on the server, delete the nonsystematic storehouse in new burst, and New burst is added in Mongos clusters.
When there is the business dilatation demand of Mongos cluster resources business side, can be provided by corresponding demand interface is needed Seek information.Here demand interface can be that in the form of a cloud platform, cloud platform is provided with business demand editing interface, industry To submit to after the corresponding information editing of business demand business side.
When business dilatation demand information is received by demand entrance, generated according to corresponding business demand information corresponding Mongos cluster dilatation tasks, so that server is initialized accordingly the expansion of burst according to Mongos cluster dilatation tasks Hold operation.
Step S130, selects available a number of server from Database Systems, and by Mongos cluster dilatations Task is distributed to the client of the initialization Mongos cluster bursts on selected each server.
Here available a number of server is selected from Database Systems, be on the one hand according to each server from The availability of body resource and it is whether available carry out selecting to can be used to the server for disposing the business, to reduce the wasting of resources; On the other hand, it is also desirable to the quantity of the server of the business is disposed according to the selection of business demand information, to meet business demand.Example Such as, business demand needs to increase by 10 bursts, but the available space of each server can only increase by 2 bursts, then just need 5 available servers are wanted to carry out the dilatation of the business.
After available a number of server is chosen, Mongos cluster dilatation tasks are distributed to selected each The client of the initialization Mongos cluster bursts on server.
Expand when the client of the initialization Mongos cluster bursts on selected each server receives Mongos clusters After appearance task, the client for initializing Mongos cluster bursts is serviced according to the Mongos cluster dilatation tasks for being received at place New burst is initialized on device, the nonsystematic storehouse in new burst is deleted, and new burst is added in Mongos clusters.
Here nonsystematic data base be it is non-in server carry, be in order to ensure that user can use, need newly-built Burst in create a nonsystematic data base, but during by existing Data Migration to new burst, this nonsystematic number It is unnecessary according to storehouse, so when carrying out new burst and being initialized, needs carry out the nonsystematic data base in the burst Delete, then new burst is added in Mongos clusters again, be finally completed the dilatation of Mongos clusters.
Since it is desired that the server selected to each sends Mongos cluster dilatation tasks, so, business demand The number of Mongos cluster dilatation tasks is the same with the quantity of the server for selecting, and then disposes the data base of the quantity Task is sent on the server of selection.
It can be seen that, the present invention can be automatically performed the dilatation of data base according to business dilatation demand, improve data-base capacity-enlarging efficiency, In the case where business demand is met, it is ensured that the stability of Database Systems operation.
In one embodiment of the invention, the reception in step S110 needs the industry for using more Mongos cluster resources Business dilatation demand information includes:The interface for submitting business demand information to is provided in specified cloud platform, by the interface Need the business dilatation demand information for using more Mongos cluster resources.
When there is the business dilatation demand of more Mongos cluster resources business side, the cloud platform that can pass through to specify above is carried For demand interface the offer of demand information is provided.For example, cloud platform provides a webpage, and business side carries out phase on the webpage Answer the information editing of business demand.After business side edits, submitted to, then its business demand will pass through this cloud platform Demand interface be sent to rear end carry out Mongos cluster dilatations process operation.
In one embodiment of the invention, the Mongos cluster dilatation tasks in step S120 include:Required service The quantity of device and the relevant parameter of deployment Mongos cluster bursts;Available one is selected from Database Systems in step S130 The server of fixed number amount includes:The available service of respective numbers is selected from Database Systems according to the quantity of required service device Device.
Business side is submitted to after the business dilatation demand of more Mongos cluster resources, in order to complete the process of demand, is needed Corresponding dilatation task is generated according to business dilatation demand, and includes the quantity of the server needed for repairing in the task, so as to Carry out the selection of available server;The relevant parameter of the Mongos cluster bursts of dilatation is also included, for example:The disk of needs Space etc..
After dilatation task is generated, the quantity of the server needed for will being included in dilatation task is selected, When selecting server, the demand except to meet business dilatation in quantity and relevant parameter, for example, data base's deployment task Needed for server quantity be 5, then need when selection select 5 available servers;Will also be according to each clothes The situation of business device itself is selected, such as business in the availability of server own resource, whether available and data base Importance selected, to reduce the waste of server resource.After from the aspect of comprehensive two, could final choice respective numbers Server.
Because in Mongos cluster dilatations, the burst of increase is also likely to be master-slave mode database form, master-slave mode number Include a MDL with one or more from data base according to storehouse, realize the separation of data base read-write function.Main number It is responsible for writing the operation of data according to storehouse, is responsible for being backed up and be responsible for data query etc. to the data of MDL from data base Operation.In order to realize the dilatation of master-slave mode data base, in one embodiment of the invention, being expanded according to business in step S120 Holding demand information generation Mongos cluster dilatation tasks includes:According to business dilatation demand information, the number of required service device is determined Amount, and Role Information of the data base for disposing in burst is needed on each server of institute's quantification, it is master data for example Storehouse is still from data base;Role Information of the data base for disposing in burst is needed on each server according to institute's quantification, Generate the Mongos cluster dilatation tasks of the institute's quantification for corresponding to Role Information respectively.
For example, 4 servers are selected during dilatation, 1 MDL and 3 is needed from data base, then 1 will be generated The Mongos cluster dilatation tasks of MDL and corresponding 3 Mongos cluster dilatation tasks from data base.
Specifically, available a number of server is selected in Database Systems, and by Mongos cluster dilatation tasks The client of the initialization Mongos cluster bursts being distributed on selected each server includes:According to the required service for determining Device data volume selects the server of corresponding data amount from Database Systems, and will respectively correspond to institute's quantification of Role Information Mongos cluster dilatations task be distributed to initialization on the server of selected respective numbers correspondingly at random The client of Mongos cluster bursts.
Data base's deployment task of institute's quantification of corresponding Role Information here, is to be sent to selected clothes at random On business device, that is to say, that each server for selecting can receive the Mongos cluster dilatation tasks of a correspondence Role Information, But the Mongos cluster dilatation tasks of specifically which role are uncertain.That is, the transmission of task is random point Send out, not limiting certain Mongos cluster dilatation task must be distributed to a server specified, as long as ensureing after distribution, choosing Each server selected has been distributed a Mongos cluster dilatation task.For example, it is determined that the quantity of server be 3, then be accomplished by selecting three servers, it is respectively server 1, server 2, server 3, eventually generate 1 master data The Mongos cluster dilatation tasks in storehouse and corresponding 2 Mongos cluster dilatation tasks from data base, carry out task transmission When, the Mongos cluster dilatation tasks of MDL can be distributed to the initialization Mongos cluster bursts on server 1 Client, the client of the initialization Mongos cluster bursts that can be distributed on server 2, can also be distributed to server 3 On initialization Mongos cluster bursts client;Other 2 can distribute from the Mongos cluster dilatation tasks of data base To the client of the initialization Mongos cluster bursts on server 1, the initialization Mongos collection that can be distributed on server 2 The client of the client of group's burst, the initialization Mongos cluster bursts that can also be distributed on server 3, after final distribution Ensure that server 1, server 2 and server 3 there are Mongos cluster dilatation tasks.
In a specific example, needs carry out dilatation in 4 servers, and one of them is MDL, and in addition three Individual is from data base.After Mongos cluster dilatations task is generated, the parameter included in one of Mongos clusters dilatation task Information is:P1=mdm, P2=30G, P3=200G.Wherein, P1 representation databases role, P2 represents memory headroom, and P3 represents magnetic Disk space.When the client of the initialization Mongos cluster bursts of selected one of server receives the Mongos collection After group's dilatation task, by the parameter information in the task, a MDL, the data base will be set up on its server There are 30G internal memories, the disk space of 200G.
When the data base of Mongos frameworks carries out data to be write, however not excluded that occur that mass data is stored in same In individual burst, and the little situation of the data volume in other bursts, in order to avoid such case appearance, have in Mongos frameworks Data in the more burst of data storage are moved out of part storage to other relative frees by one data function in a balanced way In burst, data volume in all bursts effect in a balanced way is reached.So, after Mongos cluster dilatations are carried out, in the present invention One embodiment in, the method shown in Fig. 1 is further included:Start the data migration operation of Mongos clusters, to what is added Migrating data in new burst.
It is divided into several data blocks (can also claim chunck or bucket) in Mongos clusters in each burst again, starts Mongos The data migration operation of cluster, the migrating data in the new burst for adding, that is to say, that create in the new burst for adding Data block, by Data Migration to data block.For example, original Mongos clusters have 4 bursts, there is 6 data in each burst The data volume of block, after Mongos cluster dilatations, Mongos clusters have newly increased 2 bursts, become 6 bursts, then start number After according to equalizer, will just the amount of 44 data blocks of migration be migrated in newly increase 2 bursts respectively, finally cause in each burst There is the data volume of 4 data blocks.
After the dilatation of Mongos clusters is good, in one embodiment of the invention, the method shown in Fig. 1 is further included: Receive the initialization result information that the client of the initialization Mongos cluster bursts on selected each server is returned;By institute The initialization result information of reception is sent to the business side of submission business dilatation demand information by specifying communications conduit.
Business dilatation is the situation for more business amount, after Mongos clusters no longer need dilatation, in order to reduce number According to the waste of base resource, need for the burst after dilatation to carry out offline process, in one embodiment of the invention, shown in Fig. 1 Method further include:
Dispose the offline client of burst of Mongos clusters on each server in Database Systems respectively;Wherein, divide The offline client of piece determines the data base of the offline burst of institute's needs on the server, and offline dividing is needed to determined by The data base of piece carries out offline process.After the demand of business dilatation terminates, the offline client of data base determines place server On the offline burst of needs data base, and need the data base of offline burst to carry out offline process to determined by.
The data base that the carries out burst offline process when, if comprising dilatation burst in business dilatation demand information Data base's expired time, also includes data base's expired time of dilatation burst in Mongos cluster dilatation tasks, then, under burst Line client determines that the institute data base of offline burst that needs on the server includes:Comprising expansion in business dilatation demand information Hold the expired time of burst, and the also expired time comprising dilatation burst in Mongos cluster dilatation tasks;The offline visitor of burst Family end scanning institute resource information on the server obtains the expired time of dilatation burst, when the expired time arrival of dilatation burst When determine that the corresponding burst that dilatation is disposed is to need offline burst, the data base that the offline fragment packets of the needs contain is under needs The data base of line.For example, when business side proposes business dilatation demand, the data base of the burst of a dilatation is preset Expired time be 10 days, then when the business dilatation burst data base use 10 days after, the burst in server is offline Client determines that the data base of the burst of the dilatation has arrived at expired time 10 days, and the data base of the burst will be carried out Offline process.
When the data base that carries out burst offline process, the data base for needing offline burst is not necessarily new dilatation Burst data base, it is also possible to after the data base's unitary analysiss to the whole Mongos clusters of the business, it is determined that need it is offline Burst data base.In this case, it is determined that needing the method for the data base of offline burst is:The offline client of burst The access information of the burst disposed on the server of place is obtained, the visit capacity within nearest a period of time is less than into dividing for preset value Piece is defined as needing offline burst, and the data base that the offline fragment packets of the needs contain is the offline data base of needs.For example, if Preset value is determined for 100, then the data base of burst of the quantity less than 100 times is all accessed within a period of time just can be considered as Need the data base of offline burst.
During the use of the burst of Mongos clusters, unavoidably occur that burst goes wrong, it is no longer available Situation, if without corresponding counter-measure, the data in the burst for going wrong will lose.In order to prevent losing for data Lose, needs carry out disposing burst migration client, to carry out the migration of data.In one embodiment of the invention, the method Further include:Dispose the burst migration client of Mongos clusters respectively on each server of Database Systems.
When there is the no longer available situation of burst, the client can receive the no longer available information of specified burst, according to The information generates the newly-built task of burst and burst migration task;Available a number of service is selected from Database Systems Device, the client of the initialization Mongos cluster bursts newly-built task of burst being distributed on selected each server, and Burst is migrated into the burst migration client that task is distributed on selected each server, wherein selecting in the foundation of server One is described in detail, will not be described here.
Burst migration client on selected each server is received after burst migration task, initializes Mongos collection The client of group's burst is initializing on the server new burst according to the newly-built task of burst for being received, and deletes new dividing Nonsystematic storehouse in piece, new burst is added in Mongos clusters;Burst migrates client by disabled specified burst Data Migration to new burst.
Since it is desired that the no longer available state of the burst of migrating data, so, it is above-mentioned in order to prevent the waste of resource Method is further included:After the Data Migration in disabled specified burst is finished, delete disabled from Mongos clusters Specified burst.
Fig. 2 shows that the structure of the device for realizing the dilatation of Mongos clusters automatization according to an embodiment of the invention is shown It is intended to.As shown in Fig. 2 this realizes that the device 200 of Mongos clusters automatization dilatation includes:
Client deployment unit 210, is suitable on each server in Database Systems deployment initialization Mongos respectively The client of cluster burst.
Mongos clusters are a kind of data-base clusters of distributed storage architecture, are adapted to the storage of mass data.Mongos Cluster includes several routing nodes, several burst nodes and some metadata nodes.Wherein, routing node is used to incite somebody to action The demand of business side is pointed in corresponding burst, and stored data position, burst node in each burst are recorded in metadata For storing substantial amounts of data.When user carries out data query, the storage location of corresponding data in metadata node can be passed through Carry out the inquiry of corresponding data.When the business dilatation demand in the face of more Mongos cluster resources, can be by increasing cluster In burst carry out the dilatation of whole Mongos clusters.
In order to realize the automatic dilatation of Mongos clusters, need to dispose one on each server in Database Systems The client of individual initialization Mongos cluster bursts, the client of initialization Mongos cluster bursts is for Mongos clusters The initialized client of burst, with finishing service demand in the dilatation to Mongos cluster bursts.
Demand receiving unit 220, is suitable to receive the business dilatation demand information for needing to use more Mongos cluster resources.
When there is the business dilatation demand of Mongos cluster resources business side, can be provided by corresponding demand interface is needed Seek information.Here demand interface can be that in the form of a cloud platform, cloud platform is provided with business demand editing interface, industry To submit to after the corresponding information editing of business demand business side.
When business dilatation demand information is received by demand entrance, generated according to corresponding business demand information corresponding Mongos cluster dilatation tasks, so that server is initialized accordingly the expansion of burst according to Mongos cluster dilatation tasks Hold operation.
Dilatation processing unit 230, is suitable to generate Mongos cluster dilatation tasks according to business dilatation demand information;From data Available a number of server is selected in the system of storehouse, and Mongos cluster dilatation tasks are distributed to into selected each service The client of the initialization Mongos cluster bursts on device.Wherein, the client of Mongos cluster bursts is initialized according to being connect The Mongos cluster dilatation tasks of receipts are initializing on the server new burst, delete the nonsystematic storehouse in new burst, And new burst is added in Mongos clusters.
Here available a number of server is selected from Database Systems, be on the one hand according to each server from The availability of body resource and it is whether available carry out selecting to can be used to the server for disposing the business, to reduce the wasting of resources; On the other hand, it is also desirable to the quantity of the server of the business is disposed according to the selection of business demand information, to meet business demand.Example Such as, business demand needs to increase by 10 bursts, but the available space of each server can only increase by 2 bursts, then just need 5 available servers are wanted to carry out the dilatation of the business.
After available a number of server is chosen, Mongos cluster dilatation tasks are distributed to selected each The client of the initialization Mongos cluster bursts on server.
Expand when the client of the initialization Mongos cluster bursts on selected each server receives Mongos clusters After appearance task, the client for initializing Mongos cluster bursts is serviced according to the Mongos cluster dilatation tasks for being received at place New burst is initialized on device, the nonsystematic storehouse in new burst is deleted, new burst is added in Mongos clusters.
Here nonsystematic data base be it is non-in server carry, be in order to ensure that user can use, need newly-built Burst in create a nonsystematic data base, but during by existing Data Migration to new burst, this nonsystematic number It is unnecessary according to storehouse, so when carrying out new burst and being initialized, needs carry out the nonsystematic data base in the burst Delete, then new burst is added in Mongos clusters again, be finally completed the dilatation of Mongos clusters.
Since it is desired that the server selected to each sends Mongos cluster dilatation tasks, so, business demand The number of Mongos cluster dilatation tasks is the same with the quantity of the server for selecting, and then disposes the data base of the quantity Task is sent on the server of selection.
It can be seen that, the present invention can be automatically performed the dilatation of data base according to business dilatation demand, improve data-base capacity-enlarging efficiency, In the case where business demand is met, it is ensured that the stability of Database Systems operation.
In one embodiment of the invention, demand receiving unit 220, is suitable to be provided in specified cloud platform and submits industry to The interface of business demand information, the business dilatation demand information for using more Mongos cluster resources is needed by the interface.
When there is the business dilatation demand of more Mongos cluster resources business side, the cloud platform that can pass through to specify above is carried For demand interface the offer of demand information is provided.For example, cloud platform provides a webpage, and business side carries out phase on the webpage Answer the information editing of business demand.After business side edits, submitted to, then its business demand will pass through this cloud platform Demand interface be sent to rear end carry out Mongos cluster dilatations process operation.
In one embodiment of the invention, Mongos clusters dilatation task includes:The quantity of required service device and portion The relevant parameter of administration's Mongos cluster bursts.
Dilatation processing unit 230, is suitable to that respective numbers are selected from Database Systems according to the quantity of required service device Available server.
Business side is submitted to after the business dilatation demand of more Mongos cluster resources, in order to complete the process of demand, is needed Corresponding dilatation task is generated according to business dilatation demand, and includes the quantity of the server needed for repairing in the task, so as to Carry out the selection of available server;The relevant parameter of the Mongos cluster bursts of dilatation is also included, for example:The disk of needs Space etc..
After dilatation task is generated, the quantity of the server needed for will being included in dilatation task is selected, When selecting server, the demand except to meet business dilatation in quantity and relevant parameter, for example, data base's deployment task Needed for server quantity be 5, then need when selection select 5 available servers;Will also be according to each clothes The situation of business device itself is selected, such as business in the availability of server own resource, whether available and data base Importance selected, to reduce the waste of server resource.After from the aspect of comprehensive two, could final choice respective numbers Server.
Because in Mongos cluster dilatations, the burst of increase is also likely to be master-slave mode database form, master-slave mode number Include a MDL with one or more from data base according to storehouse, realize the separation of data base read-write function.Main number It is responsible for writing the operation of data according to storehouse, is responsible for being backed up and be responsible for data query etc. to the data of MDL from data base Operation.In order to realize the dilatation of master-slave mode data base, in one embodiment of the invention, dilatation processing unit 230 is suitable to root According to business dilatation demand information, determining needs what is disposed in the quantity of required service device, and each server of institute's quantification Role Information of the data base in burst, is MDL or from data base for example;According to each server of institute's quantification The upper Role Information for needing the data base of deployment in burst, generates the Mongos of the institute's quantification for corresponding to Role Information respectively Cluster dilatation task.
For example, 4 servers are selected during dilatation, 1 MDL and 3 is needed from data base, then 1 will be generated The Mongos cluster dilatation tasks of MDL and corresponding 3 Mongos cluster dilatation tasks from data base.
Specifically, dilatation processing unit 230, is suitable to be selected from Database Systems according to the required service device data volume for determining The server of corresponding data amount is selected, and the Mongos cluster dilatation tasks for corresponding to institute's quantification of Role Information respectively is random The client of the initialization Mongos cluster bursts being distributed to correspondingly on the server of selected respective numbers.
Data base's deployment task of institute's quantification of corresponding Role Information here, is to be sent to selected clothes at random On business device, that is to say, that each server for selecting can receive the Mongos cluster dilatation tasks of a correspondence Role Information, But the Mongos cluster dilatation tasks of specifically which role are uncertain.That is, the transmission of task is random point Send out, not limiting certain Mongos cluster dilatation task must be distributed to a server specified, as long as ensureing after distribution, choosing Each server selected has been distributed a Mongos cluster dilatation task.For example, it is determined that the quantity of server be 3, then be accomplished by selecting three servers, it is respectively server 1, server 2, server 3, eventually generate 1 master data The Mongos cluster dilatation tasks in storehouse and corresponding 2 Mongos cluster dilatation tasks from data base, carry out task transmission When, the Mongos cluster dilatation tasks of MDL can be distributed to the initialization Mongos cluster bursts on server 1 Client, the client of the initialization Mongos cluster bursts that can be distributed on server 2, can also be distributed to server 3 On initialization Mongos cluster bursts client;Other 2 can distribute from the Mongos cluster dilatation tasks of data base To the client of the initialization Mongos cluster bursts on server 1, the initialization Mongos collection that can be distributed on server 2 The client of the client of group's burst, the initialization Mongos cluster bursts that can also be distributed on server 3, after final distribution Ensure that server 1, server 2 and server 3 there are Mongos cluster dilatation tasks.
In a specific example, needs carry out dilatation in 4 servers, and one of them is MDL, and in addition three Individual is from data base.After Mongos cluster dilatations task is generated, the parameter included in one of Mongos clusters dilatation task Information is:P1=mdm, P2=30G, P3=200G.Wherein, P1 representation databases role, P2 represents memory headroom, and P3 represents magnetic Disk space.When the client of the initialization Mongos cluster bursts of selected one of server receives the Mongos collection After group's dilatation task, by the parameter information in the task, a MDL, the data base will be set up on its server There are 30G internal memories, the disk space of 200G.
When the data base of Mongos frameworks carries out data to be write, however not excluded that occur that mass data is stored in same In individual burst, and the little situation of the data volume in other bursts, in order to avoid such case appearance, have in Mongos frameworks Data in the more burst of data storage are moved out of part storage to other relative frees by one data function in a balanced way In burst, data volume in all bursts effect in a balanced way is reached.So, after Mongos cluster dilatations are carried out, in the present invention One embodiment in, dilatation processing unit 230, be further adapted for start Mongos clusters data migration operation, to addition New burst in migrating data.
It is divided into several data blocks (can also claim chunck or bucket) in Mongos clusters in each burst again, starts Mongos The data migration operation of cluster, the migrating data in the new burst for adding, that is to say, that create in the new burst for adding Data block, by Data Migration to data block.For example, original Mongos clusters have 4 bursts, there is 6 data in each burst The data volume of block, after Mongos cluster dilatations, Mongos clusters have newly increased 2 bursts, become 6 bursts, then start number After according to equalizer, will just the amount of 44 data blocks of migration be migrated in newly increase 2 bursts respectively, finally cause in each burst There is the data volume of 4 data blocks.
After the dilatation of Mongos clusters is good, in one embodiment of the invention, dilatation processing unit 230 is further fitted In the initialization result information that the client for receiving the initialization Mongos cluster bursts on selected each server is returned;Will The initialization result information for being received is sent to the business side of submission business dilatation demand information by specifying communications conduit.
Business dilatation is the situation for more business amount, after Mongos clusters no longer need dilatation, in order to reduce number According to the waste of base resource, need for the burst after dilatation to carry out offline process, in one embodiment of the invention, client end Administration's unit 210, is further adapted on each server in Database Systems disposing the offline visitor of burst of Mongos clusters respectively Family end;Wherein, the offline client of burst determines the institute data base for needing offline burst on the server, and to determined by Needing the data base of offline burst carries out offline process.After the demand of business dilatation terminates, the offline client of data base is true Fixed institute on the server need the data base of offline burst, and need the data base of offline burst to carry out to determined by Offline process.
The data base that the carries out burst offline process when, if comprising dilatation burst in business dilatation demand information Data base's expired time, also includes data base's expired time of dilatation burst in Mongos cluster dilatation tasks, then, business expands Hold the expired time comprising dilatation burst in demand information, and the also mistake comprising dilatation burst in Mongos cluster dilatation tasks Time phase;The offline client of burst by scanning institute on the server resource information acquisition dilatation burst expired time, when The expired time of dilatation burst determines that the corresponding burst that dilatation is disposed is to need offline burst when reaching, the needs are offline to be divided The data base that piece is included is the offline data base of needs.For example, when business side proposes business dilatation demand, preset The expired time of the data base of the burst of one dilatation is 10 days, then when the data base of the dilatation burst of the business uses 10 days Afterwards, the offline client of burst in server determines that the data base of the burst of the dilatation has arrived at expired time 10 days, just Offline process can be carried out to the data base of the burst.
When the data base that carries out burst offline process, the data base for needing offline burst is not necessarily new dilatation Burst data base, it is also possible to after the data base's unitary analysiss to the whole Mongos clusters of the business, it is determined that need it is offline Burst data base.In this case, it is determined that needing the method for the data base of offline burst is:The offline client of burst The access information of the burst disposed on the server of place is obtained, the visit capacity within nearest a period of time is less than into dividing for preset value Piece is defined as needing offline burst, and the data base that the offline fragment packets of the needs contain is the offline data base of needs.For example, if Preset value is determined for 100, then the data base of burst of the quantity less than 100 times is all accessed within a period of time just can be considered as Need the data base of offline burst.
During the use of the burst of Mongos clusters, unavoidably occur that burst goes wrong, it is no longer available Situation, if without corresponding counter-measure, the data in the burst for going wrong will lose.In order to prevent losing for data Lose, needs carry out disposing burst migration client, to carry out the migration of data.In one embodiment of the invention, client Deployment unit 210, is further adapted for disposing the burst migration visitor of Mongos clusters respectively on each server of Database Systems Family end.
Demand receiving unit 220, is further adapted for, when there is the no longer available situation of burst, receiving and specifying burst no longer Available information.
Dilatation processing unit 230, is further adapted for generating the newly-built task of burst and burst migration task according to the information;From Available a number of server is selected in Database Systems, the newly-built task of burst is distributed on selected each server Initialization Mongos cluster bursts client, and by burst migrate task be distributed on selected each server point Piece migrates client, wherein the foundation upper for selecting server is described in detail, will not be described here.
Burst migration client on selected each server is received after burst migration task, initializes Mongos collection The client of group's burst is initializing on the server new burst according to the newly-built task of burst for being received, and deletes new dividing Nonsystematic storehouse in piece, new burst is added in Mongos clusters;Burst migrates client by disabled specified burst Data Migration is to new burst.
Since it is desired that the no longer available state of the burst of migrating data, so, in order to prevent the waste of resource, dilatation Processing unit 230, is further adapted for after the Data Migration in disabled specified burst is finished, deleting not from Mongos clusters Available specified burst.
In sum, technology according to the present invention scheme, on each server in Database Systems initialization is all deployed with The client of Mongos cluster bursts, after the business dilatation demand information of the Mongos cluster resources for receiving business side, will Business dilatation demand information generates dilatation business, and selects a number of available server, and dilatation task is sent to into choosing The client of the initialization Mongos cluster bursts on the server selected, the client will carry out its place according to dilatation task Server carry out the initialization of new burst, complete the dilatation of Mongos clusters.It can be seen that, the present invention can be according to business dilatation need The dilatation for being automatically performed data base is asked, data-base capacity-enlarging efficiency is improved, in the case where business demand is met, it is ensured that data base set The stability of system operation.
It should be noted that:
Provided herein algorithm and display be not inherently related to any certain computer, virtual bench or miscellaneous equipment. Various fexible units can also be used together based on teaching in this.As described above, construct required by this kind of device Structure be obvious.Additionally, the present invention is also not for any certain programmed language.It is understood that, it is possible to use it is various Programming language realizes the content of invention described herein, and the description done to language-specific above is to disclose this Bright preferred forms.
In description mentioned herein, a large amount of details are illustrated.It is to be appreciated, however, that the enforcement of the present invention Example can be put into practice in the case of without these details.In some instances, known method, structure is not been shown in detail And technology, so as not to obscure the understanding of this description.
Similarly, it will be appreciated that in order to simplify the disclosure and help understand one or more in each inventive aspect, exist Above in the description of the exemplary embodiment of the present invention, each feature of the present invention is grouped together into single enforcement sometimes In example, figure or descriptions thereof.However, the method for the disclosure should be construed to reflect following intention:I.e. required guarantor The more features of feature that the application claims ratio of shield is expressly recited in each claim.More precisely, such as following Claims reflect as, inventive aspect is all features less than single embodiment disclosed above.Therefore, Thus the claims for following specific embodiment are expressly incorporated in the specific embodiment, wherein each claim itself All as the separate embodiments of the present invention.
Those skilled in the art are appreciated that can be carried out adaptively to the module in the equipment in embodiment Change and they are arranged in one or more equipment different from the embodiment.Can be the module or list in embodiment Unit or component are combined into a module or unit or component, and can be divided in addition multiple submodule or subelement or Sub-component.In addition at least some in such feature and/or process or unit is excluded each other, can adopt any Combine to all features disclosed in this specification (including adjoint claim, summary and accompanying drawing) and so disclosed Where all processes or unit of method or equipment are combined.Unless expressly stated otherwise, this specification is (including adjoint power Profit is required, summary and accompanying drawing) disclosed in each feature can it is identical by offers, be equal to or the alternative features of similar purpose carry out generation Replace.
Although additionally, it will be appreciated by those of skill in the art that some embodiments described herein include other embodiments In included some features rather than further feature, but the combination of the feature of different embodiments means in of the invention Within the scope of and form different embodiments.For example, in the following claims, embodiment required for protection appoint One of meaning can in any combination mode using.
The present invention all parts embodiment can be realized with hardware, or with one or more processor operation Software module realize, or with combinations thereof realization.It will be understood by those of skill in the art that can use in practice Microprocessor or digital signal processor (DSP) are realizing according to embodiments of the present invention realizing that Mongos clusters automatization expands The some or all functions of some or all parts in the device of appearance.The present invention is also implemented as performing here (for example, computer program and computer program are produced for some or all equipment of described method or program of device Product).Such program for realizing the present invention can be stored on a computer-readable medium, or can have one or more The form of signal.Such signal can be downloaded from internet website and obtained, or be provided on carrier signal, or to appoint What other forms is provided.
It should be noted that above-described embodiment the present invention will be described rather than limits the invention, and ability Field technique personnel can design without departing from the scope of the appended claims alternative embodiment.In the claims, Any reference markss between bracket should not be configured to limitations on claims.Word "comprising" is not excluded the presence of not Element listed in the claims or step.Word "a" or "an" before element does not exclude the presence of multiple such Element.The present invention can come real by means of the hardware for including some different elements and by means of properly programmed computer It is existing.If in the unit claim for listing equipment for drying, several in these devices can be by same hardware branch To embody.The use of word first, second, and third does not indicate that any order.These words can be explained and be run after fame Claim.
The invention discloses A1, a kind of method for realizing the dilatation of Mongos clusters automatization, including:
Respectively deployment initializes the client of Mongos cluster bursts on each server in Database Systems;
Reception needs the business dilatation demand information for using more Mongos cluster resources, according to the business dilatation demand Information generates Mongos cluster dilatation tasks;
Available a number of server is selected from Database Systems, and the Mongos clusters dilatation task is divided Issue the client of the initialization Mongos cluster bursts on selected each server;
Wherein, the client for initializing Mongos cluster bursts is being located according to the Mongos cluster dilatation tasks for being received New burst is initialized on server, the nonsystematic storehouse in new burst is deleted, and new burst is added in Mongos clusters.
A2, the method as described in A1, wherein, the reception needs to use the business dilatation of more Mongos cluster resources to need Information is asked to include:
The interface for submitting business demand information to is provided in specified cloud platform, is needed using more by the interface The business dilatation demand information of Mongos cluster resources.
A3, the method as described in A1, wherein,
The Mongos clusters dilatation task includes:The quantity of required service device and the phase of deployment Mongos cluster bursts Related parameter;
It is described to select available a number of server to include from Database Systems:According to the quantity of required service device The available server of respective numbers is selected from Database Systems.
A4, the method as described in A1, wherein, it is described that Mongos cluster dilatations are generated according to the business dilatation demand information Task includes:
According to the business dilatation demand information, the quantity of required service device, and each service of institute's quantification are determined Role Information of the data base for disposing in burst is needed on device;
Role Information of the data base for disposing in burst is needed on each server according to institute's quantification, difference is generated The Mongos cluster dilatation tasks of institute's quantification of the correspondence Role Information.
A5, the method as described in A4, wherein, available a number of server is selected in the Database Systems, and The client of the initialization Mongos cluster bursts Mongos clusters dilatation task being distributed on selected each server End includes:
Required service device data volume according to determining selects the server of corresponding data amount from Database Systems, and will divide Not Dui Ying the Role Information institute's quantification Mongos cluster dilatations task be distributed to correspondingly at random it is selected Respective numbers server on initialization Mongos cluster bursts client.
A6, the method as described in A1, wherein, the method is further included:
Start the data migration operation of Mongos clusters, the migrating data in the new burst for adding.
A7, the method as described in A1, wherein, the method is further included:
Receive the initialization result that the client of the initialization Mongos cluster bursts on selected each server is returned Information;
The initialization result information for being received is sent to into the submission business dilatation demand letter by specifying communications conduit The business side of breath.
A8, the method as described in A1, wherein, the method is further included:
Dispose the offline client of burst of Mongos clusters on each server in Database Systems respectively;
Wherein, the offline client of burst determines the data base of the offline burst of institute's needs on the server, and to it is true The data base of the offline burst of fixed needs carries out offline process.
A9, the method as described in A8, wherein, the offline client of the burst determines that institute's needing on the server is offline The data base of burst includes:
Expired time comprising dilatation burst in the business dilatation demand information, and in Mongos cluster dilatation tasks Also the expired time of dilatation burst is included;The offline client scan of the burst resource information on the server obtain dilatation The expired time of burst, determines that the corresponding burst that dilatation is disposed is to need offline dividing when the expired time of dilatation burst is reached Piece, the data base that the offline fragment packets of the needs contain is the offline data base of needs;
Or,
The offline client of the burst obtains the access information of the burst disposed on the server of place, by nearest one section Visit capacity is defined as needing offline burst, the data base that the offline fragment packets of the needs contain less than the burst of preset value in time To need offline data base.
A10, the method as described in A1, wherein, the method is further included:
Dispose the burst migration client of Mongos clusters respectively on each server of Database Systems;
The information for specifying burst no longer available is received, the newly-built task of burst and burst migration task are generated according to the information;
Available a number of server is selected from Database Systems, the newly-built task of the burst is distributed to selected The client of the initialization Mongos cluster bursts on each server selected, and burst migration task is distributed to selected Burst migration client on each server selected;
Wherein, initialize Mongos cluster bursts client according to the newly-built task of burst for being received in place server The new burst of upper initialization, deletes the nonsystematic storehouse in new burst, and new burst is added in Mongos clusters;Burst is migrated Client is by the Data Migration in the disabled specified burst to new burst.
A11, the method as described in weighing A10, wherein, the method is further included:
After the Data Migration in the disabled specified burst is finished, delete described disabled from Mongos clusters Specified burst.
The invention also discloses B12, a kind of device for realizing the dilatation of Mongos clusters automatization, including:
Client deployment unit, is suitable on each server in Database Systems deployment initialization Mongos clusters respectively The client of burst;
Demand receiving unit, is suitable to receive the business dilatation demand information for needing to use more Mongos cluster resources;
Dilatation processing unit, is suitable to generate Mongos cluster dilatation tasks according to the business dilatation demand information;From number According to selecting available a number of server in the system of storehouse, and the Mongos clusters dilatation task is distributed to selected The client of the initialization Mongos cluster bursts on each server;
Wherein, the client for initializing Mongos cluster bursts is being located according to the Mongos cluster dilatation tasks for being received New burst is initialized on server, the nonsystematic storehouse in new burst is deleted, new burst is added in Mongos clusters.
B13, the device as described in B12, wherein,
The demand receiving unit, is suitable to be provided in specified cloud platform the interface for submitting business demand information to, passes through The interface needs the business dilatation demand information for using more Mongos cluster resources.
B14, the device as described in B12, wherein,
The Mongos clusters dilatation task includes:The quantity of required service device and the phase of deployment Mongos cluster bursts Related parameter;
The dilatation processing unit, is suitable to that respective numbers are selected from Database Systems according to the quantity of required service device Available server.
B15, the device as described in B12, wherein,
The dilatation processing unit, is suitable to, according to the business dilatation demand information, determine the quantity of required service device, with And Role Information of the data base in burst for needing to dispose on each server of institute's quantification;According to each of institute's quantification Role Information of the data base in burst disposed is needed on server, generate correspond to the Role Information respectively determine number The Mongos cluster dilatation tasks of amount.
B16, the device as described in B15, wherein,
The dilatation processing unit, is suitable to be selected from Database Systems accordingly according to the required service device data volume for determining The server of data volume, and will respectively correspond to the Mongos clusters dilatation task random of institute's quantification of the Role Information One client for being accordingly distributed to the initialization Mongos cluster bursts on the server of selected respective numbers.
B17, the device as described in B12, wherein,
The dilatation processing unit, is further adapted for starting the data migration operation of Mongos clusters, new to what is added Migrating data in burst.
B18, the device as described in B12, wherein,
The dilatation processing unit, is further adapted for receiving the initialization Mongos clusters point on selected each server The initialization result information that the client of piece is returned;The initialization result information for being received is sent to by specifying communications conduit Submit the business side of the business dilatation demand information to.
B19, the device as described in B12, wherein,
The client deployment unit, is further adapted for disposing Mongos respectively on each server in Database Systems The offline client of burst of cluster;
Wherein, the offline client of burst determines the data base of the offline burst of institute's needs on the server, and to it is true The data base of the offline burst of fixed needs carries out offline process.
B20, the device as described in B19, wherein,
Expired time comprising dilatation burst in the business dilatation demand information, and in Mongos cluster dilatation tasks Also the expired time of dilatation burst is included;Resource information acquisition of the offline client of the burst by scanning institute on the server The expired time of dilatation burst, determines that the corresponding burst that dilatation is disposed is offline to need when the expired time of dilatation burst is reached Burst, the data base that the offline fragment packets of the needs contain is the offline data base of needs;
Or,
The offline client of the burst obtains the access information of the burst disposed on the server of place, by nearest one section Visit capacity is defined as needing offline burst, the data base that the offline fragment packets of the needs contain less than the burst of preset value in time To need offline data base.
B21, the device as described in B12, wherein,
The client deployment unit, is further adapted for disposing Mongos collection respectively on each server of Database Systems The burst migration client of group;
The demand receiving unit, is further adapted for receiving the no longer available information of specified burst;
The dilatation processing unit, is further adapted for generating the newly-built task of burst and burst migration task according to the information; Available a number of server is selected from Database Systems, the newly-built task of the burst is distributed to into selected each clothes The client of the initialization Mongos cluster bursts on business device, and burst migration task is distributed to into selected each clothes Burst migration client on business device;
Wherein, initialize Mongos cluster bursts client according to the newly-built task of burst for being received in place server The new burst of upper initialization, deletes the nonsystematic storehouse in new burst, and new burst is added in Mongos clusters;Burst is migrated Client is by the Data Migration of the disabled specified burst to new burst.
B22, the device as described in B21, wherein,
The dilatation processing unit, is further adapted for after the Data Migration in the disabled specified burst is finished, The disabled specified burst is deleted from Mongos clusters.

Claims (10)

1. a kind of method for realizing the dilatation of Mongos clusters automatization, including:
Respectively deployment initializes the client of Mongos cluster bursts on each server in Database Systems;
Reception needs the business dilatation demand information for using more Mongos cluster resources, according to the business dilatation demand information Generate Mongos cluster dilatation tasks;
Available a number of server is selected from Database Systems, and the Mongos clusters dilatation task is distributed to The client of the initialization Mongos cluster bursts on selected each server;
Wherein, the client for initializing Mongos cluster bursts is serviced according to the Mongos cluster dilatation tasks for being received at place New burst is initialized on device, the nonsystematic storehouse in new burst is deleted, and new burst is added in Mongos clusters.
2. the method for claim 1, wherein the reception needs the business dilatation for using more Mongos cluster resources Demand information includes:
The interface for submitting business demand information to is provided in specified cloud platform, is needed using more by the interface The business dilatation demand information of Mongos cluster resources.
3. the method for claim 1, wherein
The Mongos clusters dilatation task includes:The quantity of required service device is joined to the related of deployment Mongos cluster bursts Number;
It is described to select available a number of server to include from Database Systems:According to the quantity of required service device from number According to the available server that respective numbers are selected in the system of storehouse.
4. it is the method for claim 1, wherein described that the expansion of Mongos clusters is generated according to the business dilatation demand information Appearance task includes:
According to the business dilatation demand information, determine in the quantity of required service device, and each server of institute's quantification Need Role Information of the data base of deployment in burst;
Role Information of the data base for disposing in burst, generation is needed to correspond to respectively on each server according to institute's quantification The Mongos cluster dilatation tasks of institute's quantification of the Role Information.
5. method as claimed in claim 4, wherein, available a number of server is selected in the Database Systems, And the visitor of the initialization Mongos cluster bursts being distributed to the Mongos clusters dilatation task on selected each server Family end includes:
Required service device data volume according to determining selects the server of corresponding data amount from Database Systems, and will be right respectively The Mongos cluster dilatations task for answering institute's quantification of the Role Information is distributed to correspondingly at random selected phase Answer the client of the initialization Mongos cluster bursts on the server of quantity.
6. the method for claim 1, wherein the method is further included:
Start the data migration operation of Mongos clusters, the migrating data in the new burst for adding.
7. the method for claim 1, wherein the method is further included:
Receive the initialization result information that the client of the initialization Mongos cluster bursts on selected each server is returned;
The initialization result information for being received is submitted to the business dilatation demand information by specifying communications conduit to be sent to Business side.
8. the method for claim 1, wherein the method is further included:
Dispose the offline client of burst of Mongos clusters on each server in Database Systems respectively;
Wherein, the offline client of burst determines the institute data base for needing offline burst on the server, and to determined by Needing the data base of offline burst carries out offline process.
9. a kind of device for realizing the dilatation of Mongos clusters automatization, including:
Client deployment unit, is suitable on each server in Database Systems deployment initialization Mongos cluster bursts respectively Client;
Demand receiving unit, is suitable to receive the business dilatation demand information for needing to use more Mongos cluster resources;
Dilatation processing unit, is suitable to generate Mongos cluster dilatation tasks according to the business dilatation demand information;From data base Available a number of server is selected in system, and the Mongos clusters dilatation task is distributed to into selected each clothes The client of the initialization Mongos cluster bursts on business device;
Wherein, the client for initializing Mongos cluster bursts is serviced according to the Mongos cluster dilatation tasks for being received at place New burst is initialized on device, the nonsystematic storehouse in new burst is deleted, new burst is added in Mongos clusters.
10. device as claimed in claim 9, wherein,
The demand receiving unit, is suitable to be provided in specified cloud platform the interface for submitting business demand information to, is connect by this Mouth receives the business dilatation demand information for needing to use more Mongos cluster resources.
CN201611250080.1A 2016-12-29 2016-12-29 Method and device for realizing automatic expansion of Mongos cluster Active CN106682199B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201611250080.1A CN106682199B (en) 2016-12-29 2016-12-29 Method and device for realizing automatic expansion of Mongos cluster

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201611250080.1A CN106682199B (en) 2016-12-29 2016-12-29 Method and device for realizing automatic expansion of Mongos cluster

Publications (2)

Publication Number Publication Date
CN106682199A true CN106682199A (en) 2017-05-17
CN106682199B CN106682199B (en) 2020-09-01

Family

ID=58872157

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201611250080.1A Active CN106682199B (en) 2016-12-29 2016-12-29 Method and device for realizing automatic expansion of Mongos cluster

Country Status (1)

Country Link
CN (1) CN106682199B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107544848A (en) * 2017-08-30 2018-01-05 深圳云天励飞技术有限公司 Cluster expansion method, apparatus, electronic equipment and storage medium
CN110222030A (en) * 2019-05-13 2019-09-10 福建天泉教育科技有限公司 The method of Database Dynamic dilatation, storage medium
CN113868335A (en) * 2021-09-15 2021-12-31 威讯柏睿数据科技(北京)有限公司 Method and equipment for expanding distributed clusters of memory database

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2007014296A2 (en) * 2005-07-25 2007-02-01 Parascale, Inc. Scalable distributed file storage access and management
CN101753534A (en) * 2008-12-10 2010-06-23 徐文祥 Zoning adaptive network system based on cluster server and building method
CN103970907A (en) * 2014-05-28 2014-08-06 浪潮电子信息产业股份有限公司 Method for dynamically expanding database cluster
CN104506620A (en) * 2014-12-23 2015-04-08 西安电子科技大学 Extensible automatic computing service platform and construction method for same
CN104615657A (en) * 2014-12-31 2015-05-13 天津南大通用数据技术股份有限公司 Expanding and shrinking method for distributed cluster with nodes supporting multiple data fragments
CN104967664A (en) * 2015-05-13 2015-10-07 西安三星电子研究有限公司 Automatic cloud deploying system and method

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2007014296A2 (en) * 2005-07-25 2007-02-01 Parascale, Inc. Scalable distributed file storage access and management
CN101753534A (en) * 2008-12-10 2010-06-23 徐文祥 Zoning adaptive network system based on cluster server and building method
CN103970907A (en) * 2014-05-28 2014-08-06 浪潮电子信息产业股份有限公司 Method for dynamically expanding database cluster
CN104506620A (en) * 2014-12-23 2015-04-08 西安电子科技大学 Extensible automatic computing service platform and construction method for same
CN104615657A (en) * 2014-12-31 2015-05-13 天津南大通用数据技术股份有限公司 Expanding and shrinking method for distributed cluster with nodes supporting multiple data fragments
CN104967664A (en) * 2015-05-13 2015-10-07 西安三星电子研究有限公司 Automatic cloud deploying system and method

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107544848A (en) * 2017-08-30 2018-01-05 深圳云天励飞技术有限公司 Cluster expansion method, apparatus, electronic equipment and storage medium
CN107544848B (en) * 2017-08-30 2019-10-25 深圳云天励飞技术有限公司 Cluster expansion method, apparatus, electronic equipment and storage medium
CN110222030A (en) * 2019-05-13 2019-09-10 福建天泉教育科技有限公司 The method of Database Dynamic dilatation, storage medium
CN110222030B (en) * 2019-05-13 2021-08-06 福建天泉教育科技有限公司 Dynamic database capacity expansion method and storage medium
CN113868335A (en) * 2021-09-15 2021-12-31 威讯柏睿数据科技(北京)有限公司 Method and equipment for expanding distributed clusters of memory database

Also Published As

Publication number Publication date
CN106682199B (en) 2020-09-01

Similar Documents

Publication Publication Date Title
US7530073B1 (en) Systems and methods for the repartitioning of data
US10108632B2 (en) Splitting and moving ranges in a distributed system
CN104598459B (en) database processing, data access method and system
CN106294352B (en) A kind of document handling method, device and file system
CN103312761B (en) System and method for optimizing downloadable content transmission
CN104461768B (en) copy storage device and copy storage method
CN107391628A (en) Method of data synchronization and device
CN106682199A (en) Method and device for achieving automatic expansion of Mongos cluster
CN106874459A (en) Stream data storage method and device
CN107924391A (en) The method and apparatus of shared collaborative editing document
CN108427728A (en) Management method, equipment and the computer-readable medium of metadata
CN103605657A (en) Method and device for reconstructing index online
CN107807797A (en) The method, apparatus and server of data write-in
CN103516774A (en) Method and system for eliminating multiplicating storage based on cloud storage
CN112966832B (en) Multi-server-based federal learning system
CN106991112A (en) Information query method and device
CN110825794A (en) Partition merging method and database server
CN108228390A (en) Data return shelves method and device
CN108009147A (en) Electronics book cover generation method, electronic equipment and computer-readable storage medium
CN106779482A (en) The method for allocating tasks and system of dominance relation constraint between a kind of task based access control
CN106682198A (en) Method and device for achieving automatic database deploying
CN103905512B (en) A kind of data processing method and equipment
CN109522240A (en) A kind of data processing method and device
CN105978744A (en) Resource allocation method, device and system
CN110362540A (en) A kind of storage of data, visitor's number acquisition methods and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant