WO2017128992A1 - 物理机数据迁移至云端的方法、装置和系统 - Google Patents

物理机数据迁移至云端的方法、装置和系统 Download PDF

Info

Publication number
WO2017128992A1
WO2017128992A1 PCT/CN2017/071386 CN2017071386W WO2017128992A1 WO 2017128992 A1 WO2017128992 A1 WO 2017128992A1 CN 2017071386 W CN2017071386 W CN 2017071386W WO 2017128992 A1 WO2017128992 A1 WO 2017128992A1
Authority
WO
WIPO (PCT)
Prior art keywords
server
source database
database
application server
database server
Prior art date
Application number
PCT/CN2017/071386
Other languages
English (en)
French (fr)
Inventor
邓自立
徐军标
Original Assignee
阿里巴巴集团控股有限公司
邓自立
徐军标
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 阿里巴巴集团控股有限公司, 邓自立, 徐军标 filed Critical 阿里巴巴集团控股有限公司
Publication of WO2017128992A1 publication Critical patent/WO2017128992A1/zh

Links

Images

Classifications

    • 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/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
    • 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

Definitions

  • the present invention relates to the field of data migration, and in particular, to a method, an apparatus, and a system for migrating physical machine data to the cloud.
  • Cloud computing as an add-on, use, and delivery model for Internet-based related services, typically involves providing dynamically scalable and often virtualized resources over the Internet.
  • cloud computing With the continuous development of cloud computing, the deepening of cloud computing applications, and the growing demand for big data processing, more and more applications are being migrated to the cloud.
  • the embodiments of the present invention provide a method, an apparatus, and a system for migrating physical machine data to the cloud, so as to at least solve the technical problem that the client stops using the application in the process of migrating the application to the cloud in the prior art.
  • a method for migrating physical machine data to a cloud includes: synchronizing 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 For deployment on the cloud 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, wherein the first application server is used by the current client user to access the source database.
  • the application server that is accessed by the client user through the first domain name is changed from the first application server to the second application server by modifying the address information that is bound to the first domain name in the DNS server, where the second application server is The application server deployed in the cloud; after successfully establishing the access link of the second application server and the target database, the client user accesses the source database synchronized in the target database through the second application server.
  • an apparatus for migrating physical machine data to the cloud including: a synchronization module, configured to synchronize a source database in the source database server to a target database server, where the source database server For the physical machine, the target database server is a server deployed in the cloud; the switching module 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.
  • the first application server is a physical machine used by the current client user to access the source database
  • the replacement module is configured to modify the address information that has been bound to the first domain name in the DNS server to access the client user through the first domain name.
  • the application server is replaced by the first application server as the second application server, wherein the second application server is an application server deployed in the cloud; and the access module is configured to successfully establish an access link between the second application server and the target database.
  • Client user Through the second application server to access the target database source database synchronization obtained.
  • a system for migrating physical machine data to the cloud including: a source database server, configured to provide a source database, where the source database server is a physical machine; a target database server, and The source database server establishes a communication relationship for receiving the source database synchronized by the source database server, wherein the target database server is a service deployed on the cloud; the first application server, after the source database server confirms that the source database is synchronized, and the target database Server communication, configured to switch the currently accessed database server 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; the DNS server, and the first application server Communicating with the second application server for modifying the address information that has been bound to the first domain name; the second application server establishing an access link with the target database for the client user to read the DNS server has been modified The second application server accessed by the domain name enables the client user to access the source database synchronized in
  • the source database in the source database server is synchronized to the target database server, and after the source database server confirms that the source database synchronization is completed, the database server accessed by the first application server is used by the source.
  • the method of switching the database server to the target database server by modifying the address information that has been bound to the first domain name in the DNS server, to reach the application server that accesses the client user through the first domain name by the first
  • the purpose of replacing the application server with the second application server is to achieve the technical effect that the application can continue to be used by the user when the application is migrated to the cloud, thereby solving the problem that the prior art moves the application to the cloud and causes the customer to The technical problem of stopping the use of the terminal.
  • FIG. 1 is a block diagram showing the hardware structure of a computer terminal for a method for migrating physical machine data to the cloud according to an embodiment of the present invention
  • FIG. 2 is a flowchart of a method for migrating optional physical machine data to the cloud according to 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 flowchart of a method for migrating optional physical machine data to the cloud according to an embodiment of the present application
  • FIG. 7 is an interaction diagram of an optional method for migrating physical machine data to the cloud according to an embodiment of the present application.
  • FIG. 8 is a schematic structural diagram of an apparatus for migrating optional physical machine data to a cloud according to an embodiment of the present application.
  • FIG. 9 is a schematic structural diagram of an apparatus for migrating optional physical machine data to the cloud according to an embodiment of the present application.
  • FIG. 10 is a schematic structural diagram of an apparatus for migrating optional physical machine data to the cloud according to an embodiment of the present application
  • FIG. 11 is a schematic structural diagram of an apparatus for migrating optional physical machine data to a cloud according to an embodiment of the present application
  • FIG. 12 is a schematic structural diagram of an apparatus for migrating optional physical machine data to the cloud according to an embodiment of the present application.
  • FIG. 13 is a schematic structural diagram of an apparatus for migrating optional physical machine data to a cloud according to an embodiment of the present application.
  • FIG. 14 is a schematic structural diagram of an apparatus for migrating optional physical machine data to the cloud according to an embodiment of the present application.
  • FIG. 15 is a schematic structural diagram of an apparatus for migrating optional physical machine data to the cloud according to an embodiment of the present application.
  • 16 is a schematic structural diagram of an optional system for migrating physical machine data to the cloud according to an embodiment of the present application
  • FIG. 17 is a structural block diagram of a computer terminal according to an embodiment of the present application.
  • DNS server It consists of a domain name resolver and a domain name server, and has the function of converting a domain name into an IP address.
  • Host file is a system file with no extension name, used to establish a "database" associated with some commonly used website domain names and their corresponding IP addresses.
  • an embodiment of a method for migrating physical machine data to the cloud is also provided.
  • the steps shown in the flowchart of the accompanying drawings may be in a computer system such as a set of computer executable instructions. The steps shown and described may be performed in a different order than the ones described herein, although the logical order is shown in the flowchart.
  • FIG. 1 A hardware block diagram of a computer terminal of a method for migrating physical machine data to the cloud.
  • computer terminal 10 may include one or more (only one shown) processor 102 (processor 102 may include, but is not limited to, a processing device such as a microprocessor MCU or a programmable logic device FPGA)
  • 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
  • a transmission module 106 for communication functions.
  • computer terminal 10 may also include more or fewer components than those shown in FIG. 1, or have a different configuration than that shown in FIG.
  • the memory 104 can 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 runs the software programs and modules stored in the memory 104. In order to perform various functional applications and data processing, that is, the method of realizing the above physical machine data migration to the cloud.
  • 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.
  • memory 104 may further include memory remotely located relative to processor 102, which may be coupled to 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.
  • Transmission device 106 is for receiving or transmitting data via a network.
  • the network specific examples described above may include a wireless network provided by a communication provider of the computer terminal 10.
  • the transmission device 106 includes a Network Interface Controller (NIC) that can be connected to other network devices through a base station to communicate with the Internet.
  • the transmission device 106 can be a Radio Frequency (RF) module for communicating with the Internet wirelessly.
  • NIC Network Interface Controller
  • RF Radio Frequency
  • FIG. 2 is a flowchart of a method for migrating optional physical machine data to the 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 in the cloud.
  • the source database may be a database for storing data generated when the user uses the client on the physical machine, and the physical machine is a physical computer relative to the virtual machine.
  • the source database may be a database of the client on the physical machine, and the foregoing 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 that is consistent with the source database.
  • the server on the cloud is a server deployed on the network, and may be a virtual server deployed in 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 used by the current client user to access the source database. Physical machine.
  • the current client may be an e-commerce transaction system
  • the source database may be a database of the e-commerce transaction system on the physical machine
  • the source database in the source database server is synchronized to the target database server.
  • Step S27 The application server that is accessed by the client user through the first domain name is replaced by the first application server to the second application server by modifying the address information that is bound to the first domain name in the DNS server, where the second application server is An application server deployed on the cloud.
  • the address information bound to the first domain name in the foregoing step is the IP address information in the physical machine corresponding to the first domain name.
  • the first domain name has a binding relationship with the IP address corresponding to the first domain name in the physical machine, and the user can access the IP address in the DNS server by inputting the first domain name.
  • a domain name corresponding to the physical machine through the DNS server, and the first The address information that has been bound to the domain name is changed to the corresponding address information of the first domain name in the cloud server, so that the client user does not access the physical machine corresponding to the first domain name in the DNS server when the first domain name is input.
  • the application server on the cloud corresponding to the first domain name in the DNS server is directly accessed.
  • Step S29 after successfully establishing an access link between the second application server and the target database, the client user accesses the source database synchronized in the target database through the second application server.
  • the second application server may be an application server in the cloud
  • the target database may be a database deployed in a server on the cloud.
  • the source database in the source database server is synchronized to the target database server; after the source database server confirms that the source database synchronization is completed, the database server accessed by the first application server is switched by the source database server.
  • the target database server is configured to change the address information that has been bound to the first domain name in the DNS server, and the application server accessed by the client user through the first domain name is replaced by the first application server as the second application server; After the application server and the target database access link, the client user accesses the source database synchronized in the target database through the second application server.
  • the client user in the process of synchronizing the source data in the source database to the target database server, the client user still reads the source database in the source database server during the process of using the client until the source database server confirms the source database synchronization. After the completion, the client user 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 client user still uses the source database in the physical machine until the physical machine The source database has been completely synchronized to the server on the cloud, and the client user only starts accessing the database in the server on the cloud. Therefore, during the process of synchronizing the source data in the source database to the target database server, the client user can use it normally. Guest The process of synchronizing the source data in the source database to the target database server does not affect the user's use.
  • the response obtained by the user is bound to the first domain name in the modified DNS server.
  • the address information has the same response result before, so modifying the address information already bound to the first domain name in the DNS server does not affect the use of the client user.
  • step S23 in the process of synchronizing the source database in the source database server to the target database server, the method includes:
  • step S231 the first IP address stored in the first application server and bound to the database domain name is modified to the IP address of the target database server, where the first IP address is the IP address of the source database 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 stored in the first application server and bound to the database domain name is modified to the IP address of the target database server by using 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 of the source database server.
  • the synchronization manner is: full amount synchronization or incremental synchronization, wherein the source database synchronization is confirmed by any one of the following methods:
  • Manner 1 The first application server polls the source database server in real time or periodically. If the synchronization end information generated by the source database server is detected, it is determined that the source database synchronization is completed.
  • the source database server may be a physical machine, and when the source database is synchronized from the physical machine to the server deployed in the cloud, the source database server is used as the source database server.
  • the physical machine can generate the information about the end of the synchronization step, and the first application server acts as a physical machine accessing the source database, and monitors in real time whether the information about the end of the synchronization step generated by the source database server occurs in the source database, and the first application server monitors the source database.
  • the information generated by the server ends the synchronization step, it is confirmed that the above synchronization step is completed.
  • the source database server may still be a physical machine, and when the source database is synchronized from the physical machine to the server deployed in the cloud, the physical machine serving as the source database server can generate the synchronization step end.
  • the first application server as a physical machine accessing the source database, periodically polls the source database server to detect whether the synchronization step of the source database server ends in the source database, that is, the first application server is in a certain period. The information of the synchronization end is found in the source database server. When the first application server monitors the information that the synchronization step is completed by the source database server, it is confirmed that the synchronization step is completed.
  • the source database server executes the synchronization source database according to the preset synchronization duration.
  • the first application server detects that the synchronization duration arrives, or detects that the synchronization duration delay time is reached, it is determined that the source database synchronization is completed.
  • the preset synchronization duration may be 48 hours, and the synchronization duration may be 12 hours.
  • the duration of the synchronization source database reaches 48 hours, it can be confirmed that the step of synchronizing the source database is completed; or when the duration of the synchronization source database reaches 60 hours, the step of confirming the synchronization source database is completed.
  • the preset synchronization duration is a preset synchronization time according to the data volume of the source database. The larger the amount of data in the source database, the longer the preset synchronization duration, and the preset synchronization can be considered.
  • the duration is greater than the length of time required to synchronize the source database.
  • step S25 after confirming that the synchronization of the source database is completed, the method further includes:
  • Step S251 stopping the source database synchronization, and modifying the access authority of the target database server from the read-only permission that has been set to the permission to write, so that any one application server is allowed to access the target database server, wherein the source database is synchronized to the target.
  • Database server At the same time or before, set the access permissions of the target database server to read-only.
  • the source database may be a source database in a physical machine
  • the target database server may be a database server on the cloud
  • the access authority of the database server on the cloud refers to a read-only mode.
  • the synchronization step ends, the synchronization of the source database is stopped.
  • the access rights of the source database in the physical machine are modified to read-only, but all access sources are
  • the link of the database is disconnected, so the user accesses the target database in the database server on the cloud through the first application server, and needs to target the target database when the user accesses the target database in the database server on the cloud through the first application server.
  • the database performs read and write operations, so the access rights of the database server on the cloud are modified to allow writing.
  • the method before modifying the address information that has been bound to the first domain name in the DNS server, the method further includes:
  • step S271 the cloud starts the second application server to connect to the target database server.
  • the second application server may be a server deployed in the cloud
  • the target data server may also be a server deployed in the cloud.
  • Starting the second application server to connect to the target database server may be to start a server deployed on the cloud to connect to another server deployed on the cloud that includes the synchronized source database.
  • Step S273 extracting a second IP address that is stored in the host file of the second application server and bound to the database domain name.
  • the hosts file is an association database established by the domain name and its corresponding IP address, and the associated database can find an IP address corresponding to the domain name.
  • the second application server may be a server deployed in the cloud, and the host file is an associated database of the domain name and its corresponding IP address, and includes an IP address corresponding to the database domain name, and is deployed on the cloud.
  • the host file in the second application server contains an IP address corresponding to the database domain name for connecting to the target database server.
  • Step S275 determining whether the second application server is successfully connected to the target database by verifying the extracted second IP address in the second application server.
  • verifying the extracted second IP address is to verify whether the second IP address is an IP address corresponding to the database domain name, and if the second IP address is input, if the second application server If the connection is established with the target database server, the verification succeeds.
  • the extracted second IP address is the IP address corresponding to the database domain name. If the second application server does not establish a connection with the target database server, the verification fails.
  • the second IP address is not the IP address corresponding to the database domain name.
  • Step S277 if it is verified that the second IP address is successful, it is determined that the second application server connects to the target database successfully.
  • the second IP address is considered to be an IP address corresponding to the database domain name, so that the connection of the second application server to the target database is determined, so that the client user
  • the second application server can establish a connection with the database obtained by the synchronization source database, that is, the user can access the database server existing in the cloud in the same manner as the source database by accessing the server deployed in the cloud.
  • the target database is considered to be an IP address corresponding to the database domain name
  • step S275 determining whether the second application server is successfully connected to the target database by verifying the extracted second IP address in the second application server includes:
  • Step S2751 inputting the extracted second IP address in the access interface of the second application server.
  • the access interface of the second application server includes an input field of inputting a web address and/or an IP address, and the location may be at the top of the access interface of the second application server, and the input is input to the input field. After the IP address, you can choose to confirm the database page corresponding to this 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 of the second application server and the target database is successfully established.
  • the second application server does not establish a connection with the access link of the target database, and the extraction is obtained.
  • the second IP address obtained is not the IP address corresponding to the database domain name of the target database server.
  • step S29 after the client user accesses the source database synchronized 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.
  • the source data server when there are still users accessing the source database server, the source data server generates corresponding access traffic.
  • the source database server does not generate any access traffic if the user of the client accesses the target database by deploying the database server with the cloud.
  • step S293 if the source database server does not generate any traffic within a predetermined time, the task running in the background of the source database server is stopped.
  • the source database server does not generate any traffic within a predetermined time, it can be considered that the client of the client accesses the database by accessing the database server deployed in the cloud within a predetermined time, and no user accesses the source database through the source database server. Therefore, the task that the source database server runs in the background is stopped.
  • the user in the case that it is detected that the source data server does not generate any traffic within the preset time and stops the task running in the background of the source data server, if the task of the source data server running in the background is stopped, the user exists.
  • the source database server accesses the source database
  • the user will not be able to access the source database in the source data server, that is, the page accessed by the user may have an access error, so the user cannot use the client normally, but because The user-entered domain name has been connected to the cloud application server, and the cloud application server has established a connection with the target database deployed in the cloud, so the user only needs to retry the application or refresh the access page.
  • the client is used normally, and the process is very short. In practice, the impact of the cloud on the client usage is greatly reduced.
  • step S29 the client user passes the second application service. After accessing the source database synchronized in the target database, the method further includes:
  • step S295 if the server deployed on the cloud fails, the second application server and/or the target database server deployed in the cloud are reversely switched to the corresponding physical machine by using the steps in step S23 to step S29.
  • the step of reversely switching the second application server and/or the target database server of the cloud deployment to the corresponding physical machine includes:
  • A1 Set the access permission of the source data server to read-only, synchronize the database in the target database server to the source database server, and bind the database domain name of the cloud server to the target database server by the switch script.
  • the IP address is modified to the first IP address of the source database server, as shown in FIG. 5, to synchronize the target database in the target database server to the source database server;
  • the second application server and the target database server deployed in the cloud fail, the second application server and/or the target database server deployed in the cloud are reversely switched to corresponding ones.
  • the steps of the physical machine include:
  • A2 Set the access permission of the source data server to read-only, synchronize the database in the target database server to the source database server, and bind the database domain name of the cloud server to the target database server by the switch script.
  • the IP address is modified to the first IP address of the source database server to synchronize the target database in the target database server to the source database server;
  • the cloud starts the first application server to connect to the source database server, extracts the first IP address stored in the host file of the first application server and is bound to the database domain name, and verifies the extracted first IP address to confirm the first application server. Whether the connection with the metabase server is successful, so that the application server accessed by the client user through the first domain name is switched by the second application server in the cloud to the first application server on the physical machine.
  • the extracted first IP address is input, and in the case that the database of the source database server is successfully opened, it is confirmed that the access link of the first application server and the source database server is successfully established.
  • a plurality of first application servers are deployed under the cloud, each of the first application servers accesses the source database server, and multiple second application servers are deployed in the cloud, and the second application server accesses the target database server.
  • the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course, by hardware, but in many cases, the former is A better implementation.
  • the technical solution of the present invention which is essential or contributes to the prior art, may be embodied in the form of a software product stored in a storage medium (such as ROM/RAM, disk,
  • the optical disc includes a number of instructions for causing a terminal device (which may be a cell phone, a computer, a server, or a network device, etc.) to perform the methods of various embodiments of the present invention.
  • set the access permissions of the target database to read-only before or at the same time as synchronizing the source database in the source database server to the target database server.
  • synchronizing the source database in the source database server to the target database server may be performed by a database tool, such as Facebook Cloud's Data Transmission product, which can be implemented on the source database server to the target database server (eg, RDS, Relational Datebase Service, cloud database) Full data synchronization and incremental synchronization (for example: DTS Digital Theatre System, digital cinema system).
  • a database tool such as Facebook Cloud's Data Transmission product, which can be implemented on the source database server to the target database server (eg, RDS, Relational Datebase Service, cloud database) Full data synchronization and incremental synchronization (for example: DTS Digital Theatre System, digital cinema system).
  • the cloud starts the second application server to connect to the target database server, and verifies the IP address in the host of the second application server.
  • the extracted second IP address is input in the access interface of the second application server. If the database page of the target database server is successfully opened, the access link of the second application server and the target database is successfully established.
  • a method for migrating optional physical machine data to the cloud is provided, and the method may include the following steps S701 to S709:
  • set the access permissions of the target database to read-only before or at the same time as synchronizing the source database in the source database server to the target database server.
  • the access rights of the target data server are set to allow writing.
  • S705 Modify the IP address of the source database server bound to the database domain name to the IP address of the target data server.
  • the second IP address is input to the second application server, and if the database of the database server is successfully opened, it is confirmed that the second application server is successfully connected to the target database.
  • the application server that accesses the client user through the first domain name is replaced by the first application server to the second application server.
  • the source data server generates traffic within a predetermined time, and if the source database server does not generate traffic within a predetermined time, the running task of the source database server in the background is stopped.
  • a device for migrating physical machine data to a cloud device to migrate to the cloud includes: a synchronization module 80, a switching module 82, a replacement module 84, and Access module 86.
  • the synchronization module 80 is configured to synchronize the source database in the source database server to the target database server, wherein the source database server is a physical machine, the target database server is a server deployed on the cloud, and the switching module 82 is configured to confirm the source at the source database server.
  • the database server accessed by the first application server is switched 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 to access the source database; the replacement module 84 is configured to pass the address information already bound to the first domain name in the DNS server, and pass the client user
  • the application server accessed by the first domain name is replaced by the first application server as the second application server, wherein the second application server is an application server deployed in the cloud; and the access module 86 is configured to successfully establish the second application server and the target database.
  • the client user accesses the source database synchronized in the target database through the second application server.
  • the source database may be a database of a client on a physical machine, where the physical machine is a physical computer relative to a virtual machine, and the first application server may be a physical machine used by the current user to access the source database, and second The application server can be an application server on the cloud.
  • the synchronization module 80, the switching module 82, the replacement module 84, and the access module 86 correspond to the steps S23 to S29 in the first embodiment, and the examples and application scenarios implemented by the four modules and corresponding steps. The same, but not limited to, the content disclosed in the above embodiment 1. It should be noted that the above module can be operated as part of the device in the computer terminal 10 provided in the first embodiment.
  • the source database in the source database server is synchronized to the target database server; after the source database server confirms that the source database synchronization is completed, the database server accessed by the first application server is switched by the source database server.
  • the target database server is configured to change the address information that has been bound to the first domain name in the DNS server, and the application server accessed by the client user through the first domain name is replaced by the first application server as the second application server; After the application server and the target database access link, the client user accesses the source database synchronized in the target database through the second application server.
  • the client user in the process of synchronizing the source data in the source database to the target database server, the client user still reads the source database in the source database server during the process of using the client until the source database server confirms the source database synchronization. After the completion, the client user 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 client user still uses the source in the physical machine.
  • the database until the source database in the physical machine has been completely synchronized to the server on the cloud, the client user starts to access the database in the server on the cloud, so in the process of synchronizing the source data in the source database to the target database server, The client user can use the client normally, and the process of synchronizing the source data in the source database to the target database server does not affect the user's use.
  • the response obtained by the user is bound to the first domain name in the modified DNS server.
  • the address information has the same response result before, so modifying the address information already bound to the first domain name in the DNS server does not affect the use of the client user.
  • the synchronization module 80 includes a modification module 90 and a disconnection module 92.
  • the modifying module 90 is configured to modify, by using a switching script, a first IP address that is bound to the database domain name 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;
  • the open module 92 is configured to disconnect all access links of the source database server after the switching script sets the access authority of the source database server to read-only.
  • the foregoing modification module 90 and the disconnection module 92 correspond to steps S231 to S233 in the first embodiment, and the foregoing modules are the same as the examples and application scenarios implemented by the corresponding steps, but are not limited to the above embodiments.
  • the foregoing synchronization manner is: full amount synchronization or incremental synchronization, wherein the foregoing apparatus may further include: a polling module 100 and a first detecting module 102.
  • the polling module 100 is configured to poll the source database server in real time or periodically by the first application server. If the synchronization end information generated by the source database server is detected, it is determined that the source database synchronization is completed; the first detection module 102 is configured to execute the synchronization source database according to the preset synchronization duration, and the synchronization time is detected by the first application server. In the case of arrival, or when the delay time of the synchronization duration is reached, it is determined that the source database synchronization is completed.
  • the foregoing polling module 100 and the first detecting module 102 correspond to the first mode and the second mode in the first embodiment.
  • the two modules are the same as the examples and application scenarios implemented by the corresponding steps, but are not limited thereto.
  • the foregoing apparatus may further include: a first stopping module 110.
  • the first stopping module 110 is configured to stop the source database synchronization, and modify the access permission of the target database server from the read-only permission that has been set to the permission to write, so that any one of the application servers is allowed to access the target database server, wherein the source is Set the access permissions of the target database server to read-only at the same time as or before the database is synchronized to the target database server.
  • the preset synchronization duration is a preset synchronization time according to the data volume of the source database. The larger the amount of data in the source database, the longer the preset synchronization duration, and the preset synchronization can be considered.
  • the duration is greater than the length of time required to synchronize the source database.
  • the first stop module 110 corresponds to the step S251 in the first embodiment, and the module is the same as the example and the application scenario implemented by the corresponding steps, but is not limited to the content disclosed in the first embodiment. It should be noted that the above module can be operated as part of the device in the computer terminal 10 provided in the first embodiment.
  • the foregoing apparatus may further include: a starting module 120, an extracting module 122, a first determining module 124, and a second determining module 126.
  • the startup module 120 is configured to start the second application server in the cloud to connect to the target database server.
  • the extraction module 122 is configured to extract the second IP address that is stored in the host file of the second application server and is bound to the database domain name. Determining whether the second application server is connected to the target database by verifying the extracted second IP address in the second application server.
  • the second determining module 126 is configured to determine that the second application server connects to the target database successfully if the second IP address is verified to be successful.
  • the foregoing startup module 120, the extraction module 122, the first determination module 124, and the second determination module 126 correspond to steps S271 to S277 in the first embodiment, and the four modules are implemented by corresponding steps.
  • the example and the application scenario are the same, but are not limited to the content disclosed in the first embodiment. It should be noted that the above module can be operated as part of the device in the computer terminal 10 provided in the first embodiment.
  • the first determining module 124 includes an input module 130 and an establishing 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 the second IP address is input, if the database page of the target database server is successfully opened, the second application The access link between the server and the target database was successfully established.
  • the input module 130 and the establishing module 132 correspond to the steps S291 to S293 in the first embodiment.
  • the two modules are the same as the examples and application scenarios implemented by the corresponding steps, but are not limited to the above embodiments.
  • the foregoing apparatus may further include: a second detecting module 140 and a second stopping module 142.
  • the second detecting module 140 is configured to detect whether the source database server generates traffic within a predetermined time; and 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.
  • the user in the case that it is detected that the source data server does not generate any traffic within the preset time and stops the task running in the background of the source data server, if the task of the source data server running in the background is stopped, the user exists. Number of sources accessed through the source database server According to the database, the user will not be able to access the source database in the source data server, that is, the page accessed by the user may have an access error, so the user cannot use the client normally, but since the domain name entered by the user has been
  • the connection is established with the cloud application server, and the cloud application server has established a connection with the target database deployed in the cloud, so the user can use the client only by retrying the application or refreshing the access page. And this process is very short, which greatly reduces the impact of cloud on the application of the application in the actual operation.
  • the foregoing second detection module 140 and second stop module 142 correspond to steps S291 to S293 in the first embodiment, and the two modules are the same as the examples and application scenarios implemented by the corresponding steps, but not It is limited to the content disclosed in the above embodiment 1. It should be noted that the above module can be operated as part of the device in the computer terminal 10 provided in the first embodiment.
  • the foregoing apparatus may further include: a reverse switching module 150.
  • the reverse switching module 150 is configured to reversely switch the second application server and/or the target database server of the cloud deployment to the corresponding physical machine by using the apparatus of claim 10 if the server deployed on the cloud fails.
  • the foregoing reverse switching module 150 corresponds to step S295 in the first embodiment.
  • the two modules are the same as the examples and application scenarios implemented by the corresponding steps, but are not limited to the content disclosed in the first embodiment. . It should be noted that the above module can be operated as part of the device in the computer terminal 10 provided in the first embodiment.
  • multiple first application servers are deployed in the cloud, each first application server accesses the source database server, and multiple second application servers are deployed in the cloud, and the second application server accesses the target. Database server.
  • a system for migrating physical machine data to the cloud is further provided.
  • the system includes: a source database server 161, a target database server 163, The first application server 165, the DNS server 167, and the second application server 169.
  • the source database server 161 is configured to provide a source database, where the source database server is a physical machine;
  • the target database server 163 is configured to establish a communication relationship with the source database server, and is configured to receive a source database synchronized by the source database server, where the target database server is a server deployed in the cloud;
  • 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 to switch the currently accessed database server from the source database server to the target database server, where the first application server is the current client.
  • the DNS server 167 is in communication with the first application server and the second application server, and is configured to modify address information that has been bound to the first domain name;
  • the second application server 169 establishes an access link with the target database, and the client user reads the second application server that has been modified by the first domain name by the DNS server, so that the client user accesses the target database through the second application server.
  • the source database obtained by synchronization, wherein the second application server is an application server deployed on the cloud.
  • the source database in the source database server is synchronized to the target database server; after the source database server confirms that the source database synchronization is completed, the database server accessed by the first application server is switched by the source database server.
  • the target database server is configured to change the address information that has been bound to the first domain name in the DNS server, and the application server accessed by the client user through the first domain name is replaced by the first application server as the second application server; After the application server and the target database access link, the client user accesses the source database synchronized in the target database through the second application server.
  • the client user in the process of synchronizing the source data in the source database to the target database server, the client user still reads the source database in the source database server during the process of using the client until the source database server confirms the source database synchronization. After the completion, the client uses The user 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 client user still uses the source database in the physical machine until the source database in the physical machine is completely Synchronize to the server on the cloud, the client user starts to access the database in the server on the cloud, so in the process of synchronizing the source data in the source database to the target database server, the client user can use the client normally, that is, the source The process of synchronizing source data in the database to the target database server does not affect the user's use.
  • the response obtained by the user is bound to the first domain name in the modified DNS server.
  • the address information has the same response result before, so modifying the address information already bound to the first domain name in the DNS server does not affect the use of the client user.
  • Embodiments of the present invention may provide a computer terminal, which may be any one of computer terminal groups.
  • the foregoing computer terminal may also be replaced with a terminal device such as a mobile terminal.
  • the computer terminal may be located in at least one network device of the plurality of network devices of the computer network.
  • the computer terminal may execute the program code of the following steps in the method for migrating the physical machine data to the cloud: synchronizing 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 The database server is a server deployed in the cloud; 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 the current client.
  • the object that the user uses to access the source database The application server that is accessed by the client user through the first domain name is replaced by the first application server to the second application server, where the second application server is The application server deployed in the cloud; after successfully establishing the access link of the second application server and the target database, the client user accesses the source database synchronized in the target database through the second application server.
  • FIG. 17 is a structural block diagram of a computer terminal according to an embodiment of the present invention.
  • the computer terminal A may include one or more (only one shown in the figure) processor 171, memory 173, transmission device 175, and server 177.
  • the memory can be used to store software programs and modules, such as the method and device corresponding to the method and device for migrating the physical machine data to the cloud in the embodiment of the present invention, and the processor runs the software program and the module stored in the memory, thereby Perform various functional applications and data processing, that is, implement the above method of migrating physical machine data to the cloud.
  • the memory may include a 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.
  • the memory can further include memory remotely located relative to the processor, which can be connected to terminal A 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 processor may invoke the memory stored information and the application by the transmission device to perform the following steps: synchronizing 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 deployed The server on the cloud; after the source database server confirms that the source database is synchronized, the database server accessed by the first application server is switched from the source database server to the target database server, wherein the first application server is used by the current client user to access the source.
  • the physical server of the database is configured to change the address information that has been bound to the first domain name in the DNS server, and the application server accessed by the client user through the first domain name is replaced by the first application server as the second application server, where the second application is used.
  • the server is an application server deployed on the cloud; after successfully establishing an access link of the second application server and the target database, the client user accesses the source database synchronized in the target database through the second application server.
  • the foregoing processor may further execute the following program code: use a switching script to modify a first IP address stored in the first application server and bound to the database domain name to an IP address of the target database server, where The IP address is the IP address of the source database server; after the switch script sets the access permission of the source database server to read-only, all access links to the source database server are disconnected.
  • the foregoing processor may further execute the following program code: the synchronization manner is: full amount synchronization or incremental synchronization, wherein the source database synchronization is confirmed by any one of the following methods: mode 1: the first application server is real-time Or poll the source database server periodically, and if the synchronization end information generated by the source database server is detected, it is determined that the source database synchronization is completed.
  • Manner 2 The source database server executes the synchronization source database according to the preset synchronization duration. When the first application server detects that the synchronization duration arrives, or detects that the synchronization duration delay time is reached, it is determined that the source database synchronization is completed.
  • the foregoing processor may further execute the following program code: stop the source database synchronization, and modify the access permission of the target database server from the read-only permission that has been set to the write permission, so that any application server is allowed to access.
  • the target database server where the access permissions of the target database server are set to read-only, either before or before the source database is synchronized to the target database server.
  • the foregoing processor may further execute the following program code: the cloud starts the second application server to connect to the target database server; and extracts a second IP address that is stored in the host file of the second application server and is bound to the database domain name; Determining whether the second application server is successfully connected to the target database by verifying the extracted second IP address in the second application server; if the second IP address is verified to be successful, determining that the second application server is successfully connected to the target database.
  • the foregoing processor may further execute the following program code: input the extracted second IP address in the access interface of the second application server; and successfully open the database of the target database server after inputting the second IP address The page is successfully established by the access link of the second application server and the target database.
  • the foregoing processor may further execute the following program code: detecting whether the source database server generates traffic within a predetermined time; if the source database server is not within the predetermined time If any traffic is generated, the task of running the source database server in the background is stopped.
  • the foregoing processor may further execute the following program code: if the server deployed in the cloud fails, use the steps in claim 1 to reversely switch the second application server and/or the target database server deployed in the cloud. To the corresponding physical machine.
  • the foregoing processor may further execute the following program code: deploying multiple first application servers in the cloud, each first application server accessing the source database server, and deploying multiple second application servers in the cloud, Both application servers access the target database server.
  • the source database in the source database server is synchronized to the target database server, and after the source database server confirms that the source database synchronization is completed, the database server accessed by the first application server is used by the source.
  • the method of switching the database server to the target database server by modifying the address information that has been bound to the first domain name in the DNS server, to reach the application server that accesses the client user through the first domain name by the first
  • the purpose of replacing the application server with the second application server is to achieve the technical effect that the application can continue to be used by the user when the application is migrated to the cloud, thereby solving the problem that the prior art moves the application to the cloud and causes the customer to The technical problem of stopping the use of the terminal.
  • FIG. 17 is only schematic, and the computer terminal can also be a smart phone (such as an Android mobile phone, an iOS mobile phone, etc.), a tablet computer, a palmtop computer, and a mobile Internet device (Mobile Internet Devices, MID). ), PAD and other terminal devices.
  • Fig. 17 does not limit the structure of the above electronic device.
  • computer terminal A may also include more or fewer components (such as a network interface, display device, etc.) than shown in FIG. 17, or have a different configuration than that shown in FIG.
  • Embodiments of the present invention also provide a storage medium.
  • the foregoing storage medium may be used to save the program code executed by the physical machine data migration to the cloud method provided by the foregoing Embodiment 1.
  • the foregoing storage medium may be located in any one of the computer terminal groups in the computer network, or in any one of the mobile terminal groups.
  • the storage medium is configured to store program code for performing the following steps: synchronizing the source database in the source database server to the target database server, wherein the source database server is a physical machine, the target database The server is a server deployed in the cloud; after the source database server confirms that the source database is synchronized, the database server accessed by the first application server is switched from the source database server to the target database server, wherein the first application server is the current client user.
  • the second application server is an application server deployed on the cloud; after successfully establishing an access link of the second application server and the target database, the client user accesses the source database synchronized in the target database through the second application server.
  • the foregoing storage medium is further configured to store program code for performing the following steps: using a switching script to modify the first IP address stored in the first application server and bound to the database domain name to the IP address of the target database server.
  • the first IP address is the IP address of the source database server; after the switching script sets the access permission of the source database server to read-only, all access links to the source database server are disconnected.
  • the foregoing storage medium is further configured to store program code for performing the following steps: the synchronization manner is: full amount synchronization or incremental synchronization, wherein the source database synchronization is confirmed by any one of the following methods: manner 1: The first application server polls the source database server in real time or periodically. If the synchronization end information generated by the source database server is detected, it is determined that the source database synchronization is completed. Manner 2: The source database server performs the number of synchronization sources according to the preset synchronization duration. According to the database, when the first application server detects that the synchronization duration arrives, or detects that the delay time of the synchronization duration is reached, it is determined that the source database synchronization is completed.
  • the foregoing storage medium is further configured to store program code for performing the following steps: stopping the source database synchronization, and modifying the access permission of the target database server from the read-only permission that has been set to the permission to write, so that the permission is allowed.
  • Any application server accesses the target database server, where the access rights of the target database server are set to read-only while or before the source database is synchronized to the target database server.
  • the foregoing storage medium is further configured to store program code for performing the following steps: the cloud starts the second application server to connect to the target database server; and extracts the database domain name stored in the host file of the second application server. a second IP address; determining, by the second application server, the extracted second IP address, whether the second application server is successfully connected to the target database; if the second IP address is successful, determining the second application server connection The target database is successful.
  • the foregoing storage medium is further configured to store program code for performing the following steps: inputting the extracted second IP address in an access interface of the second application server; and successfully opening after inputting the second IP address The database page of the target database server, the access link of the second application server and the target database is successfully established.
  • the foregoing storage medium is further configured to store program code for performing: detecting whether the source database server generates traffic within a predetermined time; if the source database server does not generate any traffic within a predetermined time, stopping the source database The task that runs in the background of the server.
  • the foregoing storage medium is further configured to store program code for performing the following steps: if the server deployed on the cloud fails, adopting the steps in claim 1 to deploy the second application server and/or target in the cloud.
  • the database server switches back to the corresponding physical machine.
  • the foregoing storage medium is further configured to store program code for performing the following steps: deploying multiple first application servers under the cloud, each first application server accessing the source database server, and deploying multiple units in the cloud The second application server accesses the target database server.
  • the disclosed technical contents may be implemented in other manners.
  • the device embodiments described above are merely illustrative.
  • the division of a unit is only a logical function division.
  • multiple units or components may be combined or may be integrated into Another system, or some features can be ignored or not executed.
  • the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, unit or module, and may be electrical or otherwise.
  • the units described as separate components may or may not be physically separate, and the components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of the embodiment.
  • each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
  • the above integrated unit can be implemented in the form of hardware or in the form of a software functional unit.
  • An integrated unit if implemented in the form of a software functional unit and sold or used as a standalone product, can be stored in a computer readable storage medium.
  • the technical solution of the present invention which is essential or contributes to the prior art, or all or part of the technical solution, may be embodied in the form of a software product stored in a storage medium.
  • a number of instructions are included to cause a computer device (which may be a personal computer, server or network device, etc.) to perform all or part of the steps of the various embodiments of the present invention.
  • the foregoing storage medium includes: a U disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic disk, or an optical disk, and the like. .

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Information Transfer Between Computers (AREA)
  • Computer And Data Communications (AREA)

