CN106997306B - Method, device and system for migrating physical machine data to cloud - Google Patents

Method, device and system for migrating physical machine data to cloud Download PDF

Info

Publication number
CN106997306B
CN106997306B CN201610053119.4A CN201610053119A CN106997306B CN 106997306 B CN106997306 B CN 106997306B CN 201610053119 A CN201610053119 A CN 201610053119A CN 106997306 B CN106997306 B CN 106997306B
Authority
CN
China
Prior art keywords
server
source database
database
application server
database 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.)
Active
Application number
CN201610053119.4A
Other languages
Chinese (zh)
Other versions
CN106997306A (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.)
Alibaba Group Holding Ltd
Original Assignee
Alibaba Group Holding 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 Alibaba Group Holding Ltd filed Critical Alibaba Group Holding Ltd
Priority to CN201610053119.4A priority Critical patent/CN106997306B/en
Priority to PCT/CN2017/071386 priority patent/WO2017128992A1/en
Priority to TW106102456A priority patent/TWI724095B/en
Publication of CN106997306A publication Critical patent/CN106997306A/en
Application granted granted Critical
Publication of CN106997306B publication Critical patent/CN106997306B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • G06F9/485Task life-cycle, e.g. stopping, restarting, resuming execution
    • G06F9/4856Task life-cycle, e.g. stopping, restarting, resuming execution resumption being on a different machine, e.g. task migration, virtual machine migration
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5083Techniques for rebalancing the load in a distributed system
    • G06F9/5088Techniques for rebalancing the load in a distributed system involving task migration

Abstract

The invention discloses a method, a device and a system for migrating physical machine data to a cloud. Wherein, the method comprises the following steps: synchronizing a source database in a source database server to a target database server; after the source database server confirms that the source database synchronization is completed, switching the database server accessed by the first application server from the source database server to a target database server; changing an application server accessed by a client user through a first domain name from a first application server to a second application server by modifying address information bound with the first domain name in a DNS server; and after the access link between the second application server and the target database is successfully established, the client user accesses the source database obtained synchronously in the target database through the second application server. The method and the device solve the technical problem that the client stops using in the process of migrating the application to the cloud in the prior art.

Description

