CN115562702A - Control method, control device, machine-readable storage medium, and processor - Google Patents

Control method, control device, machine-readable storage medium, and processor Download PDF

Info

Publication number
CN115562702A
CN115562702A CN202211193528.6A CN202211193528A CN115562702A CN 115562702 A CN115562702 A CN 115562702A CN 202211193528 A CN202211193528 A CN 202211193528A CN 115562702 A CN115562702 A CN 115562702A
Authority
CN
China
Prior art keywords
cluster
application
control
current application
met
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211193528.6A
Other languages
Chinese (zh)
Inventor
郭宏
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
CCB Finetech Co Ltd
Original Assignee
CCB Finetech Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by CCB Finetech Co Ltd filed Critical CCB Finetech Co Ltd
Priority to CN202211193528.6A priority Critical patent/CN115562702A/en
Publication of CN115562702A publication Critical patent/CN115562702A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

The embodiment of the application provides a control method, a control device, a machine readable storage medium and a processor. The control method comprises the following steps: for any of the clusters, performing the following: judging whether the cluster needs to execute a control operation aiming at the current application, wherein the control operation is any one of the following operations: deploying the current application, updating the current application, and rolling back the current application; judging whether an operation threshold value is met or not under the condition that the cluster needs to execute the control operation aiming at the current application, wherein the operation threshold value is a threshold value corresponding to the cluster executing the control operation aiming at the current application; and sending a control instruction for controlling the cluster to execute the control operation for the current application if the operation threshold is met, so that the cluster executes the control operation for the current application. Thereby, the automatic control cluster is realized to execute control operation aiming at the application.

Description

