WO2016101718A1 - 数据补全方法和装置 - Google Patents

数据补全方法和装置 Download PDF

Info

Publication number
WO2016101718A1
WO2016101718A1 PCT/CN2015/094153 CN2015094153W WO2016101718A1 WO 2016101718 A1 WO2016101718 A1 WO 2016101718A1 CN 2015094153 W CN2015094153 W CN 2015094153W WO 2016101718 A1 WO2016101718 A1 WO 2016101718A1
Authority
WO
WIPO (PCT)
Prior art keywords
database
slave
data
new primary
new
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Ceased
Application number
PCT/CN2015/094153
Other languages
English (en)
French (fr)
Inventor
杨挺
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Qihoo Technology Co Ltd
Qizhi Software Beijing Co Ltd
Original Assignee
Beijing Qihoo Technology Co Ltd
Qizhi Software Beijing Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Qihoo Technology Co Ltd, Qizhi Software Beijing Co Ltd filed Critical Beijing Qihoo Technology Co Ltd
Priority to US15/539,966 priority Critical patent/US10045397B2/en
Publication of WO2016101718A1 publication Critical patent/WO2016101718A1/zh
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W84/00Network topologies
    • H04W84/18Self-organising networks, e.g. ad-hoc networks or sensor networks
    • H04W84/20Leader-follower arrangements
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • G06F16/275Synchronous replication
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/25Integrating or interfacing systems involving database management systems
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor

Definitions

  • the present invention relates to the field of computers, and in particular, to a data complementing method and apparatus.
  • relational databases are widely used, such as MYSQL databases.
  • a master-slave architecture is used in relational database clusters.
  • Figure 1 it is a schematic diagram of a MYSQL database cluster, which includes: a master database (master) and three slave databases, and three slave databases are:
  • Slave-1 and Slave-2 are located in the machine room 1
  • Slave-3 is located in the machine room 2.
  • the primary database master is connected to the slave databases Slave-1, Slave-2 and Slave-3, respectively.
  • the master database master may be down for various reasons, in order to reduce the impact of the database on the business, then you need to choose a slave database as the new master database to replace the original master database.
  • the latest data in the current database cluster needs to be saved in the primary database, so the data in the new primary database needs to be completed.
  • the present invention has been made in order to provide a data complementing method and corresponding apparatus that overcomes the above problems or at least partially solves or alleviates the above problems.
  • a data completion method is provided, which is applied to a primary database switch in a master-slave database cluster, the method comprising:
  • a data completion method for application to a primary database switch in a master-slave database cluster, the method comprising:
  • a data completion apparatus for switching to a primary database in a master-slave database cluster, the apparatus comprising:
  • a first main library selection module adapted to select a slave database from the database cluster as a new primary database
  • a first connection establishing module configured to sequentially establish a first connection between the new primary database and all other secondary databases
  • a first synchronization module adapted to separately compare the new primary database with all other data from the database to synchronize all other new data from the database to the new primary database
  • the first completion confirmation module is adapted to end the data completion of the new primary database when the data comparison and synchronization of all of the other secondary databases is completed.
  • a data completion apparatus for switching to a primary database in a master-slave database cluster, the apparatus comprising:
  • a second main library selection module adapted to select a slave database from the database cluster as a new primary database
  • a third connection establishing module configured to establish a first connection between the new primary database and a further secondary database
  • a third synchronization module adapted to compare the new primary database with the data of the other secondary databases to synchronize the new data from the database to the new primary database
  • a second completion confirmation module configured to repeat the operations performed by the third connection establishment module and the third synchronization module until the new primary database completes data comparison and synchronization with all other secondary databases
  • a fourth connection establishing module is adapted to establish a second connection between the new primary database and all other secondary databases to synchronize data of the new primary database to all other secondary databases.
  • a computer program comprising computer readable code, when said computer readable code is run on a computing device, causing said computing device to perform any of the above A method of data completion.
  • the embodiment of the invention provides a data completion method and device.
  • a slave database is selected from the database cluster as a new primary database, and a new master is sequentially established.
  • the database is compared with all other first connections from the database, and the new primary database is compared with all other data from the database to synchronize all other new data from the database to the new primary database to complete
  • the data of the new primary database is completed, so that the new primary database has the latest data in the database cluster, ensuring the smooth switching of the primary database, so as not to affect the normal operation of the database.
  • FIG. 1 is a schematic diagram showing the architecture of an existing MYSQL database cluster
  • FIG. 2 is a schematic flow chart showing a data completion method according to an embodiment of the present invention
  • FIG. 3 is a schematic flowchart diagram of a data completion method in a master database switching in a MYSQL database cluster according to an embodiment of the present invention
  • FIG. 4 is a schematic flow chart showing a method for selecting a new primary database of a MYSQL database cluster according to an embodiment of the present invention
  • FIG. 5 is a schematic diagram showing the architecture of a MYSQL database cluster after selecting a new primary database according to an embodiment of the present invention
  • FIG. 6 is a schematic flow chart of a data completion method according to an embodiment of the present invention.
  • FIG. 7 is a schematic flow chart of a data completion method in a MYSQL database primary database switching according to an embodiment of the present invention.
  • FIG. 8 is a schematic structural diagram of a data completion device according to an embodiment of the present invention.
  • FIG. 9 is a schematic structural diagram of a data completion device according to an embodiment of the present invention.
  • Figure 10 is a block diagram schematically showing a computing device for performing a data completion method in accordance with the present invention.
  • Figure 11 is a schematic illustration of a method for maintaining or carrying out a data completion method in accordance with the present invention.
  • the storage unit of the program code The storage unit of the program code.
  • the embodiment of the invention provides a data completion method, which can implement data completion on a new primary database during the switching process of the primary database of the database cluster, and ensure normal operation of the database cluster.
  • the data completion method provided in the first embodiment is to first establish a new primary database connection with all other secondary databases, and then perform data comparison and synchronization with the secondary database.
  • FIG. 2 is a schematic flowchart of a data completion method according to the embodiment. The method is applied to a primary database switch in a master-slave database cluster, and specifically includes steps S202 to S208.
  • the embodiment of the invention provides a data completion method.
  • a slave database is selected from the database cluster as a new primary database, and a new primary database is sequentially established. All other first connections from the database, the new primary database is compared with all other data from the database, respectively, to synchronize all other new data from the database to the new primary database to complete the new.
  • the data completion of the primary database enables the new primary database to have the latest data in the database cluster, ensuring smooth switching of the primary database, thereby not affecting the normal operation of the database.
  • This embodiment is a specific application scenario of the foregoing first embodiment. Through the embodiment, the method provided by the present invention can be more clearly and specifically illustrated.
  • connection control device is not limited to being implemented by a server, and those skilled in the art may implement the connection control device in other manners on the basis of reading the present invention, which are all included in the scope of the present invention. .
  • the MYSQL database cluster shown in FIG. 1 of the background art is taken as an example, and the current number is used.
  • the data completion of the Slave-1 is taken as an example.
  • the present embodiment is described by taking a complete primary database switching process as an example.
  • FIG. 3 is a schematic flowchart of a method for data completion in a primary database switching in a MYSQL database cluster according to an embodiment of the present invention. The method includes steps S301 to S304.
  • step S301 is executed to select a new primary database when the primary database of the MYSQL database fails to provide services due to downtime.
  • the selection and switching of the new primary database for performing the MYSQL database may include various methods. In the present invention, it is not limited to which method is used to select and switch the new primary database of the MYSQL database.
  • the new primary database can be in the MYSQL database cluster or in other MYSQL database clusters. If the new primary database is in the current MYSQL database cluster, the amount of data that needs to be completed is small. If it is in other MYSQL database clusters, there may be more data to be completed. But when the amount of data is not large, the difference is not obvious.
  • FIG. 4 is a schematic flowchart of a method for selecting a new primary database of a MYSQL database cluster, and adopts a new primary database in the MYSQL database cluster. The way, including the following steps:
  • Step S301-1 obtaining a list of all the slave databases of the MYSQL database cluster.
  • Figure 1 is from the database:
  • step S301-2 a slave database is selected from the database recorded in the above list as a new master database.
  • the gtid information is enabled in both the primary database and the secondary database, which is the primary condition for the database cluster to perform primary database switching.
  • the secondary database which is the primary condition for the database cluster to perform primary database switching.
  • the status of the slave database is the alive state, and the number of delayed transactions is less than the preset number.
  • the screening process for a slave database may generally include the following three steps: A, B, and C:
  • step B judging whether the current slave database is in the alive state, and if so, proceeding to the screening of step B. If not, the slave database does not meet the condition as the new master database, and continues to judge the next slave database.
  • the method for determining whether the current slave database is in the alive state may be:
  • the ping operation is performed from the database, it is determined whether the corresponding delay time exceeds the preset time (for example, may be 0.5 ms). If not, it is determined to be the alive state, and if so, it is determined that it is not the alive state.
  • the preset time for example, may be 0.5 ms
  • step B judging whether the current gtid and binlog information of the slave database is enabled, and if yes, proceeding to the screening of step C. If not, the slave database does not meet the condition of being the new master database, and continues to judge the next slave database.
  • gtid is created when the transaction on the original primary database master is submitted. Since gtid needs to be unique in the global primary-standby topology, gtid can easily improve some complex replication topologies during automatic switching.
  • the new primary database for example, by pointing to a specific gtid to determine the new standby replication coordinates.
  • the gtid is generally composed of two parts:
  • the source_id is used to indicate the source server, which is represented by server_uuid. This value is generated on the first startup and written to the configuration file data/auto.cnf of the MYSQL database.
  • the transaction_id is determined based on the first commit transaction on the source server.
  • the gtid is recorded in the binlog of the MYSQL database.
  • the type of event it can represent in the binlog can be:
  • GTID_LOG_EVENT GTID used to represent subsequent transactions
  • ANONYMOUS_GTID_LOG_EVENT Anonymous GTID event type
  • PREVIOUS_GTIDS_LOG_EVENT used to represent the gtid collection that has been executed before the current binlog file.
  • the preset number can be 100.
  • the determination is not necessarily performed in the order of steps A, B, and C, and the determination may be performed in any order.
  • selecting a new primary database it is not limited to include the above three steps A, B, and C, and only one or two of them may be included, and related technical solutions are all included in the scope of the present invention.
  • FIG. 5 is a schematic diagram of the architecture of the MYSQL database cluster after selecting a new primary database.
  • step S302 is performed to establish a new primary database with all other secondary databases in it.
  • the new primary database needs to be first established with all other secondary databases in turn.
  • the order in which the connection is established is not limited, and the connection may be established in order from the database, or the connection may be established in any order, as long as all the slave databases are connected to the new master database.
  • the first connection is a master-slave connection
  • the other slave database is a master-slave relationship with the new master database.
  • the relationship between Slave-1 and Slave-2 and Slave-3 is dominant and slave.
  • connection between the new primary database Slave-1 and the slave database Slave-2 is first described as an example.
  • step S303 is performed to compare the data of the new primary database with the data of all other secondary databases to synchronize other new data from the database to the new primary database.
  • the data of the primary database and the multiple secondary databases should be consistent, so if the Slave-1 is switched to the new primary database, it needs to ensure that it has the entire MYSQL database. The latest data in, therefore, the data in Slave-1 needs to be The data from the database is compared one by one.
  • the new data in the database can be synchronized to the new master database by one-to-one comparison form if one of the new data exists from the database.
  • the method may further include: each time the comparison of one of the slave databases and the synchronization of the new data is completed, the method may further include:
  • the first connection between the new primary library and all the secondary storages may be established one by one, and then the data synchronization may be completed one by one, and then all the first connections are disconnected. It should be understood by those skilled in the art that the present invention does not limit the establishment, disconnection, and order of data comparison as long as the data comparison and completion can be completed, and related technical solutions are all included in the scope of the present invention.
  • step S304 may be performed to switch the primary database of the MYSQL database cluster to the new primary database.
  • the switch to the primary database can be completed by modifying the configuration file of the MYSQL database.
  • the method may further include:
  • the method may further include:
  • a second connection between the new primary database and all other secondary databases is in turn, and the data in the new primary database is synchronized to all other secondary databases.
  • the second connection is also a master-slave connection, and in the second connection, the new primary database and the other secondary databases respectively have a master and slave status.
  • the embodiment of the present invention provides a data completion method for switching a primary database in a MYSQL database cluster.
  • a slave database is selected from the MYSQL database cluster as a new primary database.
  • a new primary database is established with all other secondary databases from the database, and the new primary database is compared with all other data from the database to synchronize all other new data from the database to the new master.
  • the database to complete the data completion of the new primary database, so that the new primary database has the latest data in the MYSQL database cluster, to ensure the smooth switching of the primary database, so as not to affect the normal operation of the MYSQL database business.
  • the embodiment of the invention provides a data completion method, which can implement data completion on a new primary database during the switching process of the primary database of the database cluster, and ensure normal operation of the database cluster.
  • the data completion method provided in the third embodiment adopts a method of sequentially establishing a new primary database and other connections from the database, and sequentially comparing and synchronizing with other databases.
  • FIG. 6 is a schematic flowchart of a data completion method according to the embodiment. The method is applied to a primary database switch in a master-slave database cluster, and specifically includes steps S602 to S610.
  • S602 Select a slave database from the database cluster as a new primary database.
  • S604 Establish a new primary database and a first connection from the database.
  • S606 Compare the new primary database with the other data from the database to synchronize the new data from the database to the new primary database.
  • Steps S604 and S606 are repeated until the new primary database completes data comparison and synchronization with all other secondary databases.
  • S610 Establish a second connection between the new primary database and all other secondary databases to synchronize the data of the new primary database to all other secondary databases.
  • the embodiment of the invention provides a data completion method.
  • a slave database is selected from the database cluster as a new primary database, and a new primary database is established.
  • the other first connection from the database, the new primary database is compared with the other data from the database to synchronize the new data from the database to the new primary database, and the first connection and the data are repeated.
  • the steps of synchronization until the new primary database and all other secondary databases complete the data comparison and synchronization, establish a second connection between the new primary database and all other secondary databases, to synchronize the data of the new primary database to all Other slave databases can complete the data completion of the new primary database, so that the new primary database has the latest data in the database cluster, ensuring the smooth switching of the primary database, and also updating all the data from the database to the latest data. Therefore, it will not affect the normal operation of the database business.
  • This embodiment is a specific application scenario of the foregoing embodiment 3.
  • the method provided by the present invention can be more clearly and specifically illustrated by the embodiment.
  • connection control device is not limited to being implemented by a server, and those skilled in the art may implement the connection control device in other manners on the basis of reading the present invention, which are all included in the scope of the present invention. .
  • the MYSQL database cluster shown in FIG. 1 in the background art is taken as an example, and the current number is used.
  • the data completion of the Slave-1 is taken as an example.
  • the present embodiment is described by taking a complete primary database switching process as an example.
  • FIG. 7 is a schematic flowchart of a data completion method for switching a primary database of a MYSQL database according to an embodiment of the present invention, where the method includes steps S701 to S708.
  • step S701 is executed to select a new primary database when the primary database of the MYSQL database cluster cannot provide services.
  • the method for selecting a new main library is similar to the method in step S301 of the second embodiment, and details are not described herein again.
  • step S702 is performed to establish a first connection between the new primary database and one of the secondary databases.
  • the method provided in this embodiment is: in the process of performing data completion on the new primary database, the new primary database is sequentially connected with all other secondary databases.
  • the comparison and synchronization are sequentially performed, and after the comparison and synchronization to a slave database is completed, the first connection is disconnected, and the next slave database is established.
  • the order in which the connection is established is not limited, and the connection may be established in order from the database, or the connection may be established in any order, as long as all the slave databases are circulated once.
  • the first connection is a master-slave connection
  • the other slave database is a master-slave relationship with the new master database.
  • the relationship between Slave-1 and Slave-2 and Slave-3 is dominant and slave.
  • connection between the new primary database Slave-1 and the slave database Slave-2 is first described as an example.
  • step S703 is performed to compare the data of the new primary database with the data in the secondary database. If there is no new data from the database, return to step S702 to establish a first connection with the next secondary database; If there is new data in the slave database, step S704 is performed.
  • the data of the primary database and the multiple secondary databases should be consistent, so if the Slave-1 is switched to the new primary database, it needs to ensure that it has the entire MYSQL database. The latest data in it, therefore, the data in Slave-1 needs to be compared with all other data from the database.
  • step S704 the new data from the database is synchronized to the new primary database.
  • step S705 is executed to disconnect the first connection between the new primary database and the secondary database.
  • step S706 is executed to determine whether the comparison and synchronization of all the slave databases are completed. If yes, step S707 is performed, and if not, return to step S702 to establish a connection with the next slave database.
  • step S707 can be performed to sequentially create a new primary number.
  • the data in the new primary database is synchronized to all other secondary databases by the second connection between the library and all other slave databases.
  • the second connection is also a master-slave connection, and in the second connection, the new primary database and the other secondary databases respectively have a master and slave status.
  • step S708 is executed to switch the primary database of the MYSQL database to the new primary database.
  • the switch to the primary database can be completed by modifying the configuration file of the MYSQL database.
  • the method may further include:
  • the embodiment of the invention provides a data completion method.
  • a slave database is selected from the database cluster as a new primary database, and a new primary database is established.
  • the other first connection from the database, the new primary database is compared with the other data from the database to synchronize the new data from the database to the new primary database, and the first connection and the data are repeated.
  • the steps of synchronization until the new primary database and all other secondary databases complete the data comparison and synchronization, establish a second connection between the new primary database and all other secondary databases, to synchronize the data of the new primary database to all Other slave databases can complete the data completion of the new primary database, so that the new primary database has the latest data in the database cluster, ensuring the smooth switching of the primary database, and also updating all the data from the database to the latest data. Therefore, it will not affect the normal operation of the database business.
  • the fifth embodiment preferably provides a data completion device corresponding to the first embodiment and the second embodiment.
  • FIG. 8 is a structural block diagram of a data completion device according to an embodiment of the present invention, which is applied to a primary database switch in a master-slave database cluster, and the apparatus 800 includes:
  • the first main library selection module 810 is adapted to select a slave database from the database cluster as a new primary database
  • the first connection establishing module 820 is coupled to the first main library selecting module 810, and is adapted to sequentially establish a new primary database and all other first connections from the database;
  • the first synchronization module 830 is coupled to the first connection establishment module 820 and is adapted to separately compare the new primary database with all other data from the database to synchronize all other new data from the database to the new primary.
  • the database In the database;
  • the first completion confirmation module 840 coupled to the first synchronization module 830, is adapted to end the data completion of the new primary database when the data alignment and synchronization for all other secondary databases is completed.
  • the first main library selection module 810 further includes:
  • the list obtaining unit 811 is adapted to obtain a list of all the slave databases of the database cluster before sequentially establishing a new primary database and all connections from the database;
  • the main library screening unit 812 is coupled to the list obtaining unit 811, and is adapted to filter, in all the slave databases of the list record, a slave database that meets the preset condition as a new master database.
  • the predetermined condition includes at least one of the following:
  • the number of delayed transactions from the database is less than the preset amount.
  • the first connection is a master-slave connection
  • the other slave databases and the new master database respectively have a master and slave status.
  • the first synchronization module 830 is further adapted to:
  • the apparatus 800 further includes:
  • the second connection establishing module 850 is coupled to the first completion confirmation module 840, and is adapted to sequentially establish the new primary database and all other secondary databases after ending the data completion of the new primary database. Second connection;
  • the second synchronization module 860 coupled to the second connection establishment module 850, is adapted to synchronize data of the new primary database to all other secondary databases.
  • the second connection is a master-slave connection
  • the new primary database has a master and slave status with the other secondary databases.
  • the database cluster is a MYSQL database cluster.
  • the embodiment of the invention provides a data completion device.
  • a slave database is selected from the database cluster as a new primary database, and a new primary database is sequentially established. All other first connections from the database, the new primary database is compared with all other data from the database, respectively, to synchronize all other new data from the database to the new primary database to complete the new.
  • the data completion of the primary database enables the new primary database to have the latest data in the database cluster, ensuring smooth switching of the primary database, thereby not affecting the normal operation of the database.
  • the sixth embodiment preferably provides a data completion device corresponding to the third embodiment and the fourth embodiment.
  • FIG. 9 is a structural block diagram of a data completion device according to an embodiment of the present invention, which is applied to a primary database switch in a master-slave database cluster, and the apparatus 900 includes:
  • the second main library selection module 910 is adapted to select a slave database from the database cluster as the new primary database
  • the third connection establishing module 920 is coupled to the second main library selecting module 910, and is adapted to establish a new primary database and a first connection from the other database;
  • the third synchronization module 930 is coupled to the third connection establishing module 920 and is adapted to compare the new primary database with other data from the database to synchronize the new data from the database to the new primary database. ;
  • the second completion confirmation module 940 is coupled to the third synchronization module 930 and is adapted to repeat the operations performed by the third connection establishment module 920 and the third synchronization module 930 until the new primary database completes the data ratio with all other secondary databases. Right and synchronized;
  • a fourth connection establishing module 950 coupled to the second completion confirmation module 940, is adapted to establish a second connection between the new primary database and all other secondary databases to synchronize the data of the new primary database to all other secondary database.
  • the third synchronization module 930 is further adapted to:
  • the first connection is a master-slave connection
  • the other slave databases and the new primary database respectively have a master and slave status.
  • the second connection is a master-slave connection
  • the new primary database and the other secondary databases respectively have a master and slave status.
  • the embodiment of the invention provides a data completion device, in the process of master-slave database cluster performing primary database switching, selecting a slave database as a new master database from the database cluster, and establishing a new master database and a The other first connection from the database, the new primary database is compared with the other data from the database to synchronize the new data from the database to the new primary database, and the first connection and the data are repeated.
  • the steps of synchronization until the new primary database completes the data comparison with all other secondary databases establishing a second connection between the new primary database and all other secondary databases to synchronize the data of the new primary database to all other slaves
  • the database can complete the data completion of the new primary database, so that the new primary database has the latest data in the database cluster, ensuring the smooth switching of the primary database, and also updating all the data from the database to the latest data, thus not Will affect the normal operation of the database business.
  • modules in the devices of the embodiments can be adaptively changed and placed in one or more devices different from the embodiment.
  • the modules or units or components of the embodiments may be combined into one module or unit or component, and further they may be divided into a plurality of sub-modules or sub-units or sub-components.
  • any combination of the features disclosed in the specification, including the accompanying claims, the abstract and the drawings, and any methods so disclosed, or All processes or units of the device are combined.
  • Each feature disclosed in this specification (including the accompanying claims, the abstract and the drawings) may be replaced by alternative features that provide the same, equivalent or similar purpose.
  • the various component embodiments of the present invention may be implemented in hardware, or in a software module running on one or more processors, or in a combination thereof.
  • a microprocessor or digital signal processor may be used in practice to implement some or all of the functionality of some or all of the components of a data completion device in accordance with embodiments of the present invention.
  • the invention can also be implemented as a device or device program (e.g., a computer program and a computer program product) for performing some or all of the methods described herein.
  • a program implementing the invention may be stored on a computer readable medium or may be in the form of one or more signals. Such signals may be downloaded from an Internet website, provided on a carrier signal, or provided in any other form.
  • Figure 10 illustrates a block diagram of a computing device that can implement any of the data completions in accordance with the present invention.
  • the computing device conventionally includes a processor 1010 and a computer program product or computer readable medium in the form of a memory 1020.
  • the memory 1020 may be an electronic memory such as a flash memory, an EEPROM (Electrically Erasable Programmable Read Only Memory), an EPROM, a hard disk, or a ROM.
  • Memory 1020 has a storage space 1030 that stores program code 1031 for performing any of the method steps described above.
  • storage space 1030 storing program code may include separate program code for implementing various steps in the above methods, respectively. 1031.
  • the program code can be read from or written to one or more computer program products.
  • Such computer program products include program code carriers such as hard disks, compact disks (CDs), memory cards or floppy disks.
  • Such a computer program product is typically a portable or fixed storage unit such as that shown in FIG.
  • the storage unit may have storage segments, storage spaces, and the like that are similarly arranged to memory 1020 in the computing device of FIG.
  • the program code can be compressed, for example, in an appropriate form.
  • the storage unit comprises computer readable code 1031' for performing the steps of the method according to the invention, ie code that can be read by, for example, a processor such as 1010, which when executed by the computing device causes the computing device Perform the various steps in the method described above.