Method, device and system for migrating physical machine data to cloud
Technical Field
The invention relates to the field of data migration, in particular to a method, a device and a system for migrating physical machine data to a cloud.
Background
The proliferation, use, and delivery model of cloud computing as an internet-based related service typically involves providing dynamically scalable and often virtualized resources over the internet. With the continuous development of cloud computing, the continuous deepening of cloud computing applications and the continuous expansion of the requirement for large data processing, more and more applications are migrated to the cloud.
However, in the prior art, in the process of migrating the application onto the cloud, all or part of the functions of the application need to be stopped, so that a user may use or may not use the application normally in the migration process. For some online applications, such as transaction systems of electronic commerce, stopping applications for application migration may bring poor user experience, even cause a drop in transaction amount, and existing cloud-going schemes mostly rely on more middleware, especially middleware such as database access (such as Taobao TDDL) and application transformation, which are high in cost. And the method has no universality for different development languages, so that the method has no universal feasibility.
Aiming at the technical problem that the client stops using in the process of migrating the application to the cloud in the prior art, an effective solution is not provided at present.
Disclosure of Invention
The embodiment of the invention provides a method, a device and a system for migrating physical machine data to a cloud end, which are used for at least solving the technical problem that a client end stops using in the process of migrating an application to the cloud end in the prior art.
According to an aspect of the embodiments of the present invention, there is provided a method for migrating physical machine data to a cloud, including: synchronizing a source database in a source database server to a target database server, wherein the source database server is a physical machine, and the target database server is a server deployed on a cloud end; after the source database server confirms that the source database synchronization is completed, switching the database server accessed by the first application server from the source database server to a target database server, wherein the first application server is a physical machine used by a current client user for accessing the source database; changing an application server accessed by a client user through a first domain name from a first application server to a second application server by modifying address information bound with the first domain name in a DNS server, wherein the second application server is an application server deployed on a cloud end; and after the access link between the second application server and the target database is successfully established, the client user accesses the source database obtained synchronously in the target database through the second application server.
According to another aspect of the embodiments of the present invention, there is also provided a device for migrating physical machine data to a cloud, including: the system comprises a synchronization module, a target database server and a database management module, wherein the synchronization module is used for synchronizing a source database in a source database server to the target database server, the source database server is a physical machine, and the target database server is a server deployed on a cloud end; the switching module is used for switching the database server accessed by the first application server from the source database server to a target database server after the source database server confirms that the source database is synchronized, wherein the first application server is a physical machine used by a current client user for accessing the source database; the system comprises a replacing module, a cloud server and a server management module, wherein the replacing module is used for replacing an application server accessed by a client user through a first domain name from the first application server to a second application server by modifying address information bound with the first domain name in a DNS server, and the second application server is an application server deployed on a cloud end; and the access module is used for accessing the source database obtained by synchronization in the target database by the client user through the second application server after the access link between the second application server and the target database is successfully established.
According to another aspect of the embodiments of the present invention, there is provided a system for migrating physical machine data to a cloud, including: the source database server is used for providing a source database, wherein the source database server is a physical machine; the target database server establishes a communication relation with the source database server and is used for receiving the source database synchronized by the source database server, wherein the target database server is a service deployed on the cloud end; the first application server is communicated with the target database server after the source database server confirms that the source database is synchronized, and is used for switching the currently accessed database server from the source database server to the target database server, wherein the first application server is a physical machine used by a current client user for accessing the source database; a DNS server, which is communicated with the first application server and the second application server and is used for modifying the address information bound with the first domain name; and the second application server establishes an access link with the target database, and is used for the client user to read the modified second application server accessed through the first domain name by the DNS server, so that the client user accesses the source database synchronously obtained in the target database through the second application server, wherein the second application server is an application server deployed on the cloud.
In the embodiment of the present invention, a source database in a source database server is synchronized to a target database server, and after the source database server confirms that the source database is synchronized, a database server accessed by a first application server is switched from the source database server to the target database server, and address information bound to a first domain name in a DNS server is modified, so that an application server accessed by a client user through the first domain name is changed from the first application server to a second application server, and thus, a technical effect that the application can be continuously used by the user when the application is migrated to a cloud is achieved, and a technical problem that the client stops using when the application is migrated to the cloud in the prior art is solved.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the invention and together with the description serve to explain the invention without limiting the invention. In the drawings:
fig. 1 is a block diagram of a hardware structure of a computer terminal of a method for migrating physical machine data to a cloud according to an embodiment of the present invention;
FIG. 2 is a flow chart of an alternative method for migrating physical machine data to a cloud in accordance with an embodiment of the present application;
fig. 3 is a schematic diagram of a user accessing a source database server through a first application server according to an embodiment of the present application;
FIG. 4 is a schematic diagram of a user accessing a target database server through a first application server according to an embodiment of the present application;
FIG. 5 is a schematic diagram of a user accessing a target database server through a second application server according to an embodiment of the present application;
FIG. 6 is a flow chart of an alternative method for migrating physical machine data to a cloud in accordance with an embodiment of the present application;
FIG. 7 is an interaction diagram of an alternative method for migrating physical machine data to a cloud in accordance with embodiments of the present application;
fig. 8 is a schematic structural diagram of an alternative apparatus for migrating physical machine data to a cloud according to an embodiment of the present application;
fig. 9 is a schematic structural diagram of an alternative apparatus for migrating physical machine data to a cloud according to an embodiment of the present application;
fig. 10 is a schematic structural diagram of an alternative apparatus for migrating physical machine data to a cloud according to an embodiment of the present application;
fig. 11 is a schematic structural diagram of an alternative apparatus for migrating physical machine data to a cloud according to an embodiment of the present application;
fig. 12 is a schematic structural diagram of an alternative apparatus for migrating physical machine data to a cloud according to an embodiment of the present application;
fig. 13 is a schematic structural diagram of an alternative apparatus for migrating physical machine data to a cloud according to an embodiment of the present application;
fig. 14 is a schematic structural diagram of an alternative apparatus for migrating physical machine data to a cloud according to an embodiment of the present application;
fig. 15 is a schematic structural diagram of an alternative apparatus for migrating physical machine data to a cloud according to an embodiment of the present application;
fig. 16 is a schematic structural diagram of an alternative system for migrating physical machine data to a cloud according to an embodiment of the present application; and
fig. 17 is a block diagram of a computer terminal according to an embodiment of the present application.
Detailed Description
In order to make the technical solutions of the present invention better understood, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that the terms "first," "second," and the like in the description and claims of the present invention and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the invention described herein are capable of operation in sequences other than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
First, some terms or terms appearing in the description of the embodiments of the present application are applicable to the following explanations:
a DNS server: the domain name resolver is composed of a domain name resolver and a domain name server, and has a function of converting domain names into IP addresses.
And the host file is a system file without an extension name and is used for establishing a related 'database' between some commonly used website domain names and IP addresses corresponding to the website domain names.
Example 1
There is also provided, in accordance with an embodiment of the present invention, an embodiment of a method for migrating physical machine data to a cloud, where the steps illustrated in the flowchart of the accompanying drawings may be performed in a computer system, such as a set of computer-executable instructions, and where a logical order is illustrated in the flowchart, in some cases, the steps illustrated or described may be performed in an order different than that illustrated or described herein.
The method provided by the first embodiment of the present application may be executed in a mobile terminal, a computer terminal, or a similar computing device. Taking an example of the method running on a computer terminal, fig. 1 is a hardware structure block diagram of the computer terminal of the method for migrating physical machine data to a cloud according to the embodiment of the present invention. As shown in fig. 1, the computer terminal 10 may include one or more (only one shown) processors 102 (the processor 102 may include, but is not limited to, a processing device such as a microprocessor MCU or a programmable logic device FPGA), a memory 104 for storing data, and a transmission module 106 for communication functions. It will be understood by those skilled in the art that the structure shown in fig. 1 is only an illustration and is not intended to limit the structure of the electronic device. For example, the computer terminal 10 may also include more or fewer components than shown in FIG. 1, or have a different configuration than shown in FIG. 1.
The memory 104 may be used to store software programs and modules of application software, such as program instructions/modules corresponding to the method for migrating physical machine data to the cloud in the embodiment of the present invention, and the processor 102 executes various functional applications and data processing by running the software programs and modules stored in the memory 104, that is, implementing the method for migrating physical machine data to the cloud. The memory 104 may include high speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include memory located remotely from the processor 102, which may be connected to the computer terminal 10 via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The transmission device 106 is used for receiving or transmitting data via a network. Specific examples of the network described above may include a wireless network provided by a communication provider of the computer terminal 10. In one example, the transmission device 106 includes a Network adapter (NIC) that can be connected to other Network devices through a base station to communicate with the internet. In one example, the transmission device 106 can be a Radio Frequency (RF) module, which is used to communicate with the internet in a wireless manner.
In the foregoing operating environment, the present application provides a method for migrating physical machine data to a cloud end as shown in fig. 2. Fig. 2 is a flowchart of an optional method for migrating physical machine data to a cloud according to an embodiment of the present application, as shown in fig. 2, the method includes:
step S23, synchronize the source database in the source database server to the target database server, where the source database server is a physical machine and the target database server is a server deployed on the cloud.
Specifically, in the above steps, the source database may be a database for data generated when the client is used by a user who is deposited on a physical machine, the physical machine being a physical computer with respect to the virtual machine.
In an optional scheme, the source database may be a database of the client on the physical machine, and the step synchronizes the source database in the database server on the physical machine to the server on the cloud, so that the server on the cloud includes a database consistent with the source database.
It should be noted that the server on the cloud is a server deployed at a network end, and may be a virtual server deployed at the cloud, but is not limited thereto.
Step S25, after the source database server confirms that the source database synchronization is completed, the database server accessed by the first application server is switched from the source database server to the target database server, where the first application server is a physical machine used by the current client user to access the source database.
In an alternative embodiment, the current client may be an e-commerce transaction system, the source database may be a database of the e-commerce transaction system on a physical machine, before the step of synchronizing the source database in the source database server to the target database server is completed, as shown in fig. 3, a user accesses the source database in the physical machine through a load balancer to read or write related data during the use of the e-commerce transaction system, and after the step of synchronizing the source database in the source database server to the target database server is completed, as shown in fig. 4, the user reads or writes related data by accessing the source database in the server on the cloud during the use of the e-commerce transaction system.
Step S27, changing the application server accessed by the client user through the first domain name from the first application server to a second application server by modifying the address information already bound to the first domain name in the DNS server, where the second application server is an application server deployed on the cloud.
Specifically, in the above step, the address information bound by the first domain name is IP address information in the physical machine corresponding to the first domain name.
In an optional embodiment, in the DNS server, the first domain name has a binding relationship with an IP address corresponding to the first domain name in the physical machine, and the user can access the physical machine whose IP address corresponds to the first domain name in the DNS server by inputting the first domain name, and by modifying the address information that has been bound to the first domain name in the DNS server to the address information that corresponds to the first domain name in the cloud server, the client user does not access the physical machine whose IP address corresponds to the first domain name in the DNS server any longer but directly accesses the application server whose IP address corresponds to the first domain name in the cloud server when inputting the first domain name.
In step S29, after the access link between the second application server and the target database is successfully established, the client user accesses the source database synchronized in the target database through the second application server.
In an alternative embodiment, the second application server may be an application server on the cloud, and the target database may be a database deployed in a server on the cloud. After the access link between the application server on the cloud and the database deployed in the server on the cloud is successfully established, the user of the client accesses the database deployed in the server on the cloud, namely the source database previously deployed in the physical machine, through the server on the cloud.
In the first solution disclosed in the foregoing embodiment of the present application, a source database in a source database server is synchronized to a target database server; after the source database server confirms that the source database synchronization is completed, switching the database server accessed by the first application server from the source database server to a target database server; changing an application server accessed by a client user through a first domain name from a first application server to a second application server by modifying address information bound with the first domain name in a DNS server; and after the access link between the second application server and the target database is successfully established, the client user accesses the source database obtained synchronously in the target database through the second application server.
It should be noted that, in the process of synchronizing the source data in the source database to the target database server, the user of the client still reads the source database in the source database server in the process of using the client, until the source database server confirms that the source database synchronization is completed, the user of the client starts to use the database in the target database server, that is, in the process of synchronizing the database in the physical machine to the database server in the cloud, the user of the client still uses the source database in the physical machine until the source database in the physical machine is completely synchronized to the server in the cloud, and the user of the client starts to access the database in the server in the cloud, so that the user of the client can normally use the client in the process of synchronizing the source data in the source database to the target database server, i.e. the process of synchronizing the source data in the source database to the target database server does not affect the use of the user.
It should be further noted that, when the user of the client inputs the first domain name, after modifying the address information already bound to the first domain name in the DNS server, the response obtained by the user is the same response result as that obtained before modifying the address information already bound to the first domain name in the DNS server, so that modifying the address information already bound to the first domain name in the DNS server does not affect the use of the user of the client.
Therefore, the technical problem that the client stops using in the process of migrating the application to the cloud in the prior art is solved by the scheme of the first embodiment provided by the application.
According to the above embodiment of the present application, step S23, in the process of synchronizing the source database in the source database server to the target database server, includes:
step S231, modifying the first IP address bound to the database domain name stored in the first application server into the IP address of the target database server using the switching script, where the first IP address is the IP address of the source database server.
It should be noted that, when the user accesses the source database in the source database server through the first application server, the database domain name stored in the first application server has a corresponding relationship with the first IP address of the source database. After the first IP address bound with the database domain name and stored in the first application server is modified into the IP address of the target database server through the switching script, the user can access the target database in the target database server through the first application server.
Step S233, after the switching script sets the access right of the source database server to read only, disconnects all access links accessing the source database server.
According to the above embodiment of the present application, the synchronization method is: full-quantity synchronization or incremental synchronization, wherein the synchronization of the source database is confirmed to be completed in any one of the following modes:
the first method is as follows: the first application server polls the source database server in real time or at regular time, and if the synchronization ending information generated by the source database server is detected, the synchronization of the source database is determined to be completed.
In an optional embodiment, the source database server may be a physical machine, when the synchronization of the source database from the physical machine to the server deployed in the cloud is completed, the physical machine serving as the source database server can generate information that the synchronization step is completed, the first application server serving as the physical machine accessing the source database monitors whether the information that the synchronization step generated by the source database server is completed occurs in the source database in real time, and when the first application server monitors the information that the synchronization step generated by the source database server is completed, the completion of the synchronization step is determined.
In another optional embodiment, the source database server may still be a physical machine, when the synchronization of the source database from the physical machine to the server deployed in the cloud is completed, the physical machine serving as the source database server can generate information about the completion of the synchronization step, the first application server serves as a physical machine accessing the source database, the source database server is polled regularly to detect whether information about the completion of the synchronization step generated by the source database server appears in the source database, that is, the first application server searches for the information about the completion of the synchronization in the source database server at a certain period, and when the first application server monitors the information about the completion of the synchronization step generated by the source database server, the synchronization step is confirmed to be completed.
The second method comprises the following steps: and the source database server executes the synchronization of the source database according to the preset synchronization time length, and determines that the synchronization of the source database is completed when the first application server detects that the synchronization time length arrives or detects that the delay time of the synchronization time length arrives.
In an alternative example, the preset synchronization period may be 48 hours, and the extension time of the synchronization period may be 12 hours. Under the condition that the time length of the synchronization source database reaches 48 hours, the completion of the step of synchronizing the source database can be confirmed; or under the condition that the time length of the synchronization source database reaches 60 hours, the step of confirming the synchronization source database is completed.
It should be noted that the preset synchronization duration is preset synchronization time according to the data volume of the source database, and the larger the data volume in the source database is, the longer the preset synchronization duration is, and the preset synchronization duration can be considered to be greater than the duration required for synchronizing the source database.
According to the above embodiment of the present application, in step S25, after confirming that the synchronization of the source databases is completed, the method further includes:
step S251, stopping synchronization of the source database, and modifying the access right of the target database server from the set read-only right to the write-allowed right, so as to allow any application server to access the target database server, wherein the access right of the target database server is set to be read-only while or before the source database is synchronized to the target database server.
In an alternative embodiment, the source database may be a source database in the physical machine, the target database server may be a database server on the cloud, the access right of the database server on the cloud is a read-only mode, and then the source database in the physical machine is synchronized with the database server on the cloud, when the synchronization step is finished, the synchronization of the source database is stopped, at this time, the access authority of the source database in the physical machine is modified to be read-only, but all links accessing the source database are disconnected, the user thus accesses the target database in the database server on the cloud via the first application server, in the case where a user accesses a target database in a database server on the cloud through a first application server, the operation of reading and writing the target database is required, so the access authority of the database server on the cloud is modified to allow writing.
According to the above embodiment of the present application, in step S27, before modifying the address information already bound to the first domain name in the DNS server, the method further includes:
in step S271, the cloud starts the second application server to connect to the target database server.
In an optional embodiment, the second application server may be a server deployed on the cloud, and the target data server may also be a server deployed on the cloud. Starting the second application server to connect to the target database server may be starting a server deployed on the cloud to connect to another server deployed on the cloud that includes the synchronized source database.
Step S273, extracting the second IP address bound to the database domain name stored in the host file of the second application server.
Specifically, the hosts file is an association database established by the domain name and the IP address corresponding to the domain name, and the IP address corresponding to the domain name can be found through the association database.
In an optional embodiment, the second application server may be a server deployed on the cloud, the host file serves as an associated database of the domain name and the IP address corresponding to the domain name, and includes the IP address corresponding to the domain name of the database, and the host file deployed in the second application server on the cloud includes the IP address corresponding to the domain name of the database and used for connecting to the target database server.
In step S275, it is determined in the second application server whether the connection between the second application server and the target database is successful by verifying the extracted second IP address.
In an optional embodiment, the extracted second IP address is an IP address used for verifying whether the second IP address is corresponding to the database domain name, in the case of inputting the second IP address, if the second application server establishes a connection relationship with the target database server, the verification may be considered as successful, the extracted second IP address is an IP address corresponding to the database domain name, if the second application server does not establish a connection relationship with the target database server, the verification fails, and the extracted second IP address is not an IP address corresponding to the database domain name.
Step S277, if the verification of the second IP address is successful, it is determined that the second application server is successful in connecting to the target database.
In an optional embodiment, when the second IP address is successfully verified, the second IP address is considered to be an IP address corresponding to the database domain name, and therefore it is determined that the second application server is successfully connected to the target database, so that when a user of the client accesses the second application server using the client, the second application server can establish a connection with the database obtained by synchronizing the source database, that is, the user can access the target database in the database server on the cloud consistent with the source database by accessing the server deployed on the cloud.
According to the above embodiment of the present application, in step S275, determining, in the second application server, whether the connection between the second application server and the target database is successful by verifying the extracted second IP address, includes:
in step S2751, the extracted second IP address is input in the access interface of the second application server.
In an alternative embodiment, the access interface of the second application server includes an input field for inputting a website address and/or an IP address, the input field may be located at the top of the access interface of the second application server, and after the input field inputs the extracted IP address, the input field may select to confirm entry into the database page corresponding to the IP address.
Step S2753, after the second IP address is input, if the database page of the target database server is successfully opened, the access link between the second application server and the target database is successfully established.
In an alternative example, if the database page in the target database server cannot be opened, the access link between the second application server and the target database is not established, and the extracted second IP address is not the IP address corresponding to the database domain name of the target database server.
According to the above embodiment of the present application, in step S29, after the client user accesses the synchronized source database in the target database through the second application server, the method further includes:
step S291, detecting whether the source database server generates traffic within a predetermined time.
Specifically, when there are still users accessing the source database server, the source database server generates corresponding access traffic.
In an alternative embodiment, in a case where all users of the client access the target database through the database server deployed in the cloud, the source database server does not generate any access traffic.
Step S293, if the source database server does not generate any traffic within the predetermined time, the task running in the background of the source database server is stopped.
Specifically, if the source database server does not generate any traffic within a predetermined time, it may be considered that, within the predetermined time, the user of the client accesses the database by accessing the database server of the deployment and cloud, and the user does not access the source database by the source database server, so the task running in the background of the source database server is stopped.
It should be noted here that after stopping the task running in the background of the source data server, most users of the client access the target database through the database server deployed and in the cloud.
It should be further noted that, in the case that it is detected within the preset time that the source data server does not generate any traffic and stops the task running in the background of the source data server, if the instant of stopping the task running in the background of the source data server exists that the user accesses the source database through the source database server, the user will have a situation that the user cannot access the source database in the source data server, that is, the page accessed by the user will have an access error, so the user cannot normally use the client, but because the domain name input by the user has been connected to the application server in the cloud and the application server in the cloud has been connected to the target database deployed in the cloud, the user can normally use the client by only retrying the application or refreshing the access page, and this process is very short, in actual operation, the influence of cloud on the use of the client is greatly reduced.
According to the above embodiment of the present application, in step S29, after the client user accesses the synchronized source database in the target database through the second application server, the method further includes:
step S295, if the server deployed on the cloud end fails, the steps from step S23 to step S29 are adopted to reversely switch the second application server and/or the target database server deployed on the cloud end to the corresponding physical machine.
In an optional example, in the case that the target database server deployed in the cloud fails, the step of switching the second application server and/or the target database server deployed in the cloud to the corresponding physical machine in the reverse direction includes:
a1. setting the access right of the source database server to be read-only, synchronizing the database in the target database server to the source database server, modifying a second IP address of the target database server bound with the database domain name stored in the cloud server into a first IP address of the source database server through a switching script, and synchronizing the target database in the target database server to the source database server in combination with the method shown in FIG. 5;
b1. after the synchronization step is completed, the access authority of the target database server is set to be in a read-only mode, access links of all the target database servers are disconnected, and then the access authority of the source database server is modified to be allowed to be written in, so that the database server accessed by the second application server is switched to be the physical machine serving as the source database server from the target database server.
In another optional embodiment, when both the second application server deployed at the cloud and the target database server are failed, the step of reversely switching the second application server deployed at the cloud and/or the target database server to the corresponding physical machine includes:
a2. setting the access authority of a source database server to be read-only, synchronizing a database in a target database server to the source database server, and modifying a second IP address of the target database server bound with a database domain name stored in a cloud server into a first IP address of the source database server through a switching script so as to synchronize the target database in the target database server to the source database server;
b1. after the synchronization step is completed, setting the access authority of the target database server into a read-only mode, disconnecting access links of all the target database servers, and modifying the access authority of the source database server into permission to write so that the database server accessed by the second application server is switched from the target database server to a physical machine serving as the source database server;
c2, the cloud starts the first application server to connect to the source database server, extracts the first IP address bound with the database domain name stored in the host file of the first application server, and verifies the extracted first IP address to determine whether the first application server is successfully connected with the metadata database server, so that the application server accessed by the client user through the first domain name is switched to the first application server on the physical machine by the second application server of the cloud.
d2. And establishing an access link between the first application server and the source database server, so that the user can access the target database synchronized in the source database server through the first application server.
It should be noted that, the extracted first IP address is input in the first application server, and in the case that the database of the source database server is successfully opened, it is confirmed that the access link between the first application server and the source database server is successfully established.
According to the embodiment of the application, a plurality of first application servers are deployed under the cloud, each first application server accesses a source database server, a plurality of second application servers are deployed at the cloud, and the second application servers access a target database server.
It should be noted that, for simplicity of description, the above-mentioned method embodiments are described as a series of acts or combination of acts, but those skilled in the art will recognize that the present invention is not limited by the order of acts, as some steps may occur in other orders or concurrently in accordance with the invention. Further, those skilled in the art should also appreciate that the embodiments described in the specification are preferred embodiments and that the acts and modules referred to are not necessarily required by the invention.
Through the above description of the embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but the former is a better implementation mode in many cases. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal device (such as a mobile phone, a computer, a server, or a network device) to execute the method according to the embodiments of the present invention.
A preferred embodiment of the present application is described in detail below with reference to fig. 6.
And S61, setting the access right of the target database to be read-only.
Optionally, before or while synchronizing the source database in the source database server to the target database server, the access right of the target database is set to be read-only.
And S62, synchronizing the source database in the source database server to the target database server.
Optionally, the synchronization of the source database in the source database server to the target database server may be performed through a database tool, such as Data Transmission (Data Transmission) product of the airy cloud, which can implement full Data synchronization and incremental synchronization (e.g., DTS Digital theater System) from the source database server to the target database server (e.g., RDS, Relational database Service, cloud database).
And S63, modifying the IP address of the source database server bound by the database domain name into the IP address of the target data server.
And S64, setting the access right of the source database as read-only, and disconnecting the access links of all the source databases.
And S65, after the synchronization of the source database is confirmed to stop, the access authority of the target database is set to be write-in permission.
And S66, the cloud starts the second application server to connect with the target database server and verifies the IP address in the host of the second application server.
Optionally, the extracted second IP address is input in the access interface of the second application server, and if the database page of the target database server is successfully opened, the access link between the second application server and the target database is successfully established.
S67: and after the verification is successful, the client user accesses the target database through the second application server at the cloud end.
A preferred embodiment of the present application is described in detail below with reference to fig. 7.
As shown in fig. 7, an optional method for migrating physical machine data to the cloud is provided, and the method may include the following steps S701 to S709:
s701, synchronizing the source database in the source database server to the target database server.
Optionally, before or while synchronizing the source database in the source database server to the target database server, the access right of the target database is set to be read-only.
And S703, switching the source database server accessed by the first application server into the target database server.
Optionally, after the synchronization is stopped, the access right of the target data server is set to allow writing.
S705, the IP address of the source database server bound with the database domain name is modified into the IP address of the target data server.
S707, the second IP address bound to the database domain name stored in the host file of the second application server is verified.
Optionally, the second IP address is input into the second application server, and if the database of the database server is successfully opened, it is determined that the second application server is successfully connected to the target database.
And S709, replacing the application server accessed by the client user through the first domain name with a second application server.
Optionally, whether the source database server generates the traffic is detected within a predetermined time, and the running task of the source database server in the background is stopped under the condition that the source database server does not generate the traffic within the predetermined time.
Example 2
According to an embodiment of the present invention, there is also provided a device for migrating physical machine data to a cloud, as shown in fig. 8, the device including: a synchronization module 80, a switching module 82, a replacement module 84 and an access module 86.
The synchronization module 80 is configured to synchronize a source database in a source database server to a target database server, where the source database server is a physical machine and the target database server is a server deployed on a cloud; the switching module 82 is configured to switch the database server accessed by the first application server from the source database server to the target database server after the source database server confirms that the source database synchronization is completed, where the first application server is a physical machine used by the current client user to access the source database; the replacing module 84 is configured to replace, by modifying address information already bound to the first domain name in the DNS server, the application server accessed by the client user through the first domain name from the first application server to a second application server, where the second application server is an application server deployed on a cloud; the access module 86 is configured to, after the access link between the second application server and the target database is successfully established, the client user accesses the source database synchronized in the target database through the second application server.
Optionally, the source database may be a database of the client on a physical machine, the physical machine is a physical computer relative to the virtual machine, the first application server may be a physical machine used by the current user to access the source database, and the second application server may be an application server on the cloud.
It should be noted that the synchronization module 80, the switching module 82, the replacing module 84 and the accessing module 86 correspond to steps S23 to S29 in the first embodiment, and the four modules are the same as the corresponding steps in the implementation example and the application scenario, but are not limited to the disclosure in the first embodiment. It should be noted that the modules described above as part of the apparatus may be run in the computer terminal 10 provided in the first embodiment.
In the solution disclosed in the second embodiment of the present application, a source database in a source database server is synchronized to a target database server; after the source database server confirms that the source database synchronization is completed, switching the database server accessed by the first application server from the source database server to a target database server; changing an application server accessed by a client user through a first domain name from a first application server to a second application server by modifying address information bound with the first domain name in a DNS server; and after the access link between the second application server and the target database is successfully established, the client user accesses the source database obtained synchronously in the target database through the second application server.
It should be noted that, in the process of synchronizing the source data in the source database to the target database server, the user of the client still reads the source database in the source database server in the process of using the client, until the source database server confirms that the source database synchronization is completed, the user of the client starts to use the database in the target database server, that is, in the process of synchronizing the database in the physical machine to the database server in the cloud, the user of the client still uses the source database in the physical machine until the source database in the physical machine is completely synchronized to the server in the cloud, and the user of the client starts to access the database in the server in the cloud, so that the user of the client can normally use the client in the process of synchronizing the source data in the source database to the target database server, i.e. the process of synchronizing the source data in the source database to the target database server does not affect the use of the user.
It should be further noted that, when the user of the client inputs the first domain name, after modifying the address information already bound to the first domain name in the DNS server, the response obtained by the user is the same response result as that obtained before modifying the address information already bound to the first domain name in the DNS server, so that modifying the address information already bound to the first domain name in the DNS server does not affect the use of the user of the client.
Therefore, the technical problem that the client stops using in the process of migrating the application to the cloud in the prior art is solved by the scheme of the second embodiment provided by the application.
In an alternative embodiment, as shown in fig. 9, the synchronization module 80 includes: a modification module 90 and a disconnection module 92.
The modifying module 90 is configured to modify, using a handover script, a first IP address bound to a database domain name and stored in a first application server into an IP address of a target database server, where the first IP address is an IP address of a source database server; the disconnection module 92 is configured to disconnect all access links accessing the source database server after the switching script sets the access right of the source database server to read only.
It should be noted that the modification module 90 and the disconnection module 92 correspond to steps S231 to S233 in the first embodiment, and the modules are the same as the examples and application scenarios realized by the corresponding steps, but are not limited to the disclosure of the first embodiment. It should be noted that the modules described above as part of the apparatus may be run in the computer terminal 10 provided in the first embodiment.
In an alternative embodiment, as shown in fig. 10, the above-mentioned synchronization mode is: full-quantity synchronization or incremental synchronization, wherein the apparatus may further include: a polling module 100 and a first detection module 102.
The polling module 100 is configured to poll the source database server in real time or at regular time by the first application server, and if synchronous end information generated by the source database server is detected, determine that the source database is synchronized; the first detection module 102 is configured to execute, by the source database server, synchronizing the source database according to a preset synchronization duration, and determine that synchronization of the source database is completed when the first application server detects that the synchronization duration arrives or detects that the delay time of the synchronization duration arrives.
It should be noted here that the polling module 100 and the first detection module 102 correspond to the first mode and the second mode in the first embodiment, and the two modules are the same as the example and the application scenario realized by the corresponding steps, but are not limited to the disclosure of the first embodiment. It should be noted that the modules described above as part of the apparatus may be run in the computer terminal 10 provided in the first embodiment.
In an alternative embodiment, as shown in fig. 11, the apparatus may further include: a first stop module 110.
The first stopping module 110 is configured to stop the source database synchronization, and modify the access right of the target database server from the set read-only right to a write-permission right, so as to allow any application server to access the target database server, where the access right of the target database server is set to be read-only while or before the source database is synchronized to the target database server.
It should be noted that the preset synchronization duration is preset synchronization time according to the data volume of the source database, and the larger the data volume in the source database is, the longer the preset synchronization duration is, and the preset synchronization duration can be considered to be greater than the duration required for synchronizing the source database.
It should be noted that the first stopping module 110 corresponds to the step S251 in the first embodiment, and the module is the same as the example and the application scenario realized by the corresponding step, but is not limited to the disclosure of the first embodiment. It should be noted that the modules described above as part of the apparatus may be run in the computer terminal 10 provided in the first embodiment.
In an alternative embodiment, as shown in fig. 12, the apparatus may further include: an activation module 120, an extraction module 122, a first determination module 124, and a second determination module 126.
The starting module 120 is configured to cloud start the second application server to connect to the target database server; the extracting module 122 is configured to extract a second IP address bound to the database domain name stored in the host file of the second application server; the first determining module 124 is configured to determine, in the second application server, whether the connection between the second application server and the target database is successful by verifying the extracted second IP address; the second determining module 126 is configured to determine that the second application server successfully connects to the target database if the second IP address is successfully verified.
It should be noted here that the starting module 120, the extracting module 122, the first determining module 124, and the second determining module 126 correspond to steps S271 to S277 in the first embodiment, and the four modules are the same as the corresponding steps in the implementation example and the application scenario, but are not limited to the disclosure in the first embodiment. It should be noted that the modules described above as part of the apparatus may be run in the computer terminal 10 provided in the first embodiment.
In an alternative embodiment, as shown in fig. 13, the first determining module 124 includes: an input module 130 and a setup module 132.
The input module 130 is configured to input the extracted second IP address in the access interface of the second application server; the establishing module 132 is configured to, after inputting the second IP address, successfully establish an access link between the second application server and the target database if the database page of the target database server is successfully opened.
It should be noted that the input module 130 and the establishing module 132 correspond to steps S291 to S293 in the first embodiment, and the two modules are the same as the corresponding steps in the implementation example and the application scenario, but are not limited to the disclosure of the first embodiment. It should be noted that the modules described above as part of the apparatus may be run in the computer terminal 10 provided in the first embodiment.
In an alternative embodiment, as shown in fig. 14, the apparatus may further include: a second detection module 140 and a second stop module 142.
The second detecting module 140 is configured to detect whether the source database server generates traffic within a predetermined time; the second stopping module 142 is configured to stop the task running in the background of the source database server if the source database server does not generate any traffic within a predetermined time.
It should be noted here that after stopping the task running in the background of the source data server, most users of the client access the target database through the database server deployed and in the cloud.
It should be further noted that, in the case that it is detected within the preset time that the source data server does not generate any traffic and stops the task running in the background of the source data server, if the instant of stopping the task running in the background of the source data server exists that the user accesses the source database through the source database server, the user will have a situation that the user cannot access the source database in the source data server, that is, the page accessed by the user will have an access error, so the user cannot normally use the client, but because the domain name input by the user has been connected to the application server in the cloud and the application server in the cloud has been connected to the target database deployed in the cloud, the user can normally use the client by only retrying the application or refreshing the access page, and this process is very short, in actual operation, the influence of cloud on the use of the client is greatly reduced.
It should be noted that the second detecting module 140 and the second stopping module 142 correspond to steps S291 to S293 in the first embodiment, and the two modules are the same as the corresponding steps in the implementation example and the application scenario, but are not limited to the disclosure of the first embodiment. It should be noted that the modules described above as part of the apparatus may be run in the computer terminal 10 provided in the first embodiment.
In an alternative embodiment, as shown in fig. 15, the apparatus may further include: a reverse switching module 150.
The reverse switching module 150 is configured to, if the server deployed on the cloud fails, employ the apparatus in claim 10 to switch the second application server and/or the target database server deployed on the cloud to the corresponding physical machine in the reverse direction.
It should be noted that the reverse switching module 150 corresponds to step S295 in the first embodiment, and the two modules are the same as the corresponding steps in the implementation example and application scenario, but are not limited to the disclosure in the first embodiment. It should be noted that the modules described above as part of the apparatus may be run in the computer terminal 10 provided in the first embodiment.
In an optional embodiment, a plurality of first application servers are deployed under the cloud, each first application server accesses the source database server, a plurality of second application servers are deployed at the cloud, and the second application servers access the target database server.
Example 3
According to an embodiment of the present invention, there is also provided a system for migrating physical machine data to a cloud, as shown in fig. 16, the system including: source database server 161, target database server 163, first application server 165, DNS server 167, and second application server 169.
A source database server 161, configured to provide a source database, where the source database server is a physical machine;
the target database server 163 establishes a communication relationship with the source database server, and is used for receiving the source database synchronized by the source database server, wherein the target database server is a server deployed on the cloud end;
the first application server 165, after the source database server confirms that the source database synchronization is completed, communicates with the target database server, and is used for switching the currently accessed database server from the source database server to the target database server, wherein the first application server is a physical machine used by the current client user for accessing the source database;
a DNS server 167, in communication with the first application server and the second application server, for modifying address information to be bound to the first domain name;
and the second application server 169 establishes an access link with the target database, and is used for the client user to read the second application server which is accessed through the first domain name after the DNS server is modified, so that the client user accesses the source database synchronously obtained in the target database through the second application server, wherein the second application server is an application server deployed on the cloud.
In the solution disclosed in the third embodiment of the present application, a source database in a source database server is synchronized to a target database server; after the source database server confirms that the source database synchronization is completed, switching the database server accessed by the first application server from the source database server to a target database server; changing an application server accessed by a client user through a first domain name from a first application server to a second application server by modifying address information bound with the first domain name in a DNS server; and after the access link between the second application server and the target database is successfully established, the client user accesses the source database obtained synchronously in the target database through the second application server.
It should be noted that, in the process of synchronizing the source data in the source database to the target database server, the user of the client still reads the source database in the source database server in the process of using the client, until the source database server confirms that the source database synchronization is completed, the user of the client starts to use the database in the target database server, that is, in the process of synchronizing the database in the physical machine to the database server in the cloud, the user of the client still uses the source database in the physical machine until the source database in the physical machine is completely synchronized to the server in the cloud, and the user of the client starts to access the database in the server in the cloud, so that the user of the client can normally use the client in the process of synchronizing the source data in the source database to the target database server, i.e. the process of synchronizing the source data in the source database to the target database server does not affect the use of the user.
It should be further noted that, when the user of the client inputs the first domain name, after modifying the address information already bound to the first domain name in the DNS server, the response obtained by the user is the same response result as that obtained before modifying the address information already bound to the first domain name in the DNS server, so that modifying the address information already bound to the first domain name in the DNS server does not affect the use of the user of the client.
Therefore, the technical problem that the client stops using in the process of migrating the application to the cloud in the prior art is solved by the scheme of the third embodiment.
Example 4
The embodiment of the invention can provide a computer terminal which can be any computer terminal device in a computer terminal group. Optionally, in this embodiment, the computer terminal may also be replaced with a terminal device such as a mobile terminal.
Optionally, in this embodiment, the computer terminal may be located in at least one network device of a plurality of network devices of a computer network.
In this embodiment, the computer terminal may execute the program codes of the following steps in the method for migrating physical machine data to the cloud: synchronizing a source database in a source database server to a target database server, wherein the source database server is a physical machine, and the target database server is a server deployed on a cloud end; after the source database server confirms that the source database synchronization is completed, switching the database server accessed by the first application server from the source database server to a target database server, wherein the first application server is a physical machine used by a current client user for accessing the source database; changing an application server accessed by a client user through a first domain name from a first application server to a second application server by modifying address information bound with the first domain name in a DNS server, wherein the second application server is an application server deployed on a cloud end; and after the access link between the second application server and the target database is successfully established, the client user accesses the source database obtained synchronously in the target database through the second application server.
Alternatively, fig. 17 is a block diagram of a computer terminal according to an embodiment of the present invention. As shown in fig. 17, the computer terminal a may include: one or more processors 171 (only one shown), memory 173, transmission device 175, and server 177.
The memory may be used to store software programs and modules, such as program instructions/modules corresponding to the method and apparatus for migrating physical machine data to the cloud in the embodiments of the present invention, and the processor executes various functional applications and data processing by running the software programs and modules stored in the memory, that is, the method for migrating physical machine data to the cloud is implemented. The memory may include high speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory may further include memory remotely located from the processor, and these remote memories may be connected to terminal a through a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The processor can call the information and application program stored in the memory through the transmission device to execute the following steps: synchronizing a source database in a source database server to a target database server, wherein the source database server is a physical machine, and the target database server is a server deployed on a cloud end; after the source database server confirms that the source database synchronization is completed, switching the database server accessed by the first application server from the source database server to a target database server, wherein the first application server is a physical machine used by a current client user for accessing the source database; changing an application server accessed by a client user through a first domain name from a first application server to a second application server by modifying address information bound with the first domain name in a DNS server, wherein the second application server is an application server deployed on a cloud end; and after the access link between the second application server and the target database is successfully established, the client user accesses the source database obtained synchronously in the target database through the second application server.
Optionally, the processor may further execute the program code of the following steps: modifying a first IP address which is stored in a first application server and bound with a database domain name into an IP address of a target database server by using a switching script, wherein the first IP address is the IP address of a source database server; after the switching script sets the access right of the source database server to read-only, all access links accessing the source database server are disconnected.
Optionally, the processor may further execute the program code of the following steps: the synchronization mode is as follows: full-quantity synchronization or incremental synchronization, wherein the synchronization of the source database is confirmed to be completed in any one of the following modes: the first method is as follows: the first application server polls the source database server in real time or at regular time, and if the synchronization ending information generated by the source database server is detected, the synchronization of the source database is determined to be completed. The second method comprises the following steps: and the source database server executes the synchronization of the source database according to the preset synchronization time length, and determines that the synchronization of the source database is completed when the first application server detects that the synchronization time length arrives or detects that the delay time of the synchronization time length arrives.
Optionally, the processor may further execute the program code of the following steps: stopping synchronization of the source database, and changing the access authority of the target database server from the set read-only authority to the write-permission authority so as to allow any application server to access the target database server, wherein the access authority of the target database server is set to be read-only while or before the source database is synchronized to the target database server.
Optionally, the processor may further execute the program code of the following steps: the cloud end starts a second application server to connect with the target database server; extracting a second IP address which is stored in a host file of a second application server and is bound with the domain name of the database; determining whether the second application server is successfully connected with the target database by verifying the extracted second IP address in the second application server; and if the second IP address is successfully verified, determining that the second application server is successfully connected with the target database.
Optionally, the processor may further execute the program code of the following steps: inputting the extracted second IP address in an access interface of a second application server; after the second IP address is input, if the database page of the target database server is successfully opened, the access link between the second application server and the target database is successfully established.
Optionally, the processor may further execute the program code of the following steps: detecting whether a source database server generates flow or not within preset time; and if the source database server does not generate any flow within the preset time, stopping the task running in the background of the source database server.
Optionally, the processor may further execute the program code of the following steps: if the server deployed on the cloud end fails, the steps in claim 1 are adopted to reversely switch the second application server and/or the target database server deployed on the cloud end to the corresponding physical machine.
Optionally, the processor may further execute the program code of the following steps: a plurality of first application servers are deployed under the cloud, each first application server accesses a source database server, a plurality of second application servers are deployed at the cloud, and the second application servers access a target database server.
In the embodiment of the present invention, a source database in a source database server is synchronized to a target database server, and after the source database server confirms that the source database is synchronized, a database server accessed by a first application server is switched from the source database server to the target database server, and address information bound to a first domain name in a DNS server is modified, so that an application server accessed by a client user through the first domain name is changed from the first application server to a second application server, and thus, a technical effect that the application can be continuously used by the user when the application is migrated to a cloud is achieved, and a technical problem that the client stops using when the application is migrated to the cloud in the prior art is solved.
It can be understood by those skilled in the art that the structure shown in fig. 17 is only an illustration, and the computer terminal may also be a terminal device such as a smart phone (e.g., an Android phone, an iOS phone, etc.), a tablet computer, a palm computer, a Mobile Internet Device (MID), a PAD, etc. Fig. 17 is a diagram illustrating the structure of the electronic device. For example, the computer terminal a may also include more or fewer components (e.g., network interfaces, display devices, etc.) than shown in fig. 17, or have a different configuration than shown in fig. 17.
Those skilled in the art will appreciate that all or part of the steps in the methods of the above embodiments may be implemented by a program instructing hardware associated with the terminal device, where the program may be stored in a computer-readable storage medium, and the storage medium may include: flash disks, Read-Only memories (ROMs), Random Access Memories (RAMs), magnetic or optical disks, and the like.
Example 5
The embodiment of the invention also provides a storage medium. Optionally, in this embodiment, the storage medium may be configured to store a program code executed by the method for migrating physical machine data provided in the first embodiment to a cloud.
Optionally, in this embodiment, the storage medium may be located in any one of computer terminals in a computer terminal group in a computer network, or in any one of mobile terminals in a mobile terminal group.
Optionally, in this embodiment, the storage medium is configured to store program code for performing the following steps: synchronizing a source database in a source database server to a target database server, wherein the source database server is a physical machine, and the target database server is a server deployed on a cloud end; after the source database server confirms that the source database synchronization is completed, switching the database server accessed by the first application server from the source database server to a target database server, wherein the first application server is a physical machine used by a current client user for accessing the source database; changing an application server accessed by a client user through a first domain name from a first application server to a second application server by modifying address information bound with the first domain name in a DNS server, wherein the second application server is an application server deployed on a cloud end; and after the access link between the second application server and the target database is successfully established, the client user accesses the source database obtained synchronously in the target database through the second application server.
Optionally, the storage medium is further configured to store program codes for performing the following steps: modifying a first IP address which is stored in a first application server and bound with a database domain name into an IP address of a target database server by using a switching script, wherein the first IP address is the IP address of a source database server; after the switching script sets the access right of the source database server to read-only, all access links accessing the source database server are disconnected.
Optionally, the storage medium is further configured to store program codes for performing the following steps: the synchronization mode is as follows: full-quantity synchronization or incremental synchronization, wherein the synchronization of the source database is confirmed to be completed in any one of the following modes: the first method is as follows: the first application server polls the source database server in real time or at regular time, and if the synchronization ending information generated by the source database server is detected, the synchronization of the source database is determined to be completed. The second method comprises the following steps: and the source database server executes the synchronization of the source database according to the preset synchronization time length, and determines that the synchronization of the source database is completed when the first application server detects that the synchronization time length arrives or detects that the delay time of the synchronization time length arrives.
Optionally, the storage medium is further configured to store program codes for performing the following steps: stopping synchronization of the source database, and changing the access authority of the target database server from the set read-only authority to the write-permission authority so as to allow any application server to access the target database server, wherein the access authority of the target database server is set to be read-only while or before the source database is synchronized to the target database server.
Optionally, the storage medium is further configured to store program codes for performing the following steps: the cloud end starts a second application server to connect with the target database server; extracting a second IP address which is stored in a host file of a second application server and is bound with the domain name of the database; determining whether the second application server is successfully connected with the target database by verifying the extracted second IP address in the second application server; and if the second IP address is successfully verified, determining that the second application server is successfully connected with the target database.
Optionally, the storage medium is further configured to store program codes for performing the following steps: inputting the extracted second IP address in an access interface of a second application server; after the second IP address is input, if the database page of the target database server is successfully opened, the access link between the second application server and the target database is successfully established.
Optionally, the storage medium is further configured to store program codes for performing the following steps: detecting whether a source database server generates flow or not within preset time; and if the source database server does not generate any flow within the preset time, stopping the task running in the background of the source database server.
Optionally, the storage medium is further configured to store program codes for performing the following steps: if the server deployed on the cloud end fails, the steps in claim 1 are adopted to reversely switch the second application server and/or the target database server deployed on the cloud end to the corresponding physical machine.
Optionally, the storage medium is further configured to store program codes for performing the following steps: a plurality of first application servers are deployed under the cloud, each first application server accesses a source database server, a plurality of second application servers are deployed at the cloud, and the second application servers access a target database server.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
In the above embodiments of the present invention, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
In the embodiments provided in the present application, it should be understood that the disclosed technology can be implemented in other ways. The above-described embodiments of the apparatus are merely illustrative, and for example, a division of a unit is merely a division of a logic function, and an actual implementation may have another division, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, units or modules, and may be in an electrical or other form.
Units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic or optical disk, and other various media capable of storing program codes.
The foregoing is only a preferred embodiment of the present invention, and it should be noted that it is obvious to those skilled in the art that various modifications and improvements can be made without departing from the principle of the present invention, and these modifications and improvements should also be considered as the protection scope of the present invention.

Claims (17)

1. A method for migrating physical machine data to a cloud, comprising:
synchronizing a source database in a source database server to a target database server, wherein the source database server is a physical machine, and the target database server is a server deployed on a cloud end;
after the source database server confirms that the source database synchronization is completed, switching a database server accessed by a first application server from the source database server to the target database server, wherein the first application server is a physical machine used by a current client user for accessing the source database;
changing an application server accessed by the client user through the first domain name from a first application server to a second application server by modifying address information bound with the first domain name in a DNS server, wherein the second application server is an application server deployed on the cloud end;
after the access link between the second application server and a target database is successfully established, the client user accesses the source database obtained by synchronization in the target database through the second application server;
in the process of synchronizing the source database in the source database server to the target database server, the method further includes:
modifying a first IP address which is stored in the first application server and bound with a database domain name into an IP address of the target database server by using a switching script, wherein the first IP address is the IP address of the source database server;
after the switching script sets the access right of the source database server to be read-only, all access links for accessing the source database server are disconnected;
the client comprises an e-commerce transaction system, the source database comprises a database of the e-commerce transaction system on a physical machine, and before the step of synchronizing the source database in the source database server to the target database server is completed, the source database in the physical machine is accessed through a load balancer to read or write related data in the process of using the e-commerce transaction system.
2. The method of claim 1, wherein the synchronizing is performed by: full-quantity synchronization or incremental synchronization, wherein the source database synchronization is confirmed to be completed by any one of the following methods:
the first method is as follows: the first application server polls the source database server in real time or at regular time, and if synchronous ending information generated by the source database server is detected, the source database is determined to be synchronously completed;
the second method comprises the following steps: and the source database server executes synchronization of the source database according to preset synchronization duration, and determines that the synchronization of the source database is completed when the first application server detects that the synchronization duration arrives or detects that the delay time of the synchronization duration arrives.
3. The method of claim 2, wherein after confirming that the synchronization of the source database is completed, the method further comprises: stopping the synchronization of the source database, and changing the access authority of the target database server from the set read-only authority to the write-permission authority, so as to allow any application server to access the target database server, wherein the access authority of the target database server is set to be read-only while or before the source database is synchronized to the target database server.
4. The method of claim 1, wherein prior to modifying the address information in the DNS server that is already bound to the first domain name, the method further comprises:
the cloud starts the second application server to connect with the target database server;
extracting a second IP address which is stored in a host file of the second application server and is bound with a database domain name;
determining, in the second application server, whether the connection of the second application server with the target database is successful by verifying the extracted second IP address;
and if the second IP address is verified successfully, determining that the second application server is successfully connected with the target database.
5. The method of claim 4, wherein determining in the second application server whether the second application server successfully connects to the target database by verifying the extracted second IP address comprises:
inputting the extracted second IP address in an access interface of the second application server;
after the second IP address is input, if the database page of the target database server is successfully opened, the access link between the second application server and the target database is successfully established.
6. The method of claim 1, wherein after the client user accesses the synchronized source database in the target database through the second application server, the method further comprises:
detecting whether the source database server generates flow or not within preset time;
and if the source database server does not generate any flow in the preset time, stopping the task running in the background of the source database server.
7. The method of claim 1, wherein after the client user accesses the synchronized source database in the target database through the second application server, the method further comprises:
if the server deployed on the cloud end fails, the steps in claim 1 are adopted to reversely switch the second application server deployed on the cloud end and/or the target database server to the corresponding physical machine.
8. The method of claim 1, wherein a plurality of the first application servers are deployed in a cloud, each first application server accessing the source database server, wherein a plurality of the second application servers are deployed in the cloud, and wherein the second application servers access the target database server.
9. A device for migrating physical machine data to a cloud, comprising:
the system comprises a synchronization module, a target database server and a database management module, wherein the synchronization module is used for synchronizing a source database in a source database server to the target database server, the source database server is a physical machine, and the target database server is a server deployed on a cloud end;
a switching module, configured to switch a database server accessed by a first application server from the source database server to the target database server after the source database server confirms that the source database server is synchronized, where the first application server is a physical machine used by a current client user to access the source database;
the system comprises a replacing module, a cloud server and a client, wherein the replacing module is used for replacing an application server accessed by a client user through a first domain name from the first application server to a second application server by modifying address information bound with the first domain name in a DNS server, and the second application server is an application server deployed on the cloud end;
the access module is used for accessing the source database obtained synchronously in the target database by the client user through the second application server after the access link between the second application server and the target database is successfully established;
wherein the synchronization module further comprises:
a modification module, configured to modify, using a handover script, a first IP address bound to a database domain name and stored in the first application server to an IP address of the target database server, where the first IP address is an IP address of the source database server;
a disconnection module, configured to disconnect all access links that access the source database server after the switching script sets the access right of the source database server to read only;
the client comprises an e-commerce transaction system, the source database comprises a database of the e-commerce transaction system on a physical machine, and before the step of synchronizing the source database in the source database server to the target database server is completed, the source database in the physical machine is accessed through a load balancer to read or write related data in the process of using the e-commerce transaction system.
10. The apparatus of claim 9, wherein the synchronization is performed by: full-quantity synchronization or incremental synchronization, wherein the source database is confirmed to be synchronized through any one of the following modules:
a polling module, configured to poll the source database server in real time or at regular time by the first application server, and if synchronization end information generated by the source database server is detected, determine that the source database is synchronized;
the first detection module is configured to synchronize the source database according to a preset synchronization duration, and determine that the synchronization of the source database is completed when the first application server detects that the synchronization duration arrives or detects that the delay time of the synchronization duration arrives.
11. The apparatus of claim 10, further comprising:
and the first stopping module is used for stopping the synchronization of the source database, changing the access authority of the target database server from the set read-only authority to the permission to write, and allowing any application server to access the target database server, wherein the access authority of the target database server is set to be read-only while or before the source database is synchronized to the target database server.
12. The apparatus of claim 9, further comprising:
a starting module, configured to start the second application server by the cloud to connect to the target database server;
the extraction module is used for extracting a second IP address which is stored in a host file of the second application server and is bound with a database domain name;
a first determining module, configured to determine, in the second application server, whether the connection between the second application server and the target database is successful by verifying the extracted second IP address;
and the second determining module is used for determining that the second application server is successfully connected with the target database if the second IP address is successfully verified.
13. The apparatus of claim 12, wherein the first determining module comprises:
the input module is used for inputting the extracted second IP address in an access interface of the second application server;
and the establishing module is used for successfully establishing an access link between the second application server and the target database if the database page of the target database server is successfully opened after the second IP address is input.
14. The apparatus of claim 9, further comprising:
the second detection module is used for detecting whether the source database server generates flow or not within preset time;
and the second stopping module is used for stopping the task running in the background of the source database server if the source database server does not generate any flow within the preset time.
15. The apparatus of claim 9, further comprising:
a reverse switching module, configured to, if the server deployed on the cloud end fails, use the apparatus in claim 10 to switch the second application server deployed in the cloud end and/or the target database server to a corresponding physical machine in a reverse direction.
16. The apparatus of claim 9, wherein a plurality of the first application servers are deployed in a cloud, each first application server accessing the source database server, wherein a plurality of the second application servers are deployed in the cloud, and wherein the second application servers access the target database server.
17. A system for migrating physical machine data to a cloud, comprising:
the system comprises a source database server, a database server and a database server, wherein the source database server is used for providing a source database, and is a physical machine;
the target database server is in communication relation with the source database server and is used for receiving the source database synchronized by the source database server, wherein the target database server is a server deployed on a cloud end;
the first application server is communicated with the target database server after the source database server confirms that the source database server is synchronized, and is used for switching the currently accessed database server from the source database server to the target database server, wherein the first application server is a physical machine used by a current client user for accessing the source database;
the DNS server is communicated with the first application server and the second application server and is used for modifying a first IP address which is stored in the first application server and is bound with a database domain name into an IP address of the target database server by using a switching script, and disconnecting all access links for accessing the source database server after the switching script sets the access right of the source database server to be read-only, wherein the first IP address is the IP address of the source database server;
the second application server establishes an access link with a target database, and is used for the client user to read the second application server which is modified by the DNS server and is accessed through the first domain name, so that the client user accesses the source database synchronously obtained in the target database through the second application server, wherein the second application server is an application server deployed on the cloud end;
the client comprises an e-commerce transaction system, the source database comprises a database of the e-commerce transaction system on a physical machine, and before the step of synchronizing the source database in the source database server to the target database server is completed, the source database in the physical machine is accessed through a load balancer to read or write related data in the process of using the e-commerce transaction system.
CN201610053119.4A 2016-01-26 2016-01-26 Method, device and system for migrating physical machine data to cloud Active CN106997306B (en)

