CN107105049B - Data migration method and device - Google Patents
Data migration method and device Download PDFInfo
- Publication number
- CN107105049B CN107105049B CN201710327644.5A CN201710327644A CN107105049B CN 107105049 B CN107105049 B CN 107105049B CN 201710327644 A CN201710327644 A CN 201710327644A CN 107105049 B CN107105049 B CN 107105049B
- Authority
- CN
- China
- Prior art keywords
- server
- account number
- cluster
- service
- target account
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/50—Network services
- H04L67/56—Provisioning of proxy services
- H04L67/563—Data redirection of data network streams
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Computer And Data Communications (AREA)
Abstract
The invention discloses a kind of data migration method and devices.Wherein, this method includes:The Status Change information that first server receiving control apparatus is sent, for Status Change information for indicating that the number of servers in server cluster changes, server cluster is stateful distributed server cluster;First server judges to whether there is target account number in the account number of first server current service, wherein target account number is configured as providing service by the second server in server cluster;There are in the case of target account number in the account number for judging first server current service, first server is by the Data Migration of target account number in first server to second server;After completing the Data Migration to second server of target account number, first server sends migration to control device and completes information.The present invention is solved since the distributed type assemblies service discovery component of the prior art has a single function caused the technical issues of being unfavorable for Data Migration.
Description
Technical field
The present invention relates to computer realms, in particular to a kind of data migration method and device.
Background technology
The service discovery component that general distributed type assemblies use is LIST SERVER, in the server and distributed type assemblies
All nodes are connected, and the status information of node is obtained by way of heartbeat packet, when node increase, reduce or break down
When, then the status information of current cluster in LIST SERVER is updated, and be synchronized to service consumer, in order to service consumption
Person selects suitable service node to access.
But existing service discovery service, generally directed at stateless ISP's cluster, plus-minus node is not
Have the change for the status information for considering node, cannot branch held state well server.And use fairly perfect distribution
Formula component Zookeeper can make entire framework seem more too fat to move again, be unfavorable for the maintenance in later stage.
For above-mentioned problem, currently no effective solution has been proposed.
Invention content
An embodiment of the present invention provides a kind of data migration method and devices, at least to solve the distribution due to the prior art
The technical issues of being unfavorable for Data Migration caused by formula cluster service discovery assembly function is single.
One side according to the ... of the embodiment of the present invention provides a kind of data migration method, including:First server receives
The Status Change information that control device is sent, wherein the Status Change information is used to indicate the server in server cluster
Quantity changes, and the server cluster is stateful distributed server cluster, and the server cluster includes described
First server;The first server judges to whether there is target account number in the account number of the first server current service,
Wherein, the target account number is configured as providing service by the second server in the server cluster;Described in judging
In the account number of first server current service there are the target account number in the case of, the first server takes described first
The Data Migration for the target account number on device of being engaged in is to the second server;It completes to arrive the Data Migration of the target account number
After the second server, the first server sends migration to the control device and completes information, wherein the migration
Information is completed to be used to indicate the migration that the first server is completed to the data of the target account number.
Another aspect according to the ... of the embodiment of the present invention additionally provides a kind of data migration device, including:Control device detects
It is changed to the number of servers in server cluster, wherein the server cluster is stateful distributed server
Cluster;Servers-all of the control device into the server cluster sends Status Change information, wherein the state
Modification information is for indicating that the number of servers in the server cluster changes;It is received in the control device described
After information is completed in the migration that destination server in Servers-all is sent, the control device updates the server cluster
Cluster state information, wherein the migration completes information and is used to indicate the migration of the complete paired data of the destination server, institute
It is the server for needing to carry out Data Migration in the Servers-all to state in destination server.
Another aspect according to the ... of the embodiment of the present invention additionally provides a kind of data migration method, including:First receives list
Member, the Status Change information for being sent by first server receiving control apparatus, wherein the Status Change information is used for
Indicate that the number of servers in server cluster changes, the server cluster is stateful distributed server collection
Group, the server cluster includes the first server;Judging unit, for judging described the by the first server
It whether there is target account number in the account number of one server current service, wherein the target account number is configured as by the service
Second server in device cluster provides service;Migration units, in the account for judging the first server current service
In number there are the target account number in the case of, by the first server by the target account number in the first server
Data Migration to the second server;Transmission unit, for completing the Data Migration of the target account number described in
After second server, migration is sent to the control device by the first server and completes information, wherein the migration
Information is completed to be used to indicate the migration that the first server is completed to the data of the target account number.
Another aspect according to the ... of the embodiment of the present invention additionally provides a kind of data migration device, including:Detection unit is used
In detecting that the number of servers in server cluster changes by control device, wherein the server cluster is to have
The distributed server cluster of state;Transmission unit, for all into the server cluster by the control device
Server sends Status Change information, wherein the Status Change information is used to indicate the server in the server cluster
Quantity changes;Updating unit, for the destination server hair in receiving the Servers-all in the control device
After information is completed in the migration sent, the cluster state information of the server cluster is updated by the control device, wherein institute
It states migration and completes the migration that information is used to indicate the complete paired data of the destination server, be the institute in the destination server
There is the server for needing to carry out Data Migration in server.
In embodiments of the present invention, the Status Change information sent by first server receiving control apparatus judges
It whether there is target account number in the account number of one server current service, if it is present by target account number in first server
Data Migration sends migration completion information to second server, and in the rear of migration completion to control device, has reached server
According to the purpose of the data of the Status Change information transfer target account number of control device, user data is automatically performed to realize
The technique effect of migration, so solve due to the distributed type assemblies service discovery component of the prior art have a single function caused by not
The technical issues of conducive to Data Migration.
Description of the drawings
Attached drawing described herein is used to provide further understanding of the present invention, and is constituted part of this application, this hair
Bright illustrative embodiments and their description are not constituted improper limitations of the present invention for explaining the present invention.In the accompanying drawings:
Fig. 1 is the schematic diagram of the hardware environment of data migration method according to the ... of the embodiment of the present invention;
Fig. 2 is a kind of flow chart of optional data migration method according to the ... of the embodiment of the present invention;
Fig. 3 is a kind of flow chart of optional data migration method according to the ... of the embodiment of the present invention;
Fig. 4 be it is according to the ... of the embodiment of the present invention it is a kind of it is stateful in the case of Distributed Services cluster service schematic diagram;
Fig. 5 is a kind of flow chart of node delta data moving method according to the ... of the embodiment of the present invention;
Fig. 6 is a kind of flow chart of node failure processing method according to the ... of the embodiment of the present invention;
Fig. 7 is a kind of schematic diagram of optional data migration device according to the ... of the embodiment of the present invention;
Fig. 8 is a kind of schematic diagram of optional data migration device according to the ... of the embodiment of the present invention;And
Fig. 9 is a kind of structure diagram of terminal according to the ... of the embodiment of the present invention.
Specific implementation mode
In order to enable those skilled in the art to better understand the solution of the present invention, below in conjunction in the embodiment of the present invention
Attached drawing, technical scheme in the embodiment of the invention is clearly and completely described, it is clear that described embodiment is only
The embodiment of a part of the invention, instead of all the embodiments.Based on the embodiments of the present invention, ordinary skill people
The every other embodiment that member is obtained without making creative work should all belong to the model that the present invention protects
It encloses.
It should be noted that term " first " in description and claims of this specification and above-mentioned attached drawing, "
Two " etc. be for distinguishing similar object, without being used to describe specific sequence or precedence.It should be appreciated that using in this way
Data can be interchanged in the appropriate case, so as to the embodiment of the present invention described herein can in addition to illustrating herein or
Sequence other than those of description is implemented.In addition, term " comprising " and " having " and their any deformation, it is intended that cover
It includes to be not necessarily limited to for example, containing the process of series of steps or unit, method, system, product or equipment to cover non-exclusive
Those of clearly list step or unit, but may include not listing clearly or for these processes, method, product
Or the other steps or unit that equipment is intrinsic.
First, the part noun or term occurred during the embodiment of the present invention is described is suitable for as follows
It explains:
Distributed server:So-called distributed resource sharing server is exactly to refer to data and program not being located at a clothes
It is engaged on device, but is distributed to multiple servers, with the geographic information data of dispersed distribution on network and the database being affected by it
Operation is a kind of theoretical calculation model form server of research object.
Service discovery:Service discovery component has recorded the information of all services in (extensive) distributed system, Ren Menhuo
The other services of person can find these services accordingly.
Cluster:English name is Cluster, and generally, cluster is such a technology, and multiple systems are connected to by it
Together, multiple servers is enable to work or seem as a machine machine.It is logical using group system
It is often to improve the stability of system and the data-handling capacity of network center and service ability.
Embodiment 1
According to embodiments of the present invention, a kind of embodiment of the method for Data Migration is provided.
Optionally, in the present embodiment, above-mentioned data migration method can be applied to as shown in Figure 1 by server 102
In the hardware environment constituted with terminal 104.As shown in Figure 1, server 102 is attached by network and terminal 104, it is above-mentioned
Network includes but not limited to:Wide area network, Metropolitan Area Network (MAN) or LAN, terminal 104 are not limited to PC, mobile phone, tablet computer etc..This
The data migration method of inventive embodiments can be executed by server 102, can also be executed, be can also be by terminal 104
It is executed jointly by server 102 and terminal 104.Wherein, the data migration method of the execution of terminal 104 embodiment of the present invention can also
It is to be executed by client mounted thereto.
In an optional application scenarios, the number of servers in stateful distributed server cluster becomes
When change, control device detects that the number of servers in server cluster changes, and control device is into server cluster
Servers-all sends Status Change information, and server judges to whether there is in the account number of current service should be by other server
There is provided service account number, by these account numbers carry out Data Migration, move to it is corresponding provide service server in, server to
Control device sends migration and completes information, and the migration that the destination server in control device receives Servers-all is sent is complete
After information, control device updates the cluster state information of server cluster, and service consumption end carries out in second selecting cluster
Some node offer service is provided.
Fig. 2 is a kind of flow chart of optional data migration method according to the ... of the embodiment of the present invention, as shown in Fig. 2, the party
Method may comprise steps of:
Step S202, the Status Change information that first server receiving control apparatus is sent, wherein Status Change information is used
In indicating that the number of servers in server cluster changes, server cluster is stateful distributed server cluster,
Server cluster includes first server.
Step S204, first server judge to whether there is target account number in the account number of first server current service,
In, target account number is configured as providing service by the second server in server cluster.
Step S206, there are in the case of target account number in the account number for judging first server current service, first
Server is by the Data Migration of target account number in first server to second server.
Step S208, after completing the Data Migration to second server of target account number, first server is to control
Equipment sends migration and completes information, wherein migration completes information and is used to indicate the data that first server is completed to target account number
Migration.
S202 to step S208 through the above steps is believed by the Status Change that first server receiving control apparatus is sent
Breath judges to whether there is target account number in the account number of first server current service, if it is present by mesh in first server
The Data Migration of account number is marked to second server, and completion information is migrated in rear sent to control device of migration completions, it can be with
The technology for solving to be unfavorable for caused by being had a single function Data Migration due to the distributed type assemblies service discovery component of the prior art is asked
Topic, and then reach the technique effect for being automatically performed migration of subscriber data.
In the technical solution that step S202 is provided, server cluster is stateful distributed server cluster, for example,
Game account number in some server for player provides service, then this server is stateful server, the first clothes
Business device is a server in server cluster, the number of servers in server cluster occur change (including increase and
Reduce) when, control device can send Status Change information to first server.Status Change information can be a plurality of types of letters
Breath, for example, it may be digitized instruction or a string of codes etc..
In the technical solution that step S204 is provided, first server receives the Status Change information of control device transmission
Later, judge whether to have in the account number of current service in first server and be configured as by the account of other server providing services
Number, for example, after number of servers changes, presumable account number, which can be assigned, to move in new server, so
Current first server needs to carry out self-test, and whether judge to have in the account number of own services should be by current server cluster
The account number of other server providing services.The account number of first server service provided is by first server according to hash algorithm
It calculates, can use same hash algorithm that the account number that itself provides service is calculated in each server, wherein
The account number that each server itself provides service is not determined by control device, but is obtained by calculation by each server
's.
In the technical solution that step S206 is provided, have in the account number serviced if first server is judged oneself to provide
Target account number, then first server is by the Data Migration to second server of target account number, by corresponding second server Lai
Service is provided for target account number.
The data that first server currently provides all account numbers of service are stored in first server, these data can
To be that index stores in the database with account number, for an account number, data are limited, determine, if first service
Device judge oneself provide service account number in it is in need move to the target account number serviced on other server, then to target account
Number all data migrated, the data of target account number are sent in second server by first server, send when can
To be sent to the data of each account number in second server separately as a data block, institute in need can also be sent to
The data of multiple account numbers in second server are sent to as a data block in second server, it is sent completely in data
The target Account Data in first server can be deleted, no longer be preserved afterwards.If first server and second server are
By network connection, then the data of target account number are sent to second server by first server by network, are sent out in data
It can be carried out data transmission by Transmission Control Protocol when sending.
In the technical solution that step S208 is provided, after by the Data Migration to second server of target account number,
First server sends information to control device, prompts to send migration information completion.
As a kind of optional embodiment, in first server by the Data Migration of target account number in first server to
During two servers, first server receives the service request of target account number;First server resets service request
To second server, wherein second server provides service for responding service request to target account number.If target account number
Continue to send service request to first server during moving to second server, then first server receives service
Service request is re-introduced into second server after request, service is provided for target account number by second server.In this way,
It can effectively prevent service request when the Data Migration of target account number that cannot respond and influence user's operation and game process
Smoothness improves user experience.
As a kind of optional embodiment, first server judges to whether there is in the account number of first server current service
Target account number includes:First server judges in number corresponding with the account number of current service with the presence or absence of positioned at number one code collection
Destination number except conjunction, wherein account number corresponding with the number in the first set of numbers is configured as being carried by first server
For service;In the case where judging to have the destination number being located at except the first set of numbers, first server is judged to work as
There are target account numbers in the account number of preceding service, and account number corresponding with destination number is determined as target account number.With current service
The corresponding number of account number can be game player's account number id numbers, when carrying out service configuration, the account of the first set of numbers
Number service is provided by first server, the account number of the second set of numbers provides service, therefore, first server by second server
The destination number for whether having other than the first set of numbers in the account number of current service is judged, if so, then illustrating current service
There is the account number for needing to be transferred in other server in account number, account number corresponding with destination number is determined as target account number.It is logical
In the case of often, the first set of numbers can be the set of multiple numbers, and multiple numbers in the first set of numbers can not connected
Continuous number.
In a kind of application scenarios, by taking a kind of simple hash algorithm as an example, current server quantity is 3, is played to game
The id numbers of family's account number calculated except three remainders, are the game player corresponding to id numbers that remainder is 1 by first server
Account number provides service, and service is provided for game player's account number corresponding to the id numbers for remainder for 2 by second server, by the
Three servers provide service for game player's account number corresponding to the id numbers for remainder for 0;Occur in current server quantity
Variation, when increasing to 4, control device detects that number of servers changes, and change information is sent to each server,
The account number corresponding to the id numbers for the game player for providing service by itself is obtained by calculation in each server, for example, to trip
The id numbers of play player's account number calculated except four remainders, are the game corresponding to id numbers that remainder is 1 by first server
Player's account number provides service, and service is provided for game player's account number corresponding to the id numbers for remainder for 2 by second server,
There is provided service by third server for game player's account number corresponding to the id numbers for remainder for 3, by the 4th server be for
Game player's account number corresponding to id numbers of the remainder for 0 provides service, in this way, in original first server, second service
Can all exist in device, third server and not continue by the account number of former server providing services, former server is by corresponding account number number
According to moving in new corresponding server.
As a kind of optional embodiment, in first server judges number corresponding with the account number of current service whether
Before the destination number except the first set of numbers, first server is obtained carries out Hash to the account number of current service
Operate obtained number, wherein obtained number is number corresponding with the account number of current service.To the account of current service
Number carry out hashing operation can be operated to the account number of current service by consistency hash algorithm, determining first service
When device provides the first set of numbers of service, consistency hashing operation can be carried out by the account number to current service, obtain one
Portion numbers, the account number corresponding to this portion numbers are just allocated to the account number of first server current service.
As a kind of optional embodiment, first server is by the Data Migration of target account number in first server to second
Server includes:First server obtains the ground of the second server corresponding to the second set of numbers being located at target account number
Location;First server is according to the address of second server by the Data Migration of target account number in first server to second service
Device.Target account number corresponding to second set of numbers is assigned to second server and provides service, and first server takes first
It is engaged in device in the Data Migration to second server of all target account numbers.First server by actively retrieving target account number,
Then by the Data Migration to second server of target account number, data migration efficiency can be improved.
Fig. 3 is a kind of flow chart of optional data migration method according to the ... of the embodiment of the present invention, as shown in figure 3, the party
Method may comprise steps of:
Step S302, control device detect that the number of servers in server cluster changes, wherein server set
Group is stateful distributed server cluster.
Step S304, Servers-all of the control device into server cluster send Status Change information, wherein state
Modification information is for indicating that the number of servers in server cluster changes.
Step S306, the migration that destination server in control device receives Servers-all is sent complete information it
Afterwards, the cluster state information of control device update server cluster, wherein migration completes information for indicating that destination server is complete
The migration of paired data, to need to carry out the server of Data Migration in Servers-all in destination server.
For S302 to step S306, control device detects that the number of servers in server cluster occurs through the above steps
After change, the Servers-all into server cluster sends Status Change information, to prompt server currently to newly increase
Or the server of reduction, the account that server provides itself in response to Status Change information service are migrated, are being moved
It moves after completing, control device updates the cluster state information of server cluster, can solve the distribution due to the prior art
The technical issues of being unfavorable for Data Migration caused by cluster service discovery assembly function is single, and then reach and be automatically performed number of users
According to the technique effect of migration.
In the technical solution that step S302 is provided, server count that control device can in real time in detection service device cluster
Amount, the change of number of servers further includes number of servers and increases or decreases, for example, can be examined by way of detecting heartbeat packet
It surveys, it can also be by detecting otherwise, the server cluster of the embodiment of the present invention is stateful distributed server cluster.
In the technical solution that step S304 is provided, number of servers hair of the control device in detecting server cluster
After changing, the Servers-all into server cluster sends Status Change information, all in server cluster to prompt
The quantity of server, server changes.The Status Change information that server is sent according to control device is to each server
The middle target account number for providing service carries out data transfer, the mode such as S202 to step S208 of specific data transfer and its specific real
It applies described in mode, details are not described herein.
In the technical solution that step S306 is provided, server is after having carried out Data Migration work, to control device
It sending migration and completes information, each server can be sent completely information after completing the Data Migration of itself to control device,
After all servers complete Data Migration work, control device updates the cluster state information of server cluster, control
Equipment is again updated the number of servers in server cluster.Destination server is needed in Servers-all into line number
It can be Servers-all according to migration destination server, can also be part server.
As a kind of optional embodiment, after the cluster state information that control device updates server cluster, control
Updated cluster state information is synchronized to service equipment by equipment, wherein service equipment is used for according to updated cluster shape
Service request is sent to corresponding server in server cluster by state information.Service equipment can be service consumer, service
Service request can be sent in server cluster in corresponding server by consumer according to updated cluster state information.
As a kind of optional embodiment, control device detects that change packet occurs for the number of servers in server cluster
It includes:Control device is changed by the number of servers in heartbeat packet to server cluster, wherein heartbeat packet is for referring to
Show the server increased or decreased in server cluster;Or control device detects server set by the configuration information of acquisition
Number of servers in group changes, wherein the server that configuration information is used to indicate to increase or decrease in server cluster.
Control device can not only be changed by number of servers in heartbeat packet server cluster, but also can be by getting
Configuration information detects that the number of servers in server cluster changes.
As a kind of optional embodiment, control device passes through the number of servers in heartbeat packet to server cluster
Occur to become and further include:Control device is broken down by the first server in heartbeat packet to server cluster;It is controlling
After equipment is changed by the number of servers in heartbeat packet to server cluster, control device updates server set
The cluster state information of group.If by the first server in heartbeat packet to server cluster event occurs for control device
Barrier, then control device can update the cluster state information in server cluster.
The technical solution of the embodiment of the present invention can be applied to stateful distributed server cluster, provide a kind of general
Service discovery method, allow service consumer that can correctly find corresponding ISP, when ISP's cluster need
Carry out dilatation, when something goes wrong, which can be handled some node automatically, be answered in capacity reducing or cluster
To changing accordingly.
Service discovery control centre is connected with each node in ISP's cluster, and knows collection by heartbeat packet
The state of each node in group, when needing to increase or reduce node in ISP's cluster (corresponding to dilatation and contracting
Hold), which can be notified that, to all nodes in cluster, each node can check the user itself serviced by control node,
It finds out and is not collected by the user of oneself service currently, and the user that the user concentrates is migrated in current affiliated service node
It goes, after the completion of migrating, node is notified that completion is migrated by control centre, after the completion of all service providing nodes are migrated,
Control centre can will update ISP's cluster information at service consumption end.When some node in ISP's cluster
When something goes wrong, control node can update ISP's cluster information at service consumption end in real time according to heartbeat packet,
Some node in second selecting cluster is carried out by service consumption end, offer service is provided, when the malfunctioning node is re-enabled
Afterwards, control centre can be by above-mentioned same mode, after being migrated automatically to the node data in service offer cluster, then more
ISP's cluster information of new demand servicing consumption terminal.
The present invention also provides a kind of preferred embodiment, Fig. 4 is in the case of one kind according to the ... of the embodiment of the present invention is stateful
Distributed Services cluster service schematic diagram, as shown in figure 4, node in Distributed Services cluster can periodically reporting message
Component control centre is given, a service node corresponds to a server, and service consumer can periodically go to component control centre
Newest service cluster information is pulled, when service consumer needs service, then according to service cluster information, passes through consistency
Hash algorithm selects one of service node to provide service for it, for example, have 3 service nodes in distributed type assemblies, this
Three nodes may be distributed on different machines, and service consumer passes through consistency by obtaining information from control centre
Hash algorithm selects node 3 to provide service for it.For game server, a user, which can be assigned, navigates to one
A server node gets on, and the data of the user then preserve in node, so the node is a stateful service section
Point.All users are also just divided into several set of numbers by consistent hashing algorithm, and each set of numbers is by a node
Service is provided.All numbers in first set of numbers provide service by first server, all numbers in the second set of numbers
Code provides service by second server, may there is continuous number in each set of numbers, it is also possible to be the number of dispersion entirely.
For example, at the first moment, each user account has corresponding server node, all user account numbers to be assigned to respectively
From server node on, service is provided by corresponding server for the user, at the second moment, when there is server count quantitative change
When change, the corresponding server node of all user accounts is calculated according to user id by consistent hashing algorithm, again will be needed
All user account numbers are assigned to corresponding server node, wherein the corresponding server of some users changes, some users
Corresponding server does not change, for not changing the user data of server, without being operated, for needing to change clothes
The user data of business device, will be in the migration of subscriber data to corresponding server by current server.
The server node being calculated by consistent hashing algorithm, then by migration of subscriber data to corresponding service
In device, the amount for the data for needing to migrate can be reduced to the greatest extent, when number of servers changes, mitigate and balance takes
Business device pressure.
In the above cases, it under the large-scale variation of number of users generation or other reasons, is taken in service cluster
Node number of being engaged in variation, an embodiment of the present invention provides a kind of node delta data moving method, Fig. 5 is implemented according to the present invention
A kind of flow chart of node delta data moving method of example, as shown in figure 5, first, control centre can by heartbeat packet or
The modes such as user's active arrangement update perceive the interstitial content in cluster and are changed, such as when node increases or less
When, configuration can be changed by user to mark some node to be increased or by undercarriage, and Loading Control center again
Configuration information.
Then, control centre can judge the attribute of the cluster, can be straight if the cluster belongs to stateless cluster
The status information for updating the cluster is connect, when then timing pulls information when service consumption end, updates the clothes at service consumption end
The information of business cluster;
But if when the service cluster is stateful cluster, need control centre's current Status Change first
It notifies to all nodes in the cluster;
After all nodes in cluster learn newest cluster state information, process of self-test can be carried out, in self-test
Cheng Zhong, node can be to calculate the user of currently serviced number section according to the consistent hashing algorithm that service consumption end uses
It is not the user's set that serviced by the node, and confirm an external service user, and to the institute of user set
There is user to carry out migration of subscriber data operation, in transition process, if there is the user service in external user set please be found out
It is existing, then the request is redirected in the node that the user should be serviced, after migration operation is completed, node is to control
Center sends a migration and completes request.
After request is completed in the migration that control centre is connected to the node in all service clusters, control centre can update this
The cluster state information of cluster, and later, it is when the timing of service consumption end is come when pulling cluster information, the cluster information is same
It walks and gives service consumption end, after this, service consumption end can utilize newest service cluster information to select service node.
When some node in cluster breaks down, the data migration method of the embodiment of the present invention is by service discovery group
Part is handled using following process, and Fig. 6 is a kind of flow chart of node failure processing method according to the ... of the embodiment of the present invention, such as
Shown in Fig. 6, this approach includes the following steps:
First, control centre will go out a certain node according to heartbeat packet and break down, and then control centre will be direct
The information for updating the service cluster, so that service consumption end can promptly pull the information.When this is known in service consumption end
After information, the request of the node will be gone on hash to an available node again, be equivalent to the use on the node
Family is dispersed to other nodes in cluster up.When backstage personnel intervene manually, after having repaired the malfunctioning node, so that it may with will
Malfunctioning node restocking again, then the node will reuse above-mentioned node delta data transition process, by the node
It is restored in service cluster.
It is more that the service discovery component of the embodiment of the present invention can be applied to the game that the whole district takes entirely and subregion sub-service game etc.
In the background server of a project, the test of multiple hundreds of thousands of them's scale is lived through, test result shows the service discovery component
The dilatation of server cluster, capacity reducing can be supported to operate well, and when the node in cluster breaks down, it can be promptly
Player is transferred in other service nodes, and can accomplish the unaware to user, user experience is fine.It needs to illustrate
It is that it is transparent for service consumption end that the technical solution of the embodiment of the present invention, which is directed to the data migration process of stateful server,
, i.e., service consumption end does not need to be concerned about whether the Data Migration of rear end occurs, and it is only necessary to according to currently obtained
Service cluster information, is routed, and can make the variation of back-end services internal system for a user in this way
It is unaware, the experience effect of user can also reach best.
The technical solution of the embodiment of the present invention can be compatible with stateful Distributed Services cluster and stateless point simultaneously
Cloth service cluster provides service discovery function for it, and can accomplish to change the node in Distributed Services cluster
When, the user data of stateful service cluster interior nodes is migrated automatically automatically, and update the clothes of service consumer
Cluster information be engaged in so as to its quickly selection routing, all accomplish unaware to user's operation, improve user experience.
It should be noted that for each method embodiment above-mentioned, for simple description, therefore it is all expressed as a series of
Combination of actions, but those skilled in the art should understand that, the present invention is not limited by the described action sequence because
According to the present invention, certain steps can be performed in other orders or simultaneously.Secondly, those skilled in the art should also know
It knows, embodiment described in this description belongs to preferred embodiment, and involved action and module are not necessarily of the invention
It is necessary.
Through the above description of the embodiments, those skilled in the art can be understood that according to above-mentioned implementation
The method of example can add the mode of required general hardware platform to realize by software, naturally it is also possible to by hardware, but it is very much
In the case of the former be more preferably embodiment.Based on this understanding, technical scheme of the present invention is substantially in other words to existing
The part that technology contributes can be expressed in the form of software products, which is stored in a storage
In medium (such as ROM/RAM, magnetic disc, CD), including some instructions are used so that a station terminal equipment (can be mobile phone, calculate
Machine, server or network equipment etc.) execute method described in each embodiment of the present invention.
Embodiment 2
According to embodiments of the present invention, a kind of data migration device for implementing above-mentioned data migration method is additionally provided.
Fig. 7 is a kind of schematic diagram of optional data migration device according to the ... of the embodiment of the present invention, as shown in fig. 7, the device can wrap
It includes:
First receiving unit 10, the Status Change information for being sent by first server receiving control apparatus, wherein
For the Status Change information for indicating that the number of servers in server cluster changes, the server cluster is to have shape
The distributed server cluster of state, the server cluster include the first server.
Judging unit 20 is in the account number for judging the first server current service by the first server
No there are target account numbers, wherein the target account number is configured as providing clothes by the second server in the server cluster
Business.
Migration units 30, for there are the target account numbers in the account number for judging the first server current service
In the case of, by the first server by the Data Migration of the target account number in the first server to described second
Server.
Transmission unit 40, for after completing the Data Migration to the second server of the target account number, leading to
It crosses the first server and sends migration completion information to the control device, wherein the migration completes information for indicating
The first server completes the migration to the data of the target account number.
It should be noted that the first receiving unit 10 in the embodiment can be used for executing in the embodiment of the present application 1
Step S202, the judging unit 20 in the embodiment can be used for executing the step S204 in the embodiment of the present application 1, the embodiment
In migration units 30 can be used for executing the step S206 in the embodiment of the present application 1, the transmission unit 40 in the embodiment can
For executing the step S208 in the embodiment of the present application 1.
Herein it should be noted that above-mentioned module is identical as example and application scenarios that corresponding step is realized, but not
It is limited to 1 disclosure of that of above-described embodiment.It should be noted that above-mentioned module as a part for device may operate in as
In hardware environment shown in FIG. 1, it can also pass through hardware realization by software realization.
By above-mentioned module, can solve to cause since the distributed type assemblies service discovery component of the prior art has a single function
The technical issues of being unfavorable for Data Migration, and then reach the technique effect for being automatically performed migration of subscriber data.
Optionally, which further includes:Second receiving unit, in first server by target account in first server
Number Data Migration to second server during, the service request of target account number is received by first server;Orientation
Service request is redirected to second server by unit for passing through first server, wherein second server takes for responding
Business request provides service to target account number.
Optionally, judging unit 20 includes:Judgment module, for judging the account number with current service by first server
With the presence or absence of the destination number being located at except the first set of numbers in corresponding number, wherein with number in the first set of numbers
The corresponding account number of code is configured as providing service by first server;Determining module, for judging exist positioned at number one
Code collection close except destination number in the case of, first server judges that there are target account numbers in the account number of current service, and
Account number corresponding with destination number is determined as target account number.
Optionally, which further includes:Acquiring unit, it is corresponding with the account number of current service for judging in first server
Number in the presence or absence of be located at the first set of numbers except destination number before, by first server obtain to currently taking
The account number of business carries out the obtained number of hashing operation, wherein obtained number is corresponding with the account number of current service number
Code.
Optionally, migration units 30 are used for:The second number collection being located at target account number is obtained by first server
Close the address of corresponding second server;By first server according to the address of second server by mesh in first server
The Data Migration of account number is marked to second server.
According to embodiments of the present invention, a kind of data migration device for implementing above-mentioned data migration method is additionally provided.
Fig. 8 is a kind of schematic diagram of optional data migration device according to the ... of the embodiment of the present invention, as shown in figure 8, the device can wrap
It includes:
Detection unit 50, for detecting that the number of servers in server cluster changes by control device,
In, server cluster is stateful distributed server cluster;
Transmission unit 60, for sending Status Change letter by Servers-all of the control device into server cluster
Breath, wherein Status Change information is for indicating that the number of servers in server cluster changes;
Updating unit 70, the migration sent for the destination server in receiving Servers-all in control device are completed
After information, the cluster state information of server cluster is updated by control device, wherein migration completes information for indicating mesh
The migration of the complete paired data of server is marked, is the server for needing to carry out Data Migration in Servers-all in destination server.
It should be noted that the detection unit 50 in the embodiment can be used for executing the step in the embodiment of the present application 1
S302, the transmission unit 60 in the embodiment can be used for executing the step S304 in the embodiment of the present application 1, in the embodiment
Updating unit 70 can be used for executing the step S306 in the embodiment of the present application 1.
Herein it should be noted that above-mentioned module is identical as example and application scenarios that corresponding step is realized, but not
It is limited to 1 disclosure of that of above-described embodiment.It should be noted that above-mentioned module as a part for device may operate in as
In hardware environment shown in FIG. 1, it can also pass through hardware realization by software realization.
By above-mentioned module, can solve and be led since the distributed type assemblies service discovery component of the prior art has a single function
The technical issues of being unfavorable for Data Migration of cause, and then reach the technique effect for being automatically performed migration of subscriber data.
Optionally, which further includes:Synchronization unit, the cluster state letter for updating server cluster in control device
After breath, updated cluster state information is synchronized to by service equipment by control device, wherein service equipment is used for basis
Service request is sent to corresponding server in server cluster by updated cluster state information.
Optionally, detection unit is used for:Pass through the server in heartbeat packet to server cluster by control device
Quantity changes, wherein heartbeat packet is used to indicate the server increased or decreased in server cluster;Or it is set by control
It is standby to detect that the number of servers in server cluster changes by the configuration information of acquisition, wherein configuration information is used for
Indicate the server increased or decreased in server cluster.
Optionally, detection unit is used to pass through the first service in heartbeat packet to server cluster by control device
Device breaks down;Device further includes:Updating unit, for passing through the clothes in heartbeat packet to server cluster in control device
After business device quantity changes, the cluster state information of server cluster is updated by control device.
Herein it should be noted that above-mentioned module is identical as example and application scenarios that corresponding step is realized, but not
It is limited to 1 disclosure of that of above-described embodiment.It should be noted that above-mentioned module as a part for device may operate in as
In hardware environment shown in FIG. 1, it can also pass through hardware realization by software realization, wherein hardware environment includes network
Environment.
Embodiment 3
According to embodiments of the present invention, a kind of server or terminal for implementing above-mentioned data migration method is additionally provided.
Fig. 9 is a kind of structure diagram of terminal according to the ... of the embodiment of the present invention, as shown in figure 9, the terminal may include:One
A or multiple (one is only shown in figure) processor 201, memory 203 and transmitting device 205 are (in such as above-described embodiment
Sending device), as shown in figure 9, the terminal can also include input-output equipment 207.
Wherein, memory 203 can be used for storing software program and module, such as the Data Migration side in the embodiment of the present invention
Method and the corresponding program instruction/module of device, processor 201 by operation be stored in software program in memory 203 and
Module realizes above-mentioned data migration method to perform various functions application and data processing.Memory 203 can wrap
Include high speed random access memory, can also include nonvolatile memory, as one or more magnetic storage device, flash memory or
Other non-volatile solid state memories of person.In some instances, memory 203 can further comprise remote relative to processor 201
The memory of journey setting, these remote memories can pass through network connection to terminal.The example of above-mentioned network includes but unlimited
In internet, intranet, LAN, mobile radio communication and combinations thereof.
Above-mentioned transmitting device 205 is used to receive via network or transmission data, can be also used for processor with
Data transmission between memory.Above-mentioned network specific example may include cable network and wireless network.In an example,
Transmitting device 205 includes a network adapter (Network Interface Controller, NIC), can pass through cable
It is connected with other network equipments with router so as to be communicated with internet or LAN.In an example, transmission dress
It is radio frequency (Radio Frequency, RF) module to set 205, is used to wirelessly be communicated with internet.
Wherein, specifically, memory 203 is for storing application program.
Processor 201 can call the application program that memory 203 stores by transmitting device 205, to execute following steps
Suddenly:The Status Change information that first server receiving control apparatus is sent, wherein Status Change information is for indicating server set
Number of servers in group changes, and server cluster is stateful distributed server cluster, and server cluster includes
First server;First server judges to whether there is target account number in the account number of first server current service, wherein target
Account number is configured as providing service by the second server in server cluster;In the account for judging first server current service
In number there are target account number in the case of, first server is by the Data Migration of target account number in first server to second service
Device;After completing the Data Migration to second server of target account number, first server has been migrated to control device transmission
At information, wherein migration completes information and is used to indicate the migration that first server is completed to the data of target account number.
Processor 201 is additionally operable to execute following step:First server receives the service request of target account number;First clothes
Service request is redirected to second server by business device, wherein second server is carried for responding service request to target account number
For service.
Processor 201 is additionally operable to execute following step:First server judges number corresponding with the account number of current service
In with the presence or absence of be located at the first set of numbers except destination number, wherein account corresponding with the number in the first set of numbers
It number is configured as providing service by first server;In the feelings for judging to have the destination number being located at except the first set of numbers
Under condition, first server judges that there are target account numbers in the account number of current service, and will account number corresponding with destination number it is true
It is set to target account number.
Processor 201 is additionally operable to execute following step:Judge corresponding with the account number of current service number in first server
With the presence or absence of before the destination number except the first set of numbers in code, first server obtains the account number to current service
Carry out the obtained number of hashing operation, wherein obtained number is number corresponding with the account number of current service.
Processor 201 is additionally operable to execute following step:First server moves the data of target account number in first server
Moving on to second server includes:First server obtains the second clothes corresponding to the second set of numbers being located at target account number
The address of business device;First server is according to the address of second server by the Data Migration of target account number in first server to
Two servers.
Using the embodiment of the present invention, the Status Change information sent by first server receiving control apparatus judges
It whether there is target account number in the account number of one server current service, if it is present by target account number in first server
Data Migration to second server, and migration completions it is rear to control device send migration completion information, can solve due to
The technical issues of distributed type assemblies service discovery component of the prior art is unfavorable for Data Migration caused by having a single function, Jin Erda
To the technique effect for being automatically performed migration of subscriber data.
Processor 201 can call the application program that memory 203 stores by transmitting device 205, to execute following steps
Suddenly:Control device detects that the number of servers in server cluster changes, wherein server cluster is stateful divides
Cloth server cluster;Servers-all of the control device into server cluster sends Status Change information, wherein state becomes
More information is for indicating that the number of servers in server cluster changes;In control device receives Servers-all
After information is completed in the migration that destination server is sent, control device updates the cluster state information of server cluster, wherein moves
Move and complete information and be used to indicate the migration of the complete paired data of destination server, in destination server for needed in Servers-all into
The server of row Data Migration.
Processor 201 is additionally operable to execute following step:Control device update server cluster cluster state information it
Afterwards, updated cluster state information is synchronized to service equipment by control device, wherein service equipment is used for according to updated
Service request is sent to corresponding server in server cluster by cluster state information.
Processor 201 is additionally operable to execute following step:Control device passes through the clothes in heartbeat packet to server cluster
Business device quantity changes, wherein heartbeat packet is used to indicate the server increased or decreased in server cluster;Or control is set
It is standby to detect that the number of servers in server cluster changes by the configuration information of acquisition, wherein configuration information is used for
Indicate the server increased or decreased in server cluster.
Processor 201 is additionally operable to execute following step:Control device passes through the clothes in heartbeat packet to server cluster
Business device quantity, which occurs to become, to be further included:There is event by the first server in heartbeat packet to server cluster in control device
Barrier;After control device is changed by the number of servers in heartbeat packet to server cluster, control device is more
The cluster state information of new demand servicing device cluster
Optionally, the specific example in the present embodiment can refer to showing described in above-described embodiment 1 and embodiment 2
Example, details are not described herein for the present embodiment.
It will appreciated by the skilled person that structure shown in Fig. 9 is only to illustrate, terminal can be smart mobile phone
(such as Android phone, iOS mobile phones), tablet computer, palm PC and mobile internet device (Mobile Internet
Devices, MID), the terminal devices such as PAD.Fig. 9 it does not cause to limit to the structure of above-mentioned electronic device.For example, terminal is also
May include than shown in Fig. 9 more either less components (such as network interface, display device) or with shown in Fig. 9
Different configurations.
One of ordinary skill in the art will appreciate that all or part of step in the various methods of above-described embodiment is can
To be completed come command terminal device-dependent hardware by program, which can be stored in a computer readable storage medium
In, storage medium may include:Flash disk, read-only memory (Read-Only Memory, ROM), random access device (Random
Access Memory, RAM), disk or CD etc..
Embodiment 4
The embodiments of the present invention also provide a kind of storage mediums.Optionally, in the present embodiment, above-mentioned storage medium can
For executing the program code of data migration method.
Optionally, in the present embodiment, above-mentioned storage medium can be located at multiple in network shown in above-described embodiment
On at least one of network equipment network equipment.
Optionally, in the present embodiment, storage medium is arranged to store the program code for executing following steps:
S1, the Status Change information that first server receiving control apparatus is sent, wherein Status Change information is for indicating
Number of servers in server cluster changes, and server cluster is stateful distributed server cluster, server
Cluster includes first server;
S2, first server judge to whether there is target account number in the account number of first server current service, wherein target
Account number is configured as providing service by the second server in server cluster;
S3, there are in the case of target account number in the account number for judging first server current service, first server
By the Data Migration of target account number in first server to second server;
S4, after completing the Data Migration to second server of target account number, first server is sent out to control device
Migration is sent to complete information, wherein migration completes information and is used to indicate the migration that first server is completed to the data of target account number.
Optionally, storage medium is also configured to store the program code for executing following steps:First server connects
Receive the service request of target account number;Service request is redirected to second server by first server, wherein second server
For responding service request service is provided to target account number.
Optionally, storage medium is also configured to store the program code for executing following steps:First server is sentenced
With the presence or absence of the destination number being located at except the first set of numbers in disconnected number corresponding with the account number of current service, wherein with
The corresponding account number of number in first set of numbers is configured as providing service by first server;It is located at the judging to exist
In the case of destination number except one set of numbers, first server judges that there are target accounts in the account number of current service
Number, and account number corresponding with destination number is determined as target account number.
Optionally, storage medium is also configured to store the program code for executing following steps:First server obtains
It takes and the obtained number of hashing operation is carried out to the account number of current service, wherein obtained number is the account with current service
Number corresponding number.
Optionally, storage medium is also configured to store the program code for executing following steps:First server obtains
Take the address of the second server corresponding to the second set of numbers being located at target account number;First server is according to the second clothes
Be engaged in device address by the Data Migration of target account number in first server to second server.
The embodiments of the present invention also provide a kind of storage mediums.Optionally, in the present embodiment, above-mentioned storage medium can
For executing the program code of data migration method.
Optionally, in the present embodiment, above-mentioned storage medium can be located at multiple in network shown in above-described embodiment
On at least one of network equipment network equipment.
Optionally, in the present embodiment, storage medium is arranged to store the program code for executing following steps:
S1, control device detect that the number of servers in server cluster changes, wherein server cluster is to have
The distributed server cluster of state;
S2, Servers-all of the control device into server cluster send Status Change information, wherein Status Change is believed
The number of servers for indicating in server cluster is ceased to change;
S3, after information is completed in the migration that the destination server during control device receives Servers-all is sent, control
Control equipment updates the cluster state information of server cluster, wherein migration completes information for indicating destination server completion pair
The migration of data, to need to carry out the server of Data Migration in Servers-all in destination server.
Optionally, storage medium is also configured to store the program code for executing following steps:Control device more
After the cluster state information of new demand servicing device cluster, updated cluster state information is synchronized to service equipment by control device,
Wherein, service equipment is used to that service request to be sent to corresponding clothes in server cluster according to updated cluster state information
Business device.
Optionally, storage medium is also configured to store the program code for executing following steps:Control device passes through
Number of servers in heartbeat packet to server cluster changes, wherein heartbeat packet is used to indicate in server cluster
The server increased or decreased;Or control device detects the server count in server cluster by the configuration information of acquisition
Amount changes, wherein the server that configuration information is used to indicate to increase or decrease in server cluster.
Optionally, storage medium is also configured to store the program code for executing following steps:Control device passes through
First server in heartbeat packet to server cluster breaks down;Pass through heartbeat packet to server in control device
After number of servers in cluster changes, method further includes:Control device updates the cluster state letter of server cluster
Breath.
Optionally, the specific example in the present embodiment can refer to showing described in above-described embodiment 1 and embodiment 2
Example, details are not described herein for the present embodiment.
Optionally, in the present embodiment, above-mentioned storage medium can include but is not limited to:USB flash disk, read-only memory (ROM,
Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disc or
The various media that can store program code such as CD.
The embodiments of the present invention are for illustration only, can not represent the quality of embodiment.
If the integrated unit in above-described embodiment is realized in the form of SFU software functional unit and as independent product
Sale in use, can be stored in the storage medium that above computer can be read.Based on this understanding, skill of the invention
Substantially all or part of the part that contributes to existing technology or the technical solution can be with soft in other words for art scheme
The form of part product embodies, which is stored in a storage medium, including some instructions are used so that one
Platform or multiple stage computers equipment (can be personal computer, server or network equipment etc.) execute each embodiment institute of the present invention
State all or part of step of method.
In the above embodiment of the present invention, all emphasizes particularly on different fields to the description of each embodiment, do not have in some embodiment
The part of detailed description may refer to the associated description of other embodiment.
In several embodiments provided herein, it should be understood that disclosed client, it can be by others side
Formula is realized.Wherein, the apparatus embodiments described above are merely exemplary, for example, the unit division, only one
Kind of division of logic function, formula that in actual implementation, there may be another division manner, such as multiple units or component can combine or
It is desirably integrated into another system, or some features can be ignored or not executed.Another point, it is shown or discussed it is mutual it
Between coupling, direct-coupling or communication connection can be INDIRECT COUPLING or communication link by some interfaces, unit or module
It connects, can be electrical or other forms.
The unit illustrated as separating component may or may not be physically separated, aobvious as unit
The component shown may or may not be physical unit, you can be located at a place, or may be distributed over multiple
In network element.Some or all of unit therein can be selected according to the actual needs to realize the mesh of this embodiment scheme
's.
In addition, each functional unit in each embodiment of the present invention can be integrated in a processing unit, it can also
It is that each unit physically exists alone, it can also be during two or more units be integrated in one unit.Above-mentioned integrated list
The form that hardware had both may be used in member is realized, can also be realized in the form of SFU software functional unit.
The above is only a preferred embodiment of the present invention, it is noted that for the ordinary skill people of the art
For member, various improvements and modifications may be made without departing from the principle of the present invention, these improvements and modifications are also answered
It is considered as protection scope of the present invention.
Claims (13)
1. a kind of data migration method, which is characterized in that including:
The Status Change information that first server receiving control apparatus is sent, wherein the Status Change information takes for indicating
Number of servers in business device cluster changes, and the server cluster is stateful distributed server cluster, described
Server cluster includes the first server;
The first server judge in number corresponding with the account number of current service with the presence or absence of positioned at the first set of numbers it
Outer destination number, wherein account number corresponding with the number in first set of numbers is configured as by the first service
Device provides service;
In the case where judging to have the destination number being located at except first set of numbers, the first server
Judge that there are target account numbers in the account number of the current service, and will account number corresponding with the destination number be determined as it is described
Target account number, wherein the target account number is configured as providing service by the second server in the server cluster;
There are in the case of the target account number in the account number for judging the first server current service, described first takes
Device be engaged in by the Data Migration of the target account number in the first server to the second server;
After completing the Data Migration to the second server of the target account number, the first server is to the control
Control equipment sends migration and completes information, wherein the migration completes information for indicating that the first server is completed to described
The migration of the data of target account number.
2. according to the method described in claim 1, it is characterized in that, in the first server by institute in the first server
During the Data Migration to the second server for stating target account number, the method further includes:
The first server receives the service request of the target account number;
The service request is redirected to the second server by the first server, wherein the second server is used
In responding the service request service is provided to the target account number.
3. according to the method described in claim 2, it is characterized in that, judging and the current service in the first server
With the presence or absence of before the destination number except the first set of numbers in the corresponding number of account number, the method further includes:
The first server is obtained carries out the obtained number of hashing operation to the account number of the current service, wherein described
Obtained number is number corresponding with the account number of the current service.
4. according to the method described in claim 1, it is characterized in that, the first server will be described in the first server
The Data Migration of target account number includes to the second server:
The first server obtains the second service corresponding to the second set of numbers being located at the target account number
The address of device;
The first server is according to the address of the second server by the number of the target account number in the first server
According to moving to the second server.
5. a kind of data migration method, which is characterized in that including:
Control device detects that the number of servers in server cluster changes, wherein the server cluster is to have shape
The distributed server cluster of state;
Servers-all of the control device into the server cluster sends Status Change information, wherein the state
Modification information is for indicating that the number of servers in the server cluster changes;
First server in the Servers-all, which judges to whether there is in number corresponding with the account number of current service, to be located at
Destination number except first set of numbers, wherein account number corresponding with the number in first set of numbers is configured as
Service is provided by the first server;
In the case where judging to have the destination number being located at except first set of numbers, the first server
Judge that there are target account numbers in the account number of the current service, and will account number corresponding with the destination number be determined as it is described
Target account number, the target account number is configured as providing service by the second server in the Servers-all, by described
First server is by the Data Migration of the target account number to the second server;
After the migration completion information that the control device receives that the first server is sent, the control device update
The cluster state information of the server cluster, wherein the migration completes information for indicating that the first server is completed
Migration to data.
6. according to the method described in claim 5, it is characterized in that, updating the collection of the server cluster in the control device
After group's status information, the method further includes:
The updated cluster state information is synchronized to service equipment by the control device, wherein the service equipment is used
In service request to be sent to corresponding service in the server cluster according to the updated cluster state information
Device.
7. according to the method described in claim 5, it is characterized in that, the control device detects the service in server cluster
Device quantity, which occurs to become, to be further included:
The control device is changed by heartbeat packet to the number of servers in the server cluster, wherein institute
It states heartbeat packet and is used to indicate the server increased or decreased in the server cluster;Or the control device passes through acquisition
Configuration information detects that the number of servers in the server cluster changes, wherein the configuration information is for indicating
The server increased or decreased in the server cluster.
8. the method according to the description of claim 7 is characterized in that the control device passes through heartbeat packet to the service
Number of servers in device cluster, which occurs to become, to be further included:The control device passes through in heartbeat packet to the server cluster
First server break down;
After the control device is changed by heartbeat packet to the number of servers in the server cluster, institute
The method of stating further includes:The control device updates the cluster state information of the server cluster.
9. a kind of data migration device, which is characterized in that including:
First receiving unit, the Status Change information for being sent by first server receiving control apparatus, wherein the shape
For state modification information for indicating that the number of servers in server cluster changes, the server cluster is stateful divides
Cloth server cluster, the server cluster include the first server;
Judging unit, including judgment module and determining module, the judgment module, for by the first server judge and
In the corresponding number of account number of current service with the presence or absence of be located at the first set of numbers except destination number, wherein with it is described
The corresponding account number of number in first set of numbers is configured as providing service by the first server;
The determining module, for judging there is the case where destination number being located at except first set of numbers
Under, the first server judges that there are target account numbers in the account number of the current service, and will be with the destination number pair
The account number answered is determined as the target account number, wherein the target account number is configured as by second in the server cluster
Server providing services;
Migration units, for the case where there are the target account numbers in the account number for judging the first server current service
Under, by the first server by the Data Migration of the target account number in the first server to the second service
Device;
Transmission unit, after in completion by the Data Migration to the second server of the target account number, by described
First server sends migration to the control device and completes information, wherein the migration completes information and is used to indicate described the
One server completes the migration to the data of the target account number.
10. device according to claim 9, which is characterized in that described device further includes:
Second receiving unit, in the first server by the Data Migration of the target account number in the first server
During the second server, the service request of the target account number is received by the first server;
Directed element, for the service request to be redirected to the second server by the first server, wherein
The second server provides service for responding the service request to the target account number.
11. a kind of data migration device, which is characterized in that including:
Detection unit, for detecting that the number of servers in server cluster changes by control device, wherein described
Server cluster is stateful distributed server cluster;
Transmission unit, for sending Status Change letter by Servers-all of the control device into the server cluster
Breath, wherein the Status Change information is for indicating that the number of servers in the server cluster changes;
Judging unit, including judgment module and determining module, the judgment module are used for through the in the Servers-all
One server judges in number corresponding with the account number of current service with the presence or absence of the target number being located at except the first set of numbers
Code, wherein account number corresponding with the number in first set of numbers is configured as providing service by the first server;
The determining module is used to judge there is the case where destination number being located at except first set of numbers
Under, the first server judges that there are target account numbers in the account number of the current service, and will be with the destination number pair
The account number answered is determined as the target account number, and the target account number is configured as by the second server in the Servers-all
Service is provided;
Migration units, for by the first server by the Data Migration of the target account number to the second server;
Updating unit, for after the migration completion information that the control device receives that the first server is sent, leading to
Cross the cluster state information that the control device updates the server cluster, wherein the migration completes information for indicating
The migration of the complete paired data of first server.
12. according to the devices described in claim 11, which is characterized in that described device further includes:
Synchronization unit, for after the cluster state information that the control device updates the server cluster, by described
The updated cluster state information is synchronized to service equipment by control device, wherein the service equipment is used for according to institute
It states the updated cluster state information and service request is sent to corresponding server in the server cluster.
13. according to the devices described in claim 11, which is characterized in that the detection unit is used for:
It is changed to the number of servers in the server cluster by heartbeat packet by the control device,
In, the heartbeat packet is used to indicate the server increased or decreased in the server cluster;Or pass through the control device
Detect that the number of servers in the server cluster changes by the configuration information of acquisition, wherein described to match confidence
Cease the server for indicating to increase or decrease in the server cluster.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710327644.5A CN107105049B (en) | 2017-05-10 | 2017-05-10 | Data migration method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710327644.5A CN107105049B (en) | 2017-05-10 | 2017-05-10 | Data migration method and device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN107105049A CN107105049A (en) | 2017-08-29 |
CN107105049B true CN107105049B (en) | 2018-10-02 |
Family
ID=59670186
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710327644.5A Active CN107105049B (en) | 2017-05-10 | 2017-05-10 | Data migration method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN107105049B (en) |
Families Citing this family (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110019529B (en) * | 2017-12-29 | 2024-01-30 | 华为技术有限公司 | Data node management method, system and related equipment |
CN108282527B (en) * | 2018-01-22 | 2019-07-09 | 北京百度网讯科技有限公司 | Generate the distributed system and method for Service Instance |
CN114095759B (en) * | 2020-08-03 | 2024-01-12 | 海能达通信股份有限公司 | Stream media redirection method and related device |
CN114615263A (en) * | 2022-02-10 | 2022-06-10 | 深圳市小满科技有限公司 | Cluster online migration method, device, equipment and storage medium |
CN115277114B (en) * | 2022-07-08 | 2023-07-21 | 北京城市网邻信息技术有限公司 | Distributed lock processing method and device, electronic equipment and storage medium |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105208435A (en) * | 2014-06-27 | 2015-12-30 | 中兴通讯股份有限公司 | Method for processing data in IPTV system and network cell equipment |
CN105760431A (en) * | 2016-01-29 | 2016-07-13 | 杭州华三通信技术有限公司 | Method and device for transferring file blocks |
Family Cites Families (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101296176B (en) * | 2007-04-25 | 2010-12-22 | 阿里巴巴集团控股有限公司 | Data processing method and apparatus based on cluster |
CN102769582B (en) * | 2012-08-02 | 2015-06-03 | 深圳中兴网信科技有限公司 | Logical server, instant messaging system and instant messaging method |
-
2017
- 2017-05-10 CN CN201710327644.5A patent/CN107105049B/en active Active
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105208435A (en) * | 2014-06-27 | 2015-12-30 | 中兴通讯股份有限公司 | Method for processing data in IPTV system and network cell equipment |
CN105760431A (en) * | 2016-01-29 | 2016-07-13 | 杭州华三通信技术有限公司 | Method and device for transferring file blocks |
Also Published As
Publication number | Publication date |
---|---|
CN107105049A (en) | 2017-08-29 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107105049B (en) | Data migration method and device | |
CN107078969B (en) | Realize computer equipment, the system and method for load balancing | |
CN105915650B (en) | Load-balancing method and device | |
CN104243337B (en) | A kind of method and device across cluster load balance | |
CN108040108A (en) | Communication handover method, device, coordination service device and readable storage medium storing program for executing | |
CN107925681A (en) | The system and method that the load balance in network packet core system is defined for distributed software | |
CN106713487A (en) | Data synchronization method and device | |
CN106301829A (en) | A kind of method and apparatus of Network dilatation | |
CN105897827A (en) | Server node, local area network server cluster and realizing method thereof | |
CN105578527B (en) | Realize the method, apparatus and system of cloud AC load balancing | |
CN104320502B (en) | Terminating gateway IP address distribution method, the method for data transfer, MME and system | |
WO2022127504A1 (en) | Network element management method and apparatus, and storage medium | |
CN106453124A (en) | Traffic scheduling method and device | |
CN108696581A (en) | Caching method, device, computer equipment and the storage medium of distributed information | |
US9894600B1 (en) | Providing adaptive network access | |
CN105930191A (en) | System service reloading method and apparatus | |
CN108696417A (en) | Business switch method in backup network and device | |
CN108595670A (en) | A kind of date storage method, device, computer installation and storage medium | |
CN107357571A (en) | Maintenance method and system of equipment component program and component server | |
CN102387028A (en) | Network system, network management server, and OAM test method | |
CN109905900A (en) | A kind of method and business processing device of center cell switching | |
CN107241387A (en) | The processing method of request of data, apparatus and system | |
CN103546308A (en) | Method, device and system for distributing wireless controller network | |
CN104426968A (en) | Data management method and device | |
CN103401954B (en) | The implementation method of virtual DHCP |
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 |