Abstract

一种物理机数据迁移至云端的方法、装置和系统。其中,该方法包括:将源数据库服务器中的源数据库同步至目标数据库服务器(S23);在源数据库服务器确认源数据库同步完成之后,将第一应用服务器访问的数据库服务器由源数据库服务器切换为目标数据库服务器(S25);通过修改DNS服务器中与第一域名已经绑定的地址信息,将客户端用户通过第一域名访问的应用服务器由第一应用服务器更换为第二应用服务器(S27);在成功建立第二应用服务器与目标数据库的访问链路之后,客户端用户通过第二应用服务器来访问目标数据库中同步得到的源数据库(S29)。解决了现有技术中将应用迁移至云上的过程中会导致客户端停止使用的技术问题。

Description

物理机数据迁移至云端的方法、装置和系统 技术领域
本发明涉及数据迁移领域,具体而言,涉及一种物理机数据迁移至云端的方法、装置和系统。
背景技术
云计算作为基于互联网的相关服务的增加、使用和交付模式,通常涉及通过互联网来提供动态易拓展且经常是虚拟化的资源。随着云计算的不断发展、云计算应用的不断深入,以及对大数据处理需求的不断扩大,越来越多的应用被迁移到云上。
然而现有技术在进行将应用迁移至云上的过程中,需要停止应用的全部功能或部分功能,以至于在迁移的过程中,用户使用或不能正常使用应用。对于一些在线应用,比如电子商务的交易系统等,为了应用迁移而停止应用会带来不好的用户体验,甚至造成交易量的下跌,且现有的上云方案大多依赖较多的中间件,特别是数据库访问等中间件(如淘宝的TDDL)和应用改造,成本较高。而且对于不同开发语言不具有通用性,因此不具有普适的可行性。
针对现有技术中将应用迁移至云上的过程会导致客户端停止使用的技术问题,目前尚未提出有效的解决方案。
发明内容
本发明实施例提供了一种物理机数据迁移至云端的方法、装置和系统,以至少解决现有技术中将应用迁移至云上的过程中会导致客户端停止使用的技术问题。
根据本发明实施例的一个方面,提供了一种物理机数据迁移至云端的方法,包括:将源数据库服务器中的源数据库同步至目标数据库服务器,其中,源数据库服务器为物理机,目标数据库服务器为部署在云端上的服 务器;在源数据库服务器确认源数据库同步完成之后,将第一应用服务器访问的数据库服务器由源数据库服务器切换为目标数据库服务器,其中,第一应用服务器为当前客户端用户用于访问源数据库的物理机;通过修改DNS服务器中与第一域名已经绑定的地址信息,将客户端用户通过第一域名访问的应用服务器由第一应用服务器更换为第二应用服务器,其中,第二应用服务器为部署在云端上的应用服务器;在成功建立第二应用服务器与目标数据库的访问链路之后,客户端用户通过第二应用服务器来访问目标数据库中同步得到的源数据库。
根据本发明实施例的另一方面,还提供了一种物理机数据迁移至云端的装置,包括:同步模块,用于将源数据库服务器中的源数据库同步至目标数据库服务器,其中,源数据库服务器为物理机,目标数据库服务器为部署在云端上的服务器;切换模块,用于在源数据库服务器确认源数据库同步完成之后,将第一应用服务器访问的数据库服务器由源数据库服务器切换为目标数据库服务器,其中,第一应用服务器为当前客户端用户用于访问源数据库的物理机;更换模块,用于通过修改DNS服务器中与第一域名已经绑定的地址信息,将客户端用户通过第一域名访问的应用服务器由第一应用服务器更换为第二应用服务器,其中,第二应用服务器为部署在云端上的应用服务器;访问模块,用于在成功建立第二应用服务器与目标数据库的访问链路之后,客户端用户通过第二应用服务器来访问目标数据库中同步得到的源数据库。
根据本发明实施例的再一方面,还提供了一种物理机数据迁移至云端的系统,包括:源数据库服务器,用于提供源数据库,其中,源数据库服务器为物理机;目标数据库服务器,与源数据库服务器建立通讯关系,用于接收源数据库服务器同步的源数据库,其中,目标数据库服务器为部署在云端上的服务;第一应用服务器,在源数据库服务器确认源数据库同步完成之后,与目标数据库服务器通信,用于将当前访问的数据库服务器由源数据库服务器切换为目标数据库服务器,其中,第一应用服务器为当前客户端用户用于访问源数据库的物理机;DNS服务器,与第一应用服务器 和第二应用服务器通信,用于修改与第一域名将已经绑定的地址信息;第二应用服务器,与目标数据库建立访问链路,用于客户端用户读取DNS服务器已经修改后的通过第一域名访问的第二应用服务器,使得客户端用户通过第二应用服务器访问目标数据库中同步得到的源数据库,其中,第二应用服务器为部署在云端上的应用服务器。
在本发明实施例中,采用将源数据库服务器中的源数据库同步至目标数据库服务器,在所述源数据库服务器确认所述源数据库同步完成之后,将第一应用服务器访问的数据库服务器由所述源数据库服务器切换为所述目标数据库服务器的方式,通过修改DNS服务器中与第一域名已经绑定的地址信息,达到了将所述客户端用户通过所述第一域名访问的应用服务器由所述第一应用服务器更换为第二应用服务器的目的,从而实现了将应用迁移至云端时应用能够继续被用户使用的技术效果,进而解决了现有技术中将应用迁移至云上的过程中会导致客户端停止使用的技术问题。
附图说明
此处所说明的附图用来提供对本发明的进一步理解,构成本申请的一部分,本发明的示意性实施例及其说明用于解释本发明,并不构成对本发明的不当限定。在附图中:
图1是本发明实施例的一种物理机数据迁移至云端的方法的计算机终端的硬件结构框图;
图2是根据本申请实施例的一种可选的物理机数据迁移至云端的方法的流程图;
图3是根据本申请实施例的一种用户通过第一应用服务器访问源数据库服务器的示意图;
图4是根据本申请实施例的一种用户通过第一应用服务器访问目标数据库服务器的示意图;
图5是根据本申请实施例的一种用户通过第二应用服务器访问目标数据库服务器的示意图;
图6是根据本申请实施例的一种可选的物理机数据迁移至云端的方法的流程图;
图7是根据本申请实施例的一种可选的物理机数据迁移至云端的方法的交互图;
图8是根据本申请实施例的一种可选的物理机数据迁移至云端的装置的结构示意图;
图9是根据本申请实施例的一种可选的物理机数据迁移至云端的装置的结构示意图;
图10是根据本申请实施例的一种可选的物理机数据迁移至云端的装置的结构示意图;
图11是根据本申请实施例的一种可选的物理机数据迁移至云端的装置的结构示意图;
图12是根据本申请实施例的一种可选的物理机数据迁移至云端的装置的结构示意图;
图13是根据本申请实施例的一种可选的物理机数据迁移至云端的装置的结构示意图;
图14是根据本申请实施例的一种可选的物理机数据迁移至云端的装置的结构示意图;
图15是根据本申请实施例的一种可选的物理机数据迁移至云端的装置的结构示意图;
图16是根据本申请实施例的一种可选的物理机数据迁移至云端的系统的结构示意图;以及
图17是根据本申请实施例的一种计算机终端的结构框图。
具体实施方式
为了使本技术领域的人员更好地理解本发明方案,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分的实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都应当属于本发明保护的范围。
需要说明的是,本发明的说明书和权利要求书及上述附图中的术语“第一”、“第二”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换,以便这里描述的本发明的实施例能够以除了在这里图示或描述的那些以外的顺序实施。此外,术语“包括”和“具有”以及他们的任何变形,意图在于覆盖不排他的包含,例如,包含了一系列步骤或单元的过程、方法、系统、产品或设备不必限于清楚地列出的那些步骤或单元,而是可包括没有清楚地列出的或对于这些过程、方法、产品或设备固有的其它步骤或单元。
首先,在对本申请实施例进行描述的过程中出现的部分名词或术语适用于如下解释:
DNS服务器:由域名解析器和域名服务器组成,具有将域名转换为IP地址的功能。
host文件:是一种没有拓展名的系统文件,用于将一些常用的网站域名与其对应的IP地址建立一个关联的“数据库”。
实施例1
根据本发明实施例,还提供了一种物理机数据迁移至云端的方法实施例,需要说明的是,在附图的流程图示出的步骤可以在诸如一组计算机可执行指令的计算机系统中执行,并且,虽然在流程图中示出了逻辑顺序,但是在某些情况下,可以以不同于此处的顺序执行所示出或描述的步骤。
本申请实施例一所提供的方法实施例可以在移动终端、计算机终端或者类似的运算装置中执行。以运行在计算机终端上为例,图1是本发明实 施例的一种物理机数据迁移至云端的方法的计算机终端的硬件结构框图。如图1所示,计算机终端10可以包括一个或多个(图中仅示出一个)处理器102(处理器102可以包括但不限于微处理器MCU或可编程逻辑器件FPGA等的处理装置)、用于存储数据的存储器104、以及用于通信功能的传输模块106。本领域普通技术人员可以理解,图1所示的结构仅为示意,其并不对上述电子装置的结构造成限定。例如,计算机终端10还可包括比图1中所示更多或者更少的组件,或者具有与图1所示不同的配置。
存储器104可用于存储应用软件的软件程序以及模块,如本发明实施例中的物理机数据迁移至云端的方法对应的程序指令/模块,处理器102通过运行存储在存储器104内的软件程序以及模块,从而执行各种功能应用以及数据处理,即实现上述的物理机数据迁移至云端的方法。存储器104可包括高速随机存储器,还可包括非易失性存储器,如一个或者多个磁性存储装置、闪存、或者其他非易失性固态存储器。在一些实例中,存储器104可进一步包括相对于处理器102远程设置的存储器,这些远程存储器可以通过网络连接至计算机终端10。上述网络的实例包括但不限于互联网、企业内部网、局域网、移动通信网及其组合。
传输装置106用于经由一个网络接收或者发送数据。上述的网络具体实例可包括计算机终端10的通信供应商提供的无线网络。在一个实例中,传输装置106包括一个网络适配器(Network Interface Controller,NIC),其可通过基站与其他网络设备相连从而可与互联网进行通讯。在一个实例中,传输装置106可以为射频(Radio Frequency,RF)模块,其用于通过无线方式与互联网进行通讯。
在上述运行环境下,本申请提供了如图2所示的物理机数据迁移至云端的方法。图2是根据本申请实施例的一种可选的物理机数据迁移至云端的方法的流程图,如图2所示,该方法包括:
步骤S23,将源数据库服务器中的源数据库同步至目标数据库服务器,其中,源数据库服务器为物理机,目标数据库服务器为部署在云端上的服务器。
具体的,在上述步骤中,源数据库可以是用于存放在物理机上的用户使用客户端时产生的数据的数据库,物理机是相对于虚拟机而言的实体计算机。
在一种可选的方案中,上述源数据库可以是客户端在物理机上的数据库,上述步骤将处于物理机上的数据库服务器中的源数据库,同步至云端上的服务器,使云端上的服务器中包含与源数据库一致的数据库。
此处需要说明的是,上述云端上的服务器为部署于网络端的服务器,可以是部署在云端的虚拟服务器,但不限于此。
步骤S25,在源数据库服务器确认源数据库同步完成之后,将第一应用服务器访问的数据库服务器由源数据库服务器切换为目标数据库服务器,其中,第一应用服务器为当前客户端用户用于访问源数据库的物理机。
在一种可选的实施例中,上述当前客户端可以是电子商务交易系统,上述源数据库可以是电子商务交易系统在物理机上的数据库,在将源数据库服务器中的源数据库同步至目标数据库服务器的步骤完成之前,结合图3所示,用户在使用电子商务交易系统的过程中,通过负载均衡器访问物理机中的源数据库读取或写入相关数据,在将源数据库服务器中的源数据库同步至目标数据库服务器的步骤完成之后,结合图4所示,用户在使用电子商务交易系统的过程中,通过访问云端上的服务器中的源数据库读取或写入相关数据。
步骤S27,通过修改DNS服务器中与第一域名已经绑定的地址信息,将客户端用户通过第一域名访问的应用服务器由第一应用服务器更换为第二应用服务器,其中,第二应用服务器为部署在云端上的应用服务器。
具体的,上述步骤中第一域名绑定的地址信息为与第一域名对应的物理机中的IP地址信息。
在一种可选的实施例中,DNS服务器中,第一域名与物理机中第一域名对应的IP地址具有绑定关系,用户通过输入第一域名即可访IP地址在DNS服务器中与第一域名对应的物理机,通过将DNS服务器中,与第一 域名已经绑定的地址信息修改为第一域名在云端服务器中对应的地址信息,使得客户端用户在输入第一域名时,不再访问IP地址在DNS服务器中与第一域名对应的物理机,而是直接访问IP地址在DNS服务器中与第一域名对应的云端上的应用服务器。
步骤S29,在成功建立第二应用服务器与目标数据库的访问链路之后,客户端用户通过第二应用服务器来访问目标数据库中同步得到的源数据库。
在一种可选的实施例中,上述第二应用服务器可以是云端上的应用服务器,目标数据库可以是部署在云端上的服务器中的数据库。在上述云端上的应用服务器与部署在云端上的服务器中的数据库的访问链路建立成功后,客户端的用户通过云端上的服务器访问部署在云端上的服务器中的数据库,即前部署在物理机中的源数据库。
本申请上述实施例一公开的方案中,将源数据库服务器中的源数据库同步至目标数据库服务器;在源数据库服务器确认源数据库同步完成之后,将第一应用服务器访问的数据库服务器由源数据库服务器切换为目标数据库服务器;通过修改DNS服务器中与第一域名已经绑定的地址信息,将客户端用户通过第一域名访问的应用服务器由第一应用服务器更换为第二应用服务器;在成功建立第二应用服务器与目标数据库的访问链路之后,客户端用户通过第二应用服务器来访问目标数据库中同步得到的源数据库。
需要说明的是,在将源数据库中的源数据同步至目标数据库服务器的过程中,客户端的用户在使用客户端的过程中依旧读取源数据库服务器中的源数据库,直至源数据库服务器确认源数据库同步完成后,客户端的用户才开始使用目标数据库服务器中的数据库,即再将物理机中的数据库同步至云端的数据库服务器的过程中,客户端的用户仍然使用物理机中的源数据库,直至物理机中的源数据库已经完全同步至云端上的服务器,客户端的用户才开始访问云端上的服务器中的数据库,因此在将源数据库中的源数据同步至目标数据库服务器的过程中,客户端的用户可以正常使用客 户端,即将源数据库中的源数据同步至目标数据库服务器的过程不会对用户的使用产生影响。
需要进一步说明的是,客户端的用户在输入第一域名时,在修改DNS服务器中与第一域名已经绑定的地址信息之后,用户得到的响应是与修改DNS服务器中与第一域名已经绑定的地址信息之前相同的响应结果,因此修改DNS服务器中与第一域名已经绑定的地址信息也不会对客户端的用户的使用产生影响。
由此,本申请提供的上述实施例一的方案解决了现有技术中将应用迁移至云上的过程中会导致客户端停止使用的技术问题。
根据本申请上述实施例,步骤S23,在将源数据库服务器中的源数据库同步至目标数据库服务器的过程中,包括:
步骤S231,使用切换脚本将第一应用服务器中存储的与数据库域名绑定的第一IP地址修改为目标数据库服务器的IP地址,其中,第一IP地址为源数据库服务器的IP地址。
需要说明的是,在用户通过第一应用服务器访问源数据库服务器中的源数据库的情况下,第一应用服务器中存储的数据库域名与源数据库的第一IP地址具有对应的关系。在通过切换脚本将第一应用服务器中存储的与数据库域名绑定的第一IP地址修改为目标数据库服务器的IP地址后,用户可以通过第一应用服务器访问目标数据库服务器中的目标数据库。
步骤S233,在切换脚本将源数据库服务器的访问权限设置为只读之后,断开访问源数据库服务器的所有访问链路。
根据本申请上述实施例,同步的方式为:全量同步或增量同步,其中,通过如下任意一种方式确认源数据库同步完成:
方式一:第一应用服务器实时或定时轮询源数据库服务器,如果检测到源数据库服务器产生的同步结束信息,则确定源数据库同步完成。
在一种可选的实施例中,上述源数据库服务器可以是物理机,当源数据库从物理机同步至部署在云端的服务器结束时,作为源数据库服务器的 物理机能够产生上述同步步骤结束的信息,第一应用服务器作为访问源数据库的物理机,实时监测源数据库中是否出现源数据库服务器产生的同步步骤结束的信息,当第一应用服务器监测得到源数据库服务器产生的同步步骤结束的信息时,确认上述同步步骤完成。
在另一种可选的实施例中,上述源数据库服务器仍可以是物理机,当源数据库从物理机同步至部署在云端的服务器结束时,作为源数据库服务器的物理机能够产生上述同步步骤结束的信息,第一应用服务器作为访问源数据库的物理机,定时轮询源数据库服务器,以检测源数据库中是否出现源数据库服务器产生的同步步骤结束的信息,即第一应用服务器以一定的周期在源数据库服务器中查找同步结束的信息,当第一应用服务器监测得到源数据库服务器产生的同步步骤结束的信息时,确认上述同步步骤完成。
方式二:源数据库服务器按照预设的同步时长来执行同步源数据库,在第一应用服务器检测到同步时长到达,或者检测到同步时长的延迟时间达到的情况下,确定源数据库同步完成。
在一种可选的是实例中,预设的同步时长可以是48小时,同步时长的延长时间可以是12小时。在同步源数据库的时长达到48小时的情况下,可以确认同步源数据库的步骤完成;或同步源数据库的时长达到60小时的情况下,确认同步源数据库的步骤完成。
此处需要说明的是,预设的同步时长是根据源数据库的数据量进行预设的同步时间,源数据库中的数据量越大,预设的同步时长越长,且能够认为预设的同步时长大于同步源数据库需要的时长。
根据本申请上述实施例,步骤S25,在确认源数据库同步完成之后,方法还包括:
步骤S251,停止源数据库同步,并将目标数据库服务器的访问权限由已经设置的只读权限修改为允许写入权限,使得允许任意一个应用服务器访问目标数据库服务器,其中,在将源数据库同步至目标数据库服务器的 同时或之前,将目标数据库服务器的访问权限设置为只读。
在一种可选的实施例中,上述源数据库可以是物理机中的源数据库,将目标数据库服务器可以是云端上的数据库服务器,将云端上的数据库服务器的访问权限是指为只读模式后,开始将物理机中的源数据库同步至云端的数据库服务器,当同步步骤结束后,停止源数据库的同步,此时,物理机中的源数据库的访问权限被修改为只读,却所有访问源数据库的链路被断开,因此用户通过第一应用服务器访问云端上的数据库服务器中的目标数据库,在用户通过第一应用服务器访问云端上的数据库服务器中的目标数据库的情况下,需要对目标数据库进行读取和写入的操作,故将云端上的数据库服务器的访问权限修改为允许写入。
根据本申请上述实施例,步骤S27,在修改DNS服务器中与第一域名已经绑定的地址信息之前,上述方法还包括:
步骤S271,云端启动第二应用服务器来连接目标数据库服务器。
在一种可选的实施例中,第二应用服务器可以是部署在云端上的服务器,目标数据服务器也可以是部署在云端的服务器。启动第二应用服务器来连接目标数据库服务器可以是启动部署在云端上的服务器连接另一包含同步得到的源数据库的部署在云端上的服务器。
步骤S273,提取第二应用服务器的host文件中存储的与数据库域名绑定的第二IP地址。
具体的,上述hosts文件为域名与其对应的IP地址建立的关联数据库,可通过该关联数据库查找到与域名相对应的IP地址。
在一种可选的实施例中,第二应用服务器可以是部署在云端上的服务器,host文件作为域名与其对应的IP地址的关联数据库,包含与数据库域名对应的IP地址,部署在云端上的第二应用服务器中的host文件包含与数据库域名对应的用于连接目标数据库服务器的IP地址。
步骤S275,在第二应用服务器中通过验证提取到的第二IP地址,来确定第二应用服务器是否与目标数据库的连接成功。
在一种可选的实施例中,验证提取到的第二IP地址即为验证第二IP地址是否是与数据库域名对应的IP地址,在输入第二IP地址的情况下,如果第二应用服务器与目标数据库服务器建立了连接关系,则可以认为验证成功,提取得到的第二IP地址为数据库域名对应的IP地址,如果第二应用服务器与目标数据库服务器没有建立连接关系,则验证失败,提取的第二IP地址并非数据库域名对应的IP地址。
步骤S277,如果验证第二IP地址成功,则确定第二应用服务器连接目标数据库成功。
在一种可选的实施例中,在第二IP地址验证成功的情况下,认为该第二IP地址为数据库域名对应的IP地址,因此确定第二应用服务器连接目标数据库成功,从而客户端的用户在使用客户端访问第二应用服务器时,第二应用服务器可以与同步源数据库得到的数据库建立连接,即用户可以通过访问部署在云端的服务器访问与源数据库一致的存在于云端上的数据库服务器中的目标数据库。
根据本申请上述实施例,步骤S275,在第二应用服务器中通过验证提取到的第二IP地址,来确定第二应用服务器是否与目标数据库的连接成功,包括:
步骤S2751,在第二应用服务器的访问界面中输入提取到的第二IP地址。
在一种可选的实施例中,第二应用服务器的访问界面包括输入网址和/或IP地址的输入栏,其位置可以在第二应用服务器的访问界面的顶端,在该输入栏输入提取到的IP地址后,可以选择确认进入此IP地址对应的数据库页面。
步骤S2753,在输入第二IP地址之后,如果成功打开目标数据库服务器的数据库页面,则第二应用服务器与目标数据库的访问链路成功建立。
在一种可选的是实例中,如果不能打开目标数据库服务器中的数据库页面,则第二应用服务器与目标数据库的访问链路未建立连接,且提取得 到的第二IP地址不为与目标数据库服务器的数据库域名对应的IP地址。
根据本申请上述实施例,步骤S29,在客户端用户通过第二应用服务器来访问目标数据库中同步得到的源数据库之后,方法还包括:
步骤S291,在预定时间内检测源数据库服务器是否产生流量。
具体的,当仍有用户访问源数据库服务器时,源数据服务器产生相应的访问流量。
在一种可选的实施例中,在客户端的用户全部通过部署与云端的数据库服务器访问目标数据库的情况下,源数据库服务器不会产生任何访问流量。
步骤S293,如果源数据库服务器在预定时间内没有产生任何流量,则停止源数据库服务器后台运行的任务。
具体的,如果源数据库服务器在预定时间内没有产生任何流量,则可以认为在预定时间内,客户端的用户均通过访问部署与云端的数据库服务器来访问数据库,没有用户再通过源数据库服务器访问源数据库,因此停止源数据库服务器后台运行的任务。
此处需要说明的是,在停止源数据服务器后台运行的任务后,多有客户端的用户均通过部署与云端的数据库服务器访问目标数据库。
需要进一步说明的是,在预设时间内检测到源数据服务器未产生任何流量,并停止了源数据服务器后台运行的任务的情况下,如果停止了源数据服务器后台运行的任务的瞬时,存在用户通过源数据库服务器访问源数据库,则该用户将出现不能访问到源数据服务器中的源数据库的情况,即该用户访问的页面会出现访问错误的情况,因此该用户不能正常使用客户端,但由于用户输入的域名已和云端的应用服务器建立了连接,且云端的应用服务器已和部署于云端的目标数据库建立了连接,因此该用户只需通过应用重试,或对访问页面进行刷新,即可正常使用客户端,且这一过程十分短暂,在实际操作中极大限度的减小了应用上云对客户端使用的影响。
根据本申请上述实施例,步骤S29,在客户端用户通过第二应用服务 器来访问目标数据库中同步得到的源数据库之后,方法还包括:
步骤S295,如果云端上部署的服务器发生故障时,采用步骤S23至步骤S29中的步骤将云端部署的第二应用服务器和/或目标数据库服务器反向切换至对应的物理机。
在一种可选的是实例中,在云端部署的目标数据库服务器发生故障的情况下,将云端部署的第二应用服务器和/或目标数据库服务器反向切换至对应的物理机的步骤包括:
a1.将源数据服务器的访问权限设置为只读,将目标数据库服务器中的数据库同步至源数据库服务器,并通过切换脚本将,将云端的服务器存储的数据库域名绑定的目标数据库服务器的第二IP地址修改为源数据库服务器的第一IP地址,结合图5所示,以将目标数据库服务器中的目标数据库同步至源数据库服务器;
b1.在上述同步步骤完成后,将目标数据库服务器的访问权限设置为只读模式,并断开所有目标数据库服务器的访问链路,再将源数据库服务器的访问权限修改为允许写入,以使第二应用服务器访问的数据库服务器由目标数据库服务器切换至作为源数据库服务器的物理机。
在另一种可选的实施例中,在云端部署的第二应用服务器和目标数据库服务器均发生故障的情况下,将云端部署的第二应用服务器和/或目标数据库服务器反向切换至对应的物理机的步骤包括:
a2.将源数据服务器的访问权限设置为只读,将目标数据库服务器中的数据库同步至源数据库服务器,并通过切换脚本将,将云端的服务器存储的数据库域名绑定的目标数据库服务器的第二IP地址修改为源数据库服务器的第一IP地址,以将目标数据库服务器中的目标数据库同步至源数据库服务器;
b1.在上述同步步骤完成后,将目标数据库服务器的访问权限设置为只读模式,并断开所有目标数据库服务器的访问链路,再将源数据库服务器的访问权限修改为允许写入,以使第二应用服务器访问的数据库服务器由 目标数据库服务器切换至作为源数据库服务器的物理机;
c2,云端启动第一应用服务器来连接源数据库服务器,提取第一应用服务器的host文件中存储的与数据库域名绑定的第一IP地址,并验证提取的第一IP地址来确认第一应用服务器是否与元数据库服务器连接成功,以使得客户端用户通过第一域名访问的应用服务器由云端的第二应用服务器切换至物理机上的第一应用服务器。
d2.建立第一应用服务器与源数据库服务器的访问链路,使得用户能够通过第一应用服务器来访问源数据库服务器中同步得到的目标数据库。
需要说明的是,在第一应用服务器中输入提取到的第一IP地址,在成功打开源数据库服务器的数据库的情况下,确认第一应用服务器与源数据库服务器的访问链路成功建立。
根据本申请上述实施例,在云下部署多台第一应用服务器,每台第一应用服务器均访问源数据库服务器,在云端部署多台第二应用服务器,第二应用服务器均访问目标数据库服务器。
需要说明的是,对于前述的各方法实施例,为了简单描述,故将其都表述为一系列的动作组合,但是本领域技术人员应该知悉,本发明并不受所描述的动作顺序的限制,因为依据本发明,某些步骤可以采用其他顺序或者同时进行。其次,本领域技术人员也应该知悉,说明书中所描述的实施例均属于优选实施例,所涉及的动作和模块并不一定是本发明所必须的。
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到根据上述实施例的方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端设备(可以是手机,计算机,服务器,或者网络设备等)执行本发明各个实施例的方法。
下面结合图6详细介绍本申请的一种优选的实施例。
S61,将目标数据库的访问权限设置为只读。
可选的,在将源数据库服务器中的源数据库同步至目标数据库服务器之前或同时,将目标数据库的访问权限设置为只读。
S62,将源数据库服务器中的源数据库同步至目标数据库服务器。
可选的,将源数据库服务器中的源数据库同步至目标数据库服务器可通过数据库工具进行,例如阿里云的数据传输(Data Transmission)产品,能够实施在源数据库服务器到目标数据库服务器(例如:RDS,Relational Datebase Service,云数据库)的全量数据同步和增量同步,(例如:DTS Digital Theatre System,数字化影院系统)。
S63,将数据库域名绑定的源数据库服务器的IP地址修改为目标数据服务器的IP地址。
S64,将源数据库的访问权限设置为只读,并断开所有源数据库的访问链路。
S65,在确认源数据库停止同步后,将目标数据库的访问权限设置为允许写入。
S66,云端启动第二应用服务器来连接目标数据库服务器,并验证第二应用服务器的host中的IP地址。
可选的,在第二应用服务器的访问界面中输入提取到的第二IP地址,如果成功打开目标数据库服务器的数据库页面,则第二应用服务器与目标数据库的访问链路成功建立。
S67:验证成功后,客户端用户通过云端的第二应用服务器来访问目标数据库。
下面结合图7详细介绍本申请的一种优选实施例。
如图7所示,提供了一种可选的物理机数据迁移至云端的方法,该方法可以包括如下步骤S701至步骤S709:
S701,将源数据库服务器中的源数据库同步至目标数据库服务器。
可选的,在将源数据库服务器中的源数据库同步至目标数据库服务器之前或同时,将目标数据库的访问权限设置为只读。
S703,将第一应用服务器访问的源数据库服务器切换为目标数据库服务器。
可选的,在停止同步之后,将目标数据服务器的访问权限设置为允许写入。
S705,将数据库域名绑定的源数据库服务器的IP地址修改为目标数据服务器的IP地址。
S707,验证第二应用服务器的host文件中存储的与数据库域名绑定的第二IP地址。
可选的,将第二IP地址输入第二应用服务器,如果成功打开数据库服务器的数据库,则确认第二应用服务器与目标数据库连接成功。
S709,将客户端用户通过第一域名访问的应用服务器由第一应用服务器更换为第二应用服务器。
可选的,在预定时间内检测源数据服务器是否产生流量,在预定时间内,源数据库服务器没有产生流量的情况下,停止源数据库服务器在后台的运行任务。
实施例2
根据本发明实施例,还提供了一种物理机数据迁移至云端的装置物理机数据迁移至云端的装置,如图8所示,该装置包括:同步模块80,切换模块82,更换模块84和访问模块86。
同步模块80用于将源数据库服务器中的源数据库同步至目标数据库服务器,其中,源数据库服务器为物理机,目标数据库服务器为部署在云端上的服务器;切换模块82用于在源数据库服务器确认源数据库同步完成之后,将第一应用服务器访问的数据库服务器由源数据库服务器切换为 目标数据库服务器,其中,第一应用服务器为当前客户端用户用于访问源数据库的物理机;更换模块84用于通过修改DNS服务器中与第一域名已经绑定的地址信息,将客户端用户通过第一域名访问的应用服务器由第一应用服务器更换为第二应用服务器,其中,第二应用服务器为部署在云端上的应用服务器;访问模块86用于在成功建立第二应用服务器与目标数据库的访问链路之后,客户端用户通过第二应用服务器来访问目标数据库中同步得到的源数据库。
可选地,上述源数据库可以是客户端在物理机上的数据库,上述物理机是相对于虚拟机而言的实体计算机,第一应用服务器可以是当前用户用于访问源数据库的物理机,第二应用服务器可以是云端上的应用服务器。
此处需要说明的是,上述同步模块80,切换模块82,更换模块84和访问模块86对应于实施例一中的步骤S23至步骤S29,四个模块与对应的步骤所实现的实例和应用场景相同,但不限于上述实施例一所公开的内容。需要说明的是,上述模块作为装置的一部分可以运行在实施例一提供的计算机终端10中。
本申请上述实施例二公开的方案中,将源数据库服务器中的源数据库同步至目标数据库服务器;在源数据库服务器确认源数据库同步完成之后,将第一应用服务器访问的数据库服务器由源数据库服务器切换为目标数据库服务器;通过修改DNS服务器中与第一域名已经绑定的地址信息,将客户端用户通过第一域名访问的应用服务器由第一应用服务器更换为第二应用服务器;在成功建立第二应用服务器与目标数据库的访问链路之后,客户端用户通过第二应用服务器来访问目标数据库中同步得到的源数据库。
需要说明的是,在将源数据库中的源数据同步至目标数据库服务器的过程中,客户端的用户在使用客户端的过程中依旧读取源数据库服务器中的源数据库,直至源数据库服务器确认源数据库同步完成后,客户端的用户才开始使用目标数据库服务器中的数据库,即再将物理机中的数据库同步至云端的数据库服务器的过程中,客户端的用户仍然使用物理机中的源 数据库,直至物理机中的源数据库已经完全同步至云端上的服务器,客户端的用户才开始访问云端上的服务器中的数据库,因此在将源数据库中的源数据同步至目标数据库服务器的过程中,客户端的用户可以正常使用客户端,即将源数据库中的源数据同步至目标数据库服务器的过程不会对用户的使用产生影响。
需要进一步说明的是,客户端的用户在输入第一域名时,在修改DNS服务器中与第一域名已经绑定的地址信息之后,用户得到的响应是与修改DNS服务器中与第一域名已经绑定的地址信息之前相同的响应结果,因此修改DNS服务器中与第一域名已经绑定的地址信息也不会对客户端用户的使用产生影响。
由此,本申请提供的上述实施例二的方案解决了现有技术中将应用迁移至云上的过程中会导致客户端停止使用的技术问题。
在一种可选的实施例中,如图9所示,上述同步模块80包括:修改模块90和断开模块92。
修改模块90用于使用切换脚本将第一应用服务器中存储的与数据库域名绑定的第一IP地址修改为目标数据库服务器的IP地址,其中,第一IP地址为源数据库服务器的IP地址;断开模块92用于在切换脚本将源数据库服务器的访问权限设置为只读之后,断开访问源数据库服务器的所有访问链路。
此处需要说明的是,上述修改模块90和断开模块92对应于实施例一中的步骤S231至步骤S233,上述模块与对应的步骤所实现的实例和应用场景相同,但不限于上述实施例一所公开的内容。需要说明的是,上述模块作为装置的一部分可以运行在实施例一提供的计算机终端10中。
在一种可选的实施例中,如图10所示,上述同步的方式为:全量同步或增量同步,其中,上述装置还可以包括:轮询模块100和第一检测模块102。
轮询模块100用于第一应用服务器实时或定时轮询源数据库服务器, 如果检测到源数据库服务器产生的同步结束信息,则确定源数据库同步完成;第一检测模块102用于源数据库服务器按照预设的同步时长来执行同步源数据库,在第一应用服务器检测到同步时长到达,或者检测到同步时长的延迟时间达到的情况下,确定源数据库同步完成。
此处需要说明的是,上述轮询模块100和第一检测模块102对应于实施例一中的方式一和方式二,两个模块与对应的步骤所实现的实例和应用场景相同,但不限于上述实施例一所公开的内容。需要说明的是,上述模块作为装置的一部分可以运行在实施例一提供的计算机终端10中。
在一种可选的实施例中,如图11所示,上述装置还可以包括:第一停止模块110。
第一停止模块110用于停止源数据库同步,并将目标数据库服务器的访问权限由已经设置的只读权限修改为允许写入权限,使得允许任意一个应用服务器访问目标数据库服务器,其中,在将源数据库同步至目标数据库服务器的同时或之前,将目标数据库服务器的访问权限设置为只读。
此处需要说明的是,预设的同步时长是根据源数据库的数据量进行预设的同步时间,源数据库中的数据量越大,预设的同步时长越长,且能够认为预设的同步时长大于同步源数据库需要的时长。
此处需要说明的是,上述第一停止模块110对应于实施例一中的步骤S251,此模块与对应的步骤所实现的实例和应用场景相同,但不限于上述实施例一所公开的内容。需要说明的是,上述模块作为装置的一部分可以运行在实施例一提供的计算机终端10中。
在一种可选的实施例中,如图12所示,上述装置还可以包括:启动模块120、提取模块122、第一确定模块124和第二确定模块126。
启动模块120用于云端启动第二应用服务器来连接目标数据库服务器;提取模块122用于提取第二应用服务器的host文件中存储的与数据库域名绑定的第二IP地址;第一确定模块124用于在第二应用服务器中通过验证提取到的第二IP地址,来确定第二应用服务器是否与目标数据库的连接成 功;第二确定模块126用于如果验证第二IP地址成功,则确定第二应用服务器连接目标数据库成功。
此处需要说明的是,上述启动模块120、提取模块122、第一确定模块124和第二确定模块126对应于实施例一中的步骤S271至步骤S277,四个模块与对应的步骤所实现的实例和应用场景相同,但不限于上述实施例一所公开的内容。需要说明的是,上述模块作为装置的一部分可以运行在实施例一提供的计算机终端10中。
在一种可选的实施例中,如图13所示,上述第一确定模块124包括:输入模块130和建立模块132。
输入模块130用于在第二应用服务器的访问界面中输入提取到的第二IP地址;建立模块132用于在输入第二IP地址之后,如果成功打开目标数据库服务器的数据库页面,则第二应用服务器与目标数据库的访问链路成功建立。
此处需要说明的是,上述输入模块130和建立模块132对应于实施例一中的步骤S291至步骤S293,两个模块与对应的步骤所实现的实例和应用场景相同,但不限于上述实施例一所公开的内容。需要说明的是,上述模块作为装置的一部分可以运行在实施例一提供的计算机终端10中。
在一种可选的实施例中,如图14所示,上述装置还可以包括:第二检测模块140和第二停止模块142。
第二检测模块140用于在预定时间内检测源数据库服务器是否产生流量;第二停止模块142用于如果源数据库服务器在预定时间内没有产生任何流量,则停止源数据库服务器后台运行的任务。
此处需要说明的是,在停止源数据服务器后台运行的任务后,多有客户端的用户均通过部署与云端的数据库服务器访问目标数据库。
需要进一步说明的是,在预设时间内检测到源数据服务器未产生任何流量,并停止了源数据服务器后台运行的任务的情况下,如果停止了源数据服务器后台运行的任务的瞬时,存在用户通过源数据库服务器访问源数 据库,则该用户将出现不能访问到源数据服务器中的源数据库的情况,即该用户访问的页面会出现访问错误的情况,因此该用户不能正常使用客户端,但由于用户输入的域名已和云端的应用服务器建立了连接,且云端的应用服务器已和部署于云端的目标数据库建立了连接,因此该用户只需通过应用重试,或对访问页面进行刷新,即可正常使用客户端,且这一过程十分短暂,在实际操作中极大限度的减小了应用上云对客户端使用的影响。
此处需要说明的是,上述第二检测模块140和第二停止模块142对应于实施例一中的步骤S291至步骤S293,两个模块与对应的步骤所实现的实例和应用场景相同,但不限于上述实施例一所公开的内容。需要说明的是,上述模块作为装置的一部分可以运行在实施例一提供的计算机终端10中。
在一种可选的实施例中,如图15所示,上述装置还可以包括:反向切换模块150。
反向切换模块150用于如果云端上部署的服务器发生故障时,采用权利要求10中的装置将云端部署的第二应用服务器和/或目标数据库服务器反向切换至对应的物理机。
此处需要说明的是,上述反向切换模块150对应于实施例一中的步骤S295,两个模块与对应的步骤所实现的实例和应用场景相同,但不限于上述实施例一所公开的内容。需要说明的是,上述模块作为装置的一部分可以运行在实施例一提供的计算机终端10中。
在一种可选的实施例中,在云下部署多台第一应用服务器,每台第一应用服务器均访问源数据库服务器,在云端部署多台第二应用服务器,第二应用服务器均访问目标数据库服务器。
实施例3
根据本发明实施例,还提供了一种物理机数据迁移至云端的系统,如图16所示,该系统包括:源数据库服务器161、目标数据库服务器163、 第一应用服务器165、DNS服务器167和第二应用服务器169。
源数据库服务器161,用于提供源数据库,其中,源数据库服务器为物理机;
目标数据库服务器163,与源数据库服务器建立通讯关系,用于接收源数据库服务器同步的源数据库,其中,目标数据库服务器为部署在云端上的服务器;
第一应用服务器165,在源数据库服务器确认源数据库同步完成之后,与目标数据库服务器通讯,用于将当前访问的数据库服务器由源数据库服务器切换为目标数据库服务器,其中,第一应用服务器为当前客户端用户用于访问源数据库的物理机;
DNS服务器167,与第一应用服务器和第二应用服务器通信,用于修改与第一域名将已经绑定的地址信息;
第二应用服务器169,与目标数据库建立访问链路,用于客户端用户读取DNS服务器已经修改后的通过第一域名访问的第二应用服务器,使得客户端用户通过第二应用服务器访问目标数据库中同步得到的源数据库,其中,第二应用服务器为部署在云端上的应用服务器。
本申请上述实施例三公开的方案中,将源数据库服务器中的源数据库同步至目标数据库服务器;在源数据库服务器确认源数据库同步完成之后,将第一应用服务器访问的数据库服务器由源数据库服务器切换为目标数据库服务器;通过修改DNS服务器中与第一域名已经绑定的地址信息,将客户端用户通过第一域名访问的应用服务器由第一应用服务器更换为第二应用服务器;在成功建立第二应用服务器与目标数据库的访问链路之后,客户端用户通过第二应用服务器来访问目标数据库中同步得到的源数据库。
需要说明的是,在将源数据库中的源数据同步至目标数据库服务器的过程中,客户端的用户在使用客户端的过程中依旧读取源数据库服务器中的源数据库,直至源数据库服务器确认源数据库同步完成后,客户端的用 户才开始使用目标数据库服务器中的数据库,即再将物理机中的数据库同步至云端的数据库服务器的过程中,客户端的用户仍然使用物理机中的源数据库,直至物理机中的源数据库已经完全同步至云端上的服务器,客户端的用户才开始访问云端上的服务器中的数据库,因此在将源数据库中的源数据同步至目标数据库服务器的过程中,客户端的用户可以正常使用客户端,即将源数据库中的源数据同步至目标数据库服务器的过程不会对用户的使用产生影响。
需要进一步说明的是,客户端的用户在输入第一域名时,在修改DNS服务器中与第一域名已经绑定的地址信息之后,用户得到的响应是与修改DNS服务器中与第一域名已经绑定的地址信息之前相同的响应结果,因此修改DNS服务器中与第一域名已经绑定的地址信息也不会对客户端的用户的使用产生影响。
由此,本申请提供的上述实施例三的方案解决了现有技术中将应用迁移至云上的过程中会导致客户端停止使用的技术问题。
实施例4
本发明的实施例可以提供一种计算机终端,该计算机终端可以是计算机终端群中的任意一个计算机终端设备。可选地,在本实施例中,上述计算机终端也可以替换为移动终端等终端设备。
可选地,在本实施例中,上述计算机终端可以位于计算机网络的多个网络设备中的至少一个网络设备。
在本实施例中,上述计算机终端可以执行物理机数据迁移至云端的方法中以下步骤的程序代码:将源数据库服务器中的源数据库同步至目标数据库服务器,其中,源数据库服务器为物理机,目标数据库服务器为部署在云端上的服务器;在源数据库服务器确认源数据库同步完成之后,将第一应用服务器访问的数据库服务器由源数据库服务器切换为目标数据库服务器,其中,第一应用服务器为当前客户端用户用于访问源数据库的物 理机;通过修改DNS服务器中与第一域名已经绑定的地址信息,将客户端用户通过第一域名访问的应用服务器由第一应用服务器更换为第二应用服务器,其中,第二应用服务器为部署在云端上的应用服务器;在成功建立第二应用服务器与目标数据库的访问链路之后,客户端用户通过第二应用服务器来访问目标数据库中同步得到的源数据库。
可选地,图17是根据本发明实施例的一种计算机终端的结构框图。如图17所示,该计算机终端A可以包括:一个或多个(图中仅示出一个)处理器171、存储器173、传输装置175以及服务器177。
其中,存储器可用于存储软件程序以及模块,如本发明实施例中的物理机数据迁移至云端的方法和装置对应的程序指令/模块,处理器通过运行存储在存储器内的软件程序以及模块,从而执行各种功能应用以及数据处理,即实现上述的物理机数据迁移至云端的方法。存储器可包括高速随机存储器,还可以包括非易失性存储器,如一个或者多个磁性存储装置、闪存、或者其他非易失性固态存储器。在一些实例中,存储器可进一步包括相对于处理器远程设置的存储器,这些远程存储器可以通过网络连接至终端A。上述网络的实例包括但不限于互联网、企业内部网、局域网、移动通信网及其组合。
处理器可以通过传输装置调用存储器存储的信息及应用程序,以执行下述步骤:将源数据库服务器中的源数据库同步至目标数据库服务器,其中,源数据库服务器为物理机,目标数据库服务器为部署在云端上的服务器;在源数据库服务器确认源数据库同步完成之后,将第一应用服务器访问的数据库服务器由源数据库服务器切换为目标数据库服务器,其中,第一应用服务器为当前客户端用户用于访问源数据库的物理机;通过修改DNS服务器中与第一域名已经绑定的地址信息,将客户端用户通过第一域名访问的应用服务器由第一应用服务器更换为第二应用服务器,其中,第二应用服务器为部署在云端上的应用服务器;在成功建立第二应用服务器与目标数据库的访问链路之后,客户端用户通过第二应用服务器来访问目标数据库中同步得到的源数据库。
可选的,上述处理器还可以执行如下步骤的程序代码:使用切换脚本将第一应用服务器中存储的与数据库域名绑定的第一IP地址修改为目标数据库服务器的IP地址,其中,第一IP地址为源数据库服务器的IP地址;在切换脚本将源数据库服务器的访问权限设置为只读之后,断开访问源数据库服务器的所有访问链路。
可选的,上述处理器还可以执行如下步骤的程序代码:同步的方式为:全量同步或增量同步,其中,通过如下任意一种方式确认源数据库同步完成:方式一:第一应用服务器实时或定时轮询源数据库服务器,如果检测到源数据库服务器产生的同步结束信息,则确定源数据库同步完成。方式二:源数据库服务器按照预设的同步时长来执行同步源数据库,在第一应用服务器检测到同步时长到达,或者检测到同步时长的延迟时间达到的情况下,确定源数据库同步完成。
可选的,上述处理器还可以执行如下步骤的程序代码:停止源数据库同步,并将目标数据库服务器的访问权限由已经设置的只读权限修改为允许写入权限,使得允许任意一个应用服务器访问目标数据库服务器,其中,在将源数据库同步至目标数据库服务器的同时或之前,将目标数据库服务器的访问权限设置为只读。
可选的,上述处理器还可以执行如下步骤的程序代码:云端启动第二应用服务器来连接目标数据库服务器;提取第二应用服务器的host文件中存储的与数据库域名绑定的第二IP地址;在第二应用服务器中通过验证提取到的第二IP地址,来确定第二应用服务器是否与目标数据库的连接成功;如果验证第二IP地址成功,则确定第二应用服务器连接目标数据库成功。
可选的,上述处理器还可以执行如下步骤的程序代码:在第二应用服务器的访问界面中输入提取到的第二IP地址;在输入第二IP地址之后,如果成功打开目标数据库服务器的数据库页面,则第二应用服务器与目标数据库的访问链路成功建立。
可选的,上述处理器还可以执行如下步骤的程序代码:在预定时间内检测源数据库服务器是否产生流量;如果源数据库服务器在预定时间内没 有产生任何流量,则停止源数据库服务器后台运行的任务。
可选的,上述处理器还可以执行如下步骤的程序代码:如果云端上部署的服务器发生故障时,采用权利要求1中的步骤将云端部署的第二应用服务器和/或目标数据库服务器反向切换至对应的物理机。
可选的,上述处理器还可以执行如下步骤的程序代码:在云下部署多台第一应用服务器,每台第一应用服务器均访问源数据库服务器,在云端部署多台第二应用服务器,第二应用服务器均访问目标数据库服务器。
在本发明实施例中,采用将源数据库服务器中的源数据库同步至目标数据库服务器,在所述源数据库服务器确认所述源数据库同步完成之后,将第一应用服务器访问的数据库服务器由所述源数据库服务器切换为所述目标数据库服务器的方式,通过修改DNS服务器中与第一域名已经绑定的地址信息,达到了将所述客户端用户通过所述第一域名访问的应用服务器由所述第一应用服务器更换为第二应用服务器的目的,从而实现了将应用迁移至云端时应用能够继续被用户使用的技术效果,进而解决了现有技术中将应用迁移至云上的过程中会导致客户端停止使用的技术问题。
本领域普通技术人员可以理解,图17所示的结构仅为示意,计算机终端也可以是智能手机(如Android手机、iOS手机等)、平板电脑、掌上电脑以及移动互联网设备(Mobile Internet Devices,MID)、PAD等终端设备。图17其并不对上述电子装置的结构造成限定。例如,计算机终端A还可包括比图17中所示更多或者更少的组件(如网络接口、显示装置等),或者具有与图17所示不同的配置。
本领域普通技术人员可以理解上述实施例的各种方法中的全部或部分步骤是可以通过程序来指令终端设备相关的硬件来完成,该程序可以存储于一计算机可读存储介质中,存储介质可以包括:闪存盘、只读存储器(Read-Only Memory,ROM)、随机存取器(Random Access Memory,RAM)、磁盘或光盘等。
实施例5
本发明的实施例还提供了一种存储介质。可选地,在本实施例中,上述存储介质可以用于保存上述实施例一所提供的物理机数据迁移至云端方法所执行的程序代码。
可选地,在本实施例中,上述存储介质可以位于计算机网络中计算机终端群中的任意一个计算机终端中,或者位于移动终端群中的任意一个移动终端中。
可选地,在本实施例中,存储介质被设置为存储用于执行以下步骤的程序代码:将源数据库服务器中的源数据库同步至目标数据库服务器,其中,源数据库服务器为物理机,目标数据库服务器为部署在云端上的服务器;在源数据库服务器确认源数据库同步完成之后,将第一应用服务器访问的数据库服务器由源数据库服务器切换为目标数据库服务器,其中,第一应用服务器为当前客户端用户用于访问源数据库的物理机;通过修改DNS服务器中与第一域名已经绑定的地址信息,将客户端用户通过第一域名访问的应用服务器由第一应用服务器更换为第二应用服务器,其中,第二应用服务器为部署在云端上的应用服务器;在成功建立第二应用服务器与目标数据库的访问链路之后,客户端用户通过第二应用服务器来访问目标数据库中同步得到的源数据库。
可选的,上述存储介质还被设置为存储用于执行以下步骤的程序代码:使用切换脚本将第一应用服务器中存储的与数据库域名绑定的第一IP地址修改为目标数据库服务器的IP地址,其中,第一IP地址为源数据库服务器的IP地址;在切换脚本将源数据库服务器的访问权限设置为只读之后,断开访问源数据库服务器的所有访问链路。
可选的,上述存储介质还被设置为存储用于执行以下步骤的程序代码:同步的方式为:全量同步或增量同步,其中,通过如下任意一种方式确认源数据库同步完成:方式一:第一应用服务器实时或定时轮询源数据库服务器,如果检测到源数据库服务器产生的同步结束信息,则确定源数据库同步完成。方式二:源数据库服务器按照预设的同步时长来执行同步源数 据库,在第一应用服务器检测到同步时长到达,或者检测到同步时长的延迟时间达到的情况下,确定源数据库同步完成。
可选的,上述存储介质还被设置为存储用于执行以下步骤的程序代码:停止源数据库同步,并将目标数据库服务器的访问权限由已经设置的只读权限修改为允许写入权限,使得允许任意一个应用服务器访问目标数据库服务器,其中,在将源数据库同步至目标数据库服务器的同时或之前,将目标数据库服务器的访问权限设置为只读。
可选的,上述存储介质还被设置为存储用于执行以下步骤的程序代码:云端启动第二应用服务器来连接目标数据库服务器;提取第二应用服务器的host文件中存储的与数据库域名绑定的第二IP地址;在第二应用服务器中通过验证提取到的第二IP地址,来确定第二应用服务器是否与目标数据库的连接成功;如果验证第二IP地址成功,则确定第二应用服务器连接目标数据库成功。
可选的,上述存储介质还被设置为存储用于执行以下步骤的程序代码:在第二应用服务器的访问界面中输入提取到的第二IP地址;在输入第二IP地址之后,如果成功打开目标数据库服务器的数据库页面,则第二应用服务器与目标数据库的访问链路成功建立。
可选的,上述存储介质还被设置为存储用于执行以下步骤的程序代码:在预定时间内检测源数据库服务器是否产生流量;如果源数据库服务器在预定时间内没有产生任何流量,则停止源数据库服务器后台运行的任务。
可选的,上述存储介质还被设置为存储用于执行以下步骤的程序代码:如果云端上部署的服务器发生故障时,采用权利要求1中的步骤将云端部署的第二应用服务器和/或目标数据库服务器反向切换至对应的物理机。
可选的,上述存储介质还被设置为存储用于执行以下步骤的程序代码:在云下部署多台第一应用服务器,每台第一应用服务器均访问源数据库服务器,在云端部署多台第二应用服务器,第二应用服务器均访问目标数据库服务器。
上述本发明实施例序号仅仅为了描述,不代表实施例的优劣。
在本发明的上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述的部分,可以参见其他实施例的相关描述。
在本申请所提供的几个实施例中,应该理解到,所揭露的技术内容,可通过其它的方式实现。其中,以上所描述的装置实施例仅仅是示意性的,例如单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,单元或模块的间接耦合或通信连接,可以是电性或其它的形式。
作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。
另外,在本发明各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。
集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可为个人计算机、服务器或者网络设备等)执行本发明各个实施例方法的全部或部分步骤。而前述的存储介质包括:U盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、移动硬盘、磁碟或者光盘等各种可以存储程序代码的介质。
以上仅是本发明的优选实施方式,应当指出,对于本技术领域的普通技术人员来说,在不脱离本发明原理的前提下,还可以做出若干改进和润饰,这些改进和润饰也应视为本发明的保护范围。