Priority Applications (3)

Application Number Priority Date Filing Date Title
CN201610053119.4A CN106997306B (en) 2016-01-26 2016-01-26 Method, device and system for migrating physical machine data to cloud
PCT/CN2017/071386 WO2017128992A1 (en) 2016-01-26 2017-01-17 Method, device and system for migrating physical machine data to cloud
TW106102456A TWI724095B (en) 2016-01-26 2017-01-23 Method, device and system for migrating physical machine data to cloud

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610053119.4A CN106997306B (en) 2016-01-26 2016-01-26 Method, device and system for migrating physical machine data to cloud

Publications (2)

Publication Number Publication Date
CN106997306A CN106997306A (en) 2017-08-01
CN106997306B true CN106997306B (en) 2021-03-09

Family

ID=59397372

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610053119.4A Active CN106997306B (en) 2016-01-26 2016-01-26 Method, device and system for migrating physical machine data to cloud

Country Status (3)

Country Link
CN (1) CN106997306B (en)
TW (1) TWI724095B (en)
WO (1) WO2017128992A1 (en)

Families Citing this family (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107391758B (en) * 2017-08-24 2020-08-04 阿里巴巴集团控股有限公司 Database switching method, device and equipment
CN110309120B (en) * 2018-03-06 2023-04-07 阿里云计算有限公司 Data processing method and data processing device
CN110545301B (en) * 2018-05-29 2022-06-17 视联动力信息技术股份有限公司 Monitoring resource synchronization method and device
CN108900572B (en) * 2018-05-31 2022-08-09 康键信息技术(深圳)有限公司 Main database domain name switching control method, computer equipment and storage medium
CN110049010B (en) * 2019-03-12 2022-03-08 广州市保伦电子有限公司 Method and system for connecting distributed platform terminal equipment with server
TWI751414B (en) * 2019-05-10 2022-01-01 新加坡商核智科技私人有限公司 Management system and method for cloud database
CN111782409B (en) * 2020-08-17 2023-12-19 支付宝(杭州)信息技术有限公司 Task processing method, device and electronic equipment, and risk identification task processing method and device
CN112235304A (en) * 2020-10-15 2021-01-15 唐琪林 Dynamic security protection method and system for industrial internet
CN114615270A (en) * 2020-12-09 2022-06-10 维沃移动通信有限公司 Method and device for migrating edge application server and refreshing or emptying DNS (domain name system) cache
US11733902B2 (en) * 2021-04-30 2023-08-22 International Business Machines Corporation Integrating and increasing performance of disaggregated memory in operating systems
CN113779000B (en) * 2021-11-15 2022-02-08 北京金堤科技有限公司 Database updating method and system, storage medium and electronic device
CN116436836B (en) * 2023-06-13 2023-09-01 阿里巴巴(中国)有限公司 Domain name data synchronous detection method, device and equipment

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101859263B (en) * 2010-06-12 2012-07-25 中国人民解放军国防科学技术大学 Quick communication method between virtual machines supporting online migration
US9063963B2 (en) * 2011-01-04 2015-06-23 Alcatel Lucent Method and system for migration of managed devices
CN102521038B (en) * 2011-12-06 2014-04-09 北京航空航天大学 Virtual machine migration method and device based on distributed file system
US9116181B2 (en) * 2011-12-29 2015-08-25 Huawei Technologies Co., Ltd. Method, apparatus, and system for virtual cluster integration
US9311122B2 (en) * 2012-03-26 2016-04-12 Oracle International Corporation System and method for providing a scalable signaling mechanism for virtual machine migration in a middleware machine environment
CN103530290B (en) * 2012-07-03 2017-12-12 深圳市腾讯计算机系统有限公司 Data migration method and system between database
CN103581213B (en) * 2012-07-19 2017-06-13 阿里巴巴集团控股有限公司 A kind of application process of shared Hosts files, equipment and system
CN103605561A (en) * 2013-11-28 2014-02-26 中标软件有限公司 Cloud computing cluster system and method for on-line migration of physical server thereof

Also Published As

Publication number Publication date
TW201730790A (en) 2017-09-01
TWI724095B (en) 2021-04-11
WO2017128992A1 (en) 2017-08-03
CN106997306A (en) 2017-08-01

Similar Documents

Publication Publication Date Title
CN106997306B (en) Method, device and system for migrating physical machine data to cloud
CN108029011B (en) Method, equipment and system for migrating SIM card to eUICC
US10826817B2 (en) Routing table synchronization method, apparatus, and system
US20150058287A1 (en) Method and device for synchronizing data
KR102087526B1 (en) Method and apparatus, device and storage medium for data processing between terminals
CN102176775A (en) Intelligent configuration device and method
CN103220358A (en) Multi-terminal on-line file synchronizing method, system, server, and terminal device
CN105430016A (en) Network access authentication method and system
CN108322366B (en) Method, device and system for accessing network
CN103942121A (en) Data recovery system and mobile terminal
CN103401907A (en) Synchronous processing method and system for login information of application program
CN105827740A (en) Method, equipment and system for contact person information backup
CN105205100A (en) Data synchronization method based on MTP between terminals and terminals
US20150079968A1 (en) Information processing method and electronic device
CN116204494B (en) Method and device for migrating active directory data, electronic equipment and storage medium
CN105376728A (en) Boot method and communication terminal
US20180302404A1 (en) Method for processing data request and system therefor, access device, and storage device
CN107623705B (en) Storage mode upgrading method, device and system based on video cloud storage system
CN112434321A (en) Data storage method and device, computer equipment and storage medium
TW201741895A (en) Method, apparatus and system for checking change of telephone number
CN110309120B (en) Data processing method and data processing device
CN109005203B (en) Data synchronization method and device, storage medium, processor and terminal
CN104079610A (en) Cloud server, and method and system for cloud synchronization of application software
CN110958287A (en) Operation object data synchronization method, device and system
CN111935029B (en) Gateway load balancing method and device, storage medium and electronic equipment

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