CN115242615B - Server operation management method and device, electronic equipment and storage medium - Google Patents
Server operation management method and device, electronic equipment and storage medium Download PDFInfo
- Publication number
- CN115242615B CN115242615B CN202210761441.8A CN202210761441A CN115242615B CN 115242615 B CN115242615 B CN 115242615B CN 202210761441 A CN202210761441 A CN 202210761441A CN 115242615 B CN115242615 B CN 115242615B
- Authority
- CN
- China
- Prior art keywords
- server
- service
- preset
- result
- interface
- 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.)
- Active
Links
- 238000007726 management method Methods 0.000 title claims description 72
- 238000001514 detection method Methods 0.000 claims abstract description 224
- 238000012544 monitoring process Methods 0.000 claims abstract description 123
- 238000000034 method Methods 0.000 claims abstract description 32
- 238000004891 communication Methods 0.000 claims description 50
- 238000004088 simulation Methods 0.000 claims description 28
- 230000002159 abnormal effect Effects 0.000 claims description 18
- 230000005856 abnormality Effects 0.000 claims description 6
- 238000004590 computer program Methods 0.000 claims description 6
- 238000005096 rolling process Methods 0.000 claims description 4
- 238000005516 engineering process Methods 0.000 abstract description 5
- 238000012360 testing method Methods 0.000 description 7
- 238000010586 diagram Methods 0.000 description 6
- 230000000977 initiatory effect Effects 0.000 description 4
- 230000000737 periodic effect Effects 0.000 description 4
- 238000012545 processing Methods 0.000 description 4
- 230000005236 sound signal Effects 0.000 description 4
- 230000004044 response Effects 0.000 description 3
- 238000012423 maintenance Methods 0.000 description 2
- 230000007246 mechanism Effects 0.000 description 2
- 230000006978 adaptation Effects 0.000 description 1
- 238000004458 analytical method Methods 0.000 description 1
- 238000003491 array Methods 0.000 description 1
- 238000013475 authorization Methods 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000013486 operation strategy Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000003068 static effect Effects 0.000 description 1
- 230000001960 triggered effect Effects 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L41/00—Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
- H04L41/06—Management of faults, events, alarms or notifications
- H04L41/0654—Management of faults, events, alarms or notifications using network fault recovery
- H04L41/0659—Management of faults, events, alarms or notifications using network fault recovery by isolating or reconfiguring faulty entities
- H04L41/0661—Management of faults, events, alarms or notifications using network fault recovery by isolating or reconfiguring faulty entities by reconfiguring faulty entities
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L41/00—Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
- H04L41/06—Management of faults, events, alarms or notifications
- H04L41/0654—Management of faults, events, alarms or notifications using network fault recovery
- H04L41/0663—Performing the actions predefined by failover planning, e.g. switching to standby network elements
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L43/00—Arrangements for monitoring or testing data switching networks
- H04L43/08—Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Environmental & Geological Engineering (AREA)
- Hardware Redundancy (AREA)
Abstract
The present disclosure relates to the field of information technologies, and in particular, to a method and an apparatus for managing operation of a server, an electronic device, and a storage medium. Firstly, sending an interface detection request to a main server; then monitoring an interface detection result corresponding to the interface detection request sent by the main server; and when the first monitoring result represents that the interface detection result is received and the interface detection result represents that the primary server has a first code error, the current software version of the primary server is returned to the target software version, and when the first monitoring result represents that the interface detection result is received and the interface detection result represents that the primary server has a first server error, the primary server is switched to the standby server. Therefore, according to the monitoring result of the interface detection request, the version is timely returned to the target software version or the main server is switched to the standby server, the running reliability of the server is improved, and the user experience is improved.
Description
Technical Field
The present disclosure relates to the field of information technologies, and in particular, to a method and an apparatus for managing operation of a server, an electronic device, and a storage medium.
Background
With the development of information technology, the iteration of server software versions is faster and faster, for example, in the field of internet e-commerce, the update iteration of internet e-commerce programs is faster and faster due to the e-commerce business requirements. After the server software version is upgraded and iterated, whether the server can operate stably is crucial to improving user experience.
In the related art, a timing handshake mode is generally adopted to detect the operation condition of a server, so that the operation condition of an upper layer service in server software cannot be accurately detected, and corresponding countermeasures cannot be taken in time when the abnormal operation condition of the server is detected.
Disclosure of Invention
In order to overcome the problems in the related art, the present disclosure provides an operation management method and apparatus for a server, an electronic device, and a storage medium.
According to a first aspect of the embodiments of the present disclosure, an operation management method for a server is provided, where the server includes an active server and a standby server, and the method includes:
sending an interface detection request to the primary server, wherein the interface detection request is used for requesting to detect a service interface of the primary server;
monitoring an interface detection result corresponding to the interface detection request sent by the main server;
when a first monitoring result represents that the interface detection result is received and the interface detection result represents that a first code error occurs in the main server, the current software version of the main server is returned to a target software version, and the first code error represents that the main server captures a preset first code exception when responding to the interface detection request;
and switching the primary server to the standby server under the condition that a first monitoring result represents that the interface detection result is received and the interface detection result represents that a first server error occurs in the primary server, wherein the first server error represents that the interface detection request is not normally responded due to the primary server.
Optionally, the target software version is determined by:
taking a preset software version as the target software version; or,
and taking the last version of the current software version as the target software version.
Optionally, the method further comprises:
and switching the active server to the standby server under the condition that the first monitoring result representation does not receive the interface detection result after reaching a first preset time period.
Optionally, the method further comprises:
and informing the first monitoring result to a preset target terminal through a preset communication mode.
Optionally, the method further comprises:
sending a service detection request to the primary server, wherein the service detection request is used for requesting one or more simulation service operations of the primary server;
monitoring a service detection result corresponding to the service detection request sent by the main server, wherein the service detection result comprises a simulation service operation result corresponding to each simulation service operation;
and determining a target operation management strategy from preset operation management strategies according to the second monitoring result, and executing the target operation management strategy.
Optionally, the preset operation policy includes at least one of switching the active server to the standby server, returning the current software version of the active server to the target software version, and notifying the second monitoring result to a preset target terminal through the preset communication manner, the determining a target operation management policy from preset operation management policies according to the second monitoring result, and the executing the target operation management policy includes:
when a second monitoring result represents that the service detection result is received and the service detection result represents that a second server error occurs in the main server, switching the main server to the standby server and/or informing a preset target terminal of the second monitoring result in the preset communication mode, wherein the second server error represents that the service detection request is not normally responded due to the main server; or,
when a second monitoring result represents that the service detection result is received and the service detection result represents that a second code error occurs in the main server, the current software version of the main server is returned to the target software version and/or the second monitoring result is notified to a preset target terminal through the preset communication mode, and the second code error represents that the main server captures a preset second code abnormality when responding to the service detection request; or,
under the condition that a second monitoring result represents that the service detection result is received and any one of the simulation service operation results does not meet the corresponding expected result range, the current software version of the main server is returned to the target software version and/or the second monitoring result is notified to a preset target terminal through the preset communication mode; or,
and switching the active server to the standby server and/or informing a preset target terminal of the second monitoring result in a preset communication mode under the condition that the service detection result is not received after the second monitoring result representation reaches a second preset time period.
Optionally, the determining a target operation management policy from preset operation management policies according to the second monitoring result includes:
and when a second monitoring result represents that the service detection result is received and the service detection result represents that the simulation service operation result meets the corresponding expected result range, informing a preset target terminal of the second monitoring result in a preset communication mode.
According to a second aspect of the embodiments of the present disclosure, there is provided an operation management apparatus of a server, the apparatus including:
the interface monitoring module is configured to send an interface detection request to the primary server, where the interface detection request is used to request to detect a service interface of the primary server;
a first monitoring module, configured to monitor an interface detection result corresponding to the interface detection request sent by the active server;
the first operation management module is configured to determine the abnormal type of the service interface when the first monitoring result represents that the interface detection result is received and the interface detection result represents that the service interface is abnormal; when the abnormal type represents that the primary server has a first code error, the current software version of the primary server is returned to a target software version, and the first code error represents that the primary server captures a preset first code abnormality when responding to the interface detection request; and switching the primary server to the standby server under the condition that the abnormal type represents that the primary server has a first server error, wherein the first server error representation does not normally respond to the interface detection request due to the primary server.
Optionally, the first operation management module is further configured to:
and switching the active server to the standby server under the condition that the first monitoring result representation does not receive the interface detection result after reaching a first preset time period.
Optionally, the first operation management module is further configured to:
and informing the first monitoring result to a preset target terminal through a preset communication mode.
Optionally, the apparatus further comprises:
a service detection module configured to send a service detection request to the primary server, where the service detection request is used to request one or more simulated service operations for the primary server;
a second monitoring module, configured to monitor a service detection result corresponding to the service detection request sent by the active server, where the service detection result includes a simulation service operation result corresponding to each simulation service operation;
and the second operation management module is configured to determine a target operation management strategy from preset operation management strategies according to a second monitoring result and execute the target operation management strategy.
Optionally, the preset operation policy includes at least one of switching the active server to the standby server, returning the current software version of the active server to the target software version, and notifying the second monitoring result to a preset target terminal through the preset communication manner, and the second operation management module is further configured to:
when a second monitoring result represents that the service detection result is received and the service detection result represents that a second server error occurs in the main server, switching the main server to the standby server and/or informing a preset target terminal of the second monitoring result in a preset communication mode, wherein the second server error represents that the service detection request is not normally responded due to the main server; or,
when a second monitoring result represents that the service detection result is received and the service detection result represents that a second code error occurs in the main server, returning the current software version of the main server to the target software version and/or informing a preset target terminal of the second monitoring result in the preset communication mode, wherein the second code error represents that the main server captures a preset second code exception when responding to the service detection request; or,
under the condition that a second monitoring result represents that the service detection result is received and any one of the simulation service operation results does not meet the corresponding expected result range, returning the current software version of the main server to the target software version and/or informing a preset target terminal of the second monitoring result in the preset communication mode; or,
and switching the active server to the standby server and/or informing a preset target terminal of the second monitoring result in a preset communication mode under the condition that the service detection result is not received after the second monitoring result representation reaches a second preset time period.
Optionally, the second operation management module is further configured to:
and when a second monitoring result represents that the service detection result is received and the service detection result represents that the simulation service operation result meets the corresponding expected result range, informing a preset target terminal of the second monitoring result in a preset communication mode.
According to a third aspect of an embodiment of the present disclosure, there is provided an electronic apparatus including:
a memory having a computer program stored thereon;
a processor for executing the computer program in the memory to implement the steps of the method of any of the embodiments of the first aspect.
According to a fourth aspect of embodiments of the present disclosure, there is provided a non-transitory computer readable storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of the method of the first aspect described above.
The technical scheme provided by the embodiment of the disclosure can have the following beneficial effects:
the method comprises the steps of firstly sending an interface detection request to a main server; then monitoring an interface detection result corresponding to the interface detection request sent by the main server; and returning the current software version of the primary server to a target software version under the condition that a first monitoring result represents that the interface detection result is received and the primary server has a first code error, and switching the primary server to the standby server under the condition that the first monitoring result represents that the interface detection result is received and the interface detection result represents that the primary server has a first server error. Therefore, according to the monitoring result of the interface detection request, the version is timely returned to the target software version or the primary server is switched to the standby server, the running reliability of the server is improved, and the user experience is improved.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Additional features and advantages of the disclosure will be set forth in the detailed description which follows.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the disclosure and, together with the description, serve to explain the principles of the disclosure, but are not intended to limit the disclosure.
Fig. 1 is a flowchart illustrating a method of operation management of a server according to an example embodiment.
FIG. 2 is a flow chart illustrating another method for operation management of a server in accordance with an illustrative embodiment.
Fig. 3 is a flowchart illustrating yet another method for managing operation of a server in accordance with an illustrative embodiment.
Fig. 4 is a flowchart illustrating a method of operation management of yet another server according to an example embodiment.
Fig. 5 is a block diagram illustrating an operation management apparatus of a server according to an exemplary embodiment.
Fig. 6 is a block diagram illustrating another operation management apparatus of a server according to an example embodiment.
FIG. 7 is a block diagram of an electronic device shown in accordance with an example embodiment.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the exemplary embodiments below are not intended to represent all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present disclosure, as detailed in the appended claims, and it should be understood that the specific embodiments described herein are merely illustrative and explanatory of the disclosure and are not restrictive of the disclosure.
It should be noted that all the actions of acquiring signals, information or data in the present application are performed under the premise of complying with the corresponding data protection regulation policy of the country of the location and obtaining the authorization given by the owner of the corresponding device.
First, an application scenario of the present disclosure is explained, in the related art, an operation management scheme of a server is usually detected by a timing handshake mechanism, for example, a preset liveness detection service program may be started in the server, and after the liveness detection service program receives a preset first handshake instruction, a second handshake instruction may be replied to complete the handshake detection mechanism. Because the live detection service program cannot completely reflect the interface and service conditions, for example, when the service layer program captures an abnormal code error, but the live detection service program can still normally reply the second handshake instruction, the running state of the server is misjudged, the running reliability of the server is affected, and the user experience is reduced.
In addition, the inventor also notes that reliability measures in the related art, such as switching between a master server and a standby server, are usually performed under the condition of human intervention or performed at regular time, and a technical scheme for adopting a corresponding operation management strategy of the server according to an interface and a service detection result is lacked, so that a corresponding operation management strategy cannot be adopted in time when the server is abnormal, the operation reliability of the server is affected, and the user experience is reduced.
The present disclosure is described below with reference to specific examples.
Fig. 1 is a flowchart illustrating a method for managing operations of a server according to an exemplary embodiment, which may include the following steps, as shown in fig. 1:
in step S101, an interface detection request is sent to the primary server.
The server may include an active server and a standby server, and the interface detection request is used to request to detect a service interface of the active server.
The backup protection provided by the backup server is a common technical scheme for improving reliability of IT (Information Technology) and is used for switching to the backup server in time to provide service for an end user when the primary server is abnormal.
The software versions of the primary server and the backup server may be the same, for example, both the primary server and the backup server are upgraded to the latest software version, or the software versions of the primary server and the backup server may also be different, for example, the primary server is upgraded to the latest software version, and the backup server is the last stable backup version, which is not limited in this disclosure.
The interface detection request is used to simulate an interface access request of a final user, and is sent to a server through a service interface of the primary server, so as to detect whether an upper layer service of the primary server can normally respond to the interface detection request, where the interface detection request may be initiated according to a preset policy, such as periodically, or may be initiated after responding to an interface detection command triggered by a user, and the disclosure does not limit this.
Illustratively, the primary server may be a Nginx (engine x server), which may run on a Linux or Unix operating system. In some possible implementations, the interface detection request may be initiated by a periodic task set in a preset crontab file in the Linux or Unix operating system. Taking the example that the primary server is a Web server, the interface detection request may be a Get request to the primary server initiated by a simulated end user, for example, the periodic task set in the crontab file includes a Get request to the primary server initiated by a CURL command in Linux, and for the specific technical request of the crontab periodic task and the CURL command, reference is made to the description in the related art, and details are not described here.
It should be particularly noted that, an example in which the active server is a Web server is given here, the active server may further include an FTP server and an SMTP server, the present disclosure does not limit the specific type of the active server, and the technical scheme of different types of servers simulating the end user to initiate the interface detection request is similar to that of the Web server, and reference may be made to the description in the related art.
In step S102, an interface detection result corresponding to the interface detection request sent by the active server is monitored.
After sending the interface detection request to the primary server, monitoring an interface monitoring result sent by the primary server in response to the interface detection request.
In step S103, when the first monitoring result indicates that the interface detection result is received, and the interface detection result indicates that the first code error occurs in the primary server, the current software version of the primary server is rolled back to the target software version.
The first code error representation main server captures a preset first code exception when responding to the interface detection request.
For example, taking the primary server as a Web server based on Nginx as an example, after initiating an HTTP request through the CURL, the return result may be determined by the CURL _ HTTP _ CODE in the return message. If the CURLINFO _ HTTP _ CODE is 500, it is characterized that the primary server captures a first CODE exception when responding to an interface detection request.
It should be particularly noted that, the above example shows an example of a first code error, and the present disclosure does not limit a specific implementation scheme for the primary server to capture the first code exception.
And when the first monitoring result represents that the interface detection result is received and the interface detection result represents that the first code error occurs in the main server, the first code error influencing the service exists in the current version, and the current version of the main server can be returned to the target version.
In some embodiments, the target version may be determined by any of the following:
and in the first mode, the preset software version is used as the target software version.
And secondly, taking the last version of the current software version as the target software version.
In another embodiment, a plurality of interface detection requests may also be initiated, and when a proportion of an abnormal detection result representing that the first code error occurs in all interface detection results in a plurality of interface detection results corresponding to the plurality of interface detection requests, respectively, is greater than or equal to a preset proportion threshold, the current version of the active server is rolled back to the target version.
The current version of the primary server may be consistent with the current version of the backup server, and after the current version of the primary server is rolled back to the target version, the current version of the backup server may also be rolled back to the target version according to a preset rolling back policy, for example, the preset rolling back policy may be that version rolling back is performed after a preset time interval elapses. For a specific version of the rollback technical solution, reference may be made to descriptions in related technologies, and details are not described herein.
In step S104, the primary server is switched to the standby server when the first monitoring result indicates that the interface detection result is received and the interface detection result indicates that the first server error occurs in the primary server.
The first server error representation does not normally respond to the interface detection request due to the main server.
Taking the primary server as a Web server based on Nginx as an example, after initiating an Http request through the CURL, a return result may be determined by the CURL info _ Http _ CODE in a return message. If the CURLINFO _ HTTP _ CODE is 200 or 201, the interface detection result is characterized as normal. In the case that the CURLINFO _ HTTP _ CODE is not equal to 200 or 201, it is characterized that the interface detection request is not normally responded to due to the primary server. For example, a CURLINFO _ HTTP _ CODE is 404 a corresponding web page does not exist for which the interface detects a request.
When the first monitoring result represents that the interface detection result is received and the interface detection result represents that the first server error occurs in the primary server, the primary server may be switched to the standby server, so that the standby server provides a service for a user and the service is prevented from being affected by the primary server error.
In another embodiment, a plurality of interface detection requests may also be initiated, and when a ratio of a plurality of interface detection results corresponding to the plurality of interface detection requests, which represent abnormal interface detection results in which a first server error occurs, in all interface detection results is greater than or equal to a preset second ratio threshold, the active server is switched to the standby server.
By the technical scheme, the version is timely returned to the target software version or the primary server is switched to the standby server according to the monitoring result of the interface detection request, so that the running reliability of the server is improved, and the user experience is improved.
Fig. 2 is a flowchart illustrating another method for managing the operation of a server according to an exemplary embodiment, where as shown in fig. 2, the method may further include the following steps:
in step S105, the active server is switched to the standby server when the first monitoring result indicates that the interface detection result is not received after the first preset time period.
For example, still taking the active server as a Web server based on Nginx as an example, after sending an interface detection request in a CURL manner, after a first preset time period is reached, a corresponding interface detection result is not received, and the active server may be switched to a standby server.
By the technical scheme, the primary server is switched to the standby server under the condition that the monitoring result of the interface detection request represents that the server responds to the overtime interface detection request, so that the running reliability of the server is further improved, and the user experience is improved.
Fig. 3 is a flowchart illustrating a method for managing operations of a server according to another exemplary embodiment, where the method may further include the following steps, as shown in fig. 3:
in step S106, the first monitoring result is notified to a preset target terminal through a preset communication method.
The preset communication mode may include at least one communication mode such as a short message, an email, or an instant messaging.
The target terminal can be a preset terminal of the operation and maintenance personnel or related personnel of the server.
Through foretell technical scheme, can in time inform the operation and maintenance personnel or the relevant personnel of server with the monitoring result of interface test request through predetermined communication mode, be convenient for in time carry out the analysis to the monitoring result of interface test request, improve the unusual response speed of server, further improve the reliability of server, promote user's experience.
Fig. 4 is a flowchart illustrating a method for managing operations of a server according to another exemplary embodiment, where the method may further include the following steps, as shown in fig. 4:
in step S107, a service detection request is sent to the active server.
The service detection request is used for requesting one or more simulation service operations of the main server.
In some possible implementation manners, in a case that the interface detection result is normal, the service detection request may be further initiated.
Illustratively, still taking the active server as a Web server based on Nginx as an example, when the CURLINFO _ HTTP _ CODE in the return message through the CURL is equal to 200 or 201, it represents that the interface detection result is normal. For example, a simulation store may be set in the e-commerce system, and the service detection request may be a Post request initiated by the simulation user to the simulation store, for example, a Post request initiated by a CURL command in Linux to the main server, and for the specific technical request of the crontab periodic task and the CURL command, reference is made to the description in the related art, and details are not described herein. In another embodiment, the active server may also be an FTP server, and the service detection request may be to upload a test file to the active server or download a test file from the server. The present disclosure is not limited to a particular type of server.
In step S108, a service detection result corresponding to the service detection request sent by the active server is monitored.
And the service detection result comprises a simulation service operation result corresponding to each simulation service operation.
Illustratively, in a case that the active server is a Web server based on Nginx, an e-commerce system is already deployed on the server, a simulated store is set in the e-commerce system, the service detection request may be an operation that simulates an end user to perform a service operation in the simulated store, for example, ordering to purchase a commodity, etc., after the server completes processing the service detection request, a corresponding service detection result may be obtained, for example, after the simulated store completes ordering to purchase a commodity, the service detection result may be obtained by querying whether order data corresponding to the ordering to purchase a commodity operation exists in an order database in the server, and in a case that the active server is an FTP server, the service detection result may be obtained by querying whether an FTP upload exists in a preset active FTP directory or whether a corresponding test file exists in the FTP download directory, for example, after uploading a test file to the server is completed, the service detection result may be determined by whether the test file exists in the upload directory on the server.
In step S109, a target operation management policy is determined from the preset operation management policies according to the second monitoring result, and the target operation management policy is executed.
The preset operation strategy comprises at least one of switching the main server to the standby server, returning the current software version of the main server to the target software version and informing the second monitoring result to the preset target terminal through a preset communication mode.
In some possible implementations, the preset operation policy may be configured by a user, so that the corresponding operation policy is implemented according to a different second monitoring result.
In some embodiments, the target operation management policy may be determined from the preset operation management policies according to the second monitoring result in the following manner, and then the target operation management policy may be executed.
In the first mode, when the second monitoring result represents that the service detection result is received and the service detection result represents that the second server error occurs in the primary server, the primary server is switched to the standby server and/or the second monitoring result is notified to a preset target terminal through a preset communication mode.
And the second server error representation does not normally respond to the service detection request due to the main server.
Taking the primary server as a Web server based on Nginx as an example, after initiating an Http request through the CURL, a return result may be determined by the CURL info _ Http _ CODE in a return message. And in the case that the CURLINFO _ HTTP _ CODE is not equal to any one of 200, 201 or 500, the fact that the service detection request is not normally responded due to the main server is characterized. In this case, the active server is switched to the standby server and/or the second monitoring result is notified to the preset target terminal through a preset communication mode.
And in the second mode, when the second monitoring result represents that the service detection result is received and the service detection result represents that the primary server has a second code error, the current software version of the primary server is returned to the target software version and/or the second monitoring result is notified to a preset target terminal through a preset communication mode.
And the second code error representation shows that the preset second code abnormality is captured by the primary server when the primary server responds to the service detection request.
For example, taking the primary server as a Web server based on Nginx as an example, after initiating a service detection request through the CURL, a return result may be determined by the CURL _ HTTP _ CODE in a return message. And in the case that the CURLINFO _ HTTP _ CODE is equal to 500, characterizing that the primary server captures a second CODE exception in response to an interface detection request. In this case, the current software version of the primary server is rolled back to the target software version and/or the second monitoring result is notified to the preset target terminal through a preset communication mode. The target software version can be a preset software version; or, a version that is the last version of the current software version, which the present disclosure does not limit.
And thirdly, under the condition that the second monitoring result represents that the service detection result is received and the service detection result represents that any simulation service operation result does not meet the corresponding expected result range, returning the current software version of the main server to the target software version and/or informing the second monitoring result to a preset target terminal through a preset communication mode.
Taking the example that the primary server is a Web server based on Nginx, when a service detection request is initiated through CURL (for example, after an order placing and purchasing operation is completed in a simulated shop), a service detection result is determined by querying whether order data corresponding to the order placing and purchasing operation exists in an order database in the server, and when the service detection result indicates that any simulated service operation result does not meet a corresponding expected result range (for example, the order data corresponding to the order placing and purchasing operation does not exist in the order data), the current software version of the primary server is backed to a target software version and/or a second monitoring result is notified to a preset target terminal through a preset communication mode. The target software version can be a preset software version; or, a version that is the last version of the current software version, which the present disclosure does not limit.
And in the fourth mode, when the second monitoring result representation reaches a second preset time period and the service detection result is not received, the main server is switched to the standby server and/or the second monitoring result is notified to a preset target terminal through a preset communication mode.
For example, still taking the active server as a Web server based on Nginx as an example, after the service detection request is sent in a CURL manner, and after a second preset time period is reached, a corresponding service detection result is not received, the active server may be switched to a standby server and/or the second monitoring result may be notified to a preset target terminal in a preset communication manner.
And fifthly, when the second monitoring result represents that the service detection result is received, and when the service detection result represents that the simulation service operation result meets the corresponding expected result range, the second monitoring result is notified to the preset target terminal through a preset communication mode.
Taking the example that the primary server is a Web server based on Nginx, when a service detection request is initiated through CURL (for example, after an order placing and purchasing operation is completed in a simulated shop), a service detection result is determined by querying whether order data corresponding to the order placing and purchasing operation exists in an order database in the server, and when the service detection result indicates that the simulated service operation result all meets a corresponding expected result range (for example, the order data corresponding to the order placing and purchasing operation exists in the order data, and detailed order data are the same as the data of the service detection request), a second monitoring result is notified to a preset target terminal through a preset communication mode.
According to the technical scheme, the target operation management strategy is determined from the preset operation management strategies according to the monitoring result of the service detection request, and the target operation management strategy is executed, so that the operation reliability of the server is improved, and the user experience is improved.
Fig. 5 is a block diagram illustrating an operation management apparatus 500 of a server according to an exemplary embodiment, and as shown in fig. 5, the message processing apparatus 500 includes:
the interface monitoring module 501 is configured to send an interface detection request to the primary server, where the interface detection request is used to request to detect a service interface of the primary server;
a first monitoring module 502, configured to monitor an interface detection result corresponding to an interface detection request sent by the active server;
the first operation management module 503 is configured to determine an abnormal type of the service interface when the first monitoring result represents that the interface detection result is received and the interface detection result represents that the service interface is abnormal; under the condition that the abnormal type represents that the primary server has a first code error, the current software version of the primary server is returned to the target software version, and the first code error represents that the primary server captures a preset first code abnormality when responding to the interface detection request; and under the condition that the abnormal type represents that the primary server has a first server error, switching the primary server to a standby server, wherein the first server error representation does not normally respond to the interface detection request due to the primary server.
Optionally, the first operation management module 503 is further configured to:
and switching the main server to the standby server under the condition that the interface detection result is not received after the first monitoring result representation reaches a first preset time period.
Optionally, the first operation management module 503 is further configured to:
and informing the first monitoring result to a preset target terminal through a preset communication mode.
By the technical scheme, the version is timely returned to the target software version or the primary server is switched to the standby server according to the monitoring result of the interface detection request, so that the running reliability of the server is improved, and the user experience is improved.
Fig. 6 is a block diagram illustrating an operation management apparatus 500 of a server according to an exemplary embodiment, and as shown in fig. 6, the message processing apparatus 500 further includes:
a service detection module 504 configured to send a service detection request to the primary server, where the service detection request is used to request one or more simulated service operations on the primary server;
a second monitoring module 505, configured to monitor a service detection result corresponding to the service detection request sent by the primary server, where the service detection result includes a simulation service operation result corresponding to each simulation service operation;
and a second operation management module 506 configured to determine a target operation management policy from the preset operation management policies according to the second monitoring result, and execute the target operation management policy.
Optionally, the preset operation policy includes at least one of switching the active server to the standby server, returning the current software version of the active server to the target software version, and notifying the second monitoring result to the preset target terminal through a preset communication manner, and the second operation management module 506 is further configured to:
when the second monitoring result represents that the service detection result is received and the service detection result represents that the primary server has a second server error, switching the primary server to a standby server and/or informing a preset target terminal of the second monitoring result in a preset communication mode, wherein the second server error represents that the service detection request is not normally responded due to the primary server; or,
when the second monitoring result represents that the service detection result is received and the service detection result represents that the primary server has a second code error, the current software version of the primary server is returned to the target software version and/or the second monitoring result is notified to a preset target terminal through a preset communication mode, and the second code error represents that the primary server captures a preset second code abnormality when responding to the service detection request; or,
under the condition that the second monitoring result represents that the service detection result is received and the service detection result represents that any simulation service operation result does not meet the corresponding expected result range, the current software version of the main server is returned to the target software version and/or the second monitoring result is notified to a preset target terminal through a preset communication mode; or,
and switching the primary server to the standby server and/or informing the second monitoring result to a preset target terminal in a preset communication mode under the condition that the service detection result is not received after the second monitoring result representation reaches a second preset time period.
Optionally, the second operation management module 506 is further configured to:
and when the second monitoring result represents that the service detection result is received and the service detection result represents that the simulation service operation result meets the corresponding expected result range, informing the second monitoring result to a preset target terminal in a preset communication mode.
With regard to the apparatus in the above embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be described in detail here.
According to the technical scheme, the target operation management strategy is determined from the preset operation management strategies according to the monitoring result of the service detection request, and the target operation management strategy is executed, so that the operation reliability of the server is improved, and the user experience is improved.
Fig. 7 is a block diagram illustrating an electronic device 700 in accordance with an example embodiment. As shown in fig. 7, the electronic device 700 may include: a processor 701 and a memory 702. The electronic device 700 may also include one or more of a multimedia component 703, an input/output (I/O) interface 704, and a communication component 705.
The processor 701 is configured to control the overall operation of the electronic device 700, so as to complete all or part of the steps in the above-described server operation management method. The memory 702 is used to store various types of data to support operation at the electronic device 700, such as instructions for any application or method operating on the electronic device 700 and application-related data, such as contact data, transmitted and received messages, pictures, audio, video, and the like. The Memory 702 may be implemented by any type of volatile or non-volatile Memory device or combination thereof, such as Static Random Access Memory (SRAM), electrically Erasable Programmable Read-Only Memory (EEPROM), erasable Programmable Read-Only Memory (EPROM), programmable Read-Only Memory (PROM), read-Only Memory (ROM), magnetic Memory, flash Memory, magnetic disk, or optical disk. The multimedia components 703 may include screen and audio components. Wherein the screen may be, for example, a touch screen and the audio component is used for outputting and/or inputting audio signals. For example, the audio component may include a microphone for receiving an external audio signal. The received audio signal may further be stored in the memory 702 or transmitted through the communication component 705. The audio assembly also includes at least one speaker for outputting audio signals. The I/O interface 704 provides an interface between the processor 701 and other interface modules, such as a keyboard, mouse, buttons, and the like. These buttons may be virtual buttons or physical buttons. The communication component 705 is used for wired or wireless communication between the electronic device 700 and other devices. Wireless Communication, such as Wi-Fi, bluetooth, near Field Communication (NFC), 2G, 3G, 4G, NB-IOT, eMTC, or other 5G, or combinations thereof, which is not limited herein. The corresponding communication component 705 may thus comprise: wi-Fi module, bluetooth module, NFC module, etc.
In an exemplary embodiment, the electronic Device 700 may be implemented by one or more Application Specific Integrated Circuits (ASICs), digital Signal Processors (DSPs), digital Signal Processing Devices (DSPDs), programmable Logic Devices (PLDs), field Programmable Gate Arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components for performing the above-described operation management method of the server.
In another exemplary embodiment, there is also provided a non-transitory computer readable storage medium including program instructions which, when executed by a processor, implement the steps of the operation management method of the server described above. For example, the computer readable storage medium may be the memory 702 including the program instructions, which are executable by the processor 701 of the electronic device 700 to perform the operation management method of the server described above.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure. This application is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice in the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It will be understood that the present disclosure is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
Claims (9)
1. An operation management method for a server, wherein the server comprises an active server and a standby server, the method comprising:
sending an interface detection request to the primary server, wherein the interface detection request is used for requesting to detect a service interface of the primary server;
monitoring an interface detection result corresponding to the interface detection request sent by the main server;
when a first monitoring result represents that the interface detection result is received and the interface detection result represents that a first code error occurs in the main server, the current software version of the main server is returned to a target software version, and the first code error represents that the main server captures a preset first code exception when responding to the interface detection request; when a first monitoring result represents that the interface detection result is received and the interface detection result represents that a first server error occurs in the main server, switching the main server to the standby server, wherein the first server error represents that the interface detection request is not normally responded due to the main server;
sending a service detection request to the main server under the condition that the interface detection result is normal, wherein the service detection request is used for requesting one or more simulation service operations of the main server;
monitoring a service detection result corresponding to the service detection request sent by the main server; the service detection result comprises a simulation service operation result corresponding to each simulation service operation;
determining a target operation management strategy from preset operation management strategies according to a second monitoring result;
and executing the target operation management strategy.
2. The method of claim 1, wherein the target software version is determined by:
taking a preset software version as the target software version; or,
and taking the last version of the current software version as the target software version.
3. The method of claim 1, further comprising:
and switching the active server to the standby server under the condition that the interface detection result is not received after the first monitoring result representation reaches a first preset time period.
4. The method according to any one of claims 1 to 3, further comprising:
and informing the first monitoring result to a preset target terminal through a preset communication mode.
5. The method according to claim 1, wherein the preset operation policy includes at least one of switching the primary server to the backup server, rolling back a current software version of the primary server to the target software version, and notifying the second monitoring result to a preset target terminal through the preset communication manner, the determining a target operation management policy from preset operation management policies according to the second monitoring result, and executing the target operation management policy includes:
when a second monitoring result represents that the service detection result is received and the service detection result represents that a second server error occurs in the main server, switching the main server to the standby server and/or informing a preset target terminal of the second monitoring result in a preset communication mode, wherein the second server error represents that the service detection request is not normally responded due to the main server; or,
when a second monitoring result represents that the service detection result is received and the service detection result represents that a second code error occurs in the main server, returning the current software version of the main server to the target software version and/or informing a preset target terminal of the second monitoring result in the preset communication mode, wherein the second code error represents that the main server captures a preset second code exception when responding to the service detection request; or,
under the condition that a second monitoring result represents that the service detection result is received and any one of the simulation service operation results does not meet the corresponding expected result range, returning the current software version of the main server to the target software version and/or informing a preset target terminal of the second monitoring result in the preset communication mode; or,
and switching the active server to the standby server and/or informing a preset target terminal of the second monitoring result in a preset communication mode under the condition that the service detection result is not received after the second monitoring result representation reaches a second preset time period.
6. The method according to claim 5, wherein the determining a target operation management policy from preset operation management policies according to the second monitoring result comprises:
and when a second monitoring result represents that the service detection result is received and the service detection result represents that the simulation service operation result meets the corresponding expected result range, informing a preset target terminal of the second monitoring result in a preset communication mode.
7. An operation management apparatus of a server, wherein the server includes an active server and a standby server, the apparatus comprising:
an interface monitoring module, configured to send an interface detection request to the primary server, where the interface detection request is used to request to detect a service interface of the primary server;
a first monitoring module, configured to monitor an interface detection result corresponding to the interface detection request sent by the active server;
the first operation management module is configured to determine the abnormal type of the service interface when the first monitoring result represents that the interface detection result is received and the interface detection result represents that the service interface is abnormal; when the abnormal type represents that the primary server has a first code error, the current software version of the primary server is returned to a target software version, and the first code error represents that the primary server captures a preset first code abnormality when responding to the interface detection request; switching the primary server to the standby server under the condition that the abnormal type represents that the primary server has a first server error, wherein the first server error represents that the interface detection request is not normally responded due to the primary server;
a service detection module configured to send a service detection request to the primary server when the interface detection result is normal, where the service detection request is used to request one or more simulated service operations for the primary server;
a second monitoring module, configured to monitor a service detection result corresponding to the service detection request sent by the active server; the service detection result comprises a simulation service operation result corresponding to each simulation service operation;
the second operation management module is configured to determine a target operation management strategy from preset operation management strategies according to a second monitoring result; and executing the target operation management strategy.
8. An electronic device, comprising:
a memory having a computer program stored thereon;
a processor for executing the computer program in the memory to implement the steps of the method of any one of claims 1 to 6.
9. A non-transitory computer-readable storage medium, on which a computer program is stored, which program, when executed by a processor, performs the steps of the method of any one of claims 1 to 6.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210761441.8A CN115242615B (en) | 2022-06-29 | 2022-06-29 | Server operation management method and device, electronic equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210761441.8A CN115242615B (en) | 2022-06-29 | 2022-06-29 | Server operation management method and device, electronic equipment and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN115242615A CN115242615A (en) | 2022-10-25 |
CN115242615B true CN115242615B (en) | 2023-04-14 |
Family
ID=83672431
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210761441.8A Active CN115242615B (en) | 2022-06-29 | 2022-06-29 | Server operation management method and device, electronic equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115242615B (en) |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104679604A (en) * | 2015-02-12 | 2015-06-03 | 大唐移动通信设备有限公司 | Method and device for switching between master node and standby node |
CN112966906A (en) * | 2021-02-10 | 2021-06-15 | 西南电子技术研究所(中国电子科技集团公司第十研究所) | Centralized monitoring platform of spacecraft ground measurement and control station resource pool architecture |
Family Cites Families (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
DE102007010803B4 (en) * | 2007-03-02 | 2009-06-04 | Viessmann Werke Gmbh & Co Kg | Apparatus and method for controlling and monitoring home automation equipment |
US9888037B1 (en) * | 2015-08-27 | 2018-02-06 | Amazon Technologies, Inc. | Cipher suite negotiation |
US10454689B1 (en) * | 2015-08-27 | 2019-10-22 | Amazon Technologies, Inc. | Digital certificate management |
CN111324377B (en) * | 2020-03-11 | 2023-03-24 | 上海东普信息科技有限公司 | Application gray level release method, system, device and storage medium |
CN111596940B (en) * | 2020-05-19 | 2023-04-07 | 杭州视联动力技术有限公司 | Version upgrading method and device, electronic equipment and storage medium |
CN113872812B (en) * | 2021-09-29 | 2023-06-23 | 联想(北京)有限公司 | Information processing method, network equipment and terminal equipment |
CN114629822B (en) * | 2022-04-18 | 2024-06-11 | 北京小米移动软件有限公司 | Link detection method, device, electronic equipment and storage medium |
-
2022
- 2022-06-29 CN CN202210761441.8A patent/CN115242615B/en active Active
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104679604A (en) * | 2015-02-12 | 2015-06-03 | 大唐移动通信设备有限公司 | Method and device for switching between master node and standby node |
CN112966906A (en) * | 2021-02-10 | 2021-06-15 | 西南电子技术研究所(中国电子科技集团公司第十研究所) | Centralized monitoring platform of spacecraft ground measurement and control station resource pool architecture |
Non-Patent Citations (1)
Title |
---|
李靖.Android应用服务器通信接口安全性检测的方案设计与实现.北京邮电大学.2019,19-54. * |
Also Published As
Publication number | Publication date |
---|---|
CN115242615A (en) | 2022-10-25 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN115190035B (en) | System, method, apparatus, and medium for providing mobile device support services | |
CN103201724B (en) | Providing application high availability in highly-available virtual machine environments | |
CN111988200B (en) | Automatic regression testing method and device based on real flow | |
US20130055271A1 (en) | Apparatus and method for controlling polling | |
CN110442502B (en) | Point burying method, device, equipment and storage medium | |
WO2019140739A1 (en) | Method for determining return visits to client, and electronic apparatus and computer-readable storage medium | |
CN113220540B (en) | Service management method, device, computer equipment and storage medium | |
CN111611140A (en) | Reporting verification method and device of buried point data, electronic equipment and storage medium | |
CN112134961B (en) | Client use control method, client and computer storage medium | |
CN111342986B (en) | Distributed node management method and device, distributed system and storage medium | |
CN115242615B (en) | Server operation management method and device, electronic equipment and storage medium | |
CN113435368B (en) | Identification method and device of monitoring data, storage medium and electronic device | |
CN111290873B (en) | Fault processing method and device | |
CN114138528A (en) | Remote calling fault tolerance processing method, terminal equipment and storage medium | |
CN114630323A (en) | Voice call service processing method and device and computer readable storage medium | |
CN110321251B (en) | Data backup method, device, equipment and storage medium based on network block equipment | |
CN113836013A (en) | Embedded point testing method and device, computer equipment and computer readable storage medium | |
CN112241283B (en) | Software upgrading method, device, computer equipment and storage medium | |
CN110874238A (en) | Online service updating method and device | |
CN115134405B (en) | Data processing method and device, electronic equipment and computer readable storage medium | |
CN113704016B (en) | Cloud function component diagnosis method, device, equipment and storage medium | |
CN111711537B (en) | Method, device and equipment for updating standby main node list | |
CN114513844B (en) | Network registration method and device, storage medium and electronic equipment | |
CN113064615B (en) | Software updating method and device, storage medium and electronic device | |
CN110019535B (en) | Database management method, database management device, storage medium and computer 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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant |