CN111414247A - Server switching method, device, management node and storage medium - Google Patents

Server switching method, device, management node and storage medium Download PDF

Info

Publication number
CN111414247A
CN111414247A CN202010330470.XA CN202010330470A CN111414247A CN 111414247 A CN111414247 A CN 111414247A CN 202010330470 A CN202010330470 A CN 202010330470A CN 111414247 A CN111414247 A CN 111414247A
Authority
CN
China
Prior art keywords
server
stand
switching
main server
target
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
CN202010330470.XA
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.)
Beijing Kingsoft Cloud Network Technology Co Ltd
Original Assignee
Beijing Kingsoft Cloud Network 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 Beijing Kingsoft Cloud Network Technology Co Ltd filed Critical Beijing Kingsoft Cloud Network Technology Co Ltd
Priority to CN202010330470.XA priority Critical patent/CN111414247A/en
Publication of CN111414247A publication Critical patent/CN111414247A/en
Priority to PCT/CN2021/084965 priority patent/WO2021213171A1/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1446Point-in-time backing up or restoration of persistent data
    • G06F11/1448Management of the data involved in backup or backup restore
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44594Unloading

Abstract

The embodiment of the disclosure provides a server switching method, a server switching device, a management node and a storage medium, and relates to the technical field of cloud computing. The method is applied to a management node of a server cluster, wherein the server cluster comprises a main server which is currently running and at least one backup server which is not currently running, and the main server runs a stand-alone database; the method comprises the following steps: monitoring whether the main server operates normally; when the main server is monitored to be incapable of normally operating, selecting a target server from the at least one backup server; switching the target server to a new main server; and after the switching is finished, the single-machine database is operated in the target server. Compared with the prior art, the scheme provided by the embodiment of the disclosure can improve the availability of the stand-alone database.

Description

Server switching method, device, management node and storage medium
Technical Field
The invention relates to the technical field of cloud computing, in particular to a server switching method, a server switching device, a management node and a storage medium.
Background
Currently, with the continuous development of network technologies, cloud computing is widely applied in more and more fields by virtue of the characteristics of high efficiency, low cost and the like. Such as the telecommunications field, the medical field, the educational field, etc.
Specifically, cloud computing means that a huge data computing processing program is decomposed into a plurality of small programs through a network cloud, then each small program is analyzed and processed through a server cluster composed of a plurality of servers, and a final processing result is fed back to a user.
A database is an important component of cloud computing, wherein the database can exist in a stand-alone format, i.e., a stand-alone database, such as MySQ L, InfluxDB, etc. the term stand-alone database refers to a database in which there is no backup data for the stored data and which can only be used by one server at a time, i.e., can only be run on one server at a time.
Obviously, when a server running a stand-alone database fails, cloud computing cannot provide a service for applying data stored in the stand-alone database, resulting in low availability of the stand-alone database.
Disclosure of Invention
The embodiment of the disclosure aims to provide a server switching method, a server switching device, a management node and a storage medium, so as to improve the availability of a stand-alone database. The specific technical scheme is as follows:
in a first aspect, the disclosed embodiments provide a server switching method, which is applied to a management node of a server cluster, where the server cluster includes a main server currently running and at least one backup server not currently running, and the main server runs a stand-alone database; the method comprises the following steps:
monitoring whether the main server operates normally;
when the main server is monitored to be incapable of normally operating, selecting a target server from the at least one backup server;
and switching the target server to a new main server, and operating the stand-alone database in the target server after the switching is finished.
Optionally, in a specific implementation manner, the step of monitoring whether the main server operates normally includes:
detecting whether a service port of the main server is alive and/or whether a service process exists; when the service port is detected to be not alive or the service process does not exist, determining that the server cannot normally operate;
alternatively, the first and second electrodes may be,
and calling a detection program preset in the stand-alone database, and monitoring whether the main server operates normally.
Optionally, in a specific implementation manner, the step of switching the target server to a new master server includes:
and calling a preset switching program to switch the target server into a new main server.
Optionally, in a specific implementation manner, the preset switching procedure is: the method comprises the steps that a preset switching program corresponding to a load balancing service is adopted, and a main server is mounted on the load balancing service; the step of switching the target server to a new master server includes:
offloading the primary server from the load balancing service;
unloading the stand-alone database from the main server;
mounting the stand-alone database on the target server, and starting the stand-alone database in the target server;
and mounting the target server to the load balancing service.
Optionally, in a specific implementation manner, the preset switching procedure is: a preset switching program corresponding to the load balancing service, wherein the main server is mounted on the load balancing service, and the target server is mounted with the single-machine database; the step of switching the target server to a new master server includes:
offloading the primary server from the load balancing service;
starting the stand-alone database in the target server;
and mounting the target server to the load balancing service.
In a second aspect, the present disclosure provides a server switching apparatus, which is applied to a management node of a server cluster, where the server cluster includes a main server currently running and at least one backup server not currently running, and the main server runs a stand-alone database; the device comprises:
the server monitoring module is used for monitoring whether the main server normally operates or not;
the server selection module is used for selecting a target server from the at least one backup server when the main server is monitored to be incapable of normally operating;
and the server switching module is used for switching the target server into a new main server, and the stand-alone database is operated in the target server after the switching is finished.
Optionally, in a specific implementation manner, the server monitoring module is specifically configured to:
detecting whether a service port of the main server is alive and/or whether a service process exists; when the service port is detected to be not alive or the service process does not exist, determining that the server cannot normally operate;
alternatively, the first and second electrodes may be,
and calling a detection program preset in the stand-alone database, and monitoring whether the main server operates normally.
Optionally, in a specific implementation manner, the server switching module is specifically configured to:
and calling a preset switching program to switch the target server into a new main server.
Optionally, in a specific implementation manner, the preset switching procedure is: the method comprises the steps that a preset switching program corresponding to a load balancing service is adopted, and a main server is mounted on the load balancing service; the server switching module is specifically configured to:
offloading the primary server from the load balancing service;
unloading the stand-alone database from the main server;
mounting the stand-alone database on the target server, and starting the stand-alone database in the target server;
and mounting the target server to the load balancing service.
Optionally, in a specific implementation manner, the preset switching procedure is: a preset switching program corresponding to the load balancing service, wherein the main server is mounted on the load balancing service, and the target server is mounted with the single-machine database; the server switching module is specifically configured to:
offloading the primary server from the load balancing service;
starting the stand-alone database in the target server;
and mounting the target server to the load balancing service.
In a third aspect, an embodiment of the present disclosure provides a management node, including a processor, a communication interface, a memory, and a communication bus, where the processor, the communication interface, and the memory complete mutual communication through the communication bus;
a memory for storing a computer program;
a processor, configured to implement the steps of any server switching method provided by the first aspect when executing the program stored in the memory.
In a fourth aspect, an embodiment of the present disclosure provides a computer-readable storage medium, where a computer program is stored in the computer-readable storage medium, and when executed by a processor, the computer program implements the steps of any server switching method provided in the first aspect.
In a fifth aspect, embodiments of the present disclosure further provide a computer program product containing instructions, which when run on a computer, causes the computer to perform the steps of any of the server switching methods provided in the first aspect.
The embodiment of the disclosure has the following beneficial effects:
by applying the scheme provided by the embodiment of the disclosure, a server cluster consisting of a plurality of servers can be constructed in advance in cloud computing. The server in operation in the server cluster is used as a main server, other servers not in operation in the server cluster are used as backup servers of the main server, and the stand-alone database is mounted on the main server and operates in the main server, namely, the main server can provide various services applying data stored in the stand-alone database. Therefore, the management node of the server cluster can monitor the main server to judge whether the main server operates normally. Furthermore, when the main server is monitored to have operation failure and cannot normally operate, the management node can select a target server from the backup servers and switch the target server to a new main server.
After the switching is completed, the target server can run the stand-alone database, that is, after the switching is completed, the stand-alone database can be mounted on the new main server and used by the new main server, so that the new main server can continue to provide the service applying the data stored in the stand-alone database. Based on this, by applying the scheme provided by the embodiment of the present disclosure, when the main server running the stand-alone database fails, it can be ensured that the main server capable of normally running and running the stand-alone data always exists by switching the main server to another backup server running the stand-alone database. Furthermore, the cloud computing can provide services applying the data stored in the stand-alone database, and therefore the usability of the stand-alone database is improved.
Drawings
In order to more clearly illustrate the embodiments of the present disclosure or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and other drawings can be obtained by those skilled in the art without creative efforts.
Fig. 1 is a schematic flowchart of a server switching method according to an embodiment of the present disclosure;
FIG. 2 is a schematic flow chart of an embodiment of S103 in FIG. 1;
FIG. 3 is a schematic flow chart of another specific implementation of S103 in FIG. 1;
fig. 4 is a schematic structural diagram of a server switching device according to an embodiment of the present disclosure;
fig. 5 is a schematic structural diagram of a management node according to an embodiment of the present disclosure.
Detailed Description
The technical solutions in the embodiments of the present disclosure will be clearly and completely described below with reference to the drawings in the embodiments of the present disclosure, and it is obvious that the described embodiments are only a part of the embodiments of the present disclosure, 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 invention.
The database can exist in a form of a single machine, namely, a single machine database, such as MySQ L, InfluxDB and the like.
In order to solve the technical problem, an embodiment of the present disclosure provides a server switching method. The method comprises the following steps:
monitoring whether the main server operates normally;
when the main server is monitored to be incapable of normally operating, selecting a target server from the at least one backup server;
and switching the target server to a new main server, and operating the stand-alone database in the target server after the switching is finished.
It should be noted that the method is applied to a management node of a server cluster, and the server cluster includes a currently running primary server and at least one currently non-running backup server.
Specifically, the stand-alone database is mounted on the main server, so that the main server runs the stand-alone database to provide various services applying the data stored in the stand-alone database. Each backup server is in an inactive state as a backup server of the primary server, and may be referred to as a "cold machine".
In the embodiment of the present disclosure, although there are multiple servers in a server cluster, only one server is in a running state, and when the server cluster provides various types of services to an application layer, the server cluster is still implemented by a single node. The single node may be identified by a domain name or an IP (Internet Protocol). That is, regardless of which server in the server cluster is running, the running server uses the same domain name or IP, i.e., after switching to a new primary server, the new primary server has the same domain name or IP as the primary server before switching.
In addition, in the embodiment of the present disclosure, the management node may be a device, which is used for managing each server, in addition to the main server and the backup server in the server cluster, or may be a main server currently running. This is reasonable and is referred to as a management node hereinafter.
When the management node is a currently running main server, and the main server is switched to a new main server, the management node of the server cluster can be switched to the new main server.
As can be seen from the above, by applying the scheme provided by the embodiment of the present disclosure, in cloud computing, a server cluster composed of a plurality of servers may be pre-constructed. The server in operation in the server cluster is used as a main server, other servers not in operation in the server cluster are used as backup servers of the main server, and the stand-alone database is mounted on the main server and operates in the main server, namely, the main server can provide various services applying data stored in the stand-alone database. Therefore, the management node of the server cluster can monitor the main server to judge whether the main server operates normally. Furthermore, when the main server is monitored to have operation failure and cannot normally operate, the management node can select a target server from the backup servers and switch the target server to a new main server.
After the switching is completed, the target server can run the stand-alone database, that is, after the switching is completed, the stand-alone database can be mounted on the new main server and used by the new main server, so that the new main server can continue to provide the service applying the data stored in the stand-alone database. Based on this, by applying the scheme provided by the embodiment of the present disclosure, when the main server running the stand-alone database fails, it can be ensured that the main server capable of normally running and running the stand-alone data always exists by switching the main server to another backup server running the stand-alone database. Furthermore, the cloud computing can provide services applying the data stored in the stand-alone database, and therefore the usability of the stand-alone database is improved.
Next, a server switching method provided in the embodiment of the present disclosure is specifically described.
Fig. 1 is a schematic flowchart of a server switching method provided in an embodiment of the present disclosure, and as shown in fig. 1, the method may include the following steps:
s101: monitoring whether the main server normally operates;
in the operation process of the main server, in order to ensure that the main server can be found to have faults in time and cannot normally operate, the main server is switched in time so as to improve the availability of the stand-alone database, and the management node can monitor whether the main server normally operates or not in the operation process of the main server.
That is, in the operation process of the main server, the management node may monitor the operation state of the main server to determine whether the current operation state of the main server is normal.
The management node can monitor whether the main server operates normally in real time or not, and also can monitor whether the main server operates normally or not according to a preset monitoring period, namely, after a certain time interval, the operation state of the main server is detected once.
Specifically, an independent monitoring program may be preset in the management node, so that the management node monitors whether the main server operates normally by operating the monitoring program, that is, the management node executes the step S101 by calling the monitoring program.
Optionally, in a specific implementation manner, the step S101 may include the following steps:
detecting whether a service port of a main server is alive and/or whether a service process exists; when detecting that the service port does not survive or the service process does not exist, determining that the server cannot normally operate;
the main server provides services to the application layer through the service port, and in the process of providing the services, the main server needs to execute service processes corresponding to various services. Obviously, when any one of the service port and the service process fails, the main server cannot operate normally. Therefore, the management node can monitor whether the main server is operating normally by detecting whether the service port and/or the service process of the main server is/are failed.
In particular, the management node may detect whether a service port of the primary server is alive and/or whether a service process exists. Specifically, the method comprises the following steps:
when the management node detects whether the service port of the main server is alive, and when the management node detects that the service port is not alive, the management node can determine that the server cannot normally operate;
when the management node detects whether the service process of the main server exists, and when the management node detects that the service process does not exist, the management node can determine that the server cannot normally operate;
when the management node detects whether the service port of the main server is alive and whether the service process exists, and detects at least one of the condition that the service port is not alive and the condition that the service process does not exist, the management node may determine that the server cannot normally operate.
Wherein, whether the service port is alive or not means: whether the process of the stand-alone database correctly monitors a certain service port and whether the network from the client to the port of the service port is connected. Thus, if a port is not monitored correctly, and/or the network from the client to the port of the service port is not connected, it can usually be said that the process of the stand-alone database is down or an error has occurred in the stand-alone database. At this time, the main service will not operate normally.
Whether a service process exists or not means: and in the process that the main server runs the stand-alone database to complete the data processing task, detecting whether a service process of the stand-alone database service related to the data processing task exists or not.
It should be noted that, when the main server executes a data processing task, that is, the main server normally stops the stand-alone database service, the management node may sense the "normally stopping" behavior, and may not determine that the main server cannot normally operate.
Optionally, in another specific implementation manner, the step S101 may include the following steps:
and calling a detection program preset in the stand-alone database, and monitoring whether the main server operates normally.
The stand-alone database may have a detection program, such as a numerics interface, a health interface, etc., for monitoring whether the main server mounted on the stand-alone database operates normally. Therefore, the management node can directly call a detection program preset in the stand-alone database to monitor whether the main server normally operates or not when monitoring whether the main server normally operates or not.
In this way, when the detection program detects that the main server fails, prompt information for prompting that the main server cannot operate normally may be generated, so that the management node may determine that the main server cannot operate normally.
S102: when the main server is monitored to be incapable of normally operating, selecting a target server from at least one backup server;
s103: and switching the target server to a new main server, and operating a stand-alone database in the target server after the switching is finished.
When the management node monitors that the main server cannot normally operate, the management node can select a backup server from at least one backup server as a target server, and then the management node can switch the target server to a new main server. After the switch is completed, the stand-alone database can be mounted on the new main server, and thus, run in the new main server.
When only one backup server is included in the server cluster, the management node can take the backup server as a target server; correspondingly, when a plurality of backup servers exist in the server cluster, the management node may randomly select any backup server as the target server, or select a backup server as the target server according to the performance index of each backup server, for example, the target server may be selected according to a CPU (Central processing unit) load of each backup server, or the target server may be selected according to the size of an available storage space of each backup server. In this regard, the embodiments of the present disclosure are not particularly limited.
Optionally, in a specific implementation manner, in the step S103, switching the target server to the new master server may include the following steps:
and calling a preset switching program to switch the target server to a new main server.
Therefore, when the management node selects a target server from the at least one backup server and monitors that the main server cannot normally operate, the management node can switch the selected target server to a new main server by calling the preset switching program.
Wherein, the preset switching program can be set in the management node; the preset switching program may also be set in another device, so that the management node may invoke the preset switching program from the other device through an Application Programming Interface (API), and the other device may not be located in a server cluster managed by the management node.
In addition, when the management node monitors whether the main server normally operates through a preset independent monitoring program, in this specific implementation manner, the management node may call the preset switching program through the monitoring program to switch the target server to a new main server.
Optionally, in a specific implementation manner, on the basis of the preset switching program provided in the specific implementation manner, as shown in fig. 2, the step S103 of switching the target server to the new main server may include the following steps:
s201: offloading the primary server from the load balancing service;
s202: unloading the stand-alone database from the main server;
s203: mounting a stand-alone database on a target server, and starting the stand-alone database in the target server;
s204: and mounting the target server to the load balancing service.
In this embodiment, the preset handover procedure is provided by a preset load balancing (L B, L ad Balance) service, so that the preset handover procedure is a handover procedure corresponding to the preset L B service, and further, when the main server is mounted on the L B service, the management node may invoke the preset handover procedure.
It should be noted that the main functions of the L B service are to ensure that the load difference between multiple servers is not too large, and in addition, providing a proxy for a real server without exposing a real IP to a client is another common function of the L B service.
The method comprises the steps that a management node monitors that a main server currently mounted by a L B service cannot normally operate, the management node can select a target server from at least one backup server, so that the management node can unload the main server from the L B service by calling a preset switching program and further unload a stand-alone database from the main service, then, the stand-alone database unloaded from the main server can be mounted on the target server, the stand-alone database is started on the target server, so that the stand-alone database can operate on the target server, and finally, the target server operating with the stand-alone database is mounted on the L B service.
Optionally, in another specific implementation manner, on the basis of the switching program provided in the above specific implementation manner, as shown in fig. 3, the step S103 of switching the target server to the new master server may include the following steps:
s301: offloading the primary server from the load balancing service;
s302: starting a stand-alone database in a target server;
s303: and mounting the target server to the load balancing service.
Similar to the specific implementation manner shown in fig. 2, in this specific implementation manner, the preset switching program may be a switching program corresponding to a preset L B service, and the main server is mounted on the preset L B service.
Additionally, it should be noted that some types of stand-alone databases can provide redundant multi-copy storage capabilities, i.e., the stand-alone database can be backed up so that multiple copies of the data stored by the stand-alone database are obtained, and each copy of the stored data is identical.
For example, a cloud hard disk, which is generally a distributed file storage system, has the following three features: 1. can be compatible with POSIX (Portable Operating System Interface of UNIX); 2. a user can access the cloud hard disk through a standard NFS (Network File System) protocol; 3. multiple users can share access to the cloud hard disk at the same time. For example, both CFS (Cloud File Storage) products and NAS (Network Attached Storage) products belong to Cloud hard disk type products.
Based on this, when the server cluster is constructed, the backup database of the stand-alone database can be mounted in each backup server. Since the data stored in the backup database is the same as the data stored in the stand-alone database, it can be considered that each backup server mounts the stand-alone database. Therefore, the target server selected from the at least one backup server can mount the stand-alone database.
Thus, in this embodiment, after the primary server is uninstalled from the L B service, the management node can directly start the standalone database mounted in the target server by invoking the above-mentioned switching procedure without re-mounting the standalone database in the target server, and further mount the target server to the L B service.
Corresponding to the server switching method provided by the embodiment of the disclosure, the embodiment of the disclosure also provides a server switching device. The device is applied to a management node of a server cluster, wherein the server cluster comprises a main server which is currently running and at least one backup server which is not currently running, and the main server runs a stand-alone database.
Fig. 4 is a schematic structural diagram of a server switching apparatus according to an embodiment of the present disclosure, and as shown in fig. 4, the apparatus may include the following modules:
a server monitoring module 410, configured to monitor whether the main server operates normally;
a server selecting module 420, configured to select a target server from the at least one backup server when it is monitored that the main server cannot operate normally;
and a server switching module 430, configured to switch the target server to a new main server, where the stand-alone database is operated in the target server after the switching is completed.
By applying the scheme provided by the embodiment of the disclosure, a server cluster consisting of a plurality of servers can be constructed in advance in cloud computing. The server in operation in the server cluster is used as a main server, other servers not in operation in the server cluster are used as backup servers of the main server, and the stand-alone database is mounted on the main server and operates in the main server, namely, the main server can provide various services applying data stored in the stand-alone database. Therefore, the management node of the server cluster can monitor the main server to judge whether the main server operates normally. Furthermore, when the main server is monitored to have operation failure and cannot normally operate, the management node can select a target server from the backup servers and switch the target server to a new main server.
After the switching is completed, the target server can run the stand-alone database, that is, after the switching is completed, the stand-alone database can be mounted on the new main server and used by the new main server, so that the new main server can continue to provide the service applying the data stored in the stand-alone database. Based on this, by applying the scheme provided by the embodiment of the present disclosure, when the main server running the stand-alone database fails, it can be ensured that the main server capable of normally running and running the stand-alone data always exists by switching the main server to another backup server running the stand-alone database. Furthermore, the cloud computing can provide services applying the data stored in the stand-alone database, and therefore the usability of the stand-alone database is improved.
Optionally, in a specific implementation manner, the server monitoring module 410 is specifically configured to:
detecting whether a service port of the main server is alive and/or whether a service process exists; when the service port is detected to be not alive or the service process does not exist, determining that the server cannot normally operate;
alternatively, the first and second electrodes may be,
and calling a detection program preset in the stand-alone database, and monitoring whether the main server operates normally.
Optionally, in a specific implementation manner, the server switching module 430 is specifically configured to:
and calling a preset switching program to switch the target server into a new main server.
Optionally, in a specific implementation manner, the preset switching procedure is: the method comprises the steps that a preset switching program corresponding to a load balancing service is adopted, and a main server is mounted on the load balancing service; the server switching module 430 is specifically configured to:
offloading the primary server from the load balancing service;
unloading the stand-alone database from the main server;
mounting the stand-alone database on the target server, and starting the stand-alone database in the target server;
and mounting the target server to the load balancing service.
Optionally, in a specific implementation manner, the preset switching procedure is: a preset switching program corresponding to the load balancing service, wherein the main server is mounted on the load balancing service, and the target server is mounted with the single-machine database; the server switching module 430 is specifically configured to:
offloading the primary server from the load balancing service;
starting the stand-alone database in the target server;
and mounting the target server to the load balancing service.
Corresponding to the server switching method provided by the embodiment of the present disclosure, the embodiment of the present disclosure further provides a management node, as shown in fig. 5, including a processor 501, a communication interface 502, a memory 503 and a communication bus 504, where the processor 501, the communication interface 502 and the memory 503 complete mutual communication through the communication bus 504,
monitoring whether the main server operates normally;
when the main server is monitored to be incapable of normally operating, selecting a target server from the at least one backup server;
and switching the target server to a new main server, and operating the stand-alone database in the target server after the switching is finished.
It should be noted that other implementation manners of the server switching method implemented by the processor 501 executing the program stored in the memory 503 are the same as the server switching method embodiment provided in the foregoing method embodiment section, and are not described again here.
By applying the scheme provided by the embodiment of the disclosure, a server cluster consisting of a plurality of servers can be constructed in advance in cloud computing. The server in operation in the server cluster is used as a main server, other servers not in operation in the server cluster are used as backup servers of the main server, and the stand-alone database is mounted on the main server and operates in the main server, namely, the main server can provide various services applying data stored in the stand-alone database. Therefore, the management node of the server cluster can monitor the main server to judge whether the main server operates normally. Furthermore, when the main server is monitored to have operation failure and cannot normally operate, the management node can select a target server from the backup servers and switch the target server to a new main server.
After the switching is completed, the target server can run the stand-alone database, that is, after the switching is completed, the stand-alone database can be mounted on the new main server and used by the new main server, so that the new main server can continue to provide the service applying the data stored in the stand-alone database. Based on this, by applying the scheme provided by the embodiment of the present disclosure, when the main server running the stand-alone database fails, it can be ensured that the main server capable of normally running and running the stand-alone data always exists by switching the main server to another backup server running the stand-alone database. Furthermore, the cloud computing can provide services applying the data stored in the stand-alone database, and therefore the usability of the stand-alone database is improved.
The communication bus mentioned in the management node may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown, but this does not mean that there is only one bus or one type of bus.
The communication interface is used for communication between the management node and other devices.
The Memory may include a Random Access Memory (RAM) or a Non-Volatile Memory (NVM), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the processor.
The Processor may be a general-purpose Processor, including a Central Processing Unit (CPU), a Network Processor (NP), and the like; but may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic device, discrete hardware component.
In another embodiment provided by the present invention, a computer-readable storage medium is further provided, in which a computer program is stored, and the computer program, when executed by a processor, implements the steps of any of the above server switching methods.
In yet another embodiment, a computer program product containing instructions is provided, which when run on a computer causes the computer to perform any of the server switching methods of the above embodiments.
The computer instructions may be stored in or transmitted from one computer-readable storage medium to another computer-readable storage medium, e.g., from one website site, computer, server, or data center via wired (e.g., coaxial cable, optical fiber, digital subscriber line (DS L)) or wireless (e.g., infrared, wireless, microwave, etc.) means to another website site, computer, server, or data center.
It is 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 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.
All the embodiments in the present specification are described in a related manner, and the same and similar parts among the embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, apparatus embodiments, management node embodiments, computer-readable storage medium embodiments, and computer program product embodiments are described for simplicity as they are substantially similar to method embodiments, where relevant, reference may be made to some descriptions of method embodiments.
The above description is only for the preferred embodiment of the present invention, and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention shall fall within the protection scope of the present invention.

Claims (12)

1. A server switching method is characterized in that the method is applied to a management node of a server cluster, wherein the server cluster comprises a main server which is currently running and at least one backup server which is not currently running, and the main server runs a stand-alone database; the method comprises the following steps:
monitoring whether the main server operates normally;
when the main server is monitored to be incapable of normally operating, selecting a target server from the at least one backup server;
and switching the target server to a new main server, and operating the stand-alone database in the target server after the switching is finished.
2. The method of claim 1, wherein the step of monitoring whether the primary server is operating normally comprises:
detecting whether a service port of the main server is alive and/or whether a service process exists; when the service port is detected to be not alive or the service process does not exist, determining that the server cannot normally operate;
alternatively, the first and second electrodes may be,
and calling a detection program preset in the stand-alone database, and monitoring whether the main server operates normally.
3. The method of claim 1, wherein the step of switching the target server to a new master server comprises:
and calling a preset switching program to switch the target server into a new main server.
4. The method according to claim 3, wherein the predetermined switching procedure is: the method comprises the steps that a preset switching program corresponding to a load balancing service is adopted, and a main server is mounted on the load balancing service; the step of switching the target server to a new master server includes:
offloading the primary server from the load balancing service;
unloading the stand-alone database from the main server;
mounting the stand-alone database on the target server, and starting the stand-alone database in the target server;
and mounting the target server to the load balancing service.
5. The method according to claim 3, wherein the predetermined switching procedure is: a preset switching program corresponding to the load balancing service, wherein the main server is mounted on the load balancing service, and the target server is mounted with the single-machine database; the step of switching the target server to a new master server includes:
offloading the primary server from the load balancing service;
starting the stand-alone database in the target server;
and mounting the target server to the load balancing service.
6. The server switching device is characterized by being applied to a management node of a server cluster, wherein the server cluster comprises a main server which is currently operated and at least one backup server which is not currently operated, and the main server is operated with a stand-alone database; the device comprises:
the server monitoring module is used for monitoring whether the main server normally operates or not;
the server selection module is used for selecting a target server from the at least one backup server when the main server is monitored to be incapable of normally operating;
and the server switching module is used for switching the target server into a new main server, and the stand-alone database is operated in the target server after the switching is finished.
7. The apparatus according to claim 6, wherein the server monitoring module is specifically configured to:
detecting whether a service port of the main server is alive and/or whether a service process exists; when the service port is detected to be not alive or the service process does not exist, determining that the server cannot normally operate;
alternatively, the first and second electrodes may be,
and calling a detection program preset in the stand-alone database, and monitoring whether the main server operates normally.
8. The apparatus of claim 6, wherein the server switching module is specifically configured to:
and calling a preset switching program to switch the target server into a new main server.
9. The apparatus of claim 8, wherein the predetermined switching procedure is: the method comprises the steps that a preset switching program corresponding to a load balancing service is adopted, and a main server is mounted on the load balancing service; the server switching module is specifically configured to:
offloading the primary server from the load balancing service;
unloading the stand-alone database from the main server;
mounting the stand-alone database on the target server, and starting the stand-alone database in the target server;
and mounting the target server to the load balancing service.
10. The apparatus of claim 8, wherein the predetermined switching procedure is: a preset switching program corresponding to the load balancing service, wherein the main server is mounted on the load balancing service, and the target server is mounted with the single-machine database; the server switching module is specifically configured to:
offloading the primary server from the load balancing service;
starting the stand-alone database in the target server;
and mounting the target server to the load balancing service.
11. A management node is characterized by comprising a processor, a communication interface, a memory and a communication bus, wherein the processor and the communication interface are used for realizing the communication between the processor and the memory through the communication bus;
a memory for storing a computer program;
a processor for implementing the method steps of any one of claims 1 to 5 when executing a program stored in the memory.
12. A computer-readable storage medium, characterized in that a computer program is stored in the computer-readable storage medium, which computer program, when being executed by a processor, carries out the method steps of any one of the claims 1-5.
CN202010330470.XA 2020-04-24 2020-04-24 Server switching method, device, management node and storage medium Pending CN111414247A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202010330470.XA CN111414247A (en) 2020-04-24 2020-04-24 Server switching method, device, management node and storage medium
PCT/CN2021/084965 WO2021213171A1 (en) 2020-04-24 2021-04-01 Server switching method and apparatus, management node and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010330470.XA CN111414247A (en) 2020-04-24 2020-04-24 Server switching method, device, management node and storage medium

