CN112052127A - Data synchronization method and device for dual-computer hot standby environment - Google Patents

Data synchronization method and device for dual-computer hot standby environment Download PDF

Info

Publication number
CN112052127A
CN112052127A CN202011086990.7A CN202011086990A CN112052127A CN 112052127 A CN112052127 A CN 112052127A CN 202011086990 A CN202011086990 A CN 202011086990A CN 112052127 A CN112052127 A CN 112052127A
Authority
CN
China
Prior art keywords
cloud platform
standby
configuration data
main
node
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202011086990.7A
Other languages
Chinese (zh)
Other versions
CN112052127B (en
Inventor
徐继浩
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Suzhou Inspur Intelligent Technology Co Ltd
Original Assignee
Suzhou Inspur Intelligent Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Suzhou Inspur Intelligent Technology Co Ltd filed Critical Suzhou Inspur Intelligent Technology Co Ltd
Priority to CN202011086990.7A priority Critical patent/CN112052127B/en
Publication of CN112052127A publication Critical patent/CN112052127A/en
Application granted granted Critical
Publication of CN112052127B publication Critical patent/CN112052127B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1446Point-in-time backing up or restoration of persistent data
    • G06F11/1448Management of the data involved in backup or backup restore
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1446Point-in-time backing up or restoration of persistent data
    • G06F11/1458Management of the backup or restore process
    • G06F11/1469Backup restoration techniques
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • G06F16/275Synchronous replication

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Quality & Reliability (AREA)
  • Databases & Information Systems (AREA)
  • Computing Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Hardware Redundancy (AREA)

Abstract

The invention provides a data synchronization method and a data synchronization device for a dual-computer hot standby environment, wherein the method comprises the following steps: when the main cloud platform generates configuration data, the main cloud platform stores the configuration data into a first local database and backs up the configuration data to the standby cloud platform, and the standby cloud platform receives the configuration data and stores the configuration data into a second local database; if the backup node does not exist, the main cloud platform stores the configuration data into the first local database and stores the configuration data into the cache module; when the standby node is newly added into the dual-computer hot standby environment, the main cloud platform acquires the configuration data in the cache module and backs up the configuration data to the standby cloud platform in batches, and the standby cloud platform stores the configuration data into the second local database after receiving the configuration data. According to the data synchronization method and device for the dual-computer hot standby environment, when the main cloud platform is restarted or the main and standby switching of the two platforms occurs, data synchronization is not needed, the time for the main and standby switching is shortened, the complexity of data synchronization is reduced, and the stability of a cloud platform system is improved.

Description

Data synchronization method and device for dual-computer hot standby environment
Technical Field
The present invention relates to the field of data synchronization technologies, and in particular, to a data synchronization method and apparatus for a dual-computer hot standby environment.
Background
With the development of cloud computing technology, the scale of a cloud platform becomes larger and larger, the reliability of the cloud platform is ensured to be more and more important, and the reliability requirement of a user on the cloud platform is higher and higher. HA (High Availability) is a technology that guarantees High Availability of the system, and the key to achieving High Availability is to eliminate single point failures and minimize down time and service interruption time. The dual-computer hot standby is a way to realize HA, that is, a cloud platform system is deployed on two server nodes at the same time, and normally, a cloud platform on one server node provides service to the outside and serves as a master node; the other node does not provide service for the idle state and is a standby node. When the cloud platform master node in normal operation is restarted or fails, the master node and the standby node are switched to another standby node in an idle state to continue providing services.
In the existing cloud platform system configuration mode, after the system deployment is completed in the dual-computer hot standby environment, one server node is selected as a master node and serves as a cloud platform for providing services to the outside. And the user logs in the main cloud platform to carry out configuration, and the configuration data is stored in the local database. When the main node fails or is restarted, the cloud platform of the standby node can manage the service and provide the service for the outside again. When the master node and the slave node are switched, the bottom layer of the cloud platform copies all data of the database of the master node to a database of another node in batch through a Distributed Replicated Block Device (DRBD) mechanism. Since the DRBD mechanism is complicated and is not easy to recover after a failure occurs, data copying of the DRBD node is required in the process of active/standby switching, which affects the time of active/standby switching.
Disclosure of Invention
One of the objectives of the present invention is to provide a data synchronization method and apparatus for a dual-cloud hot-standby environment, which do not require data synchronization when a main cloud platform is restarted or main/standby switching occurs between two platforms, thereby reducing the time for main/standby switching, reducing the complexity of data synchronization, and improving the stability of a cloud platform system.
The data synchronization method for the dual-computer hot-standby environment provided by the embodiment of the invention is applied to the dual-computer hot-standby environment, and the dual-computer hot-standby environment comprises the following steps: the main cloud platform running on the main node and the standby cloud platform running on the standby node comprise:
when the main cloud platform generates configuration data, the main cloud platform stores the configuration data into a first local database and backs up the configuration data to the standby cloud platform, and the standby cloud platform receives the configuration data and stores the configuration data into a second local database;
if the standby node does not exist, the main cloud platform stores the configuration data into the first local database and stores the configuration data into a cache module;
when the standby node is newly added into the dual-computer hot standby environment, the main cloud platform acquires the configuration data in the cache module and backs up the configuration data to the standby cloud platform in batches, and the standby cloud platform stores the configuration data into the second local database after receiving the configuration data.
Preferably, when the master cloud platform on the master node in the dual-computer hot-standby environment generates configuration data, the master cloud platform stores the configuration data in a first local database and backs up the configuration data to the standby cloud platform on the standby node, and the standby cloud platform stores the configuration data in a second local database after receiving the configuration data, including:
a main cloud platform on a main node in the dual-computer hot standby environment receives configuration data input by a user;
the real-time backup module of the main cloud platform writes the configuration data into a first local database of the main cloud platform and backs up the configuration data to a real-time backup message processing module in a standby cloud platform on a standby node in the dual-computer hot standby environment;
and the real-time backup message processing module receives the configuration data and writes the configuration data into a second local database of the standby cloud platform.
Preferably, if the backup node does not exist, the master cloud platform stores the configuration data in the first local database and stores the configuration data in the cache module, including:
a main cloud platform on a main node in the dual-computer hot standby environment receives configuration data input by a user;
and the real-time backup module of the main cloud platform checks whether the standby node exists, and if the standby node does not exist, the configuration data is written into the cache module of the main cloud platform and the first local database.
Preferably, when the standby node is newly added to the dual-computer hot-standby environment, the main cloud platform acquires the configuration data in the cache module and performs batch backup on the configuration data to the standby cloud platform, and the standby cloud platform stores the configuration data into the second local database after receiving the configuration data, including:
when the main cloud platform detects that the standby node is newly added into the dual-computer hot standby environment, a batch backup instruction is sent to a batch backup module of the main cloud platform;
the batch backup module receives the batch backup instruction, acquires the configuration data in the cache module and backs up the configuration data in batch to a batch backup message processing module in the standby cloud platform;
and the batch backup message processing module receives the batch backup configuration data and stores the batch backup configuration data into the second local database in the secondary cloud platform.
Preferably, a user can log in the main cloud platform through a client to configure the main cloud platform; the configuration data of the batch backup is incremental data which is never backed up to the backup cloud platform; and when the main cloud platform and the standby cloud platform are subjected to main-standby switching, the standby cloud platform is used for providing services.
The data synchronization device for a dual-computer hot standby environment provided by the embodiment of the invention comprises: a main cloud platform and a standby cloud platform;
when a main cloud platform on a main node in the dual-computer hot standby environment generates configuration data, the main cloud platform stores the configuration data into a first local database and backs up the configuration data to a standby cloud platform on a standby node, and the standby cloud platform stores the configuration data into a second local database after receiving the configuration data;
if the standby node does not exist, the main cloud platform stores the configuration data into the first local database and stores the configuration data into a cache module;
when the standby node is newly added into the dual-computer hot standby environment, the main cloud platform acquires the configuration data in the cache module and backs up the configuration data to the standby cloud platform in batches, and the standby cloud platform stores the configuration data into the second local database after receiving the configuration data.
Preferably, when the master cloud platform on the master node in the dual-computer hot-standby environment generates configuration data, the master cloud platform stores the configuration data in a first local database and backs up the configuration data to the standby cloud platform on the standby node, and the standby cloud platform stores the configuration data in a second local database after receiving the configuration data, including:
a main cloud platform on a main node in the dual-computer hot standby environment receives configuration data input by a user;
the real-time backup module of the main cloud platform writes the configuration data into a first local database of the main cloud platform and backs up the configuration data to a real-time backup message processing module in a standby cloud platform on a standby node in the dual-computer hot standby environment;
and the real-time backup message processing module receives the configuration data and writes the configuration data into a second local database of the standby cloud platform.
Preferably, if the backup node does not exist, the master cloud platform stores the configuration data in the first local database and stores the configuration data in the cache module, including:
a main cloud platform on a main node in the dual-computer hot standby environment receives configuration data input by a user;
and the real-time backup module of the main cloud platform checks whether the standby node exists, and if the standby node does not exist, the configuration data is written into the cache module of the main cloud platform and the first local database.
Preferably, when the standby node is newly added to the dual-computer hot-standby environment, the main cloud platform acquires the configuration data in the cache module and performs batch backup on the configuration data to the standby cloud platform, and the standby cloud platform stores the configuration data into the second local database after receiving the configuration data, including:
when the main cloud platform detects that the standby node is newly added into the dual-computer hot standby environment, a batch backup instruction is sent to a batch backup module of the main cloud platform;
the batch backup module receives the batch backup instruction, acquires the configuration data in the cache module and backs up the configuration data in batch to a batch backup message processing module in the standby cloud platform;
and the batch backup message processing module receives the batch backup configuration data and stores the batch backup configuration data into the second local database in the secondary cloud platform.
A user can log in the main cloud platform through a client to configure the main cloud platform; the configuration data of the batch backup is incremental data which is never backed up to the backup cloud platform; and when the main cloud platform and the standby cloud platform are subjected to main-standby switching, the standby cloud platform is used for providing services.
Additional features and advantages of the invention will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. The objectives and other advantages of the invention will be realized and attained by the structure particularly pointed out in the written description and claims hereof as well as the appended drawings.
The technical solution of the present invention is further described in detail by the accompanying drawings and embodiments.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this specification, illustrate embodiments of the invention and together with the description serve to explain the principles of the invention and not to limit the invention. In the drawings:
fig. 1 is a flowchart of a data synchronization method for a dual-computer hot-standby environment according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of an embodiment of the present invention;
FIG. 3 is a schematic diagram of another embodiment of the present invention;
fig. 4 is a schematic diagram of a specific application of another embodiment of the present invention.
Detailed Description
The preferred embodiments of the present invention will be described in conjunction with the accompanying drawings, and it will be understood that they are described herein for the purpose of illustration and explanation and not limitation.
The embodiment of the invention provides a data synchronization method for a dual-computer hot-standby environment, which is applied to the dual-computer hot-standby environment, and the dual-computer hot-standby environment comprises the following steps: as shown in fig. 1, the master cloud platform running on the master node and the standby cloud platform running on the standby node include:
s1, when the main cloud platform generates configuration data, the main cloud platform stores the configuration data into a first local database and backs up the configuration data to the standby cloud platform, and the standby cloud platform receives the configuration data and stores the configuration data into a second local database;
s2, if the standby node does not exist, the main cloud platform stores the configuration data into the first local database and stores the configuration data into a cache module;
and S3, when the standby node is newly added into the dual-computer hot standby environment, the main cloud platform acquires the configuration data in the cache module and backs up the configuration data in batch to the standby cloud platform, and the standby cloud platform stores the configuration data into the second local database after receiving the configuration data.
The working principle of the technical scheme is as follows: when a user logs in a main cloud platform running on a main node in a dual-computer hot-standby environment through a client and configures the main cloud platform, the main cloud platform generates corresponding configuration data, and once the configuration data are generated, the main cloud platform not only stores the configuration data into a first local database of the main cloud platform, but also backs up the configuration data onto a standby cloud platform of a standby node running in the dual-computer hot-standby environment in real time; however, if the standby node does not exist, the configuration data cannot be backed up to the standby cloud platform, and at this time, the main cloud platform not only stores the configuration data into the first local database of the main cloud platform, but also stores the configuration data into the cache module of the main cloud platform; when the standby node is newly added into the dual-computer hot standby environment, the main cloud platform backs up the configuration data in the cache module to the standby cloud platform in batches; and the configuration data received by the cloud standby platform is stored in the second local database of the cloud standby platform under any condition.
The beneficial effects of the above technical scheme are: according to the embodiment of the invention, when the main cloud platform running on the main node is configured, the main cloud platform sends the real-time backup message to the standby cloud platform on the standby node, the standby cloud platform writes the configuration data into the database after receiving the message, when the standby cloud platform is restarted or newly added into a dual-computer hot standby environment, the batch backup message is sent, and the data of the main cloud platform is synchronized to the standby cloud platform, when the main cloud platform is restarted or the two platforms are switched between the main cloud platform and the standby cloud platform, the data synchronization is not needed, the time for switching between the main cloud platform and the standby platform is reduced, the complexity of the data synchronization is reduced, and the stability of a cloud platform system is improved.
The embodiment of the invention provides a data synchronization method for a dual-computer hot standby environment, wherein when a main cloud platform on a main node in the dual-computer hot standby environment generates configuration data, the main cloud platform stores the configuration data into a first local database and backs up the configuration data to a standby cloud platform on a standby node, and the standby cloud platform stores the configuration data into a second local database after receiving the configuration data, and the method comprises the following steps:
a main cloud platform on a main node in the dual-computer hot standby environment receives configuration data input by a user;
the real-time backup module of the main cloud platform writes the configuration data into a first local database of the main cloud platform and backs up the configuration data to a real-time backup message processing module in a standby cloud platform on a standby node in the dual-computer hot standby environment;
and the real-time backup message processing module receives the configuration data and writes the configuration data into a second local database of the standby cloud platform.
The working principle of the technical scheme is as follows:
when a user logs in a main cloud platform running on a main node in a dual-computer hot-standby environment through a client and configures the main cloud platform, the main cloud platform generates corresponding configuration data; the real-time backup module of the main cloud platform writes the backup data into a first local database of the main cloud platform and sends the configuration data to the real-time backup message processing module in the backup cloud platform for backup; the real-time backup message processing module receives the configuration data and writes the configuration data into a second local database of the standby cloud platform;
for example, as shown in FIG. 2:
before the main cloud platform starts to write configuration data, a standby node exists, two nodes HOST A and HOST B in the graph represent the main node and the standby node respectively, the same cloud platform systems are operated on the nodes respectively to form a dual-computer hot standby environment, and when the main cloud platform in the dual-computer hot standby environment generates the configuration data, the data synchronization method comprises the following steps:
1. a real-time backup module of the cloud platform sends a real-time backup message to a standby cloud platform;
2. the main cloud platform writes the configuration data into a local database;
3. the real-time backup message processing module of the backup cloud platform processes the real-time backup message;
4. and the standby cloud platform writes the configuration data into a local database after processing the real-time backup message.
The beneficial effects of the above technical scheme are: when the main cloud platform generates the configuration data, the real-time backup module of the main cloud platform sends the backup data to the real-time backup message processing module of the backup cloud platform in real time for backup, and convenience of data synchronization is improved.
The embodiment of the invention provides a data synchronization method for a dual-computer hot standby environment, wherein if the standby node does not exist, a master cloud platform stores the configuration data into a first local database and stores the configuration data into a cache module, and the method comprises the following steps:
a main cloud platform on a main node in the dual-computer hot standby environment receives configuration data input by a user;
and the real-time backup module of the main cloud platform checks whether the standby node exists, and if the standby node does not exist, the configuration data is written into the cache module of the main cloud platform and the first local database.
The working principle of the technical scheme is as follows:
when a user logs in a main cloud platform running on a main node in a dual-computer hot-standby environment through a client and configures the main cloud platform, the main cloud platform generates corresponding configuration data; the real-time backup module on the main cloud platform checks whether the standby node exists, if the standby node does not exist, the configuration data cannot be backed up, and at the moment, the configuration data are written into the cache module and the first local database of the main cloud platform for standby;
for example, as shown in FIG. 3:
when the main cloud platform generates configuration data, the processing flow when the standby node does not exist or leaves is as follows:
1. the main cloud platform generates configuration data, and the configuration data is processed by the real-time backup module;
2. when the real-time backup module processes the configuration data, the real-time backup module judges that the message transmission fails or the backup node does not exist, writes the configuration data into the cache module, and simultaneously writes the configuration data into a local database;
3. the data of the cache module is used as the data during batch backup, the data stored by the cache module is the data which is not backed up to the standby node, the data sent during batch backup is ensured to be incremental data, the efficiency of batch backup is improved, and when the data sent during batch backup is the data which is not successfully backed up to the standby node, the backed-up data cannot be sent again.
The beneficial effects of the above technical scheme are: according to the embodiment of the invention, the real-time backup module of the main cloud platform checks whether the backup node exists, if the backup node does not exist, the configuration data is not only stored in the first local database of the main cloud platform, but also stored in the cache module of the main cloud platform in advance for standby, and the management capability of the system on the configuration data is improved.
The embodiment of the present invention provides a data synchronization method for a dual-computer hot-standby environment, where when a standby node is newly added to the dual-computer hot-standby environment, a master cloud platform acquires configuration data in a cache module and backs up the configuration data in batch to a standby cloud platform, and the standby cloud platform stores the configuration data in a second local database after receiving the configuration data, including:
when the main cloud platform detects that the standby node is newly added into the dual-computer hot standby environment, a batch backup instruction is sent to a batch backup module of the main cloud platform;
the batch backup module receives the batch backup instruction, acquires the configuration data in the cache module and backs up the configuration data in batch to a batch backup message processing module in the standby cloud platform;
and the batch backup message processing module receives the batch backup configuration data and stores the batch backup configuration data into the second local database in the secondary cloud platform.
The working principle of the technical scheme is as follows:
when the main platform detects that the standby node is added into the dual-computer hot standby environment, a batch backup instruction is immediately sent to a batch backup module of the main cloud platform; the method comprises the steps that a batch backup module of a main cloud platform acquires configuration data in a cache module and backs up the configuration data to a standby cloud platform, namely the configuration data is sent to a batch backup message processing module in the standby cloud platform in batch; the batch backup message processing module stores the received batch backup message into a second local database of the backup holder;
for example, as shown in FIG. 4:
the processing flow when the standby node newly joins or rejoins the cluster is as follows:
1. when the main cloud platform senses that the backup node is added, the batch backup module is informed;
2. the batch backup module receives the backup node adding message, acquires the configuration data cached before from the caching module and sends the batch backup message;
3. and after receiving the batch backup messages, a batch backup message processing module of the standby cloud platform writes the batch backup data into a local database.
The beneficial effects of the above technical scheme are: when the standby node is newly added into the dual-computer hot standby environment, the batch backup module in the main cloud platform performs batch backup on the configuration data which is not backed up to the standby cloud platform in the cache module before to the batch backup message processing module of the standby cloud platform, and the batch backup message processing module receives the configuration data and stores the configuration data into the second local database of the standby cloud platform, so that the data backup efficiency is improved.
The embodiment of the invention provides a data synchronization method for a dual-computer hot standby environment, wherein a user can log in a main cloud platform through a client to configure the main cloud platform; the configuration data of the batch backup is incremental data which is never backed up to the backup cloud platform; and when the main cloud platform and the standby cloud platform are subjected to main-standby switching, the standby cloud platform is used for providing services.
The working principle of the technical scheme is as follows:
a user establishes connection with the main cloud platform server by inputting a user name, a password and the like into the client, so that the user can configure the main cloud platform, use the functions of the main cloud platform and the like by operating the client; the data stored by the cache module is data which is not backed up to the standby node, the data sent during batch backup is ensured to be incremental data, and when the data sent during batch backup is data which is not successfully backed up to the standby node, the backed-up data cannot be sent again; because the main cloud platform and the standby cloud platform are already subjected to data synchronization before the main-standby switching, the standby cloud platform can be directly used for providing services when the main-standby switching is carried out.
The beneficial effects of the above technical scheme are: according to the embodiment of the invention, a user can log in the main cloud platform through the client to configure the main cloud platform, so that the user experience is improved, the batch backup data acquired from the cache module is incremental data from an un-backup to the standby cloud platform, and when the standby node is added into the dual-computer hot standby environment, the backup is carried out to the standby cloud platform, so that the data backup efficiency is improved, when the main and standby switching occurs, the standby cloud platform only needs to be provided with service again, no data synchronization needs to be carried out, and the time for main and standby switching is reduced.
The embodiment of the invention provides a data synchronization device for a dual-computer hot standby environment, which comprises: a main cloud platform and a standby cloud platform;
when a main cloud platform on a main node in the dual-computer hot standby environment generates configuration data, the main cloud platform stores the configuration data into a first local database and backs up the configuration data to a standby cloud platform on a standby node, and the standby cloud platform stores the configuration data into a second local database after receiving the configuration data;
if the standby node does not exist, the main cloud platform stores the configuration data into the first local database and stores the configuration data into a cache module;
when the standby node is newly added into the dual-computer hot standby environment, the main cloud platform acquires the configuration data in the cache module and backs up the configuration data to the standby cloud platform in batches, and the standby cloud platform stores the configuration data into the second local database after receiving the configuration data.
The working principle of the technical scheme is as follows: when a user logs in a main cloud platform running on a main node in a dual-computer hot-standby environment through a client and configures the main cloud platform, the main cloud platform generates corresponding configuration data, and once the configuration data are generated, the main cloud platform not only stores the configuration data into a first local database of the main cloud platform, but also backs up the configuration data onto a standby cloud platform of a standby node running in the dual-computer hot-standby environment in real time; however, if the standby node does not exist, the configuration data cannot be backed up to the standby cloud platform, and at this time, the main cloud platform not only stores the configuration data into the first local database of the main cloud platform, but also stores the configuration data into the cache module of the main cloud platform; when the standby node is newly added into the dual-computer hot standby environment, the main cloud platform backs up the configuration data in the cache module to the standby cloud platform in batches; and the configuration data received by the cloud standby platform is stored in the second local database of the cloud standby platform under any condition.
The beneficial effects of the above technical scheme are: according to the embodiment of the invention, when the main cloud platform running on the main node is configured, the main cloud platform sends the real-time backup message to the standby cloud platform on the standby node, the standby cloud platform writes the configuration data into the database after receiving the message, when the standby cloud platform is restarted or newly added into a dual-computer hot standby environment, the batch backup message is sent, and the data of the main cloud platform is synchronized to the standby cloud platform, when the main cloud platform is restarted or the two platforms are switched between the main cloud platform and the standby cloud platform, the data synchronization is not needed, the time for switching between the main cloud platform and the standby platform is reduced, the complexity of the data synchronization is reduced, and the stability of a cloud platform system is improved.
The embodiment of the invention provides a data synchronization device for a dual-computer hot standby environment, wherein when a main cloud platform on a main node in the dual-computer hot standby environment generates configuration data, the main cloud platform stores the configuration data into a first local database and backs up the configuration data to a standby cloud platform on a standby node, and the standby cloud platform stores the configuration data into a second local database after receiving the configuration data, and the data synchronization device comprises:
a main cloud platform on a main node in the dual-computer hot standby environment receives configuration data input by a user;
the real-time backup module of the main cloud platform writes the configuration data into a first local database of the main cloud platform and backs up the configuration data to a real-time backup message processing module in a standby cloud platform on a standby node in the dual-computer hot standby environment;
and the real-time backup message processing module receives the configuration data and writes the configuration data into a second local database of the standby cloud platform.
The working principle of the technical scheme is as follows:
when a user logs in a main cloud platform running on a main node in a dual-computer hot-standby environment through a client and configures the main cloud platform, the main cloud platform generates corresponding configuration data; the real-time backup module of the main cloud platform writes the backup data into a first local database of the main cloud platform and sends the configuration data to the real-time backup message processing module in the backup cloud platform for backup; the real-time backup message processing module receives the configuration data and writes the configuration data into a second local database of the standby cloud platform;
for example, as shown in FIG. 2:
before the main cloud platform starts to write configuration data, a standby node exists, two nodes HOST A and HOST B in the graph represent the main node and the standby node respectively, the same cloud platform systems are operated on the nodes respectively to form a dual-computer hot standby environment, and when the main cloud platform in the dual-computer hot standby environment generates the configuration data, the data synchronization method comprises the following steps:
1. a real-time backup module of the cloud platform sends a real-time backup message to a standby cloud platform;
2. the main cloud platform writes the configuration data into a local database;
3. the real-time backup message processing module of the backup cloud platform processes the real-time backup message;
4. and the standby cloud platform writes the configuration data into a local database after processing the real-time backup message.
The beneficial effects of the above technical scheme are: when the main cloud platform generates the configuration data, the real-time backup module of the main cloud platform sends the backup data to the real-time backup message processing module of the backup cloud platform in real time for backup, and convenience of data synchronization is improved.
An embodiment of the present invention provides a data synchronization apparatus for a dual-computer hot standby environment, where if the standby node does not exist, a master cloud platform stores the configuration data in a first local database and stores the configuration data in a cache module, where the data synchronization apparatus includes:
a main cloud platform on a main node in the dual-computer hot standby environment receives configuration data input by a user;
and the real-time backup module of the main cloud platform checks whether the standby node exists, and if the standby node does not exist, the configuration data is written into the cache module of the main cloud platform and the first local database.
The working principle of the technical scheme is as follows:
when a user logs in a main cloud platform running on a main node in a dual-computer hot-standby environment through a client and configures the main cloud platform, the main cloud platform generates corresponding configuration data; the real-time backup module on the main cloud platform checks whether the standby node exists, if the standby node does not exist, the configuration data cannot be backed up, and at the moment, the configuration data are written into the cache module and the first local database of the main cloud platform for standby;
for example, as shown in FIG. 3:
when the main cloud platform generates configuration data, the processing flow when the standby node does not exist or leaves is as follows:
1. the main cloud platform generates configuration data, and the configuration data is processed by the real-time backup module;
2. when the real-time backup module processes the configuration data, the real-time backup module judges that the message transmission fails or the backup node does not exist, writes the configuration data into the cache module, and simultaneously writes the configuration data into a local database;
3. the data of the cache module is used as the data during batch backup, the data stored by the cache module is the data which is not backed up to the standby node, the data sent during batch backup is ensured to be incremental data, the efficiency of batch backup is improved, and when the data sent during batch backup is the data which is not successfully backed up to the standby node, the backed-up data cannot be sent again.
The beneficial effects of the above technical scheme are: according to the embodiment of the invention, the real-time backup module of the main cloud platform checks whether the backup node exists, if the backup node does not exist, the configuration data is not only stored in the first local database of the main cloud platform, but also stored in the cache module of the main cloud platform in advance for standby, and the management capability of the system on the configuration data is improved.
An embodiment of the present invention provides a data synchronization apparatus for a dual-computer hot-standby environment, where when a standby node is newly added to the dual-computer hot-standby environment, a master cloud platform obtains configuration data in a cache module and performs batch backup on the configuration data to a standby cloud platform, and the standby cloud platform stores the configuration data in a second local database after receiving the configuration data, including:
when the main cloud platform detects that the standby node is newly added into the dual-computer hot standby environment, a batch backup instruction is sent to a batch backup module of the main cloud platform;
the batch backup module receives the batch backup instruction, acquires the configuration data in the cache module and backs up the configuration data in batch to a batch backup message processing module in the standby cloud platform;
and the batch backup message processing module receives the batch backup configuration data and stores the batch backup configuration data into the second local database in the secondary cloud platform.
The working principle of the technical scheme is as follows:
when the main platform detects that the standby node is added into the dual-computer hot standby environment, a batch backup instruction is immediately sent to a batch backup module of the main cloud platform; the method comprises the steps that a batch backup module of a main cloud platform acquires configuration data in a cache module and backs up the configuration data to a standby cloud platform, namely the configuration data is sent to a batch backup message processing module in the standby cloud platform in batch; the batch backup message processing module stores the received batch backup message into a second local database of the backup holder;
for example, as shown in FIG. 4:
the processing flow when the standby node newly joins or rejoins the cluster is as follows:
1. when the main cloud platform senses that the backup node is added, the batch backup module is informed;
2. the batch backup module receives the backup node adding message, acquires the configuration data cached before from the caching module and sends the batch backup message;
3. and after receiving the batch backup messages, a batch backup message processing module of the standby cloud platform writes the batch backup data into a local database.
The beneficial effects of the above technical scheme are: when the standby node is newly added into the dual-computer hot standby environment, the batch backup module in the main cloud platform performs batch backup on the configuration data which is not backed up to the standby cloud platform in the cache module before to the batch backup message processing module of the standby cloud platform, and the batch backup message processing module receives the configuration data and stores the configuration data into the second local database of the standby cloud platform, so that the data backup efficiency is improved.
The embodiment of the invention provides a data synchronization device for a dual-computer hot standby environment, wherein a user can log in a main cloud platform through a client to configure the main cloud platform; the configuration data of the batch backup is incremental data which is never backed up to the backup cloud platform; and when the main cloud platform and the standby cloud platform are subjected to main-standby switching, the standby cloud platform is used for providing services.
The working principle of the technical scheme is as follows:
a user establishes connection with the main cloud platform server by inputting a user name, a password and the like into the client, so that the user can configure the main cloud platform, use the functions of the main cloud platform and the like by operating the client; the data stored by the cache module is data which is not backed up to the standby node, the data sent during batch backup is ensured to be incremental data, and when the data sent during batch backup is data which is not successfully backed up to the standby node, the backed-up data cannot be sent again; because the main cloud platform and the standby cloud platform are already subjected to data synchronization before the main-standby switching, the standby cloud platform can be directly used for providing services when the main-standby switching is carried out.
The beneficial effects of the above technical scheme are: according to the embodiment of the invention, a user can log in the main cloud platform through the client to configure the main cloud platform, so that the user experience is improved, the batch backup data acquired from the cache module is incremental data from an un-backup to the standby cloud platform, and when the standby node is added into the dual-computer hot standby environment, the backup is carried out to the standby cloud platform, so that the data backup efficiency is improved, when the main and standby switching occurs, the standby cloud platform only needs to be provided with service again, no data synchronization needs to be carried out, and the time for main and standby switching is reduced.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present invention without departing from the spirit and scope of the invention. Thus, if such modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include such modifications and variations.

Claims (10)

1. A data synchronization method for a dual-computer hot-standby environment is applied to the dual-computer hot-standby environment, and the dual-computer hot-standby environment comprises the following steps: the main cloud platform of operation on the host node and the cloud platform of being equipped with of operation on being equipped with the node, its characterized in that includes:
when the main cloud platform generates configuration data, the main cloud platform stores the configuration data into a first local database and backs up the configuration data to the standby cloud platform, and the standby cloud platform receives the configuration data and stores the configuration data into a second local database;
if the standby node does not exist, the main cloud platform stores the configuration data into the first local database and stores the configuration data into a cache module;
when the standby node is newly added into the dual-computer hot standby environment, the main cloud platform acquires the configuration data in the cache module and backs up the configuration data to the standby cloud platform in batches, and the standby cloud platform stores the configuration data into the second local database after receiving the configuration data.
2. The method of claim 1, wherein when a primary cloud platform on a primary node in the dual-computer hot-standby environment generates configuration data, the primary cloud platform stores the configuration data in a first local database and backs up the configuration data to a standby cloud platform on a standby node, and the standby cloud platform receives the configuration data and stores the configuration data in a second local database, the method comprising:
a main cloud platform on a main node in the dual-computer hot standby environment receives configuration data input by a user;
the real-time backup module of the main cloud platform writes the configuration data into a first local database of the main cloud platform and backs up the configuration data to a real-time backup message processing module in a standby cloud platform on a standby node in the dual-computer hot standby environment;
and the real-time backup message processing module receives the configuration data and writes the configuration data into a second local database of the standby cloud platform.
3. The method of claim 1, wherein if the standby node does not exist, the primary cloud platform stores the configuration data in the first local database and stores the configuration data in a cache module, comprising:
a main cloud platform on a main node in the dual-computer hot standby environment receives configuration data input by a user;
and the real-time backup module of the main cloud platform checks whether the standby node exists, and if the standby node does not exist, the configuration data is written into the cache module of the main cloud platform and the first local database.
4. The method as claimed in claim 1, wherein when the standby node newly joins the dual-computer hot-standby environment, the primary cloud platform obtains the configuration data in the cache module and backs up the configuration data in batch to the standby cloud platform, and the standby cloud platform stores the configuration data in the second local database after receiving the configuration data, and the method includes:
when the main cloud platform detects that the standby node is newly added into the dual-computer hot standby environment, a batch backup instruction is sent to a batch backup module of the main cloud platform;
the batch backup module receives the batch backup instruction, acquires the configuration data in the cache module and backs up the configuration data in batch to a batch backup message processing module in the standby cloud platform;
and the batch backup message processing module receives the batch backup configuration data and stores the batch backup configuration data into the second local database in the secondary cloud platform.
5. The method of claim 1, wherein a user can log in the primary cloud platform through a client to configure the primary cloud platform; the configuration data of the batch backup is incremental data which is never backed up to the backup cloud platform; and when the main cloud platform and the standby cloud platform are subjected to main-standby switching, the standby cloud platform is used for providing services.
6. A data synchronization device for dual-computer hot standby environment, comprising: a main cloud platform and a standby cloud platform;
when a main cloud platform on a main node in the dual-computer hot standby environment generates configuration data, the main cloud platform stores the configuration data into a first local database and backs up the configuration data to a standby cloud platform on a standby node, and the standby cloud platform stores the configuration data into a second local database after receiving the configuration data;
if the standby node does not exist, the main cloud platform stores the configuration data into the first local database and stores the configuration data into a cache module;
when the standby node is newly added into the dual-computer hot standby environment, the main cloud platform acquires the configuration data in the cache module and backs up the configuration data to the standby cloud platform in batches, and the standby cloud platform stores the configuration data into the second local database after receiving the configuration data.
7. The apparatus of claim 6, wherein when the primary cloud platform on the primary node in the dual-computer hot-standby environment generates the configuration data, the primary cloud platform stores the configuration data in a first local database and backs up the configuration data to the standby cloud platform on the standby node, and the standby cloud platform receives the configuration data and stores the configuration data in a second local database, the apparatus comprising:
a main cloud platform on a main node in the dual-computer hot standby environment receives configuration data input by a user;
the real-time backup module of the main cloud platform writes the configuration data into a first local database of the main cloud platform and backs up the configuration data to a real-time backup message processing module in a standby cloud platform on a standby node in the dual-computer hot standby environment;
and the real-time backup message processing module receives the configuration data and writes the configuration data into a second local database of the standby cloud platform.
8. The apparatus of claim 6, wherein if the standby node does not exist, the primary cloud platform stores the configuration data in the first local database and stores the configuration data in the cache module, comprising:
a main cloud platform on a main node in the dual-computer hot standby environment receives configuration data input by a user;
and the real-time backup module of the main cloud platform checks whether the standby node exists, and if the standby node does not exist, the configuration data is written into the cache module of the main cloud platform and the first local database.
9. The apparatus for synchronizing data in a dual-computer hot-standby environment according to claim 6, wherein when the standby node newly joins the dual-computer hot-standby environment, the primary cloud platform obtains the configuration data in the cache module and backs up the configuration data in batch to the standby cloud platform, and the standby cloud platform stores the configuration data in the second local database after receiving the configuration data, including:
when the main cloud platform detects that the standby node is newly added into the dual-computer hot standby environment, a batch backup instruction is sent to a batch backup module of the main cloud platform;
the batch backup module receives the batch backup instruction, acquires the configuration data in the cache module and backs up the configuration data in batch to a batch backup message processing module in the standby cloud platform;
and the batch backup message processing module receives the batch backup configuration data and stores the batch backup configuration data into the second local database in the secondary cloud platform.
10. The apparatus of claim 6, wherein a user can log in the primary cloud platform through a client to configure the primary cloud platform; the configuration data of the batch backup is incremental data which is never backed up to the backup cloud platform; and when the main cloud platform and the standby cloud platform are subjected to main-standby switching, the standby cloud platform is used for providing services.
CN202011086990.7A 2020-10-12 2020-10-12 Data synchronization method and device for dual-computer hot standby environment Active CN112052127B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011086990.7A CN112052127B (en) 2020-10-12 2020-10-12 Data synchronization method and device for dual-computer hot standby environment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011086990.7A CN112052127B (en) 2020-10-12 2020-10-12 Data synchronization method and device for dual-computer hot standby environment

Publications (2)

Publication Number Publication Date
CN112052127A true CN112052127A (en) 2020-12-08
CN112052127B CN112052127B (en) 2022-07-22

Family

ID=73605620

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011086990.7A Active CN112052127B (en) 2020-10-12 2020-10-12 Data synchronization method and device for dual-computer hot standby environment

Country Status (1)

Country Link
CN (1) CN112052127B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114584459A (en) * 2022-03-07 2022-06-03 浪潮云信息技术股份公司 Method for realizing high availability of main and standby container cloud platforms
CN116389233A (en) * 2023-02-28 2023-07-04 港珠澳大桥管理局 Container cloud management platform active-standby switching system, method and device and computer equipment

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103500130A (en) * 2013-09-11 2014-01-08 上海爱数软件有限公司 Method for backing up dual-computer hot standby data in real time
US20190102571A1 (en) * 2017-10-03 2019-04-04 Servicenow, Inc. Searching for encrypted data within cloud based platform
CN110442643A (en) * 2019-07-05 2019-11-12 苏州浪潮智能科技有限公司 A kind of file synchronisation method and device for two-node cluster hot backup

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103500130A (en) * 2013-09-11 2014-01-08 上海爱数软件有限公司 Method for backing up dual-computer hot standby data in real time
US20190102571A1 (en) * 2017-10-03 2019-04-04 Servicenow, Inc. Searching for encrypted data within cloud based platform
CN110442643A (en) * 2019-07-05 2019-11-12 苏州浪潮智能科技有限公司 A kind of file synchronisation method and device for two-node cluster hot backup

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114584459A (en) * 2022-03-07 2022-06-03 浪潮云信息技术股份公司 Method for realizing high availability of main and standby container cloud platforms
CN116389233A (en) * 2023-02-28 2023-07-04 港珠澳大桥管理局 Container cloud management platform active-standby switching system, method and device and computer equipment
CN116389233B (en) * 2023-02-28 2024-05-28 港珠澳大桥管理局 Container cloud management platform active-standby switching system, method and device and computer equipment

Also Published As

Publication number Publication date
CN112052127B (en) 2022-07-22

Similar Documents

Publication Publication Date Title
US7428657B2 (en) Method for rolling back from snapshot with log
US5941999A (en) Method and system for achieving high availability in networked computer systems
US20180150501A1 (en) Database system, server device, computer program product, and information processing method
CN101908980B (en) Network management upgrading method and system
CN111427728B (en) State management method, main/standby switching method and electronic equipment
CN112052127B (en) Data synchronization method and device for dual-computer hot standby environment
US20100268687A1 (en) Node system, server switching method, server apparatus, and data takeover method
JP2001043105A (en) High-availability computer system and data backup method of the system
CN114124650A (en) Master-slave deployment method of SPTN (shortest Path bridging) network controller
CN106685688A (en) Cluster computer device synchronous upgrade method
KR101605455B1 (en) Method for Replicationing of Redo Log without Data Loss and System Thereof
US20230004465A1 (en) Distributed database system and data disaster backup drilling method
CN110351122B (en) Disaster recovery method, device, system and electronic equipment
CN116166470A (en) Redis cluster clone replication method and device, medium and equipment
JPH08186642A (en) Signal relay exchange duplication control device and method
CN112202601B (en) Application method of two physical node mongo clusters operated in duplicate set mode
JP2010231257A (en) High availability system and method for handling failure of high availability system
CN114785849A (en) Application high-availability method realized based on multi-level node network
CN112256484A (en) Data backup method, device and system
CN111563010B (en) Data synchronization method, system and storage medium based on dual-computer redundancy system
CN113886028A (en) Distributed system control method, device, electronic equipment and storage medium
JP2011054033A (en) Monitoring controller
JP4874211B2 (en) Computer system, synchronous operation method, node, and program
CN118300662A (en) System and method for solving hot standby of high-flux satellite system core network
KR0132955B1 (en) Method of mutual back-up duplicaion in local management

Legal Events

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