Server control method, server and storage medium
By obtaining and switching server status, the security problems caused by unreasonable administrator operations are solved, the security of the server cluster is improved, and the stability and security of the operating and maintenance states are ensured.
Patent Information
- Application Number
- CN202210899493.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-28
- Publication Date
- 2024-12-27
- Estimated Expiration
- 2042-07-28
AI Technical Summary
In the prior art, unreasonable administrator operations lead to insecure of server cluster nodes, resulting in low server security.
By obtaining the status information of the target server, it is determined that it is running or maintenance state, and sending a status switching indication to switch it to maintenance state. After receiving the switching completion message, it is controlled to ensure that the server is not disturbed during the running state. Maintenance is carried out to avoid safety problems caused by improper operation.
Improves the security of server clusters, prevents intrusions and unnecessary maintenance operations, and ensures data and system security.
Smart Images

Figure CN115277457B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present invention belong to the field of computer technology, and specifically relate to a server control method, a server, and a storage medium. Background Art
[0002] A single server in a server cluster is usually called a node, and multiple servers are usually connected through a local area network, working together closely to complete computing tasks.
[0003] Each server in the server cluster is installed with a management system such as a Platform as a Service (PaaS) system or an Infrastructure as a Service (IaaS) system. These systems are similar to the operating system installed in the server. These systems are installed with distributed software (PaaS platform and IaaS platform, etc.) to provide services to the server. In the prior art, management personnel or maintenance personnel log in to the management server through the management system according to their corresponding permissions to complete the management and maintenance work of the server cluster.
[0004] However, when the server is performing a task, when the administrator or maintenance personnel logs in to the management server to control it, unreasonable operation may cause each node in the server cluster to be unsafe, making the node easy to be invaded, resulting in low server security. Summary of the invention
[0005] In order to solve the above-mentioned problems in the prior art, that is, to solve the problem in the prior art that unreasonable operations by the administrator may make each node in the server cluster unsafe, resulting in low security of the server, an embodiment of the present invention provides a server control method, a server and a storage medium.
[0006] In a first aspect, an embodiment of the present invention provides a method for controlling a server, which is applied to a management server, comprising:
[0007] Obtaining the current status information of the target server, wherein the status information is an operating state or a maintenance state;
[0008] When the state information is a running state, obtaining a state switching indication;
[0009] Sending the state switching indication to the target server, wherein the state switching indication is used to instruct the target server to switch the running state to the maintenance state;
[0010] Receive a state switching completion message sent by the target server, and control the target server according to the state switching completion message.
[0011] In the preferred technical solution of the above-mentioned server control method, controlling the target server according to the state switching completion message includes:
[0012] According to the state switching message, the data stored in the target server is migrated, the target server is removed from the server cluster, and a maintenance operation is performed on the target server to control the target server.
[0013] In the preferred technical solution of the above server control method, performing a maintenance operation on the target server includes:
[0014] Obtaining a maintenance state level of the target server;
[0015] Acquire the maintenance operation corresponding to the status level;
[0016] The maintenance operation is performed on the target server.
[0017] In the preferred technical solution of the control method of the above server, before obtaining the state switching indication, it also includes:
[0018] Obtaining the administrator's identity authentication information and authenticating the identity authentication message, wherein the identity authentication information includes fingerprint information and / or face information;
[0019] Determine whether the identity authentication message is successfully authenticated.
[0020] In a preferred technical solution of the above-mentioned method for controlling the server, the method further includes:
[0021] When the state information is the maintenance state, obtaining the state level of the maintenance state of the target server;
[0022] Acquire the maintenance operation corresponding to the status level;
[0023] The maintenance operation is performed on the target server.
[0024] In a second aspect, an embodiment of the present invention provides a method for controlling a server, which is applied to a target server and includes:
[0025] When the state of the target server changes, the current state information is sent to the management server, and the state information is either running state or maintenance state;
[0026] Receiving a state switching instruction sent by the management server, wherein the state switching instruction is used to instruct the target server to switch the running state to the maintenance state;
[0027] Performing state switching according to the state switching indication;
[0028] When the state switching is successful, a state switching completion message is sent to the management server.
[0029] In a preferred technical solution of the above-mentioned server control method, the state switching according to the state switching indication includes:
[0030] Check whether there is a running program;
[0031] When it is determined that there is a program in the running state, a warning message is output, wherein the warning message is used to indicate that the state cannot be switched;
[0032] When it is determined that no program is running, the running state is switched to the maintenance state.
[0033] In the preferred technical solution of the above server control method, before sending the status information to the management server, it also includes:
[0034] When the state of the target server is in maintenance state, if it is detected that the target server is added to the server cluster, the maintenance state is switched to the running state;
[0035] When the state of the target server is the running state, if it is detected that the target server is removed from the server cluster, the running state is switched to the maintenance state.
[0036] In a third aspect, an embodiment of the present invention provides a management server, including:
[0037] A first acquisition module is used to acquire current status information of the target server, where the status information is a running status or a maintenance status;
[0038] A second acquisition module, used for acquiring a state switching indication when the state information is a running state;
[0039] A sending module, used for sending the state switching indication to the target server, wherein the state switching indication is used for instructing the target server to switch the running state to the maintenance state;
[0040] The processing module is used to receive a state switching completion message sent by the target server, and control the target server according to the state switching completion message.
[0041] In a fourth aspect, an embodiment of the present invention provides a service server, including:
[0042] A first sending module, used for sending current status information to the management server when the status of the target server changes, wherein the status information is a running status or a maintenance status;
[0043] A receiving module, used for receiving a state switching instruction sent by the management server, wherein the state switching instruction is used for instructing the target server to switch its state to a maintenance state;
[0044] A switching module, used for performing state switching according to the state switching indication;
[0045] The second sending module is used to send a state switching completion message to the management server when the state switching is successful.
[0046] In a fifth aspect, an embodiment of the present invention provides a management server, comprising: a processor, and a memory communicatively connected to the processor;
[0047] The memory stores computer-executable instructions;
[0048] The processor executes the computer-executable instructions stored in the memory to implement the server control method as described in the first aspect.
[0049] In a sixth aspect, an embodiment of the present invention provides a service server, comprising: a processor, and a memory communicatively connected to the processor;
[0050] The memory stores computer-executable instructions;
[0051] The processor executes the computer-executable instructions stored in the memory to implement the server control method as described in the second aspect.
[0052] In a seventh aspect, an embodiment of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer execution instructions, and when the computer execution instructions are executed by a processor, they are used to implement the control method of the server as described in the first aspect or the second aspect.
[0053] In an eighth aspect, an embodiment of the present invention provides a computer program product, including a computer program, which, when executed by a processor, is used to implement the server control method described in the first aspect or the second aspect.
[0054] It can be understood by those skilled in the art that the control method, server and storage medium of a server provided in the embodiment of the present invention obtain the current status information of the target server. When the status information is in the running state, the management server obtains the status switching instruction and then sends the status switching instruction to the target server. After the target server switches the state successfully, the management server can receive the status switching completion message sent by the target server and control the target server according to the status switching completion message, so that the server is not disturbed when it is in the running state, and maintaining it when it is in the maintenance state can effectively avoid the safety problems caused by improper operation of the management personnel or maintenance personnel, thereby improving the safety of the cluster. BRIEF DESCRIPTION OF THE DRAWINGS
[0055] The following describes a preferred implementation of a method for controlling a server of the present invention with reference to the accompanying drawings.
[0056] Figure 1 It is a scenario schematic diagram of the server control method provided by the present invention;
[0057] Figure 2 It is a flow chart of a method for controlling a server provided in Embodiment 1 of the present invention;
[0058] Figure 3 is a flow chart of another method for controlling a server provided in Embodiment 2 of the present invention;
[0059] Figure 4 is a flow chart of another method for controlling a server provided in Embodiment 3 of the present invention;
[0060] Figure 5 is a flow chart of another method for controlling a server provided in Embodiment 4 of the present invention;
[0061] Figure 6 A signaling flow chart of a method for controlling a server provided in Embodiment 5 of the present invention;
[0062] Figure 7 A schematic diagram of the structure of a management server provided in Embodiment 6 of the present invention;
[0063] Figure 8 A schematic diagram of the structure of a server provided in Embodiment 7 of the present invention;
[0064] Fig. 9 A schematic diagram of the structure of a management server provided in Embodiment 8 of the present invention;
[0065] Fig.10 A schematic diagram of the structure of a server provided in Embodiment 9 of the present invention. DETAILED DESCRIPTION
[0066] First, those skilled in the art should understand that these embodiments are only used to explain the technical principles of the present invention and are not intended to limit the protection scope of the present invention. Those skilled in the art can make adjustments to them as needed to adapt to specific application scenarios.
[0067] Secondly, it should be noted that in the description of the embodiments of the present invention, terms such as "inside" and "outside" indicating directions or positional relationships are based on the directions or positional relationships shown in the drawings. This is only for the convenience of description and does not indicate or imply that the device or component must have a specific orientation, be constructed and operated in a specific orientation. Therefore, it cannot be understood as a limitation on the present invention.
[0068] In addition, it should be noted that in the description of the embodiments of the present invention, unless otherwise clearly specified and limited, the terms "connected" and "connection" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be indirectly connected through an intermediate medium, or it can be the internal communication of two components. For those skilled in the art, the specific meanings of the above terms in the embodiments of the present invention can be understood according to specific circumstances.
[0069] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0070] When executing tasks, server clusters usually use multiple servers to perform parallel computing to achieve high computing speed. For cluster management, managers and maintenance personnel generally log in to the management system installed in the host (i.e., management node) in the cluster to control the resource configuration of the servers in the cluster.
[0071] In the prior art, when a server is executing a task, an operation and maintenance personnel or a management personnel can log in to the server to complete the management and maintenance of the server cluster, etc. However, the mandatory login to control the server may cause problems in the programs running on the server or even other servers in the cluster when the operation is unreasonable, and make the servers in the cluster easy to be invaded, and some irrelevant or dangerous software may be downloaded, etc., which has low security.
[0072] Therefore, this embodiment provides a method for controlling a server, which sets each server in a server cluster to two states: an operating state and a maintenance state, and limits the maintenance operations that can be directly performed on the server when it is in the maintenance state. When a problem occurs in a server and maintenance is required, but the server is in the operating state, a manager with higher authority is required to switch its state to the maintenance state before the maintenance personnel can perform maintenance operations, so that the server is not disturbed when it is in the operating state. Maintaining it in the maintenance state can effectively avoid security issues caused by improper operations of managers or maintenance personnel, thereby improving the security of the cluster.
[0073] Next, the above-mentioned operation state and maintenance state are explained.
[0074] Running state: means that the server can participate in computing tasks, that is, it can be determined that the server has been added to the server cluster. At this time, the program in the target server can be in the running state, or the target server can also be in the waiting state (that is, the program is not in the running state). Administrators or maintenance personnel cannot perform maintenance work on the server in this state.
[0075] Maintenance state: refers to the server being in an inoperative state and being temporarily removed from the server cluster. Administrators or maintenance personnel can perform maintenance work on the server in this state.
[0076] The principles and features of the embodiments of the present invention are described below in conjunction with the accompanying drawings. The examples given are only used to explain the embodiments of the present invention and are not used to limit the scope of the embodiments of the present invention.
[0077] Figure 1 Schematic diagram of a scenario of a method for controlling a server provided by the present invention, such as Figure 1 As shown, the server cluster 10 includes multiple servers, which can be connected via a local area network to achieve collaborative computing work. Among them, the management server 102 is usually called a host, which can manage other servers (server 101, server 103, server 104 and server 105, etc., only four are shown in the figure) in the server cluster 10 through the local area network, such as resource allocation.
[0078] Taking the target server 101 as an example, when the target server 101 is removed from the server cluster 10 by the management server 102, the target server 101 can set its state to the maintenance state. When the target server 101 is added to the server cluster 10 by the management server 102, the target server 101 can set its state to the running state. Whether the maintenance personnel can perform maintenance operations on it can be determined according to its state, that is, when the target server 101 is in the maintenance state, maintenance can be performed. When the target server 101 is in the running state, it is necessary for the administrator with higher authority to switch its state to the maintenance state before maintenance can be performed, thereby improving the security of the target server 101 and even the server cluster 10.
[0079] It should be noted that the embodiments of the present invention do not limit the actual forms of various devices in the application scenarios, nor do they limit the interaction methods between devices. In the specific application of the solution, it can be set according to actual needs.
[0080] refer to Figure 2 , Figure 2 It is a flow chart of a method for controlling a server provided in the first embodiment of the present invention. The method can be executed by a management server and specifically includes the following steps.
[0081] Step S201: Obtain the current status information of the target server, where the status information is either a running status or a maintenance status.
[0082] When the management server controls the target server, it must first obtain the current status information of the target server to determine whether the current status of the server is running or maintenance, and perform corresponding operations according to its status.
[0083] As a possible implementation manner, the current status information of the target server may be returned by the target server after the management server sends a status query request to the target server.
[0084] In another possible implementation, the current state information of the target server can be queried by the management server from the state information uploaded by the target server stored locally, wherein the state information uploaded by the target server can be sent when a state change is found. It can be understood that the current state information is the latest state information uploaded by the target server stored locally.
[0085] Step S202: When the status information is a running status, a status switching indication is obtained.
[0086] After the management server determines the state of the target server, when it is determined that the target server is in a running state, the management server obtains a state switching indication.
[0087] Optionally, before obtaining the status switching indication, the management server may obtain the administrator's identity authentication information and authenticate the identity authentication information, where the identity authentication information includes fingerprint information and / or face information, etc.
[0088] When it is determined that the identity authentication information is successfully authenticated, the management server can obtain the status switching instructions entered by the administrator through the corresponding interface on the management system (such as a PaaS system or an IaaS system, etc.), thereby preventing ordinary users or maintenance personnel from arbitrarily switching the status of the target server, further ensuring the security of the cluster.
[0089] When the status information is in maintenance state, it means that the server can perform corresponding operations, so the administrator or maintenance personnel can control the target server through the management server.
[0090] Specifically, the management server may obtain the state level of the maintenance state of the target server and the maintenance operation corresponding to the state level, and then the management server executes the maintenance operation on the target server. Performing maintenance according to the level improves the security of the target server.
[0091] Step S203: Send a state switching indication to the target server, where the state switching indication is used to instruct the target server to switch from a running state to a maintenance state.
[0092] After obtaining the state switching instruction, the management server sends the state switching instruction to the target server to instruct the target server to perform state switching.
[0093] Step S204: receiving a state switching completion message sent by the target server, and controlling the target server according to the state switching completion message.
[0094] When the target server switches the running state to the maintenance state according to the state switching instruction, the management server receives the state switching completion message sent by it, and then the management server can perform operations such as control and maintenance on the target server according to the message.
[0095] The server control method provided in this embodiment obtains the current state information of the target server. When the state information is in the running state, the management server obtains the state switching instruction, and then sends the state switching instruction to the target server. After the target server switches the state successfully, the management server can receive the state switching completion message sent by the target server, and control the target server according to the state switching completion message, so that the server is not disturbed when it is in the running state, and maintenance on it when it is in the maintenance state can effectively avoid safety problems caused by improper operation of management personnel or maintenance personnel, thereby improving the safety of the cluster.
[0096] Further, based on the first embodiment, the control of the target server by the management server is specifically introduced through the second embodiment below.
[0097] Figure 3 is a flow chart of another method for controlling a server provided in Embodiment 2 of the present invention. The method can be executed by a management server. Figure 3 As shown, the method specifically includes the following steps.
[0098] Step S301: Migrate the data stored in the target server and remove the target server from the server cluster.
[0099] Before controlling or maintaining the target server, the management server can migrate the data stored in the target server, which can prevent the management server from damaging the data generated by the target server during operation or the data stored by the target server itself when controlling the target server, thus ensuring the security of the data. The target server can also be removed from the server cluster to prevent the management server from affecting the operation of other servers in the cluster when controlling the target server.
[0100] Specifically, the data can be migrated to other servers in the server cluster for backup. It can be understood that the server used for backup is in a maintenance state. The management server can also migrate the data stored in the target server to a specific server outside the cluster for backup.
[0101] The data stored in the target server may be a program, software, or data generated during its operation, as well as basic files for the server to run the program.
[0102] As for the method of removing the target server from the server cluster, illustratively, the management server may disconnect the target server from the local area network used by the server cluster, or the target server may be removed by other methods, which are not limited in the present invention.
[0103] Step S302: Perform maintenance operations on the target server to control the target server.
[0104] After the management server migrates the data stored in the target server and removes the target server from the cluster, the administrator or maintenance personnel can control the target server through the management server.
[0105] Specifically, management personnel or maintenance personnel can perform corresponding management work according to their authority through the management system in the management server, such as the PaaS system or the IaaS system.
[0106] Optionally, the maintenance state may include multiple levels of states, each level of state corresponds to a different maintenance operation, and the maintenance state of the target server may be any of the levels of states. The management server may obtain the state level of the maintenance state of the target server and the maintenance operation corresponding to the state level, and then the management server performs the maintenance operation on the target server.
[0107] Exemplarily, when the maintenance state of the target server is at the highest level, the operations that the maintenance personnel can perform on the target server are maintenance operations corresponding to the highest level.
[0108] It should be noted that the maintenance level and the maintenance operations corresponding to each level can be set according to actual needs. For example, the maintenance level of the target server can be set in advance by the administrator through the management server, which can further improve the security of the target server and effectively prevent the server from being invaded and performing unnecessary tasks.
[0109] It can be understood that after the maintenance personnel perform maintenance on the target server, the administrator can add the server to the server cluster so that the target server can detect that it has been added to the server cluster, so that the target server automatically triggers a state switch and switches the maintenance state to the running state.
[0110] In this embodiment, the management server can migrate the data stored in the target server before controlling the target server to ensure data security. The target server can also be removed from the server cluster and then controlled to avoid affecting the operation of other servers in the cluster when the management server controls the target server.
[0111] Next, a control method for a server in which the execution subject is a target server is described through Example 3.
[0112] Figure 4 is a flow chart of another method for controlling a server provided in Embodiment 3 of the present invention. The method can be executed by a target server, such as Figure 4 As shown, the method specifically includes the following steps.
[0113] Step S401: When the state of the target server changes, the current state information is sent to the management server, and the state information is either a running state or a maintenance state.
[0114] When the status of the target server changes, the current status information is sent to the management server so that the administrator can understand the status of the target server in a timely manner.
[0115] Exemplarily, the state of the target server may be changed by: when the state of the target server is in maintenance state, if it is detected that the target server is added to the server cluster, the maintenance state is switched to running state. When the state of the target server is in running state, if it is detected that the target server is removed from the server cluster, the running state is switched to maintenance state.
[0116] The above-mentioned state switching mode can be realized, for example, by a switching program in the target server, which can monitor whether the target server is added to the server cluster to change the state of the target server. Alternatively, the state of the target server can be switched when a state switching instruction sent by the management server is monitored.
[0117] Step S402: Obtain a state switching indication sent by the management server, where the state switching indication is used to instruct the target server to switch its state to a maintenance state.
[0118] When the current state of the target server is running and the management server has management requirements for the target server, the target server may receive a state switching instruction sent by the management server to instruct the target server to switch the state to maintenance state.
[0119] Step S403: Perform state switching according to the state switching indication.
[0120] After receiving the state switching instruction, the target server switches its state according to the instruction, that is, switches the running state to the maintenance state.
[0121] Step S404: When the state switching is successful, a state switching completion message is sent to the management server.
[0122] After the target server status is successfully switched, a status switching completion message is sent to the management server, so that the administrator or maintenance personnel can control and maintain the target server through the management server.
[0123] In this embodiment, when the state of the target server changes, the target server sends the current state information to the management server so that the administrator can timely understand the state of the target server. When the state switching instruction sent by the management server is obtained, the target server switches the state according to the state switching instruction. When the state switching is successful, the target server can send a state switching completion message to the management server, so that the server is not disturbed when it is in the running state, and maintenance on it when it is in the maintenance state can effectively avoid safety problems caused by improper operation of management personnel or maintenance personnel, thereby improving the safety of the cluster.
[0124] Based on the third embodiment, the state switching of the server is specifically introduced through the fourth embodiment below.
[0125] Figure 5 is a flow chart of another method for controlling a server provided in Embodiment 4 of the present invention. The method can be executed by a target server, such as Figure 5 As shown, the method specifically includes the following steps.
[0126] Step S501: Determine whether there is a running program on the target server.
[0127] Before switching the running state to the maintenance state, the target server may detect whether there is a running program on it. If it is determined that there is a running program, step S502 is executed; if it is determined that there is no running program, step S503 is executed.
[0128] Step S502: output a warning message, where the warning message is used to indicate that the state switching cannot be performed.
[0129] When it is determined that there is a program in running state, the target server outputs a warning message. The warning message is used to indicate that the state switching cannot be performed. This can avoid the server forcibly switching states when running the program, which may affect the computing tasks and security of the target server and the server cluster, and further ensure the security of the target server in running state.
[0130] The above-mentioned method of outputting the alarm information can be exemplarily performed by a buzzer, or by other methods such as voice, and the present invention is not limited to this.
[0131] It can be understood that the target server can send a state switching failure message to the management server to prompt the management server that the state switching cannot be performed.
[0132] Optionally, a whitelist is set on the target server, which includes at least one program or software. When the target server is in the running state, the programs it can run are the programs on the whitelist, which more effectively ensures the security of the target server and makes the server cluster more secure.
[0133] Optionally, the running state may include multiple levels of states, each level of state corresponds to different operable behaviors, and when the state of the target server is the running state, the target server may execute the operable behaviors corresponding to the state level of the running state. Exemplarily, when the level of the running state is intermediate, the operable behavior corresponding to the level is to accept a USB flash drive inserted by a user. It can be understood that, that is, when the server is at this level of the running state, in addition to the operable behaviors, the server does not accept any other operations, such as user login behaviors, etc.
[0134] It should be noted that, illustratively, the above-mentioned level can be set by the target server according to the importance of the task it performs. The higher the importance, the higher the level can be set. The importance can be set by the user when adding the task. Alternatively, the level of the target server in the running state can be set in advance by the administrator through the management server.
[0135] Step S503: The target server switches the running state to the maintenance state.
[0136] When it is determined that there is no program in the running state, the target server switches the running state to the maintenance state.
[0137] In this embodiment, before the target server switches its state, it can determine whether there is a program in the running state on the target server. When it is determined that there is a program in the running state, a warning message is output to indicate that the state switching cannot be performed, which can avoid the server forcibly switching the state when running the program, causing the computing tasks and security of the target server and the server cluster to be affected, and further ensure the security of the target server in the running state. When it is determined that there is no program in the running state, the target server switches the running state to the maintenance state, so that the server is not disturbed when it is in the running state. Maintaining it in the maintenance state can effectively avoid security problems caused by improper operation of management personnel or maintenance personnel, and improve the security of the cluster.
[0138] Based on the above embodiments, the interaction between the management server and the target server is described below through Embodiment 5.
[0139] refer to Figure 6 , Figure 6 A signaling flow chart of a control method of a server provided in Embodiment 5 of the present invention, such as Figure 6 As shown, the method provided in this embodiment includes the following steps.
[0140] Step S601: When the state of the target server changes, the target server sends current state information to the management server.
[0141] The status information is running status or maintenance status.
[0142] Step S602: The management server determines whether the target server is in operation according to the status information.
[0143] If yes, execute step S603, if no, execute step S609.
[0144] Step S603: The management server obtains a state switching indication.
[0145] The state switching indication is used to instruct the target server to switch the running state to the maintenance state. In this step, the management server can obtain the identity authentication information of the administrator and authenticate it. When the authentication is successful, the management server can obtain the state switching indication input by the administrator.
[0146] Step S604: The management server sends a status switching instruction to the target server.
[0147] Step S605: Determine whether there is a running program on the target server.
[0148] If yes, execute step S606, if no, execute step S607.
[0149] Step S606: The target server sends a status switching failure message to the management server.
[0150] When it is determined that there is a program in the running state, the state switching failure message is used to indicate that a program is running on the target server and the running state cannot be switched to the maintenance state.
[0151] Step S607: The target server switches the running state to the maintenance state.
[0152] When it is determined that there is no program in the running state, the target server switches the running state to the maintenance state.
[0153] Step S608: When the state switching is successful, the target server sends a state switching completion message to the management server.
[0154] The state switching completion message is used to instruct the target server to switch from the running state to the maintenance state, and the management server can perform corresponding management work on the target server.
[0155] Step S609: Control the target server.
[0156] In this embodiment, when the state of the target server changes, the target server sends the current state information to the management server. The management server determines whether the target server is in the running state based on the state information. If so, the management server obtains the state switching indication and sends it to the target server, so that the target server switches the running state to the maintenance state when there is no program running, and sends a state switching completion message to the management server, so that the server is not disturbed when it is in the running state. When it is in the maintenance state, the management server maintains it, which can effectively avoid security problems caused by improper operation of management personnel or maintenance personnel, thereby improving the security of the cluster.
[0157] Figure 7 A schematic diagram of the structure of a management server provided in Embodiment 6 of the present invention is shown in FIG. Figure 7As shown, the management server 70 includes: a first acquisition module 701 , a second acquisition module 702 , a sending module 703 and a processing module 704 .
[0158] The first acquisition module 701 is used to acquire the current state information of the target server, where the state information is a running state or a maintenance state.
[0159] The second acquisition module 702 is used to acquire a state switching indication when the state information is a running state.
[0160] The sending module 703 is used to send a state switching indication to the target server, where the state switching indication is used to instruct the target server to switch from a running state to a maintenance state.
[0161] The processing module 704 is used to receive a state switching completion message sent by the target server, and control the target server according to the state switching completion message.
[0162] Optionally, the processing module 704 is specifically configured to:
[0163] According to the state switching message, the data stored in the target server is migrated, the target server is removed from the server cluster, and a maintenance operation is performed on the target server to control the target server.
[0164] Optionally, the processing module 704 is further configured to:
[0165] Gets the maintenance status of the target server.
[0166] Get the maintenance operation corresponding to the status level.
[0167] Perform maintenance operations on the target server.
[0168] Optionally, the management server 70 further includes: an authentication module.
[0169] The authentication module is specifically used for:
[0170] The administrator's identity authentication information is obtained and the identity authentication message is authenticated. The identity authentication information includes fingerprint information and / or face information.
[0171] Confirm that the identity authentication message is successfully authenticated.
[0172] Optionally, the management server 70 further includes: a maintenance module.
[0173] The maintenance module is specifically used for:
[0174] When the status information is a maintenance state, the maintenance state level of the target server is obtained.
[0175] Get the maintenance operation corresponding to the status level.
[0176] Perform maintenance operations on the target server.
[0177] The management server provided in this embodiment is used to execute the steps of a control method of a server in Embodiment 1 or Embodiment 2. Its implementation principle and technical effects are similar and will not be repeated here.
[0178] Figure 8 A schematic diagram of the structure of a service server provided in Embodiment 7 of the present invention is shown in FIG. Figure 8 As shown, the server 80 includes: a first sending module 801 , a receiving module 802 , a switching module 803 and a second sending module 804 .
[0179] The first sending module 801 is used to send current status information to the management server when the status of the target server changes, and the status information is the running status or the maintenance status.
[0180] The receiving module 802 is used to receive a state switching indication sent by the management server, where the state switching indication is used to instruct the target server to switch its state to a maintenance state.
[0181] The switching module 803 is used to perform state switching according to the state switching indication.
[0182] The second sending module 804 is configured to send a state switching completion message to the management server when the state switching is successful.
[0183] Optionally, the switching module 803 is specifically configured to:
[0184] Check if there is any running program.
[0185] When it is determined that there is a program in the running state, a warning message is output, and the warning message is used to indicate that the state cannot be switched.
[0186] When it is determined that no program is running, the running state is switched to the maintenance state.
[0187] Optionally, the server 80 further includes: a processing module.
[0188] The processing module is specifically used for:
[0189] When the state of the target server is in maintenance state, if it is detected that the target server is added to the server cluster, the maintenance state is switched to running state.
[0190] When the state of the target server is running, if it is detected that the target server is removed from the server cluster, the running state is switched to the maintenance state.
[0191] The business server provided in this embodiment is used to execute the steps of a control method of a server in Embodiment 3 or Embodiment 4. Its implementation principle and technical effects are similar and will not be repeated here.
[0192] Fig. 9 A schematic diagram of the structure of a management server provided in Embodiment 8 of the present invention is shown in FIG. Fig. 9 As shown, the server may include: at least one processor 901 and a memory 902 .
[0193] The memory 902 is used to store programs. Specifically, the programs may include program codes, and the program codes include computer operation instructions.
[0194] The memory 902 may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory.
[0195] The processor 901 is used to execute the computer-executable instructions stored in the memory 902 to implement the method described in the above method embodiment. The processor 901 may be a central processing unit (CPU), or an application specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present invention.
[0196] Optionally, the device may further include a communication interface 903. In a specific implementation, if the communication interface 903, the memory 902, and the processor 901 are implemented independently, the communication interface 903, the memory 902, and the processor 901 may be interconnected through a bus and communicate with each other. The bus may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus. The bus may be divided into an address bus, a data bus, a control bus, etc., but it does not mean that there is only one bus or one type of bus.
[0197] Optionally, in a specific implementation, if the communication interface 903, the memory 902 and the processor 901 are integrated on a chip, the communication interface 903, the memory 902 and the processor 901 can communicate through an internal interface.
[0198] The management server of this embodiment can be used to execute the steps of the control method of a server in Embodiment 1 or Embodiment 2. The specific implementation method and technical effect are similar and will not be repeated here.
[0199] Fig.10 A schematic diagram of the structure of a service server provided in Embodiment 9 of the present invention is shown in FIG. Fig.10 As shown, the service server may include: at least one processor 1001 and a memory 1002 .
[0200] The memory 1002 is used to store programs. Specifically, the programs may include program codes, and the program codes include computer operation instructions.
[0201] The memory 1002 may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory.
[0202] The processor 1001 is used to execute the computer-executable instructions stored in the memory 1002 to implement the method described in the above method embodiment. The processor 1001 may be a central processing unit (CPU), or an application specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present invention.
[0203] Optionally, the device may further include a communication interface 1003. In a specific implementation, if the communication interface 1003, the memory 1002 and the processor 1001 are implemented independently, the communication interface 1003, the memory 1002 and the processor 1001 may be interconnected through a bus and communicate with each other. The bus may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc., but it does not mean that there is only one bus or one type of bus.
[0204] Optionally, in a specific implementation, if the communication interface 1003, the memory 1002 and the processor 1001 are integrated on a chip, the communication interface 1003, the memory 1002 and the processor 1001 can communicate through an internal interface.
[0205] The business server of this embodiment can be used to execute the steps of the control method of a server in Embodiment 3 or Embodiment 4. The specific implementation method and technical effect are similar and will not be repeated here.
[0206] Embodiment 10 of the present invention provides a computer-readable storage medium, which may include: a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk, and other media that can store computer programs. Specifically, the computer-readable storage medium stores a computer program, which, when executed by a processor, is used to implement the steps of the control method of any one of the servers in Embodiments 1 to 5. The specific implementation method and technical effect are similar and will not be repeated here.
[0207] Embodiment 11 of the present invention provides a computer program product, including a computer program. When the computer program is executed by a processor, the steps of the control method of any one of the servers in Embodiments 1 to 5 above are implemented. The specific implementation method and technical effect are similar and will not be repeated here.
[0208] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for controlling a server, characterized in that: Applied to a management server, the method comprises: Obtaining the current status information of the target server, wherein the status information is an operating state or a maintenance state; When the state information is a running state, obtaining a state switching indication; Sending the state switching indication to the target server, wherein the state switching indication is used to instruct the target server to switch the running state to the maintenance state; receiving a state switching completion message sent by the target server, and controlling the target server according to the state switching completion message, wherein the state switching completion message is sent by the target server after switching the running state to the maintenance state when determining that there is no program in the running state; The controlling the target server according to the state switching completion message includes: According to the state switching message, the data stored in the target server is migrated, the target server is removed from the server cluster, and a maintenance operation is performed on the target server to control the target server.
2. The method according to claim 1, characterized in that Performing maintenance operations on the target server, including: Obtaining a maintenance state level of the target server; Acquire the maintenance operation corresponding to the status level; The maintenance operation is performed on the target server.
3. The method according to claim 1 or 2, characterized in that: Before obtaining the state switching indication, the method further includes: Obtaining the administrator's identity authentication information and authenticating the identity authentication information, wherein the identity authentication information includes fingerprint information and / or face information; Determine whether the identity authentication information is successfully authenticated.
4. The method according to claim 3, characterized in that The method further comprises: When the state information is the maintenance state, obtaining the state level of the maintenance state of the target server; Obtaining maintenance operations corresponding to the status level; The maintenance operation is performed on the target server.
5. A method for controlling a server, characterized in that: Applied to the target server, including: When the state of the target server changes, the current state information is sent to the management server, and the state information is either running state or maintenance state; Receiving a state switching instruction sent by the management server, wherein the state switching instruction is used to instruct the target server to switch the running state to the maintenance state; Performing state switching according to the state switching indication; When the state switching is successful, a state switching completion message is sent to the management server, so that the management server migrates the data stored in the target server according to the state switching message, removes the target server from the server cluster, and performs maintenance operations on the target server to control the target server; The performing state switching according to the state switching indication includes: Detect whether there is a running program; When it is determined that there is a program in the running state, a warning message is output, wherein the warning message is used to indicate that the state cannot be switched; When it is determined that no program is running, the running state is switched to the maintenance state.
6. The method according to claim 5, characterized in that Before sending status information to the management server, it also includes: When the state of the target server is in maintenance state, if it is detected that the target server is added to the server cluster, the maintenance state is switched to the running state; When the state of the target server is the running state, if it is detected that the target server is removed from the server cluster, the running state is switched to the maintenance state.
7. A management server, characterized in that: include: A first acquisition module is used to acquire current status information of the target server, where the status information is a running status or a maintenance status; A second acquisition module, used for acquiring a state switching indication when the state information is a running state; A sending module, used for sending the state switching indication to the target server, wherein the state switching indication is used for instructing the target server to switch the running state to the maintenance state; a processing module, configured to receive a state switching completion message sent by the target server, and control the target server according to the state switching completion message, wherein the state switching completion message is sent by the target server after switching the running state to the maintenance state when the target server determines that there is no program in the running state; The controlling the target server according to the state switching completion message includes: According to the state switching message, the data stored in the target server is migrated, the target server is removed from the server cluster, and a maintenance operation is performed on the target server to control the target server.
8. A business server, characterized in that: include: A first sending module, used for sending current status information to the management server when the status of the target server changes, wherein the status information is a running status or a maintenance status; A receiving module, used for receiving a state switching instruction sent by the management server, wherein the state switching instruction is used for instructing the target server to switch its state to a maintenance state; A switching module, used for performing state switching according to the state switching indication; A second sending module is used to send a state switching completion message to the management server when the state switching is successful, so that the management server migrates the data stored in the target server according to the state switching message, removes the target server from the server cluster, and performs maintenance operations on the target server to control the target server; The switching module is specifically used to: detect whether there is a program in the running state; when it is determined that there is a program in the running state, output a warning message, and the warning message is used to indicate that the state cannot be switched; when it is determined that no program is running, switch the running state to the maintenance state.
9. A management server, characterized in that: include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory to implement the server control method according to any one of claims 1 to 3.
10. A business server, characterized in that: include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory to implement the server control method according to claim 5 or 6.
11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are executed by a processor, they are used to implement the control method of the server according to any one of claims 1 to 6.