CN113806447A - Data synchronization method, device, equipment and medium - Google Patents
Data synchronization method, device, equipment and medium Download PDFInfo
- Publication number
- CN113806447A CN113806447A CN202111122955.0A CN202111122955A CN113806447A CN 113806447 A CN113806447 A CN 113806447A CN 202111122955 A CN202111122955 A CN 202111122955A CN 113806447 A CN113806447 A CN 113806447A
- Authority
- CN
- China
- Prior art keywords
- node
- port
- data
- standby
- ssh
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 87
- 230000001360 synchronised effect Effects 0.000 claims abstract description 80
- 238000012544 monitoring process Methods 0.000 claims abstract description 8
- 238000004590 computer program Methods 0.000 claims description 12
- 238000007726 management method Methods 0.000 description 65
- 238000010586 diagram Methods 0.000 description 6
- 101000692944 Homo sapiens PHD finger-like domain-containing protein 5A Proteins 0.000 description 2
- 102100026389 PHD finger-like domain-containing protein 5A Human genes 0.000 description 2
- 101100140267 Saccharomyces cerevisiae (strain ATCC 204508 / S288c) RDS2 gene Proteins 0.000 description 2
- 238000013523 data management Methods 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 1
- 230000000750 progressive effect Effects 0.000 description 1
- 230000004044 response Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/27—Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/07—Responding to the occurrence of a fault, e.g. fault tolerance
- G06F11/14—Error detection or correction of the data by redundancy in operation
- G06F11/1402—Saving, restoring, recovering or retrying
- G06F11/1446—Point-in-time backing up or restoration of persistent data
- G06F11/1448—Management of the data involved in backup or backup restore
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/07—Responding to the occurrence of a fault, e.g. fault tolerance
- G06F11/14—Error detection or correction of the data by redundancy in operation
- G06F11/1402—Saving, restoring, recovering or retrying
- G06F11/1446—Point-in-time backing up or restoration of persistent data
- G06F11/1458—Management of the backup or restore process
- G06F11/1464—Management of the backup or restore process for networked environments
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F21/00—Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F21/60—Protecting data
- G06F21/62—Protecting access to data via a platform, e.g. using keys or access control rules
- G06F21/6218—Protecting access to data via a platform, e.g. using keys or access control rules to a system of files or objects, e.g. local or distributed file system or database
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/50—Allocation of resources, e.g. of the central processing unit [CPU]
- G06F9/5061—Partitioning or combining of resources
- G06F9/5072—Grid computing
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Databases & Information Systems (AREA)
- Software Systems (AREA)
- Quality & Reliability (AREA)
- Computing Systems (AREA)
- Mathematical Physics (AREA)
- Data Mining & Analysis (AREA)
- Health & Medical Sciences (AREA)
- Bioethics (AREA)
- General Health & Medical Sciences (AREA)
- Computer Hardware Design (AREA)
- Computer Security & Cryptography (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The application discloses a data synchronization method, a device, equipment and a medium, wherein the method comprises the following steps: acquiring node information of a standby node corresponding to a main node sent by a database management platform; SSH connection is established with the standby node by utilizing the node information; monitoring a second port of a database on the main node through a first port of an SSH client on the main node, wherein the first port and the second port are only exposed to the main node; and if the first port monitors the data to be synchronized output by the second port, the data to be synchronized is sent to the standby node through SSH connection, so that when the SSH server on the standby node receives the data to be synchronized, the data to be synchronized is stored in the database through a third port of the database on the standby node, wherein the third port only exposes the standby node. Therefore, a high-safety data synchronization method of the main and standby nodes can be provided on the database management platform based on cloud computing, and the safety of the whole database management platform is improved.
Description
Technical Field
The present application relates to the field of cloud computing technologies, and in particular, to a data synchronization method, apparatus, device, and medium.
Background
In addition, when the master-slave data are synchronized, database service ports on the master node and the slave node need to be exposed to a public network, and ports directly exposed to the public network are easily attacked by hackers, so that the possibility of data leakage in the master-slave data synchronization process is further increased, and the safety performance of the whole cloud computing-based database management platform is reduced.
Therefore, how to provide a high-security data synchronization method on a cloud computing-based database management platform is an important problem to be solved by those skilled in the art.
Disclosure of Invention
In view of this, an object of the present application is to provide a data synchronization method, apparatus, device, and medium, which can provide a high-security data synchronization method for a master node and a slave node on a cloud-computing-based database management platform, so as to improve the security of the entire database management platform. The specific scheme is as follows:
in a first aspect, the present application discloses a data synchronization method, which is applied to a device and is applied to a master node on a cloud computing-based database management platform, and includes:
acquiring node information of a standby node corresponding to the main node, which is sent by the database management platform;
establishing SSH connection with the standby node by utilizing the node information;
monitoring a second port of a database on the main node through a first port of an SSH client on the main node, wherein the first port and the second port are both only exposed to the main node;
if the first port monitors the data to be synchronized output by the second port, the data to be synchronized is sent to the standby node through the SSH connection, so that when the SSH server on the standby node receives the data to be synchronized, the data to be synchronized is stored in the database on the standby node through a third port of the database on the standby node, wherein the third port only exposes the standby node.
Optionally, before the obtaining the node information of the standby node corresponding to the primary node, sent by the database management platform, the method further includes:
and acquiring master-slave node configuration information sent by the database management platform by using a Proxy module through an Agent module, and configuring nodes according to the master-slave node configuration information so that the master node and the slave node form a database master-slave framework.
Optionally, the obtaining node information of the standby node corresponding to the primary node, which is sent by the database management platform, includes:
and acquiring node information of the standby node corresponding to the main node, which is sent by the database management platform by using a Proxy module through an Agent module, wherein the node information comprises an SSH account, a password and an IP address of the standby node.
Optionally, the establishing, by using the node information, an SSH connection with the standby node includes:
and acquiring the node information received by the Agent module through an SSH Proxy module, and controlling the SSH client to establish SSH connection with an SSH server on the standby node by using the node information.
Optionally, the method further comprises:
acquiring first port configuration information;
configuring each of the first port and the second port to be exposed only to the host node according to the first port configuration information.
In a second aspect, the present application discloses a data synchronization method, which is applied to a backup node on a cloud computing-based database management platform, and includes:
receiving an SSH connection establishment request sent by a main node corresponding to the standby node, wherein the SSH connection establishment request is sent by the main node after receiving node information of the standby node sent by the database management platform;
responding to the SSH connection establishment request to establish SSH connection with the main node;
receiving data to be synchronized sent by the main node through the SSH connection through an SSH server on the standby node, wherein the data to be synchronized is data sent by a second port of a database on the main node, which is monitored by a first port of an SSH client on the main node, and the first port and the second port are both only exposed to the main node;
and storing the data to be synchronized into the database on the standby node through a third port of the database on the standby node, wherein the third port only exposes the standby node.
Optionally, the method further comprises:
acquiring second port configuration information;
configuring the third port to be exposed only to the standby node according to the second port configuration information.
In a third aspect, the present application discloses a data synchronization apparatus, which is applied to a master node on a cloud computing-based database management platform, and includes:
the data acquisition module is used for acquiring node information of the standby node corresponding to the main node and sent by the database management platform;
the connection establishing module is used for establishing SSH connection with the standby node by utilizing the node information;
a first port of an SSH client on the host node is configured to monitor a second port of a database on the host node, where both the first port and the second port are exposed only to the host node;
and a data sending module, configured to send the data to be synchronized to the standby node through the SSH connection if the first port monitors the data to be synchronized output by the second port, so that when the SSH server on the standby node receives the data to be synchronized, the data to be synchronized is stored in the database on the standby node through a third port of the database on the standby node, where the third port exposes only the standby node.
In a fourth aspect, the present application discloses an electronic device, comprising:
a memory and a processor;
wherein the memory is used for storing a computer program;
the processor is configured to execute the computer program to implement the data synchronization method disclosed above.
In a fifth aspect, the present application discloses a computer readable storage medium for storing a computer program, wherein the computer program, when executed by a processor, implements the data synchronization method disclosed above.
Therefore, the application discloses a data synchronization method, which is applied to a master node on a cloud computing-based database management platform, and comprises the following steps: firstly, the node information of the standby node corresponding to the main node and sent by the database management platform is obtained, and then SSH connection is established between the node information and the standby node. And then monitoring a second port of a database on the main node through a first port of an SSH client on the main node, wherein the first port and the second port are both only exposed to the main node. If the first port monitors the data to be synchronized output by the second port, the data to be synchronized is sent to the standby node through the SSH connection, so that when the SSH server on the standby node receives the data to be synchronized, the data to be synchronized is stored in the database on the standby node through a third port of the database on the standby node, wherein the third port only exposes the standby node.
Therefore, in the data synchronization process of the data synchronization method provided by the application, the port of the database on the main node, the SSH client on the main node and the port of the database on the standby node are only exposed to the local computer, but not exposed to a public network and the like outside the local computer, the ports of the database are not easily attacked by an external hacker, so that the security of the database management platform can be improved, and in addition, in the data synchronization process, the data to be synchronized is transmitted through the SSH connection between the main node and the standby node, and because the data on the SSH connection is transmitted in an encrypted manner instead of in a plain text manner, therefore, the transmitted data to be synchronized is not easy to leak, the safety of the database management platform is further improved, a data synchronization method of a main node and a standby node with high safety is provided on a database management platform based on cloud computing.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below, it is obvious that the drawings in the following description are only embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
FIG. 1 is a flow chart of a data synchronization method disclosed herein;
FIG. 2 is a schematic diagram of a specific data synchronization process disclosed herein;
FIG. 3 is an overall system architecture diagram of a cloud computing-based database management platform as disclosed herein;
FIG. 4 is a flow chart of a data synchronization method disclosed herein;
FIG. 5 is a schematic diagram of a data synchronization apparatus according to the present disclosure;
FIG. 6 is a schematic diagram of a data synchronization apparatus according to the present disclosure;
fig. 7 is a block diagram of an electronic device disclosed in the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
At present, when a database management platform based on cloud computing is used for master-slave synchronization data, data is transmitted in a plaintext and is easily acquired by a man-in-the-middle, information leakage is caused, and loss is caused. In view of this, the present application provides a data synchronization method, which can provide a high-security data synchronization method for a master node and a slave node on a database management platform based on cloud computing, and improve the security of the entire database management platform.
Referring to fig. 1, an embodiment of the present application discloses a data synchronization method, which is applied to a master node on a cloud computing-based database management platform, and the method includes:
step S11: and acquiring node information of the standby node corresponding to the main node, which is sent by the database management platform.
In practical application, a cloud computing-based database management platform includes a master node and a backup node corresponding to the master node, the master node and the backup node may be physical nodes or virtual machines, and the master node and the backup node are specifically set as physical nodes or virtual machines, which may be determined according to actual conditions, and are not specifically limited herein.
In a specific implementation process, the master node needs to receive node information of a standby node corresponding to the master node, where the node information includes an ssh (secure shell) account, a password, and an IP Address (Internet Protocol Address) of the standby node, where the node information is sent by the database management platform.
Step S12: and establishing SSH connection with the standby node by using the node information.
After the node information of the standby node is obtained, the node information and the standby node are also required to be used for establishing SSH connection. That is, the master node sends an SSH connection establishment request to the standby node by using the IP address of the standby node, the SSH account of the standby node, and the password, and the standby node needs to respond to the SSH connection establishment request to establish an SSH connection between the master node and the standby node.
Step S13: monitoring a second port of a database on the main node through a first port of an SSH client on the main node, wherein the first port and the second port are only exposed to the main node.
After the SSH connection with the standby node is established, a second port of a database on the host node needs to be monitored through a first port of an SSH client on the host node to see whether the second port outputs data, where the first port and the second port are both exposed only to the host node.
That is, the first port of the SSH client on the master node and the second port of the database are both configured to expose only the local host node and not the public network, so that a hacker cannot intercept and capture data from the first port and the second port, thereby avoiding data leakage and improving the security of the entire data management platform.
Correspondingly, the data synchronization method further comprises the following steps: acquiring first port configuration information; configuring each of the first port and the second port to be exposed only to the host node according to the first port configuration information.
That is, first port configuration information needs to be obtained, and then both the first port and the second port are configured to be exposed only to the host node according to the first port configuration information, so that the first port and the second port are not exposed to a public network.
Step S14: if the first port monitors the data to be synchronized output by the second port, the data to be synchronized is sent to the standby node through the SSH connection, so that when the SSH server on the standby node receives the data to be synchronized, the data to be synchronized is stored in the database on the standby node through a third port of the database on the standby node, wherein the third port only exposes the standby node.
If the first port monitors the data to be synchronized output by the second port, the data to be synchronized can be sent to the standby node through the SSH connection, and when the SSH server on the standby node receives the data to be synchronized, the data to be synchronized can be stored in the database on the standby node through a third port of the database on the standby node, wherein the third port only exposes the standby node.
In the data synchronization process, the data to be synchronized is transmitted through the SSH connection between the main node and the standby node, and the data to be synchronized is transmitted in an encrypted manner instead of in a plaintext manner on the SSH connection, so that the transmitted data to be synchronized is not easy to leak, the safety of the database management platform is further improved, and the data synchronization method of the main node and the standby node with high safety is provided on the database management platform based on cloud computing.
Therefore, the application discloses a data synchronization method, which is applied to a master node on a cloud computing-based database management platform, and comprises the following steps: firstly, the node information of the standby node corresponding to the main node and sent by the database management platform is obtained, and then SSH connection is established between the node information and the standby node. And then monitoring a second port of a database on the main node through a first port of an SSH client on the main node, wherein the first port and the second port are both only exposed to the main node. If the first port monitors the data to be synchronized output by the second port, the data to be synchronized is sent to the standby node through the SSH connection, so that when the SSH server on the standby node receives the data to be synchronized, the data to be synchronized is stored in the database on the standby node through a third port of the database on the standby node, wherein the third port only exposes the standby node.
Therefore, in the data synchronization process of the data synchronization method provided by the application, the port of the database on the main node, the SSH client on the main node and the port of the database on the standby node are only exposed to the local computer, but not exposed to a public network and the like outside the local computer, the ports of the database are not easily attacked by an external hacker, so that the security of the database management platform can be improved, and in addition, in the data synchronization process, the data to be synchronized is transmitted through the SSH connection between the main node and the standby node, and because the data on the SSH connection is transmitted in an encrypted manner instead of in a plain text manner, therefore, the transmitted data to be synchronized is not easy to leak, the safety of the database management platform is further improved, a data synchronization method of a main node and a standby node with high safety is provided on a database management platform based on cloud computing.
The Database Service provided by the master node and the backup node may be a Relational Database Service (RDS), and the Relational Database Service is an on-line Database Service that is ready to use, stable, reliable, and elastically scalable.
Referring to fig. 2, a schematic diagram of a data synchronization process between a primary node and a standby node is shown. The main node can provide a relational database service RDS, and the standby node can also provide the relational database service RDS. A first port (i.e., a localhost: port2 on the master node in fig. 2) of an SSH client on the master node (i.e., a SSH _ client on the master node in fig. 2) and a second port (i.e., a mysql localhost: port1 on the master node in fig. 3) of the database are both exposed only to the master node, a third port (i.e., a mysql localhost: port1 on the standby node in fig. 2) of the database on the standby node is exposed only to the standby node, a first port of the SSH client on the master node monitors the second port of the database on the master node, if the first port monitors to-be-synchronized data output by the second port, the to-be-synchronized data is sent to the standby node through an SSH connection between the master node and the standby node, and an SSH server (SSH _ server on the standby node in fig. 2) on the standby node receives the to-be-synchronized data, and storing the data to be synchronized into the database on the standby node through a third port of the database on the standby node.
In an actual implementation process, the overall system architecture of the cloud computing-based database Management Platform may be as shown in fig. 3, and includes a cloud computing-based database Management Platform 1(Data Management Platform, DMP), a master node 2 (which may provide a relational database service RDS), a slave node 3 (which may provide a relational database service RDS), a Proxy module 4 on the DMP, an Agent module 5 on the master node RDS2, an Agent module 5 on the slave node RDS3, and an SSH Proxy module 6 on the master node RDS, where the DMP Platform 1, the master node RDS2, and the slave node RDS3 may all be based on virtual machines on the cloud computing Platform and created by mirroring.
Correspondingly, the master node needs to acquire master-slave node configuration information sent by the database management platform by using the Proxy module 4 through an Agent module 5, and performs node configuration according to the master-slave node configuration information, so that the master node and the slave node form a database master-slave framework.
Correspondingly, the obtaining of the node information of the standby node corresponding to the primary node, which is sent by the database management platform, includes: and acquiring node information of a standby node corresponding to the main node, which is sent by the database management platform by using the Proxy module 4, through an Agent module 5, wherein the node information comprises an SSH account, a password and an IP address of the standby node.
Correspondingly, the establishing an SSH connection with the standby node by using the node information includes: and acquiring the node information received by the Agent module 5 through an SSH Proxy module 6, and controlling the SSH client to establish SSH connection with an SSH server on the standby node by using the node information.
Referring to fig. 4, an embodiment of the present application discloses a data synchronization method, which is applied to a standby node on a cloud computing-based database management platform, and the method includes:
step S21: and receiving an SSH connection establishment request sent by a main node corresponding to the standby node, wherein the SSH connection establishment request is sent by the main node after receiving the node information of the standby node sent by the database management platform.
In an actual implementation process, the standby node on the cloud-computing-based database management platform needs to receive an SSH connection establishment request sent by the master node, where the SSH connection establishment request is sent by the master node after receiving node information of the standby node sent by the database management platform.
That is, the database management platform first sends the node information of the standby node to the master node, after receiving the node information, the master node sends an SSH connection establishment request to the standby node by using the node information, and the standby node needs to receive the SSH connection establishment request sent by the master node.
Step S22: and responding to the SSH connection establishment request to establish the SSH connection with the main node.
After receiving the SSH connection establishment request, the SSH connection establishment request needs to be responded to establish an SSH connection with the master node.
Step S23, receiving, by the SSH server on the standby node, data to be synchronized sent by the host node through the SSH connection, where the data to be synchronized is data sent by a first port of an SSH client on the host node monitoring a second port of a database on the host node, and both the first port and the second port are exposed only to the host node.
A first port on an SSH client on the master node monitors a second port of a database on the master node, and when data to be synchronized is monitored, the master node sends the data to be synchronized to the standby node through the SSH connection, so that the standby node needs to receive the data to be synchronized sent by the master node through the SSH connection through an SSH server thereon, and the first port and the second port are both exposed only to the master node.
Step S24: and storing the data to be synchronized into the database on the standby node through a third port of the database on the standby node, wherein the third port only exposes the standby node.
After receiving the data to be synchronized, the standby node stores the data to be synchronized in the database on the standby node through a third port of the database on the standby node, and the third port only exposes the standby node.
Correspondingly, the data synchronization method further includes: acquiring second port configuration information; configuring the third port to be exposed only to the standby node according to the second port configuration information.
Therefore, the application discloses a data synchronization method, which is applied to a backup node on a database management platform based on cloud computing, and comprises the following steps: receiving an SSH connection establishment request sent by a main node corresponding to the standby node, wherein the SSH connection establishment request is sent by the main node after receiving node information of the standby node sent by the database management platform; responding to the SSH connection establishment request to establish SSH connection with the main node; receiving data to be synchronized sent by the main node through the SSH connection through an SSH server on the standby node, wherein the data to be synchronized is data sent by a second port of a database on the main node, which is monitored by a first port of an SSH client on the main node, and the first port and the second port are both only exposed to the main node; and storing the data to be synchronized into the database on the standby node through a third port of the database on the standby node, wherein the third port only exposes the standby node.
Therefore, in the data synchronization process of the data synchronization method provided by the application, the port of the database on the main node, the SSH client on the main node and the port of the database on the standby node are only exposed to the local computer, but not exposed to a public network and the like outside the local computer, the ports of the database are not easily attacked by an external hacker, so that the security of the database management platform can be improved, and in addition, in the data synchronization process, the data to be synchronized is transmitted through the SSH connection between the main node and the standby node, and because the data on the SSH connection is transmitted in an encrypted manner instead of in a plain text manner, therefore, the transmitted data to be synchronized is not easy to leak, the safety of the database management platform is further improved, a data synchronization method of a main node and a standby node with high safety is provided on a database management platform based on cloud computing.
Referring to fig. 5, an embodiment of the present application discloses a data synchronization apparatus, which is applied to a master node on a cloud computing-based database management platform, and includes:
a data obtaining module 11, configured to obtain node information of a standby node corresponding to the primary node, where the node information is sent by the database management platform;
a connection establishing module 12, configured to establish an SSH connection with the standby node by using the node information;
a first port 13 of the SSH client on the host node, configured to monitor a second port of the database on the host node, where both the first port and the second port are exposed only to the host node;
a data sending module 14, configured to send the data to be synchronized to the standby node through the SSH connection if the first port monitors the data to be synchronized output by the second port, so that when the SSH server on the standby node receives the data to be synchronized, the data to be synchronized is stored in the database on the standby node through a third port of the database on the standby node, where the third port only exposes the standby node.
Therefore, the application discloses a data synchronization method, which is applied to a master node on a cloud computing-based database management platform, and comprises the following steps: firstly, the node information of the standby node corresponding to the main node and sent by the database management platform is obtained, and then SSH connection is established between the node information and the standby node. And then monitoring a second port of a database on the main node through a first port of an SSH client on the main node, wherein the first port and the second port are both only exposed to the main node. If the first port monitors the data to be synchronized output by the second port, the data to be synchronized is sent to the standby node through the SSH connection, so that when the SSH server on the standby node receives the data to be synchronized, the data to be synchronized is stored in the database on the standby node through a third port of the database on the standby node, wherein the third port only exposes the standby node.
Therefore, in the data synchronization process of the data synchronization method provided by the application, the port of the database on the main node, the SSH client on the main node and the port of the database on the standby node are only exposed to the local computer, but not exposed to a public network and the like outside the local computer, the ports of the database are not easily attacked by an external hacker, so that the security of the database management platform can be improved, and in addition, in the data synchronization process, the data to be synchronized is transmitted through the SSH connection between the main node and the standby node, and because the data on the SSH connection is transmitted in an encrypted manner instead of in a plain text manner, therefore, the transmitted data to be synchronized is not easy to leak, the safety of the database management platform is further improved, a data synchronization method of a main node and a standby node with high safety is provided on a database management platform based on cloud computing.
In some specific embodiments, the data obtaining module 11 is further configured to:
and acquiring master-slave node configuration information sent by the database management platform by using a Proxy module through an Agent module, and configuring nodes according to the master-slave node configuration information so that the master node and the slave node form a database master-slave framework.
In some specific embodiments, the data obtaining module 11 is configured to:
and acquiring node information of the standby node corresponding to the main node, which is sent by the database management platform by using a Proxy module through an Agent module, wherein the node information comprises an SSH account, a password and an IP address of the standby node.
In some specific embodiments, the connection establishing module 12 is configured to:
and acquiring the node information received by the Agent module through an SSH Proxy module, and controlling the SSH client to establish SSH connection with an SSH server on the standby node by using the node information.
In some specific embodiments, the system further comprises a first port configuration module configured to:
acquiring first port configuration information;
configuring each of the first port and the second port to be exposed only to the host node according to the first port configuration information.
Referring to fig. 6, an embodiment of the present application discloses a data synchronization apparatus, which is applied to a standby node on a cloud-computing-based database management platform, and includes:
a request receiving module 21, configured to receive an SSH connection establishment request sent by a master node corresponding to the standby node, where the SSH connection establishment request is sent by the master node after receiving node information of the standby node sent by the database management platform;
a request response module 22, configured to respond to the SSH connection establishment request to establish an SSH connection with the host node;
a synchronization data processing module 23, configured to receive, by an SSH server on the standby node, to-be-synchronized data sent by the host node through the SSH connection, where the to-be-synchronized data is data sent by a first port of an SSH client on the host node, where the first port monitors a second port of a database on the host node, and both the first port and the second port are exposed only to the host node;
and a third port 24 of the database on the standby node, configured to store the data to be synchronized in the database on the standby node, where the third port only exposes the standby node.
Therefore, the application discloses a data synchronization method, which is applied to a backup node on a database management platform based on cloud computing, and comprises the following steps: receiving an SSH connection establishment request sent by a main node corresponding to the standby node, wherein the SSH connection establishment request is sent by the main node after receiving node information of the standby node sent by the database management platform; responding to the SSH connection establishment request to establish SSH connection with the main node; receiving data to be synchronized sent by the main node through the SSH connection through an SSH server on the standby node, wherein the data to be synchronized is data sent by a second port of a database on the main node, which is monitored by a first port of an SSH client on the main node, and the first port and the second port are both only exposed to the main node; and storing the data to be synchronized into the database on the standby node through a third port of the database on the standby node, wherein the third port only exposes the standby node.
Therefore, in the data synchronization process of the data synchronization method provided by the application, the port of the database on the main node, the SSH client on the main node and the port of the database on the standby node are only exposed to the local computer, but not exposed to a public network and the like outside the local computer, the ports of the database are not easily attacked by an external hacker, so that the security of the database management platform can be improved, and in addition, in the data synchronization process, the data to be synchronized is transmitted through the SSH connection between the main node and the standby node, and because the data on the SSH connection is transmitted in an encrypted manner instead of in a plain text manner, therefore, the transmitted data to be synchronized is not easy to leak, the safety of the database management platform is further improved, a data synchronization method of a main node and a standby node with high safety is provided on a database management platform based on cloud computing.
In some specific embodiments, the system further comprises a second port configuration module configured to:
acquiring second port configuration information;
configuring the third port to be exposed only to the standby node according to the second port configuration information.
Further, referring to fig. 7, an embodiment of the present application further discloses an electronic device, including: a processor 31 and a memory 32.
Wherein the memory 32 is used for storing a computer program; the processor 31 is configured to execute the computer program to implement the data synchronization method disclosed in the foregoing embodiments.
For the specific process of the data synchronization method, reference may be made to corresponding contents disclosed in the foregoing embodiments, and details are not repeated here.
Further, an embodiment of the present application also discloses a computer-readable storage medium for storing a computer program, wherein the computer program, when executed by a processor, implements the data synchronization method disclosed in any of the foregoing embodiments.
For the specific process of the data synchronization method, reference may be made to corresponding contents disclosed in the foregoing embodiments, and details are not repeated here.
The embodiments are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same or similar parts among the embodiments are referred to each other. The device disclosed by the embodiment corresponds to the method disclosed by the embodiment, so that the description is simple, and the relevant points can be referred to the method part for description.
The steps of a method or algorithm described in connection with the embodiments disclosed herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. A software module may reside in Random Access Memory (RAM), memory, Read Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
Finally, it is further noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of other elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The above detailed description is provided for a data synchronization method, apparatus, device, and medium provided by the present application, and a specific example is applied in the present application to explain the principle and the implementation of the present application, and the description of the above embodiment is only used to help understand the method and the core idea of the present application; meanwhile, for a person skilled in the art, according to the idea of the present application, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present application.
Claims (10)
1. A data synchronization method is characterized in that the method is applied to a master node on a cloud computing-based database management platform and comprises the following steps:
acquiring node information of a standby node corresponding to the main node, which is sent by the database management platform;
establishing SSH connection with the standby node by utilizing the node information;
monitoring a second port of a database on the main node through a first port of an SSH client on the main node, wherein the first port and the second port are both only exposed to the main node;
if the first port monitors the data to be synchronized output by the second port, the data to be synchronized is sent to the standby node through the SSH connection, so that when the SSH server on the standby node receives the data to be synchronized, the data to be synchronized is stored in the database on the standby node through a third port of the database on the standby node, wherein the third port only exposes the standby node.
2. The data synchronization method according to claim 1, wherein before the obtaining node information of the standby node corresponding to the primary node sent by the database management platform, the method further comprises:
and acquiring master-slave node configuration information sent by the database management platform by using a Proxy module through an Agent module, and configuring nodes according to the master-slave node configuration information so that the master node and the slave node form a database master-slave framework.
3. The method according to claim 1, wherein the obtaining node information of the standby node corresponding to the primary node, which is sent by the database management platform, comprises:
and acquiring node information of the standby node corresponding to the main node, which is sent by the database management platform by using a Proxy module through an Agent module, wherein the node information comprises an SSH account, a password and an IP address of the standby node.
4. The data synchronization method according to claim 3, wherein the establishing an SSH connection with the standby node by using the node information comprises:
and acquiring the node information received by the Agent module through an SSH Proxy module, and controlling the SSH client to establish SSH connection with an SSH server on the standby node by using the node information.
5. The data synchronization method according to any one of claims 1 to 4, further comprising:
acquiring first port configuration information;
configuring each of the first port and the second port to be exposed only to the host node according to the first port configuration information.
6. A data synchronization method is applied to a backup node on a database management platform based on cloud computing, and comprises the following steps:
receiving an SSH connection establishment request sent by a main node corresponding to the standby node, wherein the SSH connection establishment request is sent by the main node after receiving node information of the standby node sent by the database management platform;
responding to the SSH connection establishment request to establish SSH connection with the main node;
receiving data to be synchronized sent by the main node through the SSH connection through an SSH server on the standby node, wherein the data to be synchronized is data sent by a second port of a database on the main node, which is monitored by a first port of an SSH client on the main node, and the first port and the second port are both only exposed to the main node;
and storing the data to be synchronized into the database on the standby node through a third port of the database on the standby node, wherein the third port only exposes the standby node.
7. The data synchronization method of claim 6, further comprising:
acquiring second port configuration information;
configuring the third port to be exposed only to the standby node according to the second port configuration information.
8. A data synchronization device is applied to a master node on a cloud computing-based database management platform, and comprises:
the data acquisition module is used for acquiring node information of the standby node corresponding to the main node and sent by the database management platform;
the connection establishing module is used for establishing SSH connection with the standby node by utilizing the node information;
a first port of an SSH client on the host node is configured to monitor a second port of a database on the host node, where both the first port and the second port are exposed only to the host node;
and a data sending module, configured to send the data to be synchronized to the standby node through the SSH connection if the first port monitors the data to be synchronized output by the second port, so that when the SSH server on the standby node receives the data to be synchronized, the data to be synchronized is stored in the database on the standby node through a third port of the database on the standby node, where the third port exposes only the standby node.
9. An electronic device, comprising:
a memory and a processor;
wherein the memory is used for storing a computer program;
the processor is configured to execute the computer program to implement the data synchronization method of any one of claims 1 to 7.
10. A computer-readable storage medium for storing a computer program, wherein the computer program when executed by a processor implements the data synchronization method of any one of claims 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111122955.0A CN113806447B (en) | 2021-09-24 | 2021-09-24 | Data synchronization method, device, equipment and medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111122955.0A CN113806447B (en) | 2021-09-24 | 2021-09-24 | Data synchronization method, device, equipment and medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN113806447A true CN113806447A (en) | 2021-12-17 |
CN113806447B CN113806447B (en) | 2024-08-20 |
Family
ID=78940415
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202111122955.0A Active CN113806447B (en) | 2021-09-24 | 2021-09-24 | Data synchronization method, device, equipment and medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113806447B (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115766382A (en) * | 2022-10-21 | 2023-03-07 | 济南浪潮数据技术有限公司 | Cloud computing platform-based inspection method, system, equipment and medium |
Citations (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20090125633A1 (en) * | 2007-11-14 | 2009-05-14 | Juniper Networks, Inc. | Server initiated secure network connection |
US20130124852A1 (en) * | 2011-11-11 | 2013-05-16 | Michael T. Kain | File-based application programming interface providing ssh-secured communication |
CN206149327U (en) * | 2016-11-22 | 2017-05-03 | 北京万方数据股份有限公司 | Information cloud management platform and information system of enterprise |
CN106790446A (en) * | 2016-12-02 | 2017-05-31 | 深圳市小满科技有限公司 | Data backup system and method |
US20180113896A1 (en) * | 2016-10-20 | 2018-04-26 | International Business Machines Corporation | Synchronizing data across multiple instances of an application in a cloud |
CN108243187A (en) * | 2017-12-29 | 2018-07-03 | 亿阳安全技术有限公司 | A kind of automatic encryption method, system and service module based on SSH tunnels |
CN108600156A (en) * | 2018-03-07 | 2018-09-28 | 华为技术有限公司 | A kind of server and safety certifying method |
CN109561054A (en) * | 2017-09-26 | 2019-04-02 | 华为技术有限公司 | A kind of data transmission method, controller and access device |
CN112416878A (en) * | 2020-11-09 | 2021-02-26 | 山西云时代技术有限公司 | File synchronization management method based on cloud platform |
CN113312148A (en) * | 2021-06-15 | 2021-08-27 | 深信服科技股份有限公司 | Big data service deployment method, device, equipment and medium |
-
2021
- 2021-09-24 CN CN202111122955.0A patent/CN113806447B/en active Active
Patent Citations (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20090125633A1 (en) * | 2007-11-14 | 2009-05-14 | Juniper Networks, Inc. | Server initiated secure network connection |
US20130124852A1 (en) * | 2011-11-11 | 2013-05-16 | Michael T. Kain | File-based application programming interface providing ssh-secured communication |
US20180113896A1 (en) * | 2016-10-20 | 2018-04-26 | International Business Machines Corporation | Synchronizing data across multiple instances of an application in a cloud |
CN206149327U (en) * | 2016-11-22 | 2017-05-03 | 北京万方数据股份有限公司 | Information cloud management platform and information system of enterprise |
CN106790446A (en) * | 2016-12-02 | 2017-05-31 | 深圳市小满科技有限公司 | Data backup system and method |
CN109561054A (en) * | 2017-09-26 | 2019-04-02 | 华为技术有限公司 | A kind of data transmission method, controller and access device |
CN108243187A (en) * | 2017-12-29 | 2018-07-03 | 亿阳安全技术有限公司 | A kind of automatic encryption method, system and service module based on SSH tunnels |
CN108600156A (en) * | 2018-03-07 | 2018-09-28 | 华为技术有限公司 | A kind of server and safety certifying method |
CN112416878A (en) * | 2020-11-09 | 2021-02-26 | 山西云时代技术有限公司 | File synchronization management method based on cloud platform |
CN113312148A (en) * | 2021-06-15 | 2021-08-27 | 深信服科技股份有限公司 | Big data service deployment method, device, equipment and medium |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115766382A (en) * | 2022-10-21 | 2023-03-07 | 济南浪潮数据技术有限公司 | Cloud computing platform-based inspection method, system, equipment and medium |
Also Published As
Publication number | Publication date |
---|---|
CN113806447B (en) | 2024-08-20 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110191007B (en) | Node management method, system and computer readable storage medium | |
CN112035215B (en) | Node autonomous method, system and device of node cluster and electronic equipment | |
USRE47924E1 (en) | Caching network generated security certificates | |
CN111064569B (en) | Cluster key obtaining method and device of trusted computing cluster | |
US7788522B1 (en) | Autonomous cluster organization, collision detection, and resolutions | |
CN107113319B (en) | Method, device and system for responding in virtual network computing authentication and proxy server | |
CN111225020B (en) | User mode network file system dual-stack access method, device and equipment | |
CN102164116B (en) | Method, system and corresponding device for balancing load | |
CN111259072B (en) | Data synchronization method, device, electronic equipment and computer readable storage medium | |
CN107172001B (en) | Control method and device of website proxy server and key proxy server | |
US11163499B2 (en) | Method, apparatus and system for controlling mounting of file system | |
CN113542274A (en) | Cross-domain data transmission method, device, server and storage medium | |
CN112929225B (en) | Session exception handling method and device, computer equipment and storage medium | |
CN110619022B (en) | Node detection method, device, equipment and storage medium based on block chain network | |
CN113806447B (en) | Data synchronization method, device, equipment and medium | |
CN113038594B (en) | Network management registration method and device for MESH extended equipment | |
CN114500527A (en) | Out-of-band management system and method for edge device | |
CN113766013A (en) | Session creation method, device, equipment and storage medium | |
CN109495602A (en) | A kind of processing method and processing device of network insertion exception | |
US20180109563A1 (en) | Hub and Agent Communication Through a Firewall | |
KR20210044281A (en) | Method and apparatus for ensuring continuous device operation stability in cloud degraded mode | |
CN111240904A (en) | Database backup method and device, electronic equipment and storage medium | |
CN115037537A (en) | Abnormal traffic interception and abnormal domain name identification method, device, equipment and medium | |
CN111641664B (en) | Crawler equipment service request method, device and system and storage medium | |
CN110290173A (en) | A kind of active and standby DNS synchronous method and device |
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 |