CN115665142A - Online upgrading method based on distributed database and related device - Google Patents

Online upgrading method based on distributed database and related device Download PDF

Info

Publication number
CN115665142A
CN115665142A CN202211238098.5A CN202211238098A CN115665142A CN 115665142 A CN115665142 A CN 115665142A CN 202211238098 A CN202211238098 A CN 202211238098A CN 115665142 A CN115665142 A CN 115665142A
Authority
CN
China
Prior art keywords
task scheduling
management server
request
online
upgrading
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.)
Pending
Application number
CN202211238098.5A
Other languages
Chinese (zh)
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.)
Shenzhen Hanyun Technology Co ltd
Original Assignee
Shenzhen Hanyun 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 Shenzhen Hanyun Technology Co ltd filed Critical Shenzhen Hanyun Technology Co ltd
Priority to CN202211238098.5A priority Critical patent/CN115665142A/en
Publication of CN115665142A publication Critical patent/CN115665142A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention relates to the field of databases, and discloses an online upgrading method and a related device based on a distributed database, which comprises the following steps: constructing a distributed database, and establishing communication connection between a management server cluster and a task scheduling server cluster and communication connection between the task scheduling server cluster and a data node cluster; obtaining a database upgrade request, wherein the database upgrade request comprises: a management server online upgrade request, a task scheduling server online upgrade request or a data node online upgrade request; when the upgrading request is a management server online upgrading request, closing the slave management servers in the management server cluster, and performing online upgrading on the closed slave management servers; and when all the slave management servers are detected to be upgraded, upgrading the master management server in the management server cluster, and selecting a new master management server from the slave management servers to receive the communication request from the task scheduling server cluster.

Description

Online upgrading method based on distributed database and related device
Technical Field
The invention relates to the field of databases, in particular to an online upgrading method based on a distributed database and a related device.
Background
With the progress of technology development, people can not leave software services more and more. Under the background that people rely on software services more and more in daily life and work production, higher requirements are put on the availability of the software services, so that application software often selects distributed data with higher availability as a service for processing and storing data in a background. When a typical distributed database online application uses a database as a service for background processing and data storage, the service is required to be stopped when the database is upgraded, and the application cannot be served with the data at this time, which greatly reduces the availability of the distributed database and the online application. Therefore, how to avoid the problem that the service cannot be provided for the application terminal due to the service shutdown in the upgrading process of the distributed database becomes a technical problem to be solved urgently.
The above is only for the purpose of assisting understanding of the technical solution of the present invention, and does not represent an admission that the above is the prior art.
Disclosure of Invention
The invention mainly aims to provide an online upgrading method based on a distributed database and a related device, and aims to solve the technical problem that the service needs to be stopped and the application service cannot be realized during online upgrading based on the distributed database.
In order to achieve the above object, the present invention provides an online upgrade method based on a distributed database, which comprises the following steps:
constructing a distributed database, wherein the distributed database comprises a management server cluster, a task scheduling server cluster and a data node cluster;
establishing communication connection between the management server cluster and the task scheduling server cluster and communication connection between the task scheduling server cluster and the data node cluster;
obtaining a database upgrade request, wherein the database upgrade request comprises: a management server online upgrade request, a task scheduling server online upgrade request or a data node online upgrade request;
when the upgrading request is a management server online upgrading request, firstly closing a slave management server in the management server cluster, and performing online upgrading on the closed slave management server;
and when all the slave management servers are detected to be upgraded, upgrading the master management server in the management server cluster, and selecting a new master management server from the slave management servers to receive the communication request from the task scheduling server cluster.
Optionally, when the upgrade request is a management server online upgrade request, first closing a slave management server in the management server cluster, and performing online upgrade on the closed slave management server includes:
when the upgrading request is a management server online upgrading request, determining all machine addresses for installing management server protocols in the management server cluster;
determining a master management server and a slave management server in the management server cluster according to the machine address of the installation management server protocol;
and closing the slave management server in the management server cluster and upgrading the slave management server.
Optionally, after it is detected that all the slave management servers are completely upgraded, upgrading a master management server in the management server cluster, and meanwhile, selecting a new master management server from the slave management servers to receive a communication request from the task scheduling server cluster includes:
when all the slave management servers are detected to be upgraded, sending a preset signal to a master management server in the management server cluster so that the master management server deletes the registration information of a master management role;
upgrading a main management server in the management server cluster;
and selecting a new master management server from the slave management servers to receive the communication request from the task scheduling server cluster.
Optionally, the obtaining a database upgrade request includes: after the management server online upgrade request, the task scheduling server online upgrade request or the data node online upgrade request, the method further comprises the following steps:
when the database upgrading request is a task scheduling server online upgrading request, upgrading all task scheduling servers in the task scheduling server cluster one by one according to a preset script;
and when the database upgrading request is a data node online upgrading request, upgrading the data node cluster.
Optionally, when the database upgrade request is an online upgrade request of a task scheduling server, upgrading all task scheduling servers in the task scheduling server cluster one by one according to a preset script includes:
when the database upgrading request is a task scheduling server online upgrading request, acquiring machine addresses of all installed task scheduling services in the task scheduling server cluster;
determining a target task scheduling server in the machine address for installing the task scheduling service according to a preset rule, and sending a stop signal to the target task scheduling server by using a preset script so as to stop all working ports on the target task scheduling server;
establishing a version number corresponding to the upgrading request information in the target task scheduling server to complete the updating of the target task scheduling server;
and updating the residual task scheduling servers in the machine addresses provided with the task scheduling services one by one.
Optionally, the determining, according to a preset rule, a target task scheduling server in the machine address of the installation task scheduling service, and sending a stop signal to the target task scheduling server using a preset script to stop running of all work ports on the target task scheduling server includes:
determining a target task scheduling server in the machine address of the installation task scheduling service according to a preset rule;
sending a stop signal to the target task scheduling server by using a preset script so as to stop all the working ports on the target task scheduling server from being used;
and waiting for the target task scheduling server to finish the execution of the ongoing scheduling task.
Optionally, when the database upgrade request is a data node online upgrade request, upgrading the data node cluster includes:
when the database upgrading request is a data node online upgrading request, determining a target data node according to a second preset rule, wherein the target data node is the main data node or the slave data node;
deleting the online registration information corresponding to the target data node in the scheduling task server;
after waiting for a preset time, upgrading the target data node;
and after the target data node is detected to be upgraded, upgrading by taking the master data node or the slave data node which is not updated as the target node.
In addition, in order to achieve the above object, the present invention further provides an online upgrade apparatus based on a distributed database, including:
the database construction module is used for constructing a distributed database, and the distributed database comprises a management server cluster, a task scheduling server cluster and a data node cluster;
the communication connection module is used for establishing communication connection between the management server cluster and the task scheduling server cluster and communication connection between the task scheduling server cluster and the data node cluster;
an upgrade request module, configured to obtain a database upgrade request, where the database upgrade request includes: a management server online upgrade request, a task scheduling server online upgrade request or a data node online upgrade request;
the slave manager module is used for firstly closing the slave management servers in the management server cluster and carrying out online upgrade on the closed slave management servers when the upgrade request is the online upgrade request of the management servers;
and the master manager module is used for upgrading the master management server in the management server cluster after all the slave management servers are detected to be upgraded, and selecting a new master management server from the slave management servers to receive the communication request from the task scheduling server cluster.
In addition, in order to achieve the above object, the present invention further provides an online upgrade device based on a distributed database, where the online upgrade device based on the distributed database includes: the system comprises a memory, a processor and a distributed database-based online upgrade generation program stored on the memory and operable on the processor, wherein the distributed database-based online upgrade program is configured to implement the steps of the distributed database-based online upgrade method as described above.
In addition, to achieve the above object, the present invention further provides a storage medium, on which an online upgrade program based on a distributed database is stored, and when the online upgrade program based on the distributed database is executed by a processor, the steps of the online upgrade generation method based on the distributed database as described above are implemented.
The method comprises the steps that a distributed database is built, wherein the distributed database comprises a management server cluster, a task scheduling server cluster and a data node cluster; establishing communication connection between the management server cluster and the task scheduling server cluster and communication connection between the task scheduling server cluster and the data node cluster; obtaining a database upgrade request, wherein the database upgrade request comprises: a management server online upgrading request, a task scheduling server online upgrading request or a data node online upgrading request; when the upgrading request is a management server online upgrading request, firstly closing a slave management server in the management server cluster, and performing online upgrading on the closed slave management server; when the fact that all the slave management servers are completely upgraded is detected, the master management server in the management server cluster is upgraded, meanwhile, a new master management server is selected from the slave management servers to receive the communication request from the task scheduling server cluster, and the characteristic that all parts of the distributed database are redundant is utilized, so that the effect that the database service can be provided to the outside can be still guaranteed in the database upgrading process.
Drawings
FIG. 1 is a schematic structural diagram of a distributed database-based online upgrade device of a hardware operating environment according to an embodiment of the present invention;
FIG. 2 is a schematic flow chart of a first embodiment of the distributed database-based online upgrade method according to the present invention;
FIG. 3 is a conceptual diagram of a Tianyu star uniform database according to a first embodiment of the online upgrade method based on a distributed database of the present invention;
fig. 4 is a structure diagram of a sky-cloud-star database according to a first embodiment of the online upgrade method based on a distributed database of the present invention:
FIG. 5 is a flowchart illustrating the session service online upgrade method according to the first embodiment of the present invention;
FIG. 6 is a flowchart of a first embodiment of an online upgrade method for a distributed database according to the present invention;
fig. 7 is a block diagram of a first embodiment of the distributed database-based online upgrade apparatus according to the present invention.
The implementation, functional features and advantages of the present invention will be further described with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
Referring to fig. 1, fig. 1 is a schematic structural diagram of a distributed database-based online upgrade device for a hardware operating environment according to an embodiment of the present invention.
As shown in fig. 1, the distributed database-based online upgrade apparatus may include: a processor 1001, such as a Central Processing Unit (CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. The communication bus 1002 is used to implement connection communication among these components. The user interface 1003 may include a Display screen (Display), an input unit such as a Keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface, a wireless interface. The network interface 1004 may optionally include a standard wired interface, a WIreless interface (e.g., a WIreless-FIdelity (WI-FI) interface). The Memory 1005 may be a Random Access Memory (RAM) Memory, or may be a Non-Volatile Memory (NVM), such as a disk Memory. The memory 1005 may alternatively be a storage device separate from the processor 1001.
Those skilled in the art will appreciate that the architecture shown in FIG. 1 does not constitute a limitation of a distributed database-based online upgrade facility, and may include more or fewer components than those shown, or some components in combination, or a different arrangement of components.
As shown in fig. 1, the memory 1005, which is a storage medium, may include therein an operating system, a data storage module, a network communication module, a user interface module, and an online upgrade program based on a distributed database.
In the distributed database-based online upgrade apparatus shown in fig. 1, the network interface 1004 is mainly used for data communication with a network server; the user interface 1003 is mainly used for data interaction with a user; the processor 1001 and the memory 1005 of the online upgrade device based on the distributed database according to the present invention may be disposed in the online upgrade device based on the distributed database, and the online upgrade device based on the distributed database invokes the online upgrade program based on the distributed database stored in the memory 1005 through the processor 1001, and executes the online upgrade method based on the distributed database according to the embodiment of the present invention.
An embodiment of the present invention provides an online upgrade method based on a distributed database, and referring to fig. 2, fig. 2 is a schematic flow diagram of a first embodiment of the online upgrade method based on the distributed database.
In this embodiment, the online upgrade method based on the distributed database includes the following steps:
it should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
Step S10: and constructing a distributed database, wherein the distributed database comprises a management server cluster, a task scheduling server cluster and a data node cluster.
In a specific implementation, the distributed database built in this embodiment may be a heaven-cloud-star database, which is a typical distributed database and is mainly characterized in that each Data Node (DN) has all tables, and each DN stores part of data of each table. In the Tianyun star database, each row of table records are stored in two DNs which are in backup relation with each other, and no matter which DN executes the non-query SQL, the non-query SQL is synchronized to the corresponding backup DN for execution, so that the two DNs which are in backup relation with each other are ensured to store the same data. The database is externally provided with services by a scheduling server (server), all machines in the cluster can be provided with servers, each server can be connected with all DN, the servers receive SQL sent from the outside and issue the SQL to DN for execution after certain processing, and then the result set generated by DN is processed and returned to the requesting party. Wherein, DN represents data node, providing data storage and processing service; the server is represented as a task scheduling server; man is denoted as a management server; the master represents the role of the man providing the management service generated for man election; the follower represents the role of electing the man which is not elected as the master, in the embodiment, the master management server represents the role of electing the man as the master, and the slave management server represents the role of the man which is not elected as the master; after the connection between the application program and the server is successfully established, the master-slave node can select the data node of which the sql of the current session is directly executed between two batches of DNs storing the same data, wherein the selected data node on the side is called as the master node, and the data node on the other side is called as the slave node.
It is understood that the Sky-Cloud-Star Database (SCSDB) shown in fig. 3 is a structured Database with distributed storage and parallel computing, and can support TB-to-PB level data storage and analysis. The SCSDB adopts a shared-nothing (shared-nothing) architecture, organizes a plurality of nodes into a parallel computing network, and provides uniform database service for the outside. The SCSDB can support 1024 nodes at most, has high availability and dynamic expansion capability, and is a high-cost-performance general solution for massive structured data application.
Step S20: and establishing communication connection between the management server cluster and the task scheduling server cluster and communication connection between the task scheduling server cluster and the data node cluster.
It should be noted that the management server cluster is connected with the task scheduling server cluster, and the management server cluster is used for managing the task scheduling server in the task scheduling server cluster; the task scheduling server cluster is used for acquiring request information sent by application software, carrying out work calling according to the request information and issuing an instruction to a data node cluster connected with the task scheduling server; the data node cluster comprises a main data node and a slave data node, and after the data node cluster receives a work task distributed by a task scheduling server, the data node cluster can be distributed to the specific main data node and the slave data node which is mutually backup with the main data node according to the work task.
In a specific implementation, as shown in the sky cloud star database architecture diagram shown in fig. 4, services can be divided into three types according to features and functions:
1) A Data Node (DN) for storing and actually processing data, characterized in that each data node has a data node which is in backup relationship with each other, the backup node stores the same data, the data change of one data node can be synchronized to the backup data node, each data node can be registered as an online state after being started, in this embodiment, the backup data node is called a slave data node, and the corresponding data node is called a master data node;
2) The management server (man) for providing management service for a database cluster is characterized in that the roles of the management servers are divided into a master (called a master management server in the embodiment) or a slave (called a slave management server in the embodiment), the management servers only in the role of the master management server provide service for the cluster, the slave management servers are in a blocking state, the master management server is generated by election of all running management servers and only one master management server is generated, and the master management server can reinitiate election in the rest management server services after being closed;
3) A task scheduling server (server) for providing database access service for the outside, which is also the only service exposed to the outside by the Tianyun star database, and is mainly characterized by supporting the fault transfer capability, transferring the task to the corresponding backup DN for execution after the relevant connection error of the connected DN occurs, and only initiating the connection to the DN registered in an online state; and after the main management server finishes election again, connection can be initiated to a new main management server again. In the conventional database upgrading scheme, the service of the database needs to be completely stopped, and then the execution file and the dynamic library which need to be replaced in the upgrading process are replaced, so that the upgrading process cannot provide data service for the outside, the initiated request can be influenced by directly closing the database service, online upgrading is not supported, and the usability is greatly reduced.
Step S30: obtaining a database upgrade request, wherein the database upgrade request comprises: the method comprises the steps of a management server online upgrading request, a task scheduling server online upgrading request or a data node online upgrading request.
It should be noted that the database upgrade request may include the management server online upgrade request, the task scheduling server online upgrade request, and the data node online upgrade request at the same time, or may include only one or two of the foregoing upgrade requests, and the specific number is not limited.
Further, when the database is upgraded online, in order to reduce the work errors of the work cluster, the obtaining of the database upgrade request includes: after the management server online upgrade request, the task scheduling server online upgrade request or the data node online upgrade request, the method further comprises the following steps: when the database upgrading request is a task scheduling server online upgrading request, upgrading all task scheduling servers in the task scheduling server cluster one by one according to a preset script; and when the database upgrading request is a data node online upgrading request, upgrading the data node cluster.
Further, in order to improve efficiency when the task scheduling server cluster is upgraded, when the database upgrade request is an online upgrade request of the task scheduling server, upgrading all task scheduling servers in the task scheduling server cluster one by one according to a preset script includes: when the database upgrading request is a task scheduling server online upgrading request, acquiring machine addresses of all installed task scheduling services in the task scheduling server cluster; determining a target task scheduling server in the machine address for installing the task scheduling service according to a preset rule, and sending a stop signal to the target task scheduling server by using a preset script so as to stop all working ports on the target task scheduling server; establishing a version number corresponding to the upgrading request information in the target task scheduling server to complete the updating of the target task scheduling server; and updating the residual task scheduling servers in the machine addresses provided with the task scheduling services one by one.
In specific implementation, a preset script is used for sending a stop signal to the target task scheduling server to stop running of all the work ports on the target task scheduling server, and a control script server _ shell of a server is actually used for sending a self-defined signal of 'stopping service' to the target task scheduling server to stop port monitoring.
In a specific implementation, as shown in the flow chart of online upgrade of server service in fig. 5, all machine addresses where the server service is installed are obtained from configuration information, one of the machine addresses is selected to start upgrade, and a customized signal of customized "stop service" is sent to the server by using a server _ shell of a control script of the server; and then, updating the new version, copying a new execution file and a dependency library to the directory after creating an installation directory "/user/local/scsdbsserver/version number" of the server of the new version, starting the service of the new version server, and repeating the operation on other servers which are not updated until all the servers are updated. The server, upon receiving the out-of-service signal, will start its internal processing flow. Firstly, stopping monitoring the port number, enabling the old version server not to accept the new connection request any more, externally initiating a connection request to the server to the machine, and ensuring that the machine can still accept external connection when upgrading the server, wherein the connection request is received and processed by the new version server; if the server has the sql which is not completely executed, continuing to wait until the execution of the sql is completed, so that the request initiated before upgrading cannot be influenced; and after the server has no ongoing task and closes the connection with all DN, the server process is actively quitted.
In a specific implementation, the determining, according to a first preset rule, a target task scheduling server in the machine address of the installation task scheduling service, and sending a stop signal to the target task scheduling server using a preset script to stop running of all work ports on the target task scheduling server includes: determining a target task scheduling server in the machine address of the installation task scheduling service according to a first preset rule; sending a stop signal to the target task scheduling server by using a preset script so as to stop all the working ports on the target task scheduling server; and waiting for the target task scheduling server to finish the execution of the ongoing scheduling task. When receiving the upgrade signal, the target task scheduling server firstly suspends monitoring on the port at the first time, then checks whether a scheduling task is running, and waits for the completion of the execution of the scheduling task if the scheduling task is running, and finally the task scheduling service automatically exits. The reason is that port listening must be stopped first, otherwise there will be new scheduling task requests continuously.
It should be noted that, in this embodiment, the first preset rule is to randomly select one machine installed with the task scheduling service, and this embodiment is not limited herein.
Further, in order to improve the efficiency of upgrading the data node cluster, when the database upgrading request is a data node online upgrading request, upgrading the data node cluster includes: when the database upgrading request is a data node online upgrading request, determining a target data node according to a second preset rule, wherein the target data node is the main data node or the slave data node; deleting the online registration information corresponding to the target data node in the scheduling task server; after waiting for a preset time, upgrading the target data node; and after the target data node is detected to be upgraded, upgrading by taking the master data node or the slave data node which is not updated as the target node.
It should be noted that, in the present embodiment, the second preset rule is to randomly select all master data nodes or all slave data nodes, and the present embodiment is not limited herein.
In specific implementation, as shown in the data node online upgrade diagram shown in fig. 6, all nodes on one side of a master data node and a slave data node are selected first, and registration information of online states of the nodes is actively deleted, so that a server is ensured not to initiate new connection to the node on the side; then after waiting for three minutes, closing the batch of data nodes in the offline state, so that even if a server has tasks of the batch of nodes, the tasks can be transferred to the corresponding backup nodes through faults; after an installation directory of the new version DN is created, the installation of the new version is completed; starting a new version of DN; and then repeating the same operation on the data nodes which are not upgraded on the other side until the master node and the slave node are upgraded.
Step S40: and when the upgrading request is a management server online upgrading request, firstly closing the slave management servers in the management server cluster, and performing online upgrading on the closed slave management servers.
Further, in order to implement simultaneous upgrade and work on the management server cluster, when the upgrade request is a management server online upgrade request, first closing a slave management server in the management server cluster, and performing online upgrade on the closed slave management server includes: when the upgrading request is a management server online upgrading request, determining all machine addresses for installing management server protocols in the management server cluster; determining a master management server and a slave management server in the management server cluster according to the machine address of the installation management server protocol; and closing the slave management server in the management server cluster and upgrading the slave management server.
In specific implementation, machine addresses of all installed man services are obtained, and the role of each man is obtained; firstly, selecting a man with a role of a follower to start upgrading, and for the follower, directly closing the man service process because the man does not provide service for the cluster; and then creating an installation directory of the new version man to complete installation, and starting the new version man service.
Step S50: and when the fact that all the slave management servers are completely upgraded is detected, upgrading the master management server in the management server cluster, and meanwhile, selecting a new master management server from the slave management servers to receive the communication request from the task scheduling server cluster.
In the specific implementation, after all the followers are upgraded, the master is upgraded, and a self-defined signal of 'stopping service' is sent to the master at first; after receiving the signal, the master deletes the registration of the master role, and other mans which are upgraded to a new version initiate election again to select a new master, and at this time, all the requests of the server to the man are transferred to the new master; and the old master actively quits the process after completing the started task, and at the moment, an installation directory of the new version man can be created to complete installation, and the new version man is started to complete online upgrade of all mans.
Further, in order to prevent the master management server from being disabled when the master management server is upgraded, the upgrading the master management server in the management server cluster after it is detected that all the slave management servers are upgraded, and selecting a new master management server from the slave management servers to receive the communication request from the task scheduling server cluster includes: when all the slave management servers are detected to be upgraded, sending a preset signal to a master management server in the management server cluster so that the master management server deletes the registration information of a master management role; upgrading a main management server in the management server cluster; and selecting a new master management server from the slave management servers to receive the communication request from the task scheduling server cluster.
The embodiment is implemented by constructing a distributed database, wherein the distributed database comprises a management server cluster, a task scheduling server cluster and a data node cluster; establishing communication connection between the management server cluster and the task scheduling server cluster and communication connection between the task scheduling server cluster and the data node cluster; obtaining a database upgrade request, wherein the database upgrade request comprises: a management server online upgrading request, a task scheduling server online upgrading request or a data node online upgrading request; when the upgrading request is a management server online upgrading request, firstly closing the slave management servers in the management server cluster, and performing online upgrading on the closed slave management servers; when it is detected that all the slave management servers are upgraded, the master management server in the management server cluster is upgraded, and meanwhile, a new master management server is selected from the slave management servers to receive the communication request from the task scheduling server cluster.
Referring to fig. 7, fig. 7 is a block diagram illustrating a first embodiment of an online upgrade apparatus based on a distributed database according to the present invention.
As shown in fig. 7, the online upgrade apparatus based on a distributed database according to an embodiment of the present invention includes:
the system comprises a database construction module 10, a data node configuration module and a data node configuration module, wherein the database construction module is used for constructing a distributed database, and the distributed database comprises a management server cluster, a task scheduling server cluster and a data node cluster;
a communication connection module 20, configured to establish a communication connection between the management server cluster and the task scheduling server cluster, and a communication connection between the task scheduling server cluster and the data node cluster;
an upgrade request module 30, configured to obtain a database upgrade request, where the database upgrade request includes: a management server online upgrade request, a task scheduling server online upgrade request or a data node online upgrade request;
the slave manager module 40 is configured to, when the upgrade request is a management server online upgrade request, first close a slave management server in the management server cluster, and perform online upgrade on the closed slave management server;
and a master manager module 50, configured to upgrade a master management server in the management server cluster after all the slave management servers are detected to be upgraded, and select a new master management server from the slave management servers to receive the communication request from the task scheduling server cluster.
The embodiment is characterized in that a distributed database is constructed, wherein the distributed database comprises a management server cluster, a task scheduling server cluster and a data node cluster; establishing communication connection between the management server cluster and the task scheduling server cluster and communication connection between the task scheduling server cluster and the data node cluster; obtaining a database upgrade request, wherein the database upgrade request comprises: a management server online upgrade request, a task scheduling server online upgrade request or a data node online upgrade request; when the upgrading request is a management server online upgrading request, firstly closing a slave management server in the management server cluster, and performing online upgrading on the closed slave management server; when it is detected that all the slave management servers are upgraded, the master management server in the management server cluster is upgraded, and meanwhile, a new master management server is selected from the slave management servers to receive the communication request from the task scheduling server cluster.
In an embodiment, the slave management module 40 is further configured to determine, in the management server cluster, machine addresses of all installed management server protocols when the upgrade request is an online upgrade request of a management server; determining a master management server and a slave management server in the management server cluster according to the machine address of the installation management server protocol; and closing the slave management server in the management server cluster and upgrading the slave management server.
In an embodiment, the master management module 50 is further configured to send a preset signal to a master management server in the management server cluster to enable the master management server to delete registration information of a master management role after all the slave management servers are detected to be upgraded; upgrading a main management server in the management server cluster; and selecting a new master management server from the slave management servers to receive the communication request from the task scheduling server cluster.
In an embodiment, the upgrade request module 30 is further configured to, when the database upgrade request is an online upgrade request of a task scheduling server, upgrade all task scheduling servers in the task scheduling server cluster one by one according to a preset script; and when the database upgrading request is a data node online upgrading request, upgrading the data node cluster.
In an embodiment, the upgrade request module 30 is further configured to, when the database upgrade request is a task scheduling server online upgrade request, obtain, in the task scheduling server cluster, machine addresses of all installed task scheduling services; determining a target task scheduling server in the machine address of the installation task scheduling service according to a first preset rule, and sending a stop signal to the target task scheduling server by using a preset script so as to stop all working ports on the target task scheduling server; establishing a version number corresponding to the upgrading request information in the target task scheduling server to complete the updating of the target task scheduling server; and updating the residual task scheduling servers in the machine addresses provided with the task scheduling services one by one.
In an embodiment, the upgrade request module 30 is further configured to determine a target task scheduling server in the machine address of the installation task scheduling service according to a first preset rule; sending a stop signal to the target task scheduling server by using a preset script so as to stop all the working ports on the target task scheduling server from being used; and waiting for the target task scheduling server to finish the execution of the ongoing scheduling task. When the target task scheduling server receives the upgrading signal, the monitoring of the port is suspended for the first time, then whether a scheduling task is running or not is checked, if yes, the scheduling task is waited to be executed, and finally the task scheduling service is automatically quitted. The reason is that port listening must be stopped first, otherwise there will be new scheduling task requests continuously.
In an embodiment, the upgrade request module 30 is further configured to determine a target data node according to a second preset rule when the database upgrade request is a data node online upgrade request, where the target data node is the master data node or the slave data node; deleting the online registration information corresponding to the target data node in the scheduling task server; after waiting for a preset time, upgrading the target data node; and after the target data node is detected to be upgraded, taking the master data node or the slave data node which is not updated as the target node to be upgraded.
It should be understood that the above is only an example, and the technical solution of the present invention is not limited in any way, and in a specific application, a person skilled in the art may set the technical solution as needed, and the present invention is not limited in this respect.
It should be noted that the above-described work flows are only exemplary, and do not limit the scope of the present invention, and in practical applications, a person skilled in the art may select some or all of them to achieve the purpose of the solution of the embodiment according to actual needs, and the present invention is not limited herein.
In addition, the technical details that are not described in detail in this embodiment may refer to the stream processing method provided in any embodiment of the present invention, and are not described herein again.
Further, it is to be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or system. Without further limitation, an element defined by the phrases "comprising one of 8230; \8230;" 8230; "does not exclude the presence of additional like elements in a process, method, article, or system that comprises the element.
The above-mentioned serial numbers of the embodiments of the present invention are only for description, and do not represent the advantages and disadvantages of the embodiments.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solutions of the present invention or portions thereof that contribute to the prior art may be embodied in the form of a software product, where the computer software product is stored in a storage medium (e.g., read Only Memory (ROM)/RAM, magnetic disk, optical disk), and includes several instructions for enabling a terminal device (e.g., a mobile phone, a computer, a server, or a network device) to execute the method according to the embodiments of the present invention.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.

Claims (10)

1. An online upgrade method based on a distributed database is characterized in that the online upgrade method based on the distributed database comprises the following steps:
constructing a distributed database, wherein the distributed database comprises a management server cluster, a task scheduling server cluster and a data node cluster;
establishing communication connection between the management server cluster and the task scheduling server cluster and communication connection between the task scheduling server cluster and the data node cluster;
obtaining a database upgrade request, wherein the database upgrade request comprises: a management server online upgrading request, a task scheduling server online upgrading request or a data node online upgrading request;
when the upgrading request is a management server online upgrading request, firstly closing a slave management server in the management server cluster, and performing online upgrading on the closed slave management server;
and when all the slave management servers are detected to be upgraded, upgrading the master management server in the management server cluster, and selecting a new master management server from the slave management servers to receive the communication request from the task scheduling server cluster.
2. The distributed database-based online upgrade method according to claim 1, wherein, when the upgrade request is a management server online upgrade request, first shutting down a slave management server in the management server cluster, and performing online upgrade on the shut-down slave management server includes:
when the upgrading request is a management server online upgrading request, determining machine addresses of all installed management server protocols in the management server cluster;
determining a master management server and a slave management server in the management server cluster according to the machine address of the installation management server protocol;
and closing the slave management server in the management server cluster and upgrading the slave management server.
3. The distributed database-based online upgrade method according to claim 1, wherein the upgrading a master management server in the management server cluster after detecting that all the slave management servers are upgraded, and the selecting a new master management server from the slave management servers to receive the communication request from the task scheduling server cluster includes:
when all the slave management servers are detected to be upgraded, sending a preset signal to a master management server in the management server cluster so that the master management server deletes the registration information of a master management role;
upgrading a main management server in the management server cluster;
and selecting a new master management server from the slave management servers to receive the communication request from the task scheduling server cluster.
4. The method of claim 1, wherein the obtaining a database upgrade request comprises: after the management server online upgrade request, the task scheduling server online upgrade request or the data node online upgrade request, the method further comprises the following steps:
when the database upgrading request is a task scheduling server online upgrading request, upgrading all task scheduling servers in the task scheduling server cluster one by one according to a preset script;
and when the database upgrading request is a data node online upgrading request, upgrading all data nodes in the data node cluster.
5. The method of claim 4, wherein when the database upgrade request is a task scheduling server online upgrade request, upgrading all task scheduling servers in the task scheduling server cluster one by one according to a preset script comprises:
when the database upgrading request is a task scheduling server online upgrading request, acquiring machine addresses of all installed task scheduling services in the task scheduling server cluster;
determining a target task scheduling server in the machine address of the installation task scheduling service according to a first preset rule, and sending a stop signal to the target task scheduling server by using a preset script so as to stop all working ports on the target task scheduling server;
establishing a version number corresponding to the upgrading request information in the target task scheduling server to complete the updating of the target task scheduling server;
and updating the residual task scheduling servers in the machine addresses provided with the task scheduling services one by one.
6. The method of claim 5, wherein the determining a target task scheduling server in the machine address of the installation task scheduling service according to a first preset rule, and sending a stop signal to the target task scheduling server using a preset script to stop all work ports on the target task scheduling server comprises:
determining a target task scheduling server in the machine address of the installation task scheduling service according to a first preset rule;
sending a stop signal to the target task scheduling server by using a preset script so as to stop all the working ports on the target task scheduling server from being used;
and waiting for the target task scheduling server to finish the execution of the ongoing scheduling task.
7. The method of claim 4, wherein when the database upgrade request is a data node online upgrade request, upgrading the cluster of data nodes comprises:
when the database upgrading request is a data node online upgrading request, determining a target data node according to a second preset rule, wherein the target data node is the main data node or the slave data node;
deleting the online registration information corresponding to the target data node in the scheduling task server;
after waiting for a preset time, upgrading the target data node;
and after the target data node is detected to be upgraded, upgrading by taking the master data node or the slave data node which is not updated as the target node.
8. An online upgrade apparatus based on distributed database, comprising:
the system comprises a database construction module, a data node construction module and a data node management module, wherein the database construction module is used for constructing a distributed database, and the distributed database comprises a management server cluster, a task scheduling server cluster and a data node cluster;
the communication connection module is used for establishing communication connection between the management server cluster and the task scheduling server cluster and communication connection between the task scheduling server cluster and the data node cluster;
an upgrade request module, configured to obtain a database upgrade request, where the database upgrade request includes: a management server online upgrade request, a task scheduling server online upgrade request or a data node online upgrade request;
the slave manager module is used for firstly closing the slave management servers in the management server cluster and carrying out online upgrade on the closed slave management servers when the upgrade request is the online upgrade request of the management servers;
and the master manager module is used for upgrading the master management server in the management server cluster after all the slave management servers are detected to be upgraded, and selecting a new master management server from the slave management servers to receive the communication request from the task scheduling server cluster.
9. An online upgrade device based on a distributed database, the online upgrade device based on the distributed database comprising: a memory, a processor and an online upgrade distributed database based program stored on the memory and executable on the processor, the online upgrade distributed database based program being configured to implement the steps of the online upgrade distributed database based method as claimed in any one of claims 1 to 7.
10. A storage medium, wherein the storage medium stores thereon an online upgrade program based on a distributed database, and the online upgrade program based on a distributed database, when executed by a processor, implements the steps of the online upgrade generation method based on a distributed database according to any one of claims 1 to 7.
CN202211238098.5A 2022-10-10 2022-10-10 Online upgrading method based on distributed database and related device Pending CN115665142A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211238098.5A CN115665142A (en) 2022-10-10 2022-10-10 Online upgrading method based on distributed database and related device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211238098.5A CN115665142A (en) 2022-10-10 2022-10-10 Online upgrading method based on distributed database and related device

Publications (1)

Publication Number Publication Date
CN115665142A true CN115665142A (en) 2023-01-31

Family

ID=84987902

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211238098.5A Pending CN115665142A (en) 2022-10-10 2022-10-10 Online upgrading method based on distributed database and related device

Country Status (1)

Country Link
CN (1) CN115665142A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117573656A (en) * 2024-01-16 2024-02-20 浙江智臾科技有限公司 Database upgrading method, electronic equipment and readable storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117573656A (en) * 2024-01-16 2024-02-20 浙江智臾科技有限公司 Database upgrading method, electronic equipment and readable storage medium
CN117573656B (en) * 2024-01-16 2024-04-12 浙江智臾科技有限公司 Database upgrading method, electronic equipment and readable storage medium

Similar Documents

Publication Publication Date Title
US7698391B2 (en) Performing a provisioning operation associated with a software application on a subset of the nodes on which the software application is to operate
US20080244552A1 (en) Upgrading services associated with high availability systems
US20020073410A1 (en) Replacing software at a telecommunications platform
CN112799786A (en) Exit method, device, equipment and storage medium of micro-service instance
US11991094B2 (en) Metadata driven static determination of controller availability
CN115665142A (en) Online upgrading method based on distributed database and related device
US10721335B2 (en) Remote procedure call using quorum state store
CN113934707A (en) Cloud native database, database capacity expansion method, database capacity reduction method and device
JP2006058938A (en) Policy rule management supporting method and policy rule management supporting apparatus
US11018860B2 (en) Highly available and reliable secret distribution infrastructure
US20020073409A1 (en) Telecommunications platform with processor cluster and method of operation thereof
CN111240760A (en) Application publishing method, system, storage medium and equipment based on registry
CN116208487A (en) Method, device, equipment and medium for upgrading consensus algorithm in block chain system
CN115022307A (en) File downloading method and device, storage medium and electronic equipment
CN115102999A (en) DevOps system, service providing method, storage medium, and electronic device
JPH05250239A (en) Computer network system
CN113542319A (en) Service providing entity change notification method, device and system used in Dubbo framework
CN112261097A (en) Object positioning method for distributed storage system and electronic equipment
JPH05120023A (en) Program loading system
CN115037617B (en) Optimization method and device for dubbo service treatment
CN113407403B (en) Cloud host management method and device, computer equipment and storage medium
CN112948348B (en) Operation and maintenance control method and device, electronic equipment and storage medium
WO2023039756A1 (en) Industrial data integration device, method and computer readable storage medium
JP3527756B2 (en) How to update system files
US20230081395A1 (en) Method and system for facilitating backwards compatibility of a rest api on an evolving data model

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