Landscapes

  • Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computing Systems (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Multi Processors (AREA)

Abstract

本发明实施例提供了一种数据补全方法和装置,涉及计算机领域。本发明所提供的方法,在主从式的数据库集群进行主数据库切换的过程中,从数据库集群中选择一从数据库以作为新的主数据库,依次建立新的主数据库与所有其他从数据库的第一连接,将新的主数据库与所有其他从数据库的数据分别进行比对,以将所有其他从数据库中的新数据同步到所述新的主数据库中,以完成对新的主数据库的数据补全,使新的主数据库拥有数据库集群中最新的数据,保证主数据库的顺利切换,从而不会影响数据库的业务正常进行。

Description

数据补全方法和装置 技术领域
本发明涉及计算机领域,尤其涉及一种数据补全方法和装置。
背景技术
在目前,关系型数据库的应用非常广泛,例如MYSQL数据库。目前,关系型数据库集群中多采用一主多从的架构。如图1所示,为一MYSQL数据库集群的架构示意图,其包括:主数据库(master)和三个从数据库,三个从数据库分别为:
Slave-1、Slave-2和Slave-3。
例如图1中所示,Slave-1和Slave-2位于机房1,Slave-3位于机房2。主数据库master分别与从数据库Slave-1、Slave-2和Slave-3连接。
在现实对数据库的使用中,主数据库master有可能因为各种原因宕机,为了减少数据库对业务的影响,这时则需要选择一个从数据库作为新的主数据库来代替原来的主数据库。在数据库集群中要求主数据库中需保存有当前数据库集群中最新的数据,因此需要对新的主数据库中的数据进行补全。但是,目前并没有有效的技术手段能在数据库集群的主数据库进行切换时对新的主数据库进行数据补全。
发明内容
鉴于上述问题,提出了本发明以便提供一种克服上述问题或者至少部分地解决或者减缓上述问题的数据补全方法和相应的装置。
依据本发明的一个方面,提供了一种数据补全方法,应用于主从式数据库集群中主数据库切换,所述方法包括:
从所述数据库集群中选择一从数据库以作为新的主数据库;
依次建立所述新的主数据库与所有其他从数据库的第一连接;
将所述新的主数据库与所有其他从数据库的数据分别进行比对,以将所有其他从数据库中的新数据同步到所述新的主数据库中;以及
当完成对所述所有其他从数据库的数据比对及同步时,结束对所述新的主数据库的数据补全。
依据本发明的另一个方面,提供了一种数据补全方法,应用于主从式数据库集群中主数据库切换,所述方法包括:
a)从所述数据库集群中选择一从数据库以作为新的主数据库;
b)建立所述新的主数据库与一其他从数据库的第一连接;
c)将所述新的主数据库与所述其他从数据库的数据进行比对,以将所述其他从数据库中的新数据同步到所述新的主数据库中;
d)重复步骤b)和c),直至所述新的主数据库与所有其他从数据库都完成数据比对及同步以及
e)建立所述新的主数据库与所有其他从数据库之间的第二连接,以将所述新的主数据库的数据同步至所有其他从数据库。
依据本发明的另一个方面,提供了一种数据补全装置,应用于主从式数据库集群中主数据库切换,所述装置包括:
第一主库选取模块,适于从所述数据库集群中选择一从数据库以作为新的主数据库;
第一连接建立模块,适于依次建立所述新的主数据库与所有其他从数据库的第一连接;
第一同步模块,适于将所述新的主数据库与所有其他从数据库的数据分别进行比对,以将所有其他从数据库中的新数据同步到所述新的主数据库中;
第一补全确认模块,适于当完成对所述所有其他从数据库的数据比对及同步时,结束对所述新的主数据库的数据补全。
依据本发明的另一个方面,提供了一种数据补全装置,应用于主从式数据库集群中主数据库切换,所述装置包括:
第二主库选取模块,适于从所述数据库集群中选择一从数据库以作为新的主数据库;
第三连接建立模块,适于建立所述新的主数据库与一其他从数据库的第一连接;
第三同步模块,适于将所述新的主数据库与所述其他从数据库的数据进行比对,以将所述其他从数据库中的新数据同步到所述新的主数据库中;
第二补全确认模块,适于重复第三连接建立模块与所述第三同步模块执行的操作,直至所述新的主数据库与所有其他从数据库都完成数据比对及同步;
第四连接建立模块,适于建立所述新的主数据库与所有其他从数据库之间的第二连接,以将所述新的主数据库的数据同步至所有其他从数据库。
根据本发明的又一个方面,还提供了一种计算机程序,其包括计算机可读代码,当所述计算机可读代码在计算设备上运行时,导致所述计算设备执行上文所述的任意一种数据补全方法。
根据本发明的再一个方面,还提供了一种计算机可读介质,其中存储了上述计算机程序。
本发明的有益效果为:
本发明实施例提供了一种数据补全方法和装置,在主从式的数据库集群进行主数据库切换的过程中,从数据库集群中选择一从数据库以作为新的主数据库,依次建立新的主数据库与所有其他从数据库的第一连接,将新的主数据库与所有其他从数据库的数据分别进行比对,以将所有其他从数据库中的新数据同步到所述新的主数据库中,以完成对新的主数据库的数据补全,使新的主数据库拥有数据库集群中最新的数据,保证主数据库的顺利切换,从而不会影响数据库的业务正常进行。
上述说明仅是本发明技术方案的概述,为了能够更清楚了解本发明的技术手段,而可依照说明书的内容予以实施,并且为了让本发明的上述和其它目的、特征和优点能够更明显易懂,以下特举本发明的具体实施方式。
附图说明
通过阅读下文优选实施方式的详细描述,各种其他的优点和益处对于本领域普通技术人员将变得清楚明了。附图仅用于示出优选实施方式的目的,而并不认为是对本发明的限制。而且在整个附图中,用相同的参考符号表示相同的部件。在附图中:
图1示意性示出了现有的一种MYSQL数据库集群的架构示意图;
图2示意性示出了根据本发明一个实施例的一种数据补全方法流程示意图;
图3示意性示出了根据本发明一个实施例提供的一种MYSQL数据库集群中的主数据库切换时的数据补全方法流程示意图;
图4示意性示出了根据本发明一个实施例提供的一种选取MYSQL数据库集群的新的主数据库的方法流程示意图;
图5示意性示出了根据本发明一个实施例提供的一种选取新的主数据库后的MYSQL数据库集群的架构示意图;
图6示意性示出了根据本发明一个实施例提供的一种数据补全方法流程示意图;
图7示意性示出了根据本发明一个实施例提供的一种MYSQL数据库主数据库切换时的数据补全方法流程示意图;
图8示意性示出了根据本发明一个实施例提供的一种数据补全装置结构示意图;
图9是本发明一个实施例提供的一种数据补全装置结构示意图;
图10示意性示出了用于执行根据本发明的一种数据补全方法的计算设备的框图;以及
图11示意性示出了用于保持或者携带实现根据本发明的一种数据补全方法的 程序代码的存储单元。
具体实施方式
下面结合附图和具体的实施方式对本发明作进一步的描述。
实施例一
本发明实施例提供了一种数据补全方法,其可以实现在数据库集群的主数据库的切换过程中对新的主数据库进行数据补全,保证数据库集群的正常运行。
在本实施例一提供的数据补全方法是首先建立新的主数据库与所有其他从数据库的连接,再与从数据库进行数据比对和同步的方式。
图2是本实施例提供的一种数据补全方法的流程示意图,该方法应用于主从式数据库集群中主数据库切换,具体包括步骤S202至步骤S208。
S202:从数据库集群中选择一从数据库以作为新的主数据库。
S204:依次建立新的主数据库与所有其他从数据库的第一连接。
S206:将新的主数据库与所有其他从数据库的数据分别进行比对,以将所有其他从数据库中的新数据同步到所述新的主数据库中。
S208:当完成对所有其他从数据库的数据比对及同步时,结束对新的主数据库的数据补全。
本发明实施例提供了一种数据补全方法,在主从式的数据库集群进行主数据库切换的过程中,从数据库集群中选择一从数据库以作为新的主数据库,依次建立新的主数据库与所有其他从数据库的第一连接,将新的主数据库与所有其他从数据库的数据分别进行比对,以将所有其他从数据库中的新数据同步到所述新的主数据库中,以完成对新的主数据库的数据补全,使新的主数据库拥有数据库集群中最新的数据,保证主数据库的顺利切换,从而不会影响数据库的业务的正常进行。
实施例二
本实施例为上述实施例一的一种具体应用场景,通过本实施例,能够更加清楚、具体地阐述本发明所提供的方法。
应可理解,本发明并不限定数据库的类型,只要可以应用本发明下述方案以达到高可用目的的数据库都适用于此。此外,所述连接控制装置也不限定于通过服务器来实现,本领域技术人员在阅读本发明的基础上亦可以其他方式来实施所述的连接控制装置,其皆应涵盖在本发明的范围内。
以下,将以MYSQL数据为例说明本发明的技术方案:
在本实施例二中,仍以背景技术中图1所示的MYSQL数据库集群为例,当前数 据库集群的主数据库宕机而无法提供服务,将Slave-1作为新的主数据库进行切换时,对Slave-1进行数据补全为例进行说明。
为了对本发明的思想进行更清楚的说明,本实施例以完整的主数据库切换过程为例进行说明。
如图3所示,为本发明实施例提供的一种MYSQL数据库集群中的主数据库切换时的数据补全方法流程示意图,该方法共包括步骤S301至S304。
首先执行步骤S301,当MYSQL数据库的主数据库因宕机无法提供服务时,选取新的主数据库。
需要说明的是,在MYSQL数据库的主数据库宕机时,会导致整个MYSQL数据库的集群无法完成业务,因此需要选取其中的一个从数据库作为新的主数据库进行切换,以恢复该MYSQL数据库的业务。但是,进行MYSQL数据库的新的主数据库的选取以及切换可以包括多种方法,在本发明中并不限定在使用何种方法进行MYSQL数据库的新的主数据库的选取以及切换。
并且,新的主数据库可以是该MYSQL数据库集群中的,也可以是其他MYSQL数据库集群中的。若新的主数据库是当前MYSQL数据库集群中的,则需要补全的数据量较小,若是其他MYSQL数据库集群中的,则需要补全的数据可能较多。但是当数据量不大时,差别不明显。
为了使得本发明的技术方案更加清楚,本发明实施例还提供了图4,为一种选取MYSQL数据库集群的新的主数据库的方法流程示意图,采取在本MYSQL数据库集群中筛选得到新的主数据库的方式,包括如下步骤:
步骤S301-1,获取MYSQL数据库集群的所有从数据库的列表。
例如图1所示的例子,则从数据库为:
Slave-1、Slave-2和Slave-3。
因此,可以有上述三个从数据库组成MYSQL数据库的所有从数据库的列表,在该列表中可以使用上述三个从数据库的IP地址进行记录,新的主数据库即从该列表中的从数据库中选取。
步骤S301-2,在上述列表所记录的从数据库中筛选一个从数据库以作为新的主数据库。
进一步地,主数据库和从数据库均开启了gtid信息是数据库集群可以进行主数据库切换的首要条件,同时为了使得新的主数据库更加优异,除了开启了gtid信息,进一步的,还可以根据如下几个条件进行筛选:
从数据库的状态为alive状态、延迟事务数量小于预设数量。
在从数据库中进行新的主数据库的筛选时,至少可以包括如下三种方式:
(1)以循环的方式依次对所有的从数据库进行判断,若得到任意一个符合作为新的主数据库的条件的从数据库,即可将该从数据库作为新的主数据库,停止对其他从数据库的判断。
(2)以循环的方式依次对所有的从数据库进行判断,全部判断结束后,在符合新的主数据库的条件的从数据库中选取其中条件最好的一个从数据库作为新的主数据库。
例如,选择延迟时间最小、延迟事务数量最少或符合其它的优选条件的从数据库作为新的主数据库。
(3)以循环的方式依次对所有的从数据库进行判断,全部判断结束后,在符合新的主数据库的条件的从数据库中任意选取一个从数据库作为新的主数据库。
本实施例中,对一个从数据库的筛选过程,通常可以包括如下A、B、C三个步骤:
A)判断当前从数据库是否为alive状态,如果是,则继续进入步骤B的筛选,如果不是,则该从数据库不符合作为新的主数据库的条件,继续对下一个从数据库进行判断。
其中,判断当前从数据库是否为alive状态的方法可以是:
对当前从数据库执行ping操作,判断其返回相应的延迟时间是否超过预设时间(例如可以是0.5ms),如果不是,则判定其为alive状态,如果是,则判断其不是alive状态。
B)判断当前从数据库的gtid、binlog信息是否开启,如果是,则进入步骤C的筛选,如果不是,则该从数据库不符合作为新的主数据库的条件,继续对下一个从数据库进行判断。
其中,gtid在原主数据库master上的事务提交时被创建,由于gtid需要在全局的主-备拓扑结构中保持唯一性,因此通过gtid我们可以在自动切换时对一些复杂的复制拓扑很方便的提升新主数据库,例如通过指向特定的gtid来确定新备库复制坐标。
gtid一般由两部分组成:
gtid=source_id:transaction_id
source_id用于标示源服务器,用server_uuid来表示,这个值在第一次启动时生成,并写入到MYSQL数据库的配置文件data/auto.cnf中;
transaction_id则是根据在源服务器上第几个提交的事务来确定。
一般情况下,gtid被记录在MYSQL数据库的binlog中,它在binlog中表现的事件类型可以是:
GTID_LOG_EVENT:用于表示随后的事务的GTID;
ANONYMOUS_GTID_LOG_EVENT:匿名GTID事件类型;
PREVIOUS_GTIDS_LOG_EVENT:用于表示当前binlog文件之前已经执行过的gtid集合。
它一般被记录在binlog的文件头。
在进行查询时,可以通过执行check_candidate_eligibility函数来查询gtid、binlog等信息并确保其开启。
C)判断当前从数据库延迟的事务数量是否小于预设数量,如果是,则当前从数据库符合新的主数据库的筛选条件,如果不是,则当前从数据库不符合新的主数据库的筛选条件,继续对下一个从数据库进行判断。
其中,若从数据库延迟的事务数量过多,则说明其状况不好,不能用作新的主数据库,以免影响整个MYSQL数据库的运行效率,预设数量可以为100个。
需要说明的是,在进行新的主数据库的选取时,不一定按照步骤A、B、C的顺序进行判断,可以采取任意顺序进行判断。类似地,选取新的主数据库时也不限定一定要包含如上A、B、C三个步骤,也可以仅包含其中一个或者两个,相关技术方案皆应涵盖在本发明的范围内。
在本实施例中,以选取Slave-1为新的主数据库为例,如图5所示为一种选取新的主数据库后的MYSQL数据库集群的架构示意图。
在新的主数据库Slave-1被选定后,执行步骤S302,建立新的主数据库与其中所有其他从数据库的第一连接。
在本实施例中,在对新的主数据库进行数据补全的过程中,需要将新的主数据库依次与其他所有的从数据库建立第一连接。在本发明中,并不对建立连接的顺序进行限定,可以是与从数据库按照顺序建立连接,也可以是按照任意顺序建立连接,只要将所有的从数据库均与新的主数据库建立连接即可。
其中,该第一连接为主从式连接,其他从数据库与新的主数据库为主、从关系。例如在本实施例中,Slave-1与Slave-2、Slave-3的关系为主、从关系。
在本实施例中,以首先建立新的主数据库Slave-1和从数据库Slave-2的连接为例进行说明。
在建立连接后,执行步骤S303,比较新的主数据库的数据与所有其他从数据库中的数据,以将其他从数据库中的新数据同步到新的主数据库中。
需要说明的是,在MYSQL数据库的集群机制中,对于其中的主数据库和多个从数据库的数据应是一致的,因此若Slave-1被切换为新的主数据库,需要确保其具有整个MYSQL数据库中的最新的数据,因此,需要将Slave-1中的数据与其他所有 的从数据库中的数据一一进行比对。
在与从数据库进行数据比对时,可以通过一一比对的形式,若其中一从数据库中存在新数据,将该从数据库中的新的数据同步到新的主数据库中。
进一步地,在每完成对其中一从数据库的比对以及新数据同步时,本方法还可以包括:
断开该从数据库与新的主数据库之间的第一连接。
在另一实施例中,也可以先逐一建立新的主库与所有从库的第一连接,之后再逐一完成数据同步,然后再断开所有第一连接。本领域技术人员应可理解,只要可以完成数据比对和补全,本发明并不限定连接的建立、断开以及数据比对的顺序,相关的技术方案皆应涵盖在本发明的范围内。
完成对于新的主数据库的数据补全后,即可执行步骤S304,将MYSQL数据库集群的主数据库切换到新的主数据库。
其中,对于主数据库的切换,可以通过修改MYSQL数据库的配置文件完成。
进一步地,在完成对于新的主数据库的切换后,还可以包括:
将新的主数据库的更新配置更新到中间层,恢复业务。
进一步地,在完成为了主数据库的切换后,为了保证数据库集群中的所有数据库的数据一致,本方法还可以包括:
依次建立新的主数据库与所有其他从数据库之间的第二连接,将新的主数据库中的数据同步到所有其他从数据库中。
其中,该第二连接也为主从式连接,且在该第二连接中,新的主数据库与其他从数据库分别具有主、从的地位。
本发明实施例提供了一种MYSQL数据库集群中主数据库切换时的数据补全方法,在MYSQL数据库集群的主数据库无法提供服务时,从MYSQL数据库集群中选择一从数据库以作为新的主数据库,依次建立新的主数据库与所有其他从数据库的第一连接,将新的主数据库与所有其他从数据库的数据分别进行比对,以将所有其他从数据库中的新数据同步到所述新的主数据库中,以完成对新的主数据库的数据补全,使新的主数据库拥有MYSQL数据库集群中最新的数据,保证主数据库的顺利切换,从而不会影响MYSQL数据库的业务的正常进行。
实施例三
本发明实施例提供了一种数据补全方法,其可以实现在数据库集群的主数据库的切换过程中对新的主数据库进行数据补全,保证数据库集群的正常运行。
与实施例一、二的区别在于,本实施例三提供的数据补全方法采用的是依次建立新的主数据库与其他从数据库的连接,依次与其他从数据库进行比对和同步的方式。
图6是本实施例提供的一种数据补全方法流程示意图,该方法应用于主从式数据库集群中主数据库切换,具体包括步骤S602至步骤S610。
S602:从数据库集群中选择一从数据库以作为新的主数据库。
S604:建立新的主数据库与一其他从数据库的第一连接。
S606:将新的主数据库与上述其他从数据库的数据进行比对,以将该其他从数据库中的新数据同步到新的主数据库中。
S608:重复步骤S604和S606,直至新的主数据库与所有其他从数据库都完成数据比对及同步。
S610:建立新的主数据库与所有其他从数据库之间的第二连接,以将新的主数据库的数据同步至所有其他从数据库。
本发明实施例提供了一种数据补全方法,在主从式的数据库集群进行主数据库切换的过程中,从数据库集群中选择一从数据库以作为新的主数据库,建立新的主数据库与一其他从数据库的第一连接,将新的主数据库与上述其他从数据库的数据进行比对,以将该其他从数据库中的新数据同步到新的主数据库中,重复上述建立第一连接和数据同步的步骤,直至新的主数据库与所有其他从数据库都完成数据比对及同步,建立新的主数据库与所有其他从数据库之间的第二连接,以将新的主数据库的数据同步至所有其他从数据库,可以完成对新的主数据库的数据补全,使新的主数据库拥有数据库集群中最新的数据,保证主数据库的顺利切换,同时也将所有从数据库中的数据更新为最新数据,从而不会影响数据库的业务的正常进行。
实施例四
本实施例为上述实施例三的一种具体应用场景,通过本实施例,能够更加清楚、具体地阐述本发明所提供的方法。
应可理解,本发明并不限定数据库的类型,只要可以应用本发明下述方案以达到高可用目的的数据库都适用于此。此外,所述连接控制装置也不限定于通过服务器来实现,本领域技术人员在阅读本发明的基础上亦可以其他方式来实施所述的连接控制装置,其皆应涵盖在本发明的范围内。
以下,将以MYSQL数据库为例说明本发明的技术方案:
在本实施例二中,也以背景技术中图1所示的MYSQL数据库集群为例,当前数 据库集群的主数据库宕机而无法提供服务,将Slave-1作为新的主数据库进行切换时,对Slave-1进行数据补全为例进行说明。
为了对本发明的思想进行更清楚的说明,本实施例以完整的主数据库切换过程为例进行说明。
如图7所示,为本发明实施例提供的一种MYSQL数据库主数据库切换时的数据补全方法流程示意图,该方法共包括步骤S701至S708。
首先执行步骤S701,当MYSQL数据库集群的主数据库无法提供服务时,选取新的主数据库。
其中,选取新的主库的方法与实施例二的步骤S301中类似,这里不再赘述。
在新的主数据库Slave-1被选定后,执行步骤S702,建立新的主数据库与其中一个从数据库的第一连接。
与实施例一和实施例二不同的是,本实施例所提供的方法是:在对新的主数据库进行数据补全的过程中,将新的主数据库依次与其他所有的从数据库建立连接、依次进行比对和同步,在完成对一个从数据库的比对和同步后,断开第一连接,与下一个从数据库建立连接。在本发明中,并不对建立连接的顺序进行限定,可以是与从数据库按照顺序建立连接,也可以是按照任意顺序建立连接,只要将所有的从数据库全部循环一遍即可。
其中,该第一连接为主从式连接,其他从数据库与新的主数据库为主、从关系。例如在本实施例中,Slave-1与Slave-2、Slave-3的关系为主、从关系。
在本实施例中,以首先建立新的主数据库Slave-1和从数据库Slave-2的连接为例进行说明。
在建立连接后,执行步骤S703,比较新的主数据库的数据与该从数据库中的数据,若从数据库中的没有新数据,则返回步骤S702,建立与下一从数据库的第一连接;若该从数据库中的存在新的数据,则执行步骤S704。
需要说明的是,在MYSQL数据库的集群机制中,对于其中的主数据库和多个从数据库的数据应是一致的,因此若Slave-1被切换为新的主数据库,需要确保其具有整个MYSQL数据库中的最新的数据,因此,需要将Slave-1中的数据与其他所有的从数据库中的数据一一进行比对。
在步骤S704中,将该从数据库中的新的数据同步到新的主数据库中。
继而执行步骤S705,断开新的主数据库与该从数据库的第一连接。
继而执行步骤S706,判断是否完成了对所有从数据库的比对及同步,如果是,则执行步骤S707,如果不是,则返回步骤S702,建立与下一从数据库的连接。
完成对于新的主数据库的数据补全后,即可执行步骤S707,依次建立新的主数 据库与所有其他从数据库之间的第二连接,将新的主数据库中的数据同步到所有其他从数据库中。
其中,该第二连接也为主从式连接,且在该第二连接中,新的主数据库与其他从数据库分别具有主、从的地位。
继而执行步骤S708,将MYSQL数据库的主数据库切换到新的主数据库。
其中,对于主数据库的切换,可以通过修改MYSQL数据库的配置文件完成。
进一步地,在完成对于新的主数据库的切换后,还可以包括:
将新的主数据库的更新配置更新到中间层,恢复业务。
本发明实施例提供了一种数据补全方法,在主从式的数据库集群进行主数据库切换的过程中,从数据库集群中选择一从数据库以作为新的主数据库,建立新的主数据库与一其他从数据库的第一连接,将新的主数据库与上述其他从数据库的数据进行比对,以将该其他从数据库中的新数据同步到新的主数据库中,重复上述建立第一连接和数据同步的步骤,直至新的主数据库与所有其他从数据库都完成数据比对及同步,建立新的主数据库与所有其他从数据库之间的第二连接,以将新的主数据库的数据同步至所有其他从数据库,可以完成对新的主数据库的数据补全,使新的主数据库拥有数据库集群中最新的数据,保证主数据库的顺利切换,同时也将所有从数据库中的数据更新为最新数据,从而不会影响数据库的业务的正常进行。
实施例五
本实施例五优选地对应于实施例一和实施例二提供了一种数据补全装置。
图8是本发明一个实施例提供的一种数据补全装置结构框图,应用于主从式数据库集群中主数据库切换,该装置800包括:
第一主库选取模块810,适于从数据库集群中选择一从数据库以作为新的主数据库;
第一连接建立模块820,与第一主库选取模块810相耦合,适于依次建立新的主数据库与所有其他从数据库的第一连接;
第一同步模块830,与第一连接建立模块820相耦合,适于将新的主数据库与所有其他从数据库的数据分别进行比对,以将所有其他从数据库中的新数据同步到新的主数据库中;
第一补全确认模块840,与第一同步模块830相耦合,适于当完成对所有其他从数据库的数据比对及同步时,结束对新的主数据库的数据补全。
可选地,第一主库选取模块810进一步包括:
列表获取单元811,适于在依次建立新的主数据库与所有从数据库的连接之前,获取数据库集群的所有从数据库的列表;
主库筛选单元812,与列表获取单元811相耦合,适于在上述列表记录的所有从数据库中,筛选得到一符合预设条件的从数据库作为新的主数据库。
可选地,所述预定条件包括以下至少之一:
从数据库状态标识为alive;以及
从数据库延迟事务数量小于预设数量。
可选地,第一连接为主从式连接,且其他从数据库与新的主数据库分别具有主、从地位。
可选地,第一同步模块830进一步适于:
在完成新的主数据库与一其他从数据库的数据比对以及同步之后,断开两者之间的所述第一连接。
可选地,该装置800进一步包括:
第二连接建立模块850,与第一补全确认模块840相耦合,适于在结束对所述新的主数据库的数据补全之后,依次建立所述新的主数据库与所有其他从数据库之间的第二连接;
第二同步模块860,与第二连接建立模块850相耦合,适于将新的主数据库的数据同步至所有其他从数据库。
可选地,第二连接为主从式连接,且新的主数据库与其他从数据库分别具有主、从的地位。
可选地,所述数据库集群为MYSQL数据库集群。
本发明实施例提供了一种数据补全装置,在主从式的数据库集群进行主数据库切换的过程中,从数据库集群中选择一从数据库以作为新的主数据库,依次建立新的主数据库与所有其他从数据库的第一连接,将新的主数据库与所有其他从数据库的数据分别进行比对,以将所有其他从数据库中的新数据同步到所述新的主数据库中,以完成对新的主数据库的数据补全,使新的主数据库拥有数据库集群中最新的数据,保证主数据库的顺利切换,从而不会影响数据库的业务的正常进行。
实施例六
本实施例六优选地对应于实施例三和实施例四提供了一种数据补全装置。
图9是本发明一个实施例提供的一种数据补全装置结构框图,应用于主从式数据库集群中主数据库切换,该装置900包括:
第二主库选取模块910,适于从数据库集群中选择一从数据库以作为新的主数据库;
第三连接建立模块920,与第二主库选取模块910相耦合,适于建立新的主数据库与一其他从数据库的第一连接;
第三同步模块930,与第三连接建立模块920相耦合,适于将新的主数据库与其他从数据库的数据进行比对,以将该其他从数据库中的新数据同步到新的主数据库中;
第二补全确认模块940,与第三同步模块930相耦合,适于重复第三连接建立模块920与第三同步模块930执行的操作,直至新的主数据库与所有其他从数据库都完成数据比对及同步;
第四连接建立模块950,与第二补全确认模块940相耦合,适于建立新的主数据库与所有其他从数据库之间的第二连接,以将新的主数据库的数据同步至所有其他从数据库。
可选地,第三同步模块930进一步适于:
在完成所述新的主数据库与其他从数据库的数据比对及同步之后,断开两者之间的所述第一连接。
可选地,所述第一连接为主从式连接,且其他从数据库与新的主数据库分别具有主、从地位。
可选地,所述第二连接为主从式连接,且新的主数据库与其他从数据库分别具有主、从的地位。
本发明实施例提供了一种数据补全装置,在主从式的数据库集群进行主数据库切换的过程中,从数据库集群中选择一从数据库以作为新的主数据库,建立新的主数据库与一其他从数据库的第一连接,将新的主数据库与上述其他从数据库的数据进行比对,以将该其他从数据库中的新数据同步到新的主数据库中,重复上述建立第一连接和数据同步的步骤,直至新的主数据库与所有其他从数据库都完成数据比对,建立新的主数据库与所有其他从数据库之间的第二连接,以将新的主数据库的数据同步至所有其他从数据库,可以完成对新的主数据库的数据补全,使新的主数据库拥有数据库集群中最新的数据,保证主数据库的顺利切换,同时也将所有从数据库中的数据更新为最新数据,从而不会影响数据库的业务的正常进行。
在此处所提供的说明书中,说明了大量具体细节。然而,能够理解,本发明的实施例可以在没有这些具体细节的情况下实践。在一些实例中,并未详细示出公知的方法、结构和技术,以便不模糊对本说明书的理解。
类似地,应当理解,为了精简本公开并帮助理解各个发明方面中的一个或多个,在上面对本发明的示例性实施例的描述中,本发明的各个特征有时被一起分组到单个实施例、图、或者对其的描述中。然而,并不应将该公开的方法解释成反映如下意图:即所要求保护的本发明要求比在每个权利要求中所明确记载的特征更多的特征。更确切地说,如下面的权利要求书所反映的那样,发明方面在于少于前面公开的单个实施例的所有特征。因此,遵循具体实施方式的权利要求书由此明确地并入该具体实施方式,其中每个权利要求本身都作为本发明的单独实施例。
本领域那些技术人员可以理解,可以对实施例中的设备中的模块进行自适应性地改变并且把它们设置在与该实施例不同的一个或多个设备中。可以把实施例中的模块或单元或组件组合成一个模块或单元或组件,以及此外可以把它们分成多个子模块或子单元或子组件。除了这样的特征和/或过程或者单元中的至少一些是相互排斥之外,可以采用任何组合对本说明书(包括伴随的权利要求、摘要和附图)中公开的所有特征以及如此公开的任何方法或者设备的所有过程或单元进行组合。除非另外明确陈述,本说明书(包括伴随的权利要求、摘要和附图)中公开的每个特征可以由提供相同、等同或相似目的的替代特征来代替。
此外,本领域的技术人员能够理解,尽管在此所述的一些实施例包括其它实施例中所包括的某些特征而不是其它特征,但是不同实施例的特征的组合意味着处于本发明的范围之内并且形成不同的实施例。例如,在下面的权利要求书中,所要求保护的实施例的任意之一都可以以任意的组合方式来使用。
本发明的各个部件实施例可以以硬件实现,或者以在一个或者多个处理器上运行的软件模块实现,或者以它们的组合实现。本领域的技术人员应当理解,可以在实践中使用微处理器或者数字信号处理器(DSP)来实现根据本发明实施例的一种数据补全设备中的一些或者全部部件的一些或者全部功能。本发明还可以实现为用于执行这里所描述的方法的一部分或者全部的设备或者装置程序(例如,计算机程序和计算机程序产品)。这样的实现本发明的程序可以存储在计算机可读介质上,或者可以具有一个或者多个信号的形式。这样的信号可以从因特网网站上下载得到,或者在载体信号上提供,或者以任何其他形式提供。
例如,图10示出了可以实现根据本发明的任意一种数据补全的计算设备的框图。该计算设备传统上包括处理器1010和以存储器1020形式的计算机程序产品或者计算机可读介质。存储器1020可以是诸如闪存、EEPROM(电可擦除可编程只读存储器)、EPROM、硬盘或者ROM之类的电子存储器。存储器1020具有存储用于执行上述方法中的任何方法步骤的程序代码1031的存储空间1030。例如,存储程序代码的存储空间1030可以包括分别用于实现上面的方法中的各种步骤的各个程序代码 1031。这些程序代码可以从一个或者多个计算机程序产品中读出或者写入到这一个或者多个计算机程序产品中。这些计算机程序产品包括诸如硬盘,紧致盘(CD)、存储卡或者软盘之类的程序代码载体。这样的计算机程序产品通常为例如图11所示的便携式或者固定存储单元。该存储单元可以具有与图10的计算设备中的存储器1020类似布置的存储段、存储空间等。程序代码可以例如以适当形式进行压缩。通常,存储单元包括用于执行根据本发明方法步骤的计算机可读代码1031’,即可以由例如诸如1010之类的处理器读取的代码,当这些代码由计算设备运行时,导致该计算设备执行上面所描述的方法中的各个步骤。
本文中所称的“一个实施例”、“实施例”或者“一个或者多个实施例”意味着,结合实施例描述的特定特征、结构或者特性包括在本发明的至少一个实施例中。此外,请注意,这里“在一个实施例中”的词语例子不一定全指同一个实施例。
应该注意的是上述实施例对本发明进行说明而不是对本发明进行限制,并且本领域技术人员在不脱离所附权利要求的范围的情况下可设计出替换实施例。在权利要求中,不应将位于括号之间的任何参考符号构造成对权利要求的限制。单词“包含”不排除存在未列在权利要求中的元件或步骤。位于元件之前的单词“一”或“一个”不排除存在多个这样的元件。本发明可以借助于包括有若干不同元件的硬件以及借助于适当编程的计算机来实现。在列举了若干装置的单元权利要求中,这些装置中的若干个可以是通过同一个硬件项来具体体现。单词第一、第二、以及第三等的使用不表示任何顺序。可将这些单词解释为名称。
此外,还应当注意,本说明书中使用的语言主要是为了可读性和教导的目的而选择的,而不是为了解释或者限定本发明的主题而选择的。因此,在不偏离所附权利要求书的范围和精神的情况下,对于本技术领域的普通技术人员来说许多修改和变更都是显而易见的。对于本发明的范围,对本发明所做的公开是说明性的,而非限制性的,本发明的范围由所附权利要求书限定。

Claims (26)

  1. 一种数据补全方法,应用于主从式数据库集群中主数据库切换,所述方法包括:
    从所述数据库集群中选择一从数据库以作为新的主数据库;
    依次建立所述新的主数据库与所有其他从数据库的第一连接;
    将所述新的主数据库与所有其他从数据库的数据分别进行比对,以将所有其他从数据库中的新数据同步到所述新的主数据库中;以及
    当完成对所述所有其他从数据库的数据比对同步时,结束对所述新的主数据库的数据补全。
  2. 根据权利要求1所述的方法,其中,所述从所述数据库集群中选择一从数据库以作为新的主数据库的步骤进一步包括:
    在所述依次建立新的主数据库与所有从数据库的连接之前,获取所述数据库集群的所有从数据库的列表;以及
    在所述列表记录的所述所有从数据库中,筛选得到一符合预设条件的从数据库作为新的主数据库。
  3. 根据权利要求2所述的方法,其中,所述预定条件包括以下至少之一:
    从数据库状态标识为alive;以及
    从数据库延迟事务数量小于预设数量。
  4. 根据权利要求1-3中任一项所述的方法,其中,所述第一连接为主从式连接,且所述其他从数据库与所述新的主数据库分别具有主、从地位。
  5. 根据权利要求1-4中任一项所述的方法,其中,所述将所述新的主数据库与所有其他从数据库的数据分别进行比对,以将所有其他从数据库中的新数据同步到所述新的主数据库中的步骤进一步包括:在完成所述新的主数据库与一其他从数据库的数据比对及同步之后,断开两者之间的所述第一连接。
  6. 根据权利要求1-5中任一项所述的方法,其中,所述方法进一步包括:在结束对所述新的主数据库的数据补全之后,依次建立所述新的主数据库与所有其他从数据库之间的第二连接;以及,将所述新的主数据库的数据同步至所有其他从数据库。
  7. 根据权利要求6所述的方法,其中,所述第二连接为主从式连接,且所述新的主数据库与所述其他从数据库分别具有主、从的地位。
  8. 根据权利要求1-7中任一项所述的方法,其中,所述数据库集群为MYSQL数据库集群。
  9. 一种数据补全方法,应用于主从式数据库集群中主数据库切换,所述方法包括:
    a)从所述数据库集群中选择一从数据库以作为新的主数据库;
    b)建立所述新的主数据库与一其他从数据库的第一连接;
    c)将所述新的主数据库与所述其他从数据库的数据进行比对,以将所述其他从数据库中的新数据同步到所述新的主数据库中;
    d)重复步骤b)和c),直至所述新的主数据库与所有其他从数据库都完成数据比对及同步以及
    e)建立所述新的主数据库与所有其他从数据库之间的第二连接,以将所述新的主数据库的数据同步至所有其他从数据库。
  10. 根据权利要求9所述的方法,其中,所述步骤c)进一步包括:
    f)在完成所述新的主数据库与所述其他从数据库的数据比对及同步之后,断开两者之间的所述第一连接。
  11. 根据权利要求9或10所述的方法,其中,所述第一连接为主从式连接,且所述其他从数据库与所述新的主数据库分别具有主、从地位。
  12. 根据权利要求9-11中任一项所述的方法,其中,所述第二连接为主从式连接,且所述新的主数据库与所述其他从数据库分别具有主、从的地位。
  13. 一种数据补全装置,应用于主从式数据库集群中主数据库切换,所述装置包括:
    第一主库选取模块,适于从所述数据库集群中选择一从数据库以作为新的主数据库;
    第一连接建立模块,适于依次建立所述新的主数据库与所有其他从数据库的第一连接;
    第一同步模块,适于将所述新的主数据库与所有其他从数据库的数据分别进行比对,以将所有其他从数据库中的新数据同步到所述新的主数据库中;
    第一补全确认模块,适于当完成对所述所有其他从数据库的数据比对及同步时,结束对所述新的主数据库的数据补全。
  14. 根据权利要求13所述的装置,其中,所述第一主库选取模块进一步包括:
    列表获取单元,适于在所述依次建立新的主数据库与所有从数据库的连接之前,获取所述数据库集群的所有从数据库的列表;
    主库筛选单元,适于在所述列表记录的所述所有从数据库中,筛选得到一符合预设条件的从数据库作为新的主数据库。
  15. 根据权利要求14所述的装置,其中,所述预定条件包括以下至少之一:
    从数据库状态标识为alive;以及,
    从数据库延迟事务数量小于预设数量。
  16. 根据权利要求13-15中任一项所述的装置,其中,所述第一连接为主从式连接,且所述其他从数据库与所述新的主数据库分别具有主、从地位。
  17. 根据权利要求13-16中任一项所述的装置,其中,所述第一同步模块进一步适于:在完成所述新的主数据库与一其他从数据库的数据比对及同步之后,断开两者之间的所述第一连接。
  18. 根据权利要求13-17中任一项所述的装置,其中,所述装置进一步包括:
    第二连接建立模块,适于在结束对所述新的主数据库的数据补全之后,依次建立所述新的主数据库与所有其他从数据库之间的第二连接;
    第二同步模块,适于将所述新的主数据库的数据同步至所有其他从数据库。
  19. 根据权利要求18所述的装置,其中,所述第二连接为主从式连接,且所述新的主数据库与所述其他从数据库分别具有主、从的地位。
  20. 根据权利要求13-19中任一项所述的装置,其中,所述数据库集群为MYSQL数据库集群。
  21. 一种数据补全装置,应用于主从式数据库集群中主数据库切换,所述装置包括:
    第二主库选取模块,适于从所述数据库集群中选择一从数据库以作为新的主数据库;
    第三连接建立模块,适于建立所述新的主数据库与一其他从数据库的第一连接;
    第三同步模块,适于将所述新的主数据库与所述其他从数据库的数据进行比对,以将所述其他从数据库中的新数据同步到所述新的主数据库中;
    第二补全确认模块,适于重复第三连接建立模块与所述第三同步模块执行的操作,直至所述新的主数据库与所有其他从数据库都完成数据比对及同步;
    第四连接建立模块,适于建立所述新的主数据库与所有其他从数据库之间的第二连接,以将所述新的主数据库的数据同步至所有其他从数据库。
  22. 根据权利要求21所述的装置,其中,所述第三同步模块进一步适于:在完成所述新的主数据库与所述其他从数据库的数据比对及同步之后,断开两者之间的所述第一连接。
  23. 根据权利要求21或22所述的装置,其中,所述第一连接为主从式连接,且所述其他从数据库与所述新的主数据库分别具有主、从地位。
  24. 根据权利要求21-23中任一项所述的装置,其中,所述第二连接为主从式连接,且所述新的主数据库与所述其他从数据库分别具有主、从的地位。
  25. 一种计算机程序,包括计算机可读代码,当所述计算机可读代码在计算设备上运行时,导致所述计算设备执行根据权利要求1-8中的任一项所述的第一种数据补全方法或根据权利要求9-12中的任一项所述的第二种数据补全方法。
  26. 一种计算机可读介质,其中存储了如权利要求25所述的计算机程序。
PCT/CN2015/094153 2014-12-24 2015-11-09 数据补全方法和装置 Ceased WO2016101718A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
US15/539,966 US10045397B2 (en) 2014-12-24 2015-11-09 Data complementing method and apparatus

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201410818146.7 2014-12-24
CN201410818146.7A CN104537046B (zh) 2014-12-24 2014-12-24 数据补全方法和装置

Publications (1)

Publication Number Publication Date
WO2016101718A1 true WO2016101718A1 (zh) 2016-06-30

Family

ID=52852574

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2015/094153 Ceased WO2016101718A1 (zh) 2014-12-24 2015-11-09 数据补全方法和装置

Country Status (3)

Country Link
US (1) US10045397B2 (zh)
CN (1) CN104537046B (zh)
WO (1) WO2016101718A1 (zh)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106156318A (zh) * 2016-07-05 2016-11-23 武汉斗鱼网络科技有限公司 一种实现多节点数据库高可用的系统及方法
CN107016027A (zh) * 2016-12-08 2017-08-04 阿里巴巴集团控股有限公司 实现业务信息快速搜索的方法和装置
CN107391758A (zh) * 2017-08-24 2017-11-24 阿里巴巴集团控股有限公司 数据库切换方法、装置及设备
CN112231385A (zh) * 2020-12-11 2021-01-15 湖南新云网科技有限公司 一种数据收集方法、装置、设备及存储介质
CN115757631A (zh) * 2022-11-24 2023-03-07 度小满科技(北京)有限公司 数据库切换方法、装置、终端及存储介质

Families Citing this family (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104537046B (zh) 2014-12-24 2018-09-11 北京奇虎科技有限公司 数据补全方法和装置
CN104866556B (zh) * 2015-05-15 2019-07-23 北京奇虎科技有限公司 数据库的故障处理方法、装置和数据库系统
CN106571940A (zh) * 2015-10-08 2017-04-19 中国移动通信集团广东有限公司 一种融合网管数据与资源数据的方法和装置
CN106909568A (zh) * 2015-12-23 2017-06-30 北京奇虎科技有限公司 一种数据库集群主数据库的切换方法及装置
CN106156330A (zh) * 2016-07-06 2016-11-23 北京金山安全管理系统技术有限公司 一种数据库适配方法及数据库适配器
CN106254100B (zh) * 2016-07-27 2019-04-16 腾讯科技(深圳)有限公司 一种数据容灾方法、装置和系统
CN108243209A (zh) * 2016-12-23 2018-07-03 深圳市优朋普乐传媒发展有限公司 一种数据同步方法及装置
CN106713487B (zh) * 2017-01-16 2020-10-09 腾讯科技(深圳)有限公司 数据的同步方法和装置
CN108900572B (zh) * 2018-05-31 2022-08-09 康键信息技术(深圳)有限公司 主数据库域名切换控制方法、计算机设备和存储介质
CN109032849B (zh) * 2018-08-30 2021-03-23 百度在线网络技术(北京)有限公司 热备份系统、热备份方法和计算机设备
CN110413685B (zh) * 2019-04-12 2024-03-12 财付通支付科技有限公司 数据库服务切换方法、装置、可读存储介质和计算机设备
CN110795287B (zh) * 2019-10-30 2024-04-26 深圳前海环融联易信息科技服务有限公司 数据恢复方法、系统、电子设备及计算机存储介质
WO2021168697A1 (zh) * 2020-02-26 2021-09-02 深圳市欢太科技有限公司 数据同步方法、装置、数据存储系统及计算机可读介质

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2010277348A (ja) * 2009-05-28 2010-12-09 Nippon Telegr & Teleph Corp <Ntt> マスタースレーブ構成をもつデータベースを更新するデータベース更新方法、データベース更新システム、データベース更新装置、およびデータベース更新プログラム
CN102761528A (zh) * 2011-04-28 2012-10-31 中兴通讯股份有限公司 数据管理系统及方法
CN103020243A (zh) * 2012-12-18 2013-04-03 新浪网技术(中国)有限公司 一种数据库主从复制结构更换方法及装置
CN104537046A (zh) * 2014-12-24 2015-04-22 北京奇虎科技有限公司 数据补全方法和装置

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1262481A (zh) * 1999-01-27 2000-08-09 电话通有限公司 多个数据库的同步方法及装置
US7523110B2 (en) * 2005-03-03 2009-04-21 Gravic, Inc. High availability designated winner data replication
CN101207512B (zh) * 2006-12-22 2011-05-11 中兴通讯股份有限公司 一种数据库系统冗灾备份和切换方法
US8572031B2 (en) * 2010-12-23 2013-10-29 Mongodb, Inc. Method and apparatus for maintaining replica sets
CN102945195B (zh) * 2012-11-26 2015-11-18 国电南瑞科技股份有限公司 一种基于SQLite数据库的主备冗余复制方法

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2010277348A (ja) * 2009-05-28 2010-12-09 Nippon Telegr & Teleph Corp <Ntt> マスタースレーブ構成をもつデータベースを更新するデータベース更新方法、データベース更新システム、データベース更新装置、およびデータベース更新プログラム
CN102761528A (zh) * 2011-04-28 2012-10-31 中兴通讯股份有限公司 数据管理系统及方法
CN103020243A (zh) * 2012-12-18 2013-04-03 新浪网技术(中国)有限公司 一种数据库主从复制结构更换方法及装置
CN104537046A (zh) * 2014-12-24 2015-04-22 北京奇虎科技有限公司 数据补全方法和装置

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106156318A (zh) * 2016-07-05 2016-11-23 武汉斗鱼网络科技有限公司 一种实现多节点数据库高可用的系统及方法
CN106156318B (zh) * 2016-07-05 2022-08-16 武汉斗鱼网络科技有限公司 一种实现多节点数据库高可用的系统及方法
CN107016027A (zh) * 2016-12-08 2017-08-04 阿里巴巴集团控股有限公司 实现业务信息快速搜索的方法和装置
CN107391758A (zh) * 2017-08-24 2017-11-24 阿里巴巴集团控股有限公司 数据库切换方法、装置及设备
CN112231385A (zh) * 2020-12-11 2021-01-15 湖南新云网科技有限公司 一种数据收集方法、装置、设备及存储介质
CN115757631A (zh) * 2022-11-24 2023-03-07 度小满科技(北京)有限公司 数据库切换方法、装置、终端及存储介质

Also Published As

Publication number Publication date
US20170359853A1 (en) 2017-12-14
US10045397B2 (en) 2018-08-07
CN104537046A (zh) 2015-04-22
CN104537046B (zh) 2018-09-11

Similar Documents

Publication Publication Date Title
US10045397B2 (en) Data complementing method and apparatus
CN104516966A (zh) 一种数据库集群的高可用解决方法和装置
CN105550229B (zh) 分布式存储系统数据修复的方法和装置
CN103152395B (zh) 一种分布式文件系统的存储方法及装置
US9251233B2 (en) Merging an out of synchronization indicator and a change recording indicator in response to a failure in consistency group formation
US10860539B2 (en) De-duplication-based remote replication method, and apparatus
CN108153849B (zh) 一种数据库表切分方法、装置、系统和介质
CN103973810B (zh) 基于互联网协议ip盘的数据处理方法和装置
WO2016091069A1 (zh) 一种数据操作方法及装置
US20150143065A1 (en) Data Processing Method and Apparatus, and Shared Storage Device
CN105824846B (zh) 数据迁移方法及装置
CN107919977B (zh) 一种基于Paxos协议的在线扩容、在线缩容的方法和装置
CN102368267A (zh) 一种维护分布式系统中副本一致性的方法
WO2017101642A1 (zh) 分布式系统的数据节点升级方法及装置
CN111414136A (zh) 一种存储池的创建方法、系统、设备以及介质
CN103827843A (zh) 一种写数据方法、装置和系统
CN105468475A (zh) 数据库的备份方法及备份装置
CN106605217B (zh) 用于将应用从一个站点移动到另一站点的方法和系统
CN108183957A (zh) 主从同步方法及装置
CN106909568A (zh) 一种数据库集群主数据库的切换方法及装置
CN105550306A (zh) 多副本数据的读写方法及系统
WO2016101759A1 (zh) 一种数据路由方法、数据管理装置和分布式存储系统
WO2013078611A1 (zh) 分布式存储系统中的数据处理方法及设备、客户端
CN110413433A (zh) 一种Maria DB集群故障后的恢复方法、设备以及存储介质
CN115470298A (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: 15871789

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

WWE Wipo information: entry into national phase

Ref document number: 15539966

Country of ref document: US

122 Ep: pct application non-entry in european phase

Ref document number: 15871789

Country of ref document: EP

Kind code of ref document: A1