Control method, control device, machine-readable storage medium and processor
Technical Field
The present application relates to the field of computer technologies, and in particular, to a control method, a control apparatus, a machine-readable storage medium, and a processor.
Background
With business development, in order to improve application performance and reduce client access delay, an enterprise deploys applications into a plurality of clusters for clients to access nearby. At present, for the application version control in a multi-cluster environment, the multi-cluster is executed in parallel or is released in batches manually. The former can cause that when the updated version of the application is found to have abnormity and needs to be backed, all the upgraded clusters need to be backed at the same time, which is easy to cause service interruption; the latter is prone to operator error or omission.
Disclosure of Invention
The embodiment of the application aims to provide a control method, a control device, a machine-readable storage medium and a processor.
In order to achieve the above object, a first aspect of the embodiments of the present application provides a control method for an application in a cluster, where the control method includes: for any of the clusters, performing the following: judging whether the cluster needs to execute a control operation aiming at the current application, wherein the control operation is any one of the following operations: deploying the current application, updating the current application, and rolling back the current application; judging whether an operation threshold value is met or not under the condition that the cluster needs to execute the control operation aiming at the current application, wherein the operation threshold value is a threshold value corresponding to the cluster executing the control operation aiming at the current application; and sending a control instruction for controlling the cluster to execute the control operation for the current application under the condition that the operation threshold is met, so that the cluster executes the control operation for the current application.
Optionally, the control method further includes: under the condition that the operation threshold value is not met, judging whether the operation threshold value is met again at preset time intervals until the operation threshold value is met; and/or performing alarm prompt under the condition that the operation threshold value is not met and the preset operation time limit is exceeded.
Optionally, the operational threshold is related to a priority of the cluster.
Optionally, before determining whether the operation threshold is satisfied, the control method further includes: judging whether the operation threshold is required to be judged or not; and directly sending the control instruction without judging whether the operation threshold is met.
Accordingly, a second aspect of embodiments of the present application provides a control apparatus for applications in a cluster, where the control apparatus includes: an application control module, configured to execute the following for any one of the clusters: judging whether the cluster needs to execute a control operation aiming at the current application, wherein the control operation is any one of the following operations: deploying the current application, updating the current application, and rolling back the current application; judging whether an operation threshold value is met or not under the condition that the cluster needs to execute the control operation aiming at the current application, wherein the operation threshold value is a threshold value corresponding to the cluster executing the control operation aiming at the current application; and sending a control instruction for controlling the cluster to execute the control operation for the current application if the operation threshold is met, so that the cluster executes the control operation for the current application.
Optionally, the application control module is further configured to: under the condition that the operation threshold value is not met, judging whether the operation threshold value is met again at preset time intervals until the operation threshold value is met; and/or giving an alarm when the operation threshold is not met and the preset operation time limit is exceeded.
Optionally, the operational threshold is related to a priority of the cluster.
Optionally, the application control module is further configured to: before judging whether the operation threshold is met, judging whether the operation threshold is needed to be judged; and directly sending the control instruction without judging whether the operation threshold is met.
Furthermore, a third aspect of embodiments of the present application provides a processor configured to perform the above-described control method.
In addition, a fourth aspect of embodiments of the present application provides a machine-readable storage medium having stored thereon instructions, which, when executed by a processor, cause the processor to be configured to execute the control method described above.
Furthermore, a fifth aspect of embodiments of the present application provides a computer program product comprising a computer program which, when executed by a processor, implements the control method described above.
According to the technical scheme, whether control operation needs to be executed for the application or not is judged for any cluster, whether an operation threshold value is met or not is judged under the condition that the control operation needs to be executed, and the control instruction is sent under the condition that the operation threshold value is met, so that the cluster executes the control operation for the application.
Additional features and advantages of embodiments of the present application will be described in detail in the detailed description which follows.
Drawings
The accompanying drawings, which are included to provide a further understanding of the embodiments of the disclosure and are incorporated in and constitute a part of this specification, illustrate embodiments of the disclosure and together with the description serve to explain the embodiments of the disclosure, but are not intended to limit the embodiments of the disclosure. In the drawings:
fig. 1 schematically shows a flow chart of a control method for an application in a cluster according to an embodiment of the present application;
FIG. 2 schematically illustrates a logical view of deploying an application according to an embodiment of the present application;
FIG. 3 schematically illustrates a logical view of an update application according to an embodiment of the present application;
FIG. 4 schematically illustrates a logic diagram of a fallback application according to an embodiment of the application;
FIG. 5 schematically illustrates a logic diagram for a control method for applications in a cluster according to an embodiment of the present application;
fig. 6 schematically shows a block diagram of a control apparatus for an application in a cluster according to an embodiment of the present application; and
fig. 7 schematically shows an internal structure diagram of a computer device according to an embodiment of the present application.
Description of the reference numerals
600. Control device 601 uses control module
Detailed Description
To make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions of the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it should be understood that the specific embodiments described herein are only used for illustrating and explaining the embodiments of the present application and are not used for limiting the embodiments of the present application. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments in the present application without making creative efforts shall fall within the protection scope of the present application.
It should be noted that if directional indications (such as upper, lower, left, right, front, rear, 8230; \8230;) are referred to in the embodiments of the present application, the directional indications are only used for explaining the relative positional relationship between the components in a specific posture (as shown in the attached drawings), the motion situation, etc., and if the specific posture is changed, the directional indications are correspondingly changed.
In addition, if there is a description relating to "first", "second", etc. in the embodiments of the present application, the description of "first", "second", etc. is for descriptive purposes only and is not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of the feature. In addition, technical solutions between the embodiments may be combined with each other, but must be based on the realization of the technical solutions by a person skilled in the art, and when the technical solutions are contradictory to each other or cannot be realized, such a combination should not be considered to exist, and is not within the protection scope claimed in the present application.
A first aspect of an embodiment of the present application provides a control method for an application in a cluster.
In the embodiment of the present application, the control method may include the following. For any cluster, the following is performed. Note that the following description is given taking a certain cluster as an example, and the following description can be executed regardless of the number of clusters. Judging whether the cluster needs to execute a control operation aiming at the current application, wherein the control operation is any one of the following operations: deploying a current application, updating the current application, and rolling back the current application. The current application is an application that needs to perform a control operation, for example, the current application may be a latest application of a latest version number of a certain application, or may be a preset rollback application of a certain version that needs to rollback, or an application of a certain version number (not necessarily the latest version number) that is set to need to be deployed, and the current application may carry identification information (for example, a name) and a version number. For example, the current application is the latest application of the latest version number of a certain application, and the control operation is to update the current application. For any cluster, judging whether an old version application is deployed before the cluster, wherein the old version application and the latest application are the same application, but the version number of the old version application is lower than that of the latest application; judging whether the cluster needs to execute updating of the current application aiming at the current application by judging whether the old version of application is deployed before the cluster; if the old version of application is deployed before, the current application needs to be updated according to the current application; if the old version of the application has not been deployed before, the current application does not need to be updated according to the current application. For another example, the current application is a latest application with a latest version number of a certain application, and the control operation is to deploy the current application. Presetting which clusters are deployed aiming at the current application, and establishing a cluster deployment list; for any cluster, judging whether the current application needs to be deployed aiming at the current application by judging whether the cluster is in a cluster deployment list or not; if the current application is required to be deployed in the cluster deployment list, the current application is required to be deployed aiming at the current application; if the current application is not deployed in the cluster deployment list, the current application does not need to be deployed aiming at the current application. Or judging whether the cluster needs to execute deployment of the current application aiming at the current application by judging whether the old version application is deployed before the cluster; if the old version application is deployed before, the current application does not need to be deployed aiming at the current application; if the old version of the application has not been deployed before, the current application needs to be deployed according to the current application. For another example, the current application is a rollback application and the control operation is to rollback the current application. Presetting which clusters are backed for the current application, and establishing a cluster backspacing list; for any cluster, judging whether the current application needs to be executed and backed for the current application by judging whether the cluster is in a cluster rollback list or not; if the current application is in the cluster rollback list, the current application needs to be rolled back aiming at the current application; if not, the current application does not need to be rolled back for the current application. And under the condition that the cluster needs to execute the control operation aiming at the current application, judging whether an operation threshold value is met, wherein the operation threshold value is a threshold value corresponding to the cluster executing the control operation aiming at the current application. It should be noted that the operation threshold may be determined according to specific situations, and may be for any cluster, regardless of which operation is executed for any current application, the operation threshold corresponds to the same threshold; different operations can be executed for different current applications for any cluster, and the different operations correspond to different thresholds; the same operation can be executed for any cluster aiming at different current applications, and the same operation corresponds to the same threshold value; etc., as the case may be. In addition, in the embodiment of the present application, the operation threshold may be a default threshold or a currently configured threshold. And sending a control instruction for controlling the cluster to execute the control operation aiming at the current application under the condition that the operation threshold is met, so that the cluster executes the control operation aiming at the current application.
By the technical scheme, whether control operation needs to be executed aiming at the application or not is judged for any cluster, whether an operation threshold value is met or not is judged under the condition that the control operation needs to be executed, and a control instruction is sent under the condition that the operation threshold value is met, so that the cluster executes the control operation aiming at the application.
Fig. 1 schematically shows a flowchart of a control method for an application in a cluster according to an embodiment of the present application. As shown in fig. 1, in an embodiment of the present application, a control method for an application in a cluster is provided, which includes the following steps. The following is an example of a certain cluster, and the following may be performed regardless of the number of clusters.
In step S10, it is determined whether the cluster needs to perform a control operation for the current application, where the control operation is any one of the following: deploying the current application, updating the current application, and rolling back the current application. If yes, executing step S11; if not, step S13 is executed.
In step S11, it is determined whether an operation threshold is satisfied, where the operation threshold is a threshold corresponding to the cluster executing the control operation for the current application. If the operation threshold is met, executing the step S12; if the operation threshold is not full, step S11 is repeatedly executed. Alternatively, when the operation threshold is not satisfied and it is determined again whether the operation threshold is satisfied, it may be determined again whether the operation threshold is satisfied at preset time intervals, where the preset time intervals may be determined according to specific situations.
In step S12, a control instruction is sent to control the cluster to perform a control operation for the current application, so that the cluster performs the control operation for the current application.
Optionally, in this embodiment of the present application, the control method may further include the following. Under the condition that the operation threshold value is not met, judging whether the operation threshold value is met again at preset time intervals until the operation threshold value is met; and/or giving an alarm prompt when the operation threshold is not met and the preset operation time limit is exceeded. Specifically, the operation threshold may be determined again at a preset time interval or immediately determined again when the operation threshold is not satisfied, and the alarm prompt may be performed when the operation threshold is not satisfied even after the preset operation time limit has been exceeded. For example, the related prompt content is displayed on the interface.
Optionally, in this embodiment of the present application, the operation threshold is related to a priority of the cluster. Specifically, for the same current application and the same control operation, the operation threshold is set according to the priority of the cluster, so that when a plurality of clusters execute control operation for the current application, different clusters have a precedence order, and service interruption caused by the fact that all clusters simultaneously execute control operation for the current application is avoided.
Optionally, in this embodiment of the present application, before determining whether the operation threshold is met, the control method further includes the following. It is determined whether a determination of whether an operational threshold is satisfied. For example, it may be preset as to whether it is necessary to determine whether the operation threshold is satisfied. For example, the setting need not determine whether the operational threshold is met in a more urgent situation. And judging whether the operation threshold is met or not according to a preset condition. And directly sending a control instruction under the condition that whether the operation threshold is met or not is not required to be judged. In this way, efficiency can be improved in special cases.
Fig. 2 to fig. 4 relate to how to perform deployment application, update application, and rollback application, respectively, and the control method provided in the embodiment of the present application is exemplarily described below with reference to fig. 2 to fig. 4. Wherein the following description is in a multi-cluster environment. In the embodiment of the application, in a multi-cluster environment, different operation thresholds can be set for each cluster, so that differentiated management is performed on version control of the application, and therefore, in the multi-cluster environment, the application can automatically perform version control operations such as deployment, update, rollback and the like in batches by taking a single cluster as granularity according to a preset strategy. The technical scheme provided by the embodiment of the application mainly comprises the following steps: 1) In a multi-cluster environment, carrying out application version control on the whole system and related components in batches according to a preset threshold value of each cluster; 2) Logic and processing flow when application version management is performed on multiple clusters.
An exemplary description of a deployment application is provided in connection with fig. 2. Any application may be deployed for any cluster with reference to the following.
And judging whether the deployment is needed. If yes, judging whether to carry out condition check; if not, deployment is completed, and the method is finished. When an application needs to be deployed to a cluster which is not deployed before, an operator is required to manually submit an application deployment request to the version control manager at a front-end page. When a certain application is deployed, a cluster which needs to be deployed needs to be selected to obtain a deployment cluster list and submit necessary information such as the name and version of the application which needs to be deployed. And judging whether the cluster needs to deploy the application or not according to whether the cluster belongs to a deployment cluster list or not.
And judging whether to perform condition check. If so, judging whether the conditions are configured independently; and if not, sending a deployment instruction to the cluster controller. Wherein the condition check is to determine whether the operation threshold is satisfied. When an application is deployed in a cluster, a checkbox is used to select whether the deployment skips a condition or threshold checking step. If the check is skipped, a deployment command is sent directly to the cluster controller, which is typically only used in case of emergency on-line. The cluster controller is a module for controlling the cluster to operate, and is responsible for uniformly managing resources such as a host, a virtual machine, a container cluster and the like in the cluster, and the main functions of the cluster controller include but are not limited to startup and shutdown, application start-stop deployment deletion, database addition, deletion, modification and check and the like.
It is determined whether conditions are configured separately. If yes, configuring conditions; if not, executing the check condition. When an application is deployed in a cluster, a default preset condition (where the condition is an operation threshold) corresponding to the cluster may be selected for use, and the condition may be configured separately, for example, for the latest application. The condition of the individual configuration overrides the condition of the default configuration of this cluster to which this application applies.
Configuring conditions, namely not using default preset conditions, and performing condition configuration independently. After the condition is configured, the condition is checked, that is, the content in the condition corresponding to the cluster is obtained. For example, the condition is that "other clusters have been running for 24 hours and no service error log", and the checking condition is to check whether other clusters have been running; what, if any, the runtime is; whether there is an error log.
And judging whether the cluster meets a threshold value for deployment operation. That is, it is determined whether the content acquired by the check condition section satisfies a default preset condition or an individually configured condition. If the judgment result is that the threshold is not met temporarily, performing condition check again after a certain silent time (preset time interval) and judging whether the threshold is met; if the judgment result is that the threshold is met, sending a deployment command to the cluster controller; if the set normal deployment time limit (preset operation time limit, wherein the timing starting point is "judging whether deployment is needed") is exceeded and the deployment threshold is not met yet, prompting is carried out on a front-end interface, and checking conditions and threshold judgment are continuously carried out at regular intervals (preset time intervals) until the deployment instruction is sent according to the threshold or the deployment is manually cancelled on a front-end page.
And ending the application deployment operation of the cluster. In the deployment process, data such as application information, cluster information, current steps, execution results and the like are recorded in a database at each step for query, display and other operation bases. The application information mainly comprises an application name, a version, an application ID, a code branch ID (optional) and construction time (optional); the cluster information includes cluster name, cluster ID, cluster location, cluster usage (test, online, large client, etc.), IP and port used by the cluster controller, etc. For the application information, since part of the software is third-party software which is not built by itself, part of the software information may not exist. The cluster information and the application information exist in separate database tables, and other related information is obtained by recording the application ID and the cluster ID and performing related query with other database tables.
An exemplary update application is described in connection with fig. 3. The following can be referred to when updating any application for any cluster. After a latest application is submitted to the material warehouse (module for storing the application), the material warehouse informs the version management controller of application update by calling a rear-end Webhook interface of the version management controller.
It is determined whether the cluster needs to be updated for the latest application. If yes, performing condition check; if not, the updating is finished, and the method is finished. Specifically, the version management controller determines whether the managed cluster needs to update the latest application according to a preset condition for determining whether the cluster performs updating. If the cluster does not need to be updated (for example, a low-version application corresponding to the latest application is not installed before, an application of a current version corresponding to the latest application installed by other applications depending on the cluster, an upgrade check box is manually checked off (no update is selected)), and the like), the upgrading process is directly ended; otherwise, entering an updating step.
Judging whether condition checking is carried out or not, if so, judging whether conditions are configured independently or not; if not, an updating instruction is sent to the cluster controller. When the latest application is deployed in the cluster, a check box is used for selecting whether the current deployment skips the threshold checking step. If the check box is checked during updating, an updating command is directly sent to the cluster controller without checking and judging the threshold, and the operation is only used for emergency online generally. If the skip condition check determining step is not explicitly stated, it is determined whether the condition is separately configured.
Subsequent steps may refer to those related to the description of deploying an application in connection with fig. 2 above. It is determined whether the cluster satisfies a threshold for performing an update operation (operation threshold). If the judgment result is that the updating threshold value is not met temporarily, the condition is checked again after a certain time (preset time interval) and whether the updating threshold value is met or not is judged; if the judgment result is that the threshold value is met, sending an updating command to the cluster controller; if the maximum allowable time (preset operation time limit) is exceeded and the updated threshold value is not met, prompting is carried out on a front-end interface, and checking conditions and threshold value judgment are continuously carried out at regular intervals (preset time intervals) until the updating instruction is sent or the deployment is manually cancelled.
And ending the updating of the application of the cluster. In the updating process, data such as application information, cluster information, current step, execution result and the like are recorded in a database at each step for query, display and other operation bases.
FIG. 4 illustrates an exemplary illustration of logic for a fallback application. The following explanation applies to any application rolling back for any cluster.
The general process of the rollback application is similar to the update application, and the differences mainly lie in the following points, and other processes are not described again: 1) An operator can operate at a front-end console of the version management controller, designate a rollback application (specifically designate an application which needs to be rolled back and a version number thereof) and a cluster which needs to be rolled back, wherein the judgment of 'whether the rollback is needed' can be carried out according to designated contents; 2) An old version list and a rollback cluster list of the application are required to be inquired from a database for business personnel to select so as to specify the rollback application and the cluster required to be rolled back, and for an application version part, a once deployed version can be preferentially displayed; 3) Compared with an operator who inputs cluster information and a threshold value, the operator who designates the rollback application and the cluster which needs to be rolled back has higher operation authority, and application abnormity caused by misoperation is prevented. Specifically, an operator can forcibly designate skipping condition check on a front-end console page when an application is updated or backed, so that the version of the designated application in the multiple clusters is quickly modified for emergency updating or backing, and the operation also requires that the operator has higher operation authority than the operator who inputs cluster information and a threshold value, so that the situation that the unauthorized new version of the application is released to an important cluster due to misoperation is prevented. In addition, although fig. 4 does not show the "judging whether to configure the condition separately", this step may be performed when the application is rolled back.
The following takes a version management controller managing two clusters (cluster a and cluster B) as an example, and exemplarily introduces the technical solution provided by the embodiment of the present application.
1) The operator inputs the operation threshold corresponding to each cluster into the front-end console of the version control manager. In this example, it is assumed that the operation threshold of the cluster a is not set (i.e., the operation threshold is checked but is not passed unconditionally), and the operation threshold corresponding to the cluster B is set to have other clusters run the new version application for 24 hours and have no service error log. And the front-end console is compiled by using NodeJS and is mainly responsible for storing cluster data and an operation threshold value input by an operator into a database and reading and displaying an upgrading task result from the database.
2) The front end console stores the data in a database. The database uses MySQL and is mainly used for storing cluster information, application information and change records each time. The cluster-related information mainly includes cluster information of each managed cluster, information of a cluster controller (e.g., ip, port, and the like), information of applications running in the cluster, an operation threshold for deployment of each application, and a deployment result. The database software is not in the scope of the technical solution provided by the embodiments of the present application, but the content of the database is a part of the technical solution provided by the embodiments of the present application. The change record mainly comprises change starting time, time and result of each check, and operation content, time and result, change result and completion time are sent to the cluster controller; the operation comprises deployment, updating, rollback and the like, and the change result is successful or cancelled. Furthermore, the information of the applications running in the cluster is used to explain which cluster has installed which application or applications.
3) The new version application (the latest application) is submitted to the material warehouse. Wherein a certain latest application corresponds to a latest version of a certain application.
4) And after receiving the new version application, the material warehouse sends update information to an update controller of the version control manager through Webhook. The update controller is written using Python, and has the main functions of receiving application update information, reading information and update threshold (corresponding operation threshold for updating), detecting update conditions, sending update commands to the cluster controller, and collecting update results. For the application updating information, when the application warehouse receives a new version of application, the application warehouse can retrieve the previous application information (name, version number and the like), submit the application information to the application version controller and update the database record for the application version controller; the reading of the nano-management cluster information is to obtain the previously described cluster information (mainly descriptive information such as name, location, etc.) from the cluster controller of the target cluster.
5) After receiving the update information of the application sent by the material warehouse through WebHook, the update controller queries the clusters to be updated of the application and the threshold information (operation threshold) corresponding to the update application of each cluster from the database. When a new version of application is received, an update operation on clusters in which an old version of application is installed is directly triggered, and then which clusters install the old version of application corresponding to the same application as the latest version of application and update thresholds (operation thresholds corresponding to the updated application) of the clusters can be queried from the database.
6) The updating controller obtains the clusters needing to update the new version application as a cluster A and a cluster B through inquiry, and the update threshold of the cluster A is the update threshold of the cluster B, and the update threshold of the cluster B is the service error log which needs other clusters to run the new version application for 24 hours. After the current environment is judged, the current cluster A meets the updating condition, but the current cluster B does not meet the updating condition, and then an updating command is sent to the cluster controller of the cluster A.
7) And after receiving the updating command, the cluster controller of the cluster A reads the new version application from the material warehouse. The cluster controller is composed of a series of Shell and Python scripts, is mainly responsible for life cycle management of applications in the cluster, and can support life cycle management of applications on various platforms such as bare metal, physical machines, virtual machines and containers. The tools used by the cluster controller are outside the scope of this application.
8) And after the cluster controller receives the new version application, upgrading the application in the cluster.
9) And after the application is started, logging the log into a log center of the cluster. The log center uses a log platform built based on the ELK, and is out of the scope of the application.
10 "update controller" component of "version control manager" reads the update result of the application from the log center of cluster a for conditional judgment of subsequent other cluster upgrades.
11 Because the update threshold of cluster B is "there are no service error logs for 24 hours when other clusters have run the new version application", the current environment does not satisfy the condition, and therefore, the update command is not sent to the cluster controller of cluster B for the time being.
12 Within 24 hours of the cluster a updating application, the updating controller will judge again at regular intervals whether the updating threshold of the cluster B is satisfied, the quiet time of the retry check condition of the updating controller is set to be "1 minute to 1 hour", and is set to be "for any cluster needing updating application, check once every minute within 5 minutes (including 5 minutes, the latter case is similar) whether the updating threshold is satisfied, check once every 5 minutes within 5 to 20 minutes, check once every 10 minutes within 20 to 60 minutes, check once every 60 minutes after 60 minutes", so as to avoid checking that resources are consumed too frequently or the checking interval is too long, which results in updating lag. After cluster A updates application for 24 hours, the update controller checks the update condition of cluster B again, finds that the condition is met, that 'other existing clusters run the new version for 24 hours', and applies error-free logs by inquiring the log center of cluster A, so that the update threshold of upgrading the application in cluster B is met. And then the update controller sends an update command to the cluster controller of the cluster B, and the following process is the same as steps 7) to 9), which is not described again. And finishing the updating of the clusters A and B, and finishing the updating in the round.
In the embodiment of the application, the method and the device are used for judging the operation threshold preset by the cluster when the application is deployed, updated and backed up by acquiring and processing various information in the plurality of clusters. The classification according to the type of the collected information can be divided into the following three categories, that is, the content in the operation threshold mainly includes the following three aspects (time of event occurrence, number of event occurrences and application performance). 1) And (4) time stamping. The timestamp is used for recording the occurrence time of various events, such as the time of submitting a new version application to a material warehouse, the time of performing operations such as deployment and update on the application in each cluster, the time of operating each cluster by a version control manager, and the like, and the information can simultaneously record corresponding operation contents. Time-related settings such as "application has been submitted to the material warehouse for XX hours", "there has been other cluster updates for XX hours", etc. are supported when setting the operation threshold for a cluster. 2) A counter. The counter is used for recording the times of occurrence of specified events, such as the times of processing requests of the application, the times of error reporting of the application, the times of abnormity (deadlock, quitting and the like) of the application and the like. And when the operation threshold value is set for the cluster, the settings related to the times, such as the number of application response times, the number of application error reporting times, the number of application abnormal times and the like, are supported. 3) And (5) summarizing. The abstract is used for recording the performance of the application, such as performance related indexes of average CPU (central processing unit) occupation, average memory occupation, average interface response time and the like. And when the operation threshold value is set for the cluster, performance indexes such as CPU occupancy rate change, memory occupancy rate change, response time change and the like are supported. Further, the operation threshold setting is dependent on the priority of the clusters to control the operation in batches in the case of multiple clusters.
The collection frequency of two monitoring types of the counter and the abstract is once collected every minute, old data before one day can be recalculated by taking ten minutes as a unit, old data before three days can be recalculated by taking days as a unit, and the pressure of numerical calculation and storage is reduced as much as possible on the premise of ensuring the accuracy of recent thermal data. And the two types of data have a correlation relationship with the application version, and as the application version in a cluster changes, the two types of data in the cluster are subjected to statistical calculation again and are compared with the data before the application changes. The summary data only retains the information of 90% quantile, and ignores the data jitter caused by the emergency.
In the prior art, canary deployment exists. Canary deployment: the changes are generalized to a small fraction of users for testing before being generalized to the entire service cluster and made available to all. And continuously observing the state of each dimensionality of the tested service in the testing process, and verifying the robustness, the availability, the stability and the like of the new version.
According to the technical scheme provided by the embodiment of the application, different thresholds can be set for each cluster in advance according to the dimensions such as the application and the importance degree of each cluster. When the controller detects that the application has an update, the controller judges the threshold values of all the managed clusters, and sends instructions such as deployment or update to the controller of the cluster only when the set threshold value is reached.
After the threshold value is set for the cluster, other steps of application deployment, updating or rollback do not need manual intervention if no special condition exists, and therefore automatic batch deployment, updating or rollback and other operations of the application in a multi-cluster environment are achieved. If the application is found to be abnormal in the operation process of a certain cluster, the cluster with the lower threshold value can be operated, so that the influence is controlled to the cluster with the lower importance as much as possible, and the influence on the whole service caused by the operation of all the clusters is avoided. Meanwhile, the management control of the application on a plurality of platforms such as bare metal, physical machines, virtual machines, containers and the like can be supported by depending on the abstraction of the lower-layer application on the application running platform.
Compared with the prior art, the technical scheme provided by the embodiment of the application can conditionally control the application version in a multi-cluster environment. In addition, according to the technical scheme provided by the embodiment of the application, the influence possibly caused by application abnormity can be controlled in a smaller range as much as possible by automatically judging the operation threshold, meanwhile, the possibility of errors in manual management of multiple clusters is greatly reduced, and the overall stability of application is improved.
Accordingly, a second aspect of the embodiments of the present application provides a control apparatus for an application in a cluster.
Fig. 6 schematically shows a block diagram of a control device for applications in a cluster according to an embodiment of the present application. As shown in fig. 6, the control device 600 includes an application control module 601 for executing the following for any cluster: judging whether the cluster needs to execute a control operation aiming at the current application, wherein the control operation is any one of the following operations: deploying a current application, updating the current application and rolling back the current application; judging whether an operation threshold value is met or not under the condition that the cluster needs to execute control operation aiming at the current application, wherein the operation threshold value is a threshold value corresponding to the cluster for executing the control operation aiming at the current application; and sending a control instruction for controlling the cluster to execute the control operation aiming at the current application under the condition that the operation threshold is met, so that the cluster executes the control operation aiming at the current application.
Optionally, in this embodiment of the application, the application control module is further configured to: under the condition that the operation threshold value is not met, judging whether the operation threshold value is met again at preset time intervals until the operation threshold value is met; and/or giving an alarm prompt when the operation threshold is not met and the preset operation time limit is exceeded.
Optionally, in this embodiment of the present application, the operation threshold is related to a priority of the cluster.
Optionally, in this embodiment of the application, the application control module is further configured to: before judging whether the operation threshold is met, judging whether the operation threshold is required to be judged; and directly sending the control instruction under the condition that whether the operation threshold is met or not is not required to be judged.
The specific working principle and benefits of the control device applied in the cluster provided in the embodiment of the present application are similar to the specific working principle and benefits of the control method applied in the cluster provided in the embodiment of the present application, and will not be described again here.
The control device comprises a processor and a memory, the application control module and the like are stored in the memory as program units, and the processor executes the program modules stored in the memory to realize corresponding functions.
The processor comprises a kernel, and the kernel calls the corresponding program unit from the memory. One or more than one kernel can be set, and the control method described in the above embodiment is implemented by adjusting kernel parameters.
The memory may include volatile memory in a computer readable medium, random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM), including at least one memory chip.
Furthermore, a third aspect of embodiments of the present application provides a processor configured to execute the control method described in the above embodiments.
In addition, a fourth aspect of embodiments of the present application provides a machine-readable storage medium having stored thereon instructions that, when executed by a processor, cause the processor to be configured to execute the control method described in the above embodiments.
Furthermore, a fifth aspect of embodiments of the present application provides a computer program product comprising a computer program that, when executed by a processor, implements the control method described in the above embodiments.
In addition, a sixth aspect of the embodiments of the present application provides a computer device, where the computer device may be a server, and an internal structure diagram of the computer device may be as shown in fig. 7. The computer apparatus includes a processor a01, a network interface a02, a memory (not shown in the figure), and a database (not shown in the figure) connected through a system bus. Wherein the processor a01 of the computer device is arranged to provide computing and control capabilities. The memory of the computer apparatus includes an internal memory a03 and a nonvolatile storage medium a04. The nonvolatile storage medium a04 stores an operating system B01, a computer program B02, and a database (not shown). The internal memory a03 provides an environment for running the operating system B01 and the computer program B02 in the nonvolatile storage medium a04. The database of the computer device is used for storing data. The network interface a02 of the computer apparatus is used for communicating with an external terminal through a network connection. The computer program B02 is executed by the processor a01 to implement a control method.
Those skilled in the art will appreciate that the architecture shown in fig. 7 is merely a block diagram of some of the structures associated with the disclosed aspects and is not intended to limit the computing devices to which the disclosed aspects apply, as particular computing devices may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
In one embodiment, the control apparatus provided herein may be implemented in the form of a computer program that is executable on a computer device such as that shown in fig. 7. The memory of the computer device may store therein the individual program modules constituting the control apparatus. The computer program constituted by the respective program modules causes the processor to execute the steps in the control method of the respective embodiments of the present application described in the present specification.
Furthermore, a seventh aspect of the embodiments of the present application provides an apparatus, which includes a processor, a memory, and a program stored in the memory and executable on the processor, and when the processor executes the program, the control method described in the following embodiments is implemented.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). The memory is an example of a computer-readable medium.
Computer-readable media, which include both non-transitory and non-transitory, removable and non-removable media, may implement the information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static Random Access Memory (SRAM), dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), read Only Memory (ROM), electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), digital Versatile Disks (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium, which can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrases "comprising one of 8230; \8230;" 8230; "does not exclude the presence of additional like elements in a process, method, article, or apparatus that comprises the element.
The above are merely examples of the present application and are not intended to limit the present application. Various modifications and changes may occur to those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.

Claims (11)

1. A control method for applications in a cluster, the control method comprising:
for any of the clusters, performing the following:
judging whether the cluster needs to execute a control operation aiming at the current application, wherein the control operation is any one of the following operations: deploying the current application, updating the current application, and rolling back the current application;
judging whether an operation threshold value is met or not under the condition that the cluster needs to execute the control operation aiming at the current application, wherein the operation threshold value is a threshold value corresponding to the cluster executing the control operation aiming at the current application; and
and sending a control instruction for controlling the cluster to execute the control operation for the current application under the condition that the operation threshold is met, so that the cluster executes the control operation for the current application.
2. The control method according to claim 1, characterized by further comprising:
under the condition that the operation threshold value is not met, judging whether the operation threshold value is met again at preset time intervals until the operation threshold value is met; and/or
And under the condition that the operation threshold value is not met and the preset operation time limit is exceeded, alarming and prompting are carried out.
3. Control method according to claim 1, characterized in that the operation threshold is related to the priority of the cluster.
4. The control method of claim 1, wherein prior to determining whether the operational threshold is met, the control method further comprises:
judging whether the operation threshold is required to be judged or not; and
and directly sending the control instruction under the condition that whether the operation threshold is met or not is not required to be judged.
5. A control apparatus for applications in a cluster, the control apparatus comprising:
an application control module, configured to execute the following for any one of the clusters:
judging whether the cluster needs to execute a control operation aiming at the current application, wherein the control operation is any one of the following operations: deploying the current application, updating the current application, and rolling back the current application;
judging whether an operation threshold value is met or not under the condition that the cluster needs to execute the control operation aiming at the current application, wherein the operation threshold value is a threshold value corresponding to the cluster executing the control operation aiming at the current application; and
and if the operation threshold is met, sending a control instruction for controlling the cluster to execute the control operation on the current application, so that the cluster executes the control operation on the current application.
6. The control apparatus of claim 5, wherein the application control module is further configured to:
under the condition that the operation threshold value is not met, judging whether the operation threshold value is met again at preset time intervals until the operation threshold value is met; and/or
And under the condition that the operation threshold value is not met and the preset operation time limit is exceeded, giving an alarm.
7. The control apparatus of claim 5, wherein the operational threshold is related to a priority of the cluster.
8. The control apparatus of claim 5, wherein the application control module is further configured to:
before judging whether the operation threshold is met, judging whether the operation threshold is needed to be judged; and
and directly sending the control instruction under the condition that whether the operation threshold is met or not is not required to be judged.
9. A processor configured to perform the control method according to any one of claims 1 to 4.
10. A machine-readable storage medium having instructions stored thereon, which when executed by a processor causes the processor to be configured to perform the control method of any one of claims 1 to 4.
11. A computer program product comprising a computer program, characterized in that the computer program realizes the control method according to any one of claims 1 to 4 when executed by a processor.
CN202211193528.6A 2022-09-28 2022-09-28 Control method, control device, machine-readable storage medium, and processor Pending CN115562702A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211193528.6A CN115562702A (en) 2022-09-28 2022-09-28 Control method, control device, machine-readable storage medium, and processor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211193528.6A CN115562702A (en) 2022-09-28 2022-09-28 Control method, control device, machine-readable storage medium, and processor

Publications (1)

Publication Number Publication Date
CN115562702A true CN115562702A (en) 2023-01-03

Family

ID=84743950

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211193528.6A Pending CN115562702A (en) 2022-09-28 2022-09-28 Control method, control device, machine-readable storage medium, and processor

Country Status (1)

Country Link
CN (1) CN115562702A (en)

Similar Documents

Publication Publication Date Title
US5704031A (en) Method of performing self-diagnosing hardware, software and firmware at a client node in a client/server system
US8392907B2 (en) Communication terminal
US10068015B2 (en) Monitoring a monitoring-target process
JP2003256225A (en) Computer system, failure countermeasure and program for making computer system function
JP2002278906A (en) Update managing system, update client device, update server device and program
CN112099825B (en) Method, device, equipment and storage medium for upgrading component
CN111258850A (en) Method and device for updating software information based on Linux system
CN111090546B (en) Method, device and equipment for restarting operating system and readable storage medium
CN111538585A (en) Js-based server process scheduling method, system and device
US7206975B1 (en) Internal product fault monitoring apparatus and method
US7281165B2 (en) System and method for performing product tests utilizing a single storage device
GB2320343A (en) computer system with checkpoint facility
CN114500249B (en) Root cause positioning method and device
CN111897626A (en) Cloud computing scene-oriented virtual machine high-reliability system and implementation method
CN115562702A (en) Control method, control device, machine-readable storage medium, and processor
CN113961257B (en) Automatic detection method, system and storage medium for activation of server operating system
CN113448609B (en) Container upgrading method, device, equipment and storage medium
CN109672573B (en) Configuration file deployment method, configuration file determination method, server and storage medium
CN113900952A (en) Test case execution method and device, terminal equipment and readable storage medium
CN114546717A (en) Method and device for starting android intelligent terminal, intelligent terminal and storage medium
CN114490196A (en) Database switching method, system, device and medium
CN111124459B (en) Method and device for updating service logic of FPGA cloud server
CN113703823A (en) BMC (baseboard management controller) firmware upgrading method and device, electronic equipment and storage medium
CN110716826B (en) Cloud disk upgrading and scheduling method, cloud host, scheduling device and system
EP1160666A2 (en) Switching versions of software in a system background

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