Publications (1)

Publication Number Publication Date
CN111414247A true CN111414247A (en) 2020-07-14

Family

ID=71492211

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010330470.XA Pending CN111414247A (en) 2020-04-24 2020-04-24 Server switching method, device, management node and storage medium

Country Status (2)

Country Link
CN (1) CN111414247A (en)
WO (1) WO2021213171A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2021213171A1 (en) * 2020-04-24 2021-10-28 北京金山云网络技术有限公司 Server switching method and apparatus, management node and storage medium

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114326511A (en) * 2021-12-29 2022-04-12 珠海万力达电气自动化有限公司 Industrial and mining enterprise electric power centralized control system dual-computer switching method based on monitor configuration tool

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101876924A (en) * 2009-04-30 2010-11-03 升东网络科技发展(上海)有限公司 Database fault automatic detection and transfer method
CN106982259A (en) * 2017-04-19 2017-07-25 聚好看科技股份有限公司 The failure solution of server cluster
CN107911238A (en) * 2017-11-13 2018-04-13 郑州云海信息技术有限公司 One kind is based on IPSAN servers two unit standby method and system
CN108040108A (en) * 2017-12-11 2018-05-15 杭州电魂网络科技股份有限公司 Communication handover method, device, coordination service device and readable storage medium storing program for executing
CN108259239A (en) * 2018-01-11 2018-07-06 郑州云海信息技术有限公司 A kind of database high availability support method and system
CN109618000A (en) * 2019-01-09 2019-04-12 广州视源电子科技股份有限公司 Master-slave switching method, device, system and the server of load balancing service

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9600341B2 (en) * 2009-09-14 2017-03-21 Red Hat, Inc. Transaction sticky load balance policies
CN110333974B (en) * 2019-06-03 2022-04-15 腾讯科技(深圳)有限公司 Switching method and device of cloud storage service
CN111414247A (en) * 2020-04-24 2020-07-14 北京金山云网络技术有限公司 Server switching method, device, management node and storage medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101876924A (en) * 2009-04-30 2010-11-03 升东网络科技发展(上海)有限公司 Database fault automatic detection and transfer method
CN106982259A (en) * 2017-04-19 2017-07-25 聚好看科技股份有限公司 The failure solution of server cluster
CN107911238A (en) * 2017-11-13 2018-04-13 郑州云海信息技术有限公司 One kind is based on IPSAN servers two unit standby method and system
CN108040108A (en) * 2017-12-11 2018-05-15 杭州电魂网络科技股份有限公司 Communication handover method, device, coordination service device and readable storage medium storing program for executing
CN108259239A (en) * 2018-01-11 2018-07-06 郑州云海信息技术有限公司 A kind of database high availability support method and system
CN109618000A (en) * 2019-01-09 2019-04-12 广州视源电子科技股份有限公司 Master-slave switching method, device, system and the server of load balancing service

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2021213171A1 (en) * 2020-04-24 2021-10-28 北京金山云网络技术有限公司 Server switching method and apparatus, management node and storage medium

Also Published As

Publication number Publication date
WO2021213171A1 (en) 2021-10-28

Similar Documents

Publication Publication Date Title
US10044550B2 (en) Secure cloud management agent
US9791908B2 (en) Systems and methods for protecting virtualized assets
US20150106516A1 (en) Providing a witness service
CN108696581B (en) Distributed information caching method and device, computer equipment and storage medium
US10725763B1 (en) Update and rollback of configurations in a cloud-based architecture
US20140068040A1 (en) System for Enabling Server Maintenance Using Snapshots
WO2021184587A1 (en) Prometheus-based private cloud monitoring method and apparatus, and computer device and storage medium
CN113347037B (en) Data center access method and device
WO2019034095A1 (en) Software processing method and apparatus, electronic device and computer-readable storage medium
CN111414247A (en) Server switching method, device, management node and storage medium
CN106230954B (en) Virtualization management platform
WO2023165226A1 (en) Application resource backup method and apparatus, electronic device, and storage medium
CN112398689A (en) Network recovery method and device, storage medium and electronic equipment
CN111342986B (en) Distributed node management method and device, distributed system and storage medium
US9317355B2 (en) Dynamically determining an external systems management application to report system errors
CN111240760B (en) Application publishing method, system, storage medium and equipment based on registry
CN109324914B (en) Service calling method, service calling device and central server
US11777810B2 (en) Status sharing in a resilience framework
CN116302716A (en) Cluster deployment method and device, electronic equipment and computer readable medium
JP2015114952A (en) Network system, monitoring control unit, and software verification method
CN110768855B (en) Method and device for testing linkmzation performance
CN112988471B (en) Data backup method and device in industrial Internet system and electronic equipment
CN106469155A (en) A kind of basic data processing method, apparatus and system
US20230289203A1 (en) Server maintenance control device, server maintenance system, server maintenance control method, and program
CN116010173A (en) Abnormal response method and device based on master-slave operating system and electronic equipment

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