Claims (19)

  1. 一种物理机数据迁移至云端的方法,其特征在于,包括:
    将源数据库服务器中的源数据库同步至目标数据库服务器,其中,所述源数据库服务器为物理机,所述目标数据库服务器为部署在云端上的服务器;
    在所述源数据库服务器确认所述源数据库同步完成之后,将第一应用服务器访问的数据库服务器由所述源数据库服务器切换为所述目标数据库服务器,其中,所述第一应用服务器为当前客户端用户用于访问所述源数据库的物理机;
    通过修改DNS服务器中与第一域名已经绑定的地址信息,将所述客户端用户通过所述第一域名访问的应用服务器由所述第一应用服务器更换为第二应用服务器,其中,所述第二应用服务器为部署在所述云端上的应用服务器;
    在成功建立所述第二应用服务器与所述目标数据库的访问链路之后,所述客户端用户通过所述第二应用服务器来访问所述目标数据库中同步得到的所述源数据库。
  2. 根据权利要求1所述的方法,其特征在于,在将源数据库服务器中的源数据库同步至目标数据库服务器的过程中,所述方法还包括:
    使用切换脚本将所述第一应用服务器中存储的与数据库域名绑定的第一IP地址修改为所述目标数据库服务器的IP地址,其中,所述第一IP地址为所述源数据库服务器的IP地址;
    在所述切换脚本将所述源数据库服务器的访问权限设置为只读之后,断开访问所述源数据库服务器的所有访问链路。
  3. 根据权利要求1或2所述的方法,其特征在于,所述同步的方式为:全量同步或增量同步,其中,通过如下任意一种方式确认所述源数据库同步完成:
    方式一:所述第一应用服务器实时或定时轮询所述源数据库服务器,如果检测到所述源数据库服务器产生的同步结束信息,则确定所述源数据库同步完成;
    方式二:所述源数据库服务器按照预设的同步时长来执行同步所述源数据库,在所述第一应用服务器检测到所述同步时长到达,或者检测到所述同步时长的延迟时间达到的情况下,确定所述源数据库同步完成。
  4. 根据权利要求3所述的方法,其特征在于,在确认所述源数据库同步完成之后,所述方法还包括:停止所述源数据库同步,并将所述目标数据库服务器的访问权限由已经设置的只读权限修改为允许写入权限,使得允许任意一个应用服务器访问所述目标数据库服务器,其中,在将所述源数据库同步至所述目标数据库服务器的同时或之前,将所述目标数据库服务器的访问权限设置为只读。
  5. 根据权利要求1所述的方法,其特征在于,在修改DNS服务器中与第一域名已经绑定的地址信息之前,所述方法还包括:
    所述云端启动所述第二应用服务器来连接所述目标数据库服务器;
    提取所述第二应用服务器的host文件中存储的与数据库域名绑定的第二IP地址;
    在所述第二应用服务器中通过验证提取到的所述第二IP地址,来确定所述第二应用服务器是否与所述目标数据库的连接成功;
    如果验证所述第二IP地址成功,则确定所述第二应用服务器连接所述目标数据库成功。
  6. 根据权利要求5所述的方法,其特征在于,在所述第二应用服务器中通过验证提取到的所述第二IP地址,来确定所述第二应用服务器是否与所述目标数据库的连接成功,包括:
    在所述第二应用服务器的访问界面中输入提取到的所述第二IP地址;
    在输入所述第二IP地址之后,如果成功打开所述目标数据库服务器的数据库页面,则所述第二应用服务器与所述目标数据库的访问链路成功建立。
  7. 根据权利要求1所述的方法,其特征在于,在所述客户端用户通过所述第二应用服务器来访问所述目标数据库中同步得到的所述源数据库之后,所述方法还包括:
    在预定时间内检测所述源数据库服务器是否产生流量;
    如果所述源数据库服务器在所述预定时间内没有产生任何流量,则停止所述源数据库服务器后台运行的任务。
  8. 根据权利要求1所述的方法,其特征在于,在所述客户端用户通过所述第二应用服务器来访问所述目标数据库中同步得到的所述源数据库之后,所述方法还包括:
    如果所述云端上部署的服务器发生故障时,采用所述权利要求1中的步骤将所述云端部署的第二应用服务器和/或所述目标数据库服务器反向切换至对应的物理机。
  9. 根据权利要求1所述的方法,其特征在于,在云下部署多台所述第一应用服务器,每台第一应用服务器均访问所述源数据库服务器,在所述云端部署多台所述第二应用服务器,所述第二应用服务器均访问所述目标数据库服务器。
  10. 一种物理机数据迁移至云端的装置,其特征在于,包括:
    同步模块,用于将源数据库服务器中的源数据库同步至目标数据库服务器,其中,所述源数据库服务器为物理机,所述目标数据库服务器为部署在云端上的服务器;
    切换模块,用于在所述源数据库服务器确认所述源数据库同步完成之后,将第一应用服务器访问的数据库服务器由所述源数据库服务器切换为所述目标数据库服务器,其中,所述第一应用服务器为当前客户端用户用于访问所述源数据库的物理机;
    更换模块,用于通过修改DNS服务器中与第一域名已经绑定的地址信息,将所述客户端用户通过所述第一域名访问的应用服务器由所述第一应用服务器更换为第二应用服务器,其中,所述第二应用服务器为部署在所述云端上的应用服务器;
    访问模块,用于在成功建立所述第二应用服务器与所述目标数据库的访问链路之后,所述客户端用户通过所述第二应用服务器来访问所述目标数据库中同步得到的所述源数据库。
  11. 根据权利要求10所述的装置,其特征在于,所述同步模块还包括:
    修改模块,用于使用切换脚本将所述第一应用服务器中存储的与数据库域名绑定的第一IP地址修改为所述目标数据库服务器的IP地址,其中,所述第一IP地址为所述源数据库服务器的IP地址;
    断开模块,用于在所述切换脚本将所述源数据库服务器的访问权限设置为只读之后,断开访问所述源数据库服务器的所有访问链路。
  12. 根据权利要求10或11所述的装置,其特征在于,所述同步的方式为:全量同步或增量同步,其中,通过如下任意一种装置确认所述源数据库同步完成:
    轮询模块,用于所述第一应用服务器实时或定时轮询所述源数据库服务器,如果检测到所述源数据库服务器产生的同步结束信息,则确定所述源数据库同步完成;
    第一检测模块,用于所述源数据库服务器按照预设的同步时长来执行同步所述源数据库,在所述第一应用服务器检测到所述同步时长到达,或者检测到所述同步时长的延迟时间达到的情况下,确定所述源数据库同步完成。
  13. 根据权利要求12所述的装置,其特征在于,所述装置还包括:
    第一停止模块,用于停止所述源数据库同步,并将所述目标数据库服务器的访问权限由已经设置的只读权限修改为允许写入权限,使得允许任意一个应用服务器访问所述目标数据库服务器,其中,在将 所述源数据库同步至所述目标数据库服务器的同时或之前,将所述目标数据库服务器的访问权限设置为只读。
  14. 根据权利要求10所述的装置,其特征在于,所述装置还包括:
    启动模块,用于所述云端启动所述第二应用服务器来连接所述目标数据库服务器;
    提取模块,用于提取所述第二应用服务器的host文件中存储的与数据库域名绑定的第二IP地址;
    第一确定模块,用于在所述第二应用服务器中通过验证提取到的所述第二IP地址,来确定所述第二应用服务器是否与所述目标数据库的连接成功;
    第二确定模块,用于如果验证所述第二IP地址成功,则确定所述第二应用服务器连接所述目标数据库成功。
  15. 根据权利要求14所述的装置,其特征在于,所述第一确定模块包括:
    输入模块,用于在所述第二应用服务器的访问界面中输入提取到的所述第二IP地址;
    建立模块,用于在输入所述第二IP地址之后,如果成功打开所述目标数据库服务器的数据库页面,则所述第二应用服务器与所述目标数据库的访问链路成功建立。
  16. 根据权利要求10所述的装置,其特征在于,所述装置还包括:
    第二检测模块,用于在预定时间内检测所述源数据库服务器是否产生流量;
    第二停止模块,用于如果所述源数据库服务器在所述预定时间内没有产生任何流量,则停止所述源数据库服务器后台运行的任务。
  17. 根据权利要求10所述的装置,其特征在于,所述装置还包括:
    反向切换模块,用于如果所述云端上部署的服务器发生故障时,
    采用所述权利要求10中的装置将所述云端部署的第二应用服务器和/或所述目标数据库服务器反向切换至对应的物理机。
  18. 根据权利要求10所述的装置,其特征在于,在云下部署多台所述第一应用服务器,每台第一应用服务器均访问所述源数据库服务器,在所述云端部署多台所述第二应用服务器,所述第二应用服务器均访问所述目标数据库服务器。
  19. 一种物理机数据迁移至云端的系统,其特征在于,包括:
    源数据库服务器,用于提供源数据库,其中,所述源数据库服务器为物理机;
    目标数据库服务器,与所述源数据库服务器建立通讯关系,用于接收所述源数据库服务器同步的所述源数据库,其中,所述目标数据库服务器为部署在云端上的服务器;
    第一应用服务器,在所述源数据库服务器确认所述源数据库同步完成之后,与所述目标数据库服务器通信,用于将当前访问的数据库服务器由所述源数据库服务器切换为所述目标数据库服务器,其中,所述第一应用服务器为当前客户端用户用于访问所述源数据库的物理机;
    DNS服务器,与所述第一应用服务器和第二应用服务器通信,用于修改与第一域名将已经绑定的地址信息;
    所述第二应用服务器,与所述目标数据库建立访问链路,用于所述客户端用户读取所述DNS服务器已经修改后的通过所述第一域名访问的所述第二应用服务器,使得所述客户端用户通过所述第二应用服务器访问所述目标数据库中同步得到的所述源数据库,其中,所述第二应用服务器为部署在所述云端上的应用服务器。
PCT/CN2017/071386 2016-01-26 2017-01-17 物理机数据迁移至云端的方法、装置和系统 WO2017128992A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201610053119.4 2016-01-26
CN201610053119.4A CN106997306B (zh) 2016-01-26 2016-01-26 物理机数据迁移至云端的方法、装置和系统

Publications (1)

Publication Number Publication Date
WO2017128992A1 true WO2017128992A1 (zh) 2017-08-03

Family

ID=59397372

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/071386 WO2017128992A1 (zh) 2016-01-26 2017-01-17 物理机数据迁移至云端的方法、装置和系统

Country Status (3)

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

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108900572A (zh) * 2018-05-31 2018-11-27 康键信息技术(深圳)有限公司 主数据库域名切换控制方法、计算机设备和存储介质
CN110545301A (zh) * 2018-05-29 2019-12-06 视联动力信息技术股份有限公司 监控资源同步方法和装置
CN112235304A (zh) * 2020-10-15 2021-01-15 唐琪林 一种工业互联网的动态安全防护方法和系统
CN113779000A (zh) * 2021-11-15 2021-12-10 北京金堤科技有限公司 数据库更新方法和系统、以及存储介质和电子设备
CN114615270A (zh) * 2020-12-09 2022-06-10 维沃移动通信有限公司 边缘应用服务器迁移、dns缓存刷新或清空方法及装置
CN116436836A (zh) * 2023-06-13 2023-07-14 阿里巴巴(中国)有限公司 域名数据同步检测方法、装置及设备

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107391758B (zh) * 2017-08-24 2020-08-04 阿里巴巴集团控股有限公司 数据库切换方法、装置及设备
CN110309120B (zh) * 2018-03-06 2023-04-07 阿里云计算有限公司 数据处理方法和数据处理装置
CN110049010B (zh) * 2019-03-12 2022-03-08 广州市保伦电子有限公司 一种分布式平台终端设备连接服务器的方法及系统
TWI751414B (zh) * 2019-05-10 2022-01-01 新加坡商核智科技私人有限公司 雲端資料庫之管理系統及其方法
CN117931423A (zh) * 2020-08-17 2024-04-26 支付宝(杭州)信息技术有限公司 任务处理、风险识别任务处理方法、装置及电子设备
CN112286904A (zh) * 2020-09-30 2021-01-29 北京大米科技有限公司 集群迁移方法、装置及存储介质
US11733902B2 (en) * 2021-04-30 2023-08-22 International Business Machines Corporation Integrating and increasing performance of disaggregated memory in operating systems

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120173689A1 (en) * 2011-01-04 2012-07-05 Alcatel-Lucent Usa Inc. Method And System For Migration of Managed Devices
CN103530290A (zh) * 2012-07-03 2014-01-22 深圳市腾讯计算机系统有限公司 数据库间的数据迁移方法和系统
CN103581213A (zh) * 2012-07-19 2014-02-12 阿里巴巴集团控股有限公司 一种共享Hosts文件的应用方法、设备和系统
CN103605561A (zh) * 2013-11-28 2014-02-26 中标软件有限公司 一种云计算集群系统及其在线迁移物理服务器的方法

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101859263B (zh) * 2010-06-12 2012-07-25 中国人民解放军国防科学技术大学 一种支持在线迁移的虚拟机间快速通信方法
CN102521038B (zh) * 2011-12-06 2014-04-09 北京航空航天大学 基于分布式文件系统的虚拟机迁移方法和装置
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

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120173689A1 (en) * 2011-01-04 2012-07-05 Alcatel-Lucent Usa Inc. Method And System For Migration of Managed Devices
CN103530290A (zh) * 2012-07-03 2014-01-22 深圳市腾讯计算机系统有限公司 数据库间的数据迁移方法和系统
CN103581213A (zh) * 2012-07-19 2014-02-12 阿里巴巴集团控股有限公司 一种共享Hosts文件的应用方法、设备和系统
CN103605561A (zh) * 2013-11-28 2014-02-26 中标软件有限公司 一种云计算集群系统及其在线迁移物理服务器的方法

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110545301A (zh) * 2018-05-29 2019-12-06 视联动力信息技术股份有限公司 监控资源同步方法和装置
CN108900572A (zh) * 2018-05-31 2018-11-27 康键信息技术(深圳)有限公司 主数据库域名切换控制方法、计算机设备和存储介质
CN108900572B (zh) * 2018-05-31 2022-08-09 康键信息技术(深圳)有限公司 主数据库域名切换控制方法、计算机设备和存储介质
CN112235304A (zh) * 2020-10-15 2021-01-15 唐琪林 一种工业互联网的动态安全防护方法和系统
CN114615270A (zh) * 2020-12-09 2022-06-10 维沃移动通信有限公司 边缘应用服务器迁移、dns缓存刷新或清空方法及装置
CN113779000A (zh) * 2021-11-15 2021-12-10 北京金堤科技有限公司 数据库更新方法和系统、以及存储介质和电子设备
CN116436836A (zh) * 2023-06-13 2023-07-14 阿里巴巴(中国)有限公司 域名数据同步检测方法、装置及设备
CN116436836B (zh) * 2023-06-13 2023-09-01 阿里巴巴(中国)有限公司 域名数据同步检测方法、装置及设备

Also Published As

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

Similar Documents

Publication Publication Date Title
WO2017128992A1 (zh) 物理机数据迁移至云端的方法、装置和系统
US10530742B2 (en) Managed directory service
JP5945031B2 (ja) 複製されたデータインスタンスのプロビジョニングおよび管理
KR101868489B1 (ko) 컴퓨팅 세션의 관리
CN106406986B (zh) 一种资源共享方法及装置
KR101840222B1 (ko) 컴퓨팅 세션의 관리
US10581858B2 (en) Network attached storage (NAS) apparatus having reversible privacy settings for logical storage area shares, and methods of configuring same
TWI734744B (zh) 路由表的同步方法、裝置及系統
KR20160048763A (ko) 컴퓨팅 세션의 관리
JP2018521405A (ja) アクセス方法及び装置
CN109413649A (zh) 一种接入认证方法及装置
CN105094897A (zh) 一种虚拟机启动方法、云接入设备及云计算中心
CN103942121A (zh) 一种数据还原系统及移动终端
US11743258B2 (en) Access authenticating
CN105205100A (zh) 终端之间基于mtp的数据同步方法及终端
CN116204494B (zh) 活动目录数据迁移的方法和装置、电子设备和存储介质
CN112434321A (zh) 一种数据存储方法、装置、计算机设备及存储介质
CN106878252B (zh) 建立免密登录关系的方法、清除账号的方法及其装置
CN110046510B (zh) 跨云的数据迁移方法、装置和系统
CN105141418A (zh) 认证鉴权方法及系统
CN110309120B (zh) 数据处理方法和数据处理装置
CN111224881A (zh) 一种路由方法、系统、设备及计算机可读存储介质
CN113886217A (zh) 云数据库服务的灰度验证方法、设备、系统及存储介质
CN107968794A (zh) 一种虚拟光驱挂载方法及系统、服务器、终端
CN111935029A (zh) 网关负载均衡方法和装置、存储介质及电子设备

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 17743607

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 17743607

Country of ref document: EP

Kind code of ref document: A1