CN112882714B - SonarQube server cluster capacity expansion method and device - Google Patents

SonarQube server cluster capacity expansion method and device Download PDF

Info

Publication number
CN112882714B
CN112882714B CN202110153206.8A CN202110153206A CN112882714B CN 112882714 B CN112882714 B CN 112882714B CN 202110153206 A CN202110153206 A CN 202110153206A CN 112882714 B CN112882714 B CN 112882714B
Authority
CN
China
Prior art keywords
sonarqube
server
target
scanning
application
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
Application number
CN202110153206.8A
Other languages
Chinese (zh)
Other versions
CN112882714A (en
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.)
Industrial and Commercial Bank of China Ltd ICBC
Original Assignee
Industrial and Commercial Bank of China Ltd ICBC
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 Industrial and Commercial Bank of China Ltd ICBC filed Critical Industrial and Commercial Bank of China Ltd ICBC
Priority to CN202110153206.8A priority Critical patent/CN112882714B/en
Publication of CN112882714A publication Critical patent/CN112882714A/en
Application granted granted Critical
Publication of CN112882714B publication Critical patent/CN112882714B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • G06F8/43Checking; Contextual analysis
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5083Techniques for rebalancing the load in a distributed system
    • G06F9/5088Techniques for rebalancing the load in a distributed system involving task migration
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The invention discloses a method and a device for expanding the capacity of a SonarQube server cluster, which can be used in the financial field or other technical fields, and the method comprises the following steps: determining the mobility corresponding to a target SonarQube server according to the total number of scanning tasks processed by the target SonarQube server in a preset time interval and the total number of scanning tasks processed by other SonarQube servers instead; and if the mobility is greater than a preset threshold, migrating the scanning task processing of at least one application corresponding to the target SonarQube server to a new SonarQube server according to the total number of the processed scanning tasks of each application corresponding to the target SonarQube server. The invention is helpful to improve the processing efficiency of the code scanning task.

Description

SonarQube server cluster capacity expansion method and device
Technical Field
The invention relates to the technical field of code inspection, in particular to a method and a device for expanding a SonarQube server cluster.
Background
The SonarQube is a commonly used static code checking tool for checking applied codes, helping to check code defects, improving code quality and improving development speed. At present, the SonarQube has single-thread limitation of scanning task processing, one SonarQube server can only process one scanning task at the same time, and when a plurality of users are used simultaneously, the condition of task waiting can occur, so that the scanning efficiency and the timeliness of solving the problem are affected. How to improve the efficiency of SonarQube code scanning is a technical problem that needs to be solved in the art.
Disclosure of Invention
The invention provides a method and a device for expanding a SonarQube server cluster in order to solve the technical problems in the background technology.
In order to achieve the above object, according to one aspect of the present invention, there is provided a SonarQube server cluster expansion method, including:
determining the mobility corresponding to a target SonarQube server according to the total number of scanning tasks processed by the target SonarQube server in a preset time interval and the total number of scanning tasks processed by other SonarQube servers instead;
and if the mobility is greater than a preset threshold, migrating the scanning task processing of at least one application corresponding to the target SonarQube server to a new SonarQube server according to the total number of the processed scanning tasks of each application corresponding to the target SonarQube server.
Optionally, the migrating the processing of the scanning task of at least one application corresponding to the target SonarQube server to a new SonarQube server according to the total number of the processed scanning tasks of each application corresponding to the target SonarQube server, includes:
and if each application corresponding to the target SonarQube server belongs to the same group, migrating the scanning task processing of the application with the largest total number of processed scanning tasks to a new SonarQube server.
Optionally, the migrating the processing of the scanning task of at least one application corresponding to the target SonarQube server to a new SonarQube server according to the total number of the processed scanning tasks of each application corresponding to the target SonarQube server, includes:
if each application corresponding to the target SonarQube server does not belong to the same group, determining the total number of processed scanning tasks corresponding to each group in the target SonarQube server;
and migrating the scanning task processing of all the applications corresponding to the group with the largest total number of processed scanning tasks in the target SonarQube server to a new SonarQube server.
Optionally, migrating the application scanning task process to a new SonarQube server specifically includes:
transmitting a scanning rule set corresponding to the target SonarQube server to the new SonarQube server;
migrating a scanning task processing result applied to the target SonarQube server to the new SonarQube server;
and modifying the corresponding relation between the application and the SonarQube server from corresponding to the target SonarQube server to corresponding to the new SonarQube server.
Optionally, the target SonarQube server is used for processing a scanning task of a corresponding application; and the SonarQube client sends the scanning task corresponding to the target SonarQube server for processing when the target SonarQube server is idle, and sends the scanning task corresponding to the target SonarQube server to other idle SonarQube servers for processing when the target SonarQube server is not idle.
Optionally, after the other idle SonarQube servers process the scan task generation corresponding to the target SonarQube server, the scan task processing result is sent to the target SonarQube server through a preset database synchronization tool.
Optionally, when the SonarQube client receives a scan task, determining an application corresponding to the received scan task, determining an address of a SonarQube server corresponding to the application from a preset address table, determining an idle state of the corresponding SonarQube server according to the address, sending the received scan task to the corresponding SonarQube server for processing when the corresponding SonarQube server is idle, and sending the received scan task to other idle SonarQube servers for processing when the corresponding SonarQube server is not idle.
In order to achieve the above object, according to another aspect of the present invention, there is provided a SonarQube server cluster expansion device, including:
the mobility determining unit is used for determining the mobility corresponding to the target SonarQube server according to the total number of scanning tasks processed by the target SonarQube server in a preset time interval and the total number of scanning tasks processed by other SonarQube servers;
and the application migration unit is used for migrating the scanning task processing of at least one application corresponding to the target SonarQube server to a new SonarQube server according to the total number of the processed scanning tasks of each application corresponding to the target SonarQube server when the mobility is greater than a preset threshold.
Optionally, the application migration unit includes:
and the first migration module is used for migrating the scanning task processing of the application with the largest total number of processed scanning tasks to a new SonarQube server if each application corresponding to the target SonarQube server belongs to the same group.
Optionally, the application migration unit includes:
the department task total number determining module is used for determining the total number of the processed scanning tasks corresponding to each department in the target SonarQube server if the applications corresponding to the target SonarQube server do not belong to the same group;
and the second migration module is used for migrating the scanning task processing of all the applications corresponding to the group with the largest total number of processed scanning tasks in the target SonarQube server to a new SonarQube server.
To achieve the above object, according to another aspect of the present invention, there is also provided a computer device including a memory, a processor, and a computer program stored on the memory and executable on the processor, the processor implementing the steps in the SonarQube server cluster expansion method described above when executing the computer program.
To achieve the above object, according to another aspect of the present invention, there is also provided a computer readable storage medium storing a computer program which when executed in a computer processor implements the steps in the SonarQube server cluster expansion method described above.
The beneficial effects of the invention are as follows: according to the method, the mobility corresponding to the target SonarQube server is determined according to the total number of the scanning tasks processed by the target SonarQube server in a preset time interval and the total number of the scanning tasks processed by other SonarQube servers instead, so that when the mobility is larger than a preset threshold, the scanning task processing work of at least one application of the target SonarQube server is transferred to a new SonarQube server, and the new SonarQube server is responsible for processing, so that task splitting of the target SonarQube server is realized, namely the pressure of the target SonarQube server for processing the scanning tasks is reduced, and the overall processing efficiency of the scanning tasks is improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described, and it is obvious that the drawings in the following description are some embodiments of the present invention, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art. In the drawings:
FIG. 1 is a flow chart of a SonarQube server cluster expansion method in an embodiment of the invention;
FIG. 2 is a flow chart of the application migration of the present invention;
FIG. 3 is a flow chart of migrating an application's scan task process to a new SonarQube server;
FIG. 4 is an application scenario diagram of the SonarQube server cluster expansion method of the invention;
FIG. 5 is a block diagram of a SonarQube server cluster expansion device according to an embodiment of the invention;
FIG. 6 is a schematic diagram of a computer device according to an embodiment of the invention.
Detailed Description
In order that those skilled in the art will better understand the present invention, a technical solution in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in which it is apparent that the described embodiments are only some embodiments of the present invention, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the present invention without making any inventive effort, shall fall within the scope of the present invention.
It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention 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.
It is noted that the terms "comprises" and "comprising," and any variations thereof, in the description and claims of the present invention and in the foregoing figures, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed or inherent to such process, method, article, or apparatus.
It should be noted that, without conflict, the embodiments of the present invention and features of the embodiments may be combined with each other. The invention will be described in detail below with reference to the drawings in connection with embodiments.
It should be noted that, the SonarQube server cluster expansion method and the SonarQube server cluster expansion device can be applied to the financial field and can also be applied to other technical fields.
Fig. 4 is a schematic diagram of a SonarQube system according to the present invention, to which the SonarQube server cluster expansion method according to the present invention is applied. As shown in fig. 4, the SonarQube system of the present invention includes: the system comprises a SonarQube client, a SonarQube server cluster comprising a plurality of SonarQube servers, an address table and a database synchronization tool.
The SonarQube server cluster comprises a plurality of SonarQube servers, the SonarQube server registration is carried out in advance according to the application, each SonarQube server corresponds to at least one application, and the SonarQube server is used for processing the scanning task of the corresponding application. In an alternative embodiment of the present invention, the SonarQube server of the present invention may be a cloud server.
The address table records the SonarQube server corresponding to each application and the address of each SonarQube server. Optionally, the address table also records the corresponding department of each application.
The SonarQube client receives a scanning task sent by a user, wherein the scanning task comprises an application corresponding to the scanning task, and optionally, the scanning task also comprises a department corresponding to the application.
When a scanning task is received, the SonarQube client side firstly determines an application corresponding to the scanning task, and then reads an address table to determine an address of a SonarQube server corresponding to the application. And the SonarQube client calls a server interface according to the address of the SonarQube server to judge whether the server is idle, and if so, calls the SonarQube server corresponding to the application to process the scanning task. And if the client is not idle, the SonarQube client calls other idle SonarQube servers to process the scanning task and records the conversion information of the server. Therefore, the dynamic distribution and migration of the scanning tasks are realized, the phenomenon of uneven load of each SonarQube server is eliminated, and the SonarQube server can respond to the user request in time when a plurality of users use the same.
After the scanning task is processed, the database synchronization tool migrates the scanning task processing result to the SonarQube server corresponding to the application, so that the tasks of the same application can be intensively checked.
The SonarQube client may also record the total number of scanning tasks processed by each SonarQube server within a preset time interval. And determining the total number of scanning tasks which are processed by other SonarQube servers to the scanning tasks corresponding to the target SonarQube server in the preset time interval according to the server conversion information of the target SonarQube server.
In the embodiment of the invention, the specific flow of the SonarQube server processing the scanning task is as follows: the SonarQube client acquires a scanning rule set from the SonarQube server, scans codes applied in a scanning task according to the scanning rule in the scanning rule set to obtain a scanning result, and sends the scanning result to the SonarQube server; the SonarQube server analyzes the scanning result to obtain a scanning task processing result, and stores the scanning task processing result in a database in the SonarQube server. The invention actually refers to that the SonarQube server analyzes and processes the scanning result sent by the SonarQube client.
Fig. 1 is a flowchart of a SonarQube server cluster expansion method according to an embodiment of the present invention, as shown in fig. 1, the SonarQube server cluster expansion method of the present embodiment includes steps S101 to S102.
Step S101, determining mobility corresponding to a target SonarQube server according to the total number of scanning tasks processed by the target SonarQube server in a preset time interval and the total number of scanning tasks processed by other SonarQube servers instead.
In the embodiment of the invention, the target SonarQube server is used for processing the scanning task of the corresponding application.
As shown in fig. 4, when the target SonarQube server is idle, the SonarQube client sends a scanning task corresponding to the target SonarQube server for processing. And when the target SonarQube server is not idle, the SonarQube client sends a scanning task corresponding to the target SonarQube server to other idle SonarQube server generations for processing, and records server conversion information.
In one embodiment of the present invention, the SonarQube server being idle refers to the SonarQube server not executing a scan task process and there are no scan tasks waiting for the process. The SonarQube server is not idle, meaning that the SonarQube server is executing a scan task process or that the SonarQube server has a scan task waiting to process.
In one embodiment of the present invention, the mobility may be obtained by dividing the total number of scanning tasks processed by the target SonarQube server in a preset time interval by the total number of scanning tasks processed by other SonarQube servers in the preset time interval.
In the embodiment of the present invention, as shown in fig. 4, when a SonarQube client receives a scan task, an application corresponding to the received scan task is determined, an address of a SonarQube server corresponding to the application is determined from a preset address table, an idle state of the corresponding SonarQube server is determined according to the address, the received scan task is sent to the corresponding SonarQube server for processing when the corresponding SonarQube server is idle, and the received scan task is sent to other idle SonarQube servers for processing when the corresponding SonarQube server is not idle.
In the embodiment of the invention, after the other idle SonarQube servers process the scanning tasks corresponding to the target SonarQube server, the scanning task processing result is sent to the target SonarQube server through a preset database synchronization tool, so that the scanning tasks corresponding to the application can be checked in a concentrated mode.
Step S102, if the mobility is greater than a preset threshold, migrating the scanning task process of at least one application corresponding to the target SonarQube server to a new SonarQube server according to the total number of processed scanning tasks of each application corresponding to the target SonarQube server.
In an alternative embodiment of the present invention, this step may specifically create a new SonarQube server in the SonarQube server cluster as shown in fig. 4, so as to migrate the application's scanning task processing to the new SonarQube server. In an alternative embodiment of the present invention, the creation of a new SonarQube server in the SonarQube server cluster may specifically be cloning an available cloud server in the cloud server cluster.
In an alternative embodiment of the present invention, this step may specifically migrate the application with the largest total number of processed scan tasks to the new SonarQube server. In another alternative embodiment of the present invention, the step may specifically also be to migrate the application with the total number of the processed scanning tasks being greater than the preset value to the new SonarQube server.
Therefore, when the mobility of the target SonarQube server is larger than the preset threshold, the invention transfers the scanning task processing work of at least one application of the target SonarQube server to the new SonarQube server, and the new SonarQube server is responsible for processing, thereby realizing task splitting of the target SonarQube server, namely reducing the pressure of the target SonarQube server for scanning task processing and improving the overall processing efficiency of the scanning task.
In one embodiment of the present invention, in step S102, according to the total number of processed scan tasks of each application corresponding to the target SonarQube server, the method further includes migrating the scan task process of at least one application corresponding to the target SonarQube server to a new SonarQube server, and specifically includes:
and if each application corresponding to the target SonarQube server belongs to the same group, migrating the scanning task processing of the application with the largest total number of processed scanning tasks to a new SonarQube server.
In alternative embodiments of the invention, the groups may be departments, companies, organizations, and the like.
In one embodiment of the invention, the group is departments, if the server belongs to a plurality of applications of the same department, the method judges which application has the most scanning task, and the task processing of the application is migrated to a new server.
Fig. 2 is a flowchart of application migration according to the present invention, as shown in fig. 2, in one embodiment of the present invention, in step S102, the process of the scanning task of at least one application corresponding to the target SonarQube server is migrated to a new SonarQube server according to the total number of the processed scanning tasks of each application corresponding to the target SonarQube server, which specifically includes step S201 and step S202.
Step S201, if each application corresponding to the target SonarQube server does not belong to the same group, determining the total number of processed scan tasks corresponding to each group in the target SonarQube server.
Step S202, migrating the scanning task processing of all the applications corresponding to the group with the largest total number of processed scanning tasks in the target SonarQube server to a new SonarQube server.
In one embodiment of the invention, the group is departments, if the server belongs to the common of a plurality of departments, the scanning task number of which department is judged to be the largest, and the scanning task processing of the application of the department is migrated to a new server
Fig. 3 is a flowchart of migrating an application 'S scan task process to a new SonarQube server, and as shown in fig. 3, the present invention migrates an application' S scan task process to a new SonarQube server, specifically includes steps S301 to S303.
Step S301, transmitting the scan rule set corresponding to the target SonarQube server to the new SonarQube server.
Step S302, migrating the scanning task processing result applied in the target SonarQube server to the new SonarQube server.
And step S303, modifying the corresponding relation between the application and the SonarQube server from corresponding to the target SonarQube server to corresponding to the new SonarQube server.
In the embodiment of the present invention, step S303 is specifically to add a correspondence between an application and the new SonarQube server in an address table, add an address of the new SonarQube server in the address table, and delete a correspondence between an application and the target SonarQube server in the address table.
In the embodiment of the invention, after a new SonarQube server is created in the SonarQube server cluster, the steps S301 to S303 are further executed, and the scanning task processing migration of the application is completed.
In the embodiment of the present invention, the three steps S301 to S303 may be executed in any order, or may be executed simultaneously.
From the above embodiments, it can be seen that the present invention can dynamically expand the capacity of the SonarQube server. The method has the following advantages:
1. the invention can solve the problem that the SonarQube server waits for a plurality of tasks. The allocation before the access request server is optimized, and the load imbalance among the servers is eliminated;
2. the invention improves the response time and the overall performance of the SonarQube platform;
3. the invention can monitor the running condition of the server and the migration condition of the tasks in the server, and find out the running problem in time;
4. the invention can conveniently increase and start the server.
It should be noted that the steps illustrated in the flowcharts of the figures may be performed in a computer system such as a set of computer executable instructions, and that although a logical order is illustrated in the flowcharts, in some cases the steps illustrated or described may be performed in an order other than that illustrated herein.
Based on the same inventive concept, the embodiment of the present invention further provides a SonarQube server cluster expansion device, which can be used to implement the SonarQube server cluster expansion method described in the above embodiment, as described in the following embodiment. The principle of the SonarQube server cluster capacity expansion device for solving the problem is similar to that of the SonarQube server cluster capacity expansion method, so that the embodiment of the SonarQube server cluster capacity expansion device can be referred to the embodiment of the SonarQube server cluster capacity expansion method, and the repetition is omitted. As used below, the term "unit" or "module" may be a combination of software and/or hardware that implements the intended function. While the means described in the following embodiments are preferably implemented in software, implementation in hardware, or a combination of software and hardware, is also possible and contemplated.
Fig. 5 is a structural block diagram of a SonarQube server cluster expansion device according to an embodiment of the present invention, and as shown in fig. 5, the SonarQube server cluster expansion device according to an embodiment of the present invention includes:
the mobility determining unit 1 is configured to determine mobility corresponding to a target SonarQube server according to a total number of scanning tasks processed by the target SonarQube server in a preset time interval and a total number of scanning tasks processed by other SonarQube servers instead.
And the application migration unit 2 is configured to migrate, when the mobility is greater than a preset threshold, the scan task process of at least one application corresponding to the target SonarQube server to a new sonarque server according to the total number of processed scan tasks of each application corresponding to the target SonarQube server.
In one embodiment of the present invention, the application migration unit 2 includes:
and the first migration module is used for migrating the scanning task processing of the application with the largest total number of processed scanning tasks to a new SonarQube server if each application corresponding to the target SonarQube server belongs to the same group.
In one embodiment of the present invention, the application migration unit 2 includes:
the department task total number determining module is used for determining the total number of the processed scanning tasks corresponding to each department in the target SonarQube server if the applications corresponding to the target SonarQube server do not belong to the same group;
and the second migration module is used for migrating the scanning task processing of all the applications corresponding to the group with the largest total number of processed scanning tasks in the target SonarQube server to a new SonarQube server.
In one embodiment of the present invention, the application migration unit 2 includes:
the scanning rule set sending module is used for sending the scanning rule set corresponding to the target SonarQube server to the new SonarQube server;
the scanning task processing result migration module is used for migrating the scanning task processing result applied to the target SonarQube server to the new SonarQube server;
and the corresponding relation modifying module is used for modifying the corresponding relation between the application and the SonarQube server from corresponding to the target SonarQube server to corresponding to the new SonarQube server.
To achieve the above object, according to another aspect of the present application, there is also provided a computer apparatus. As shown in fig. 6, the computer device includes a memory, a processor, a communication interface, and a communication bus, where a computer program executable on the processor is stored on the memory, and when the processor executes the computer program, the steps in the method of the above embodiment are implemented.
The processor may be a central processing unit (Central Processing Unit, CPU). The processor may also be any other general purpose processor, digital signal processor (Digital Signal Processor, DSP), application specific integrated circuit (Application Specific Integrated Circuit, ASIC), field programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic device, discrete gate or transistor logic, discrete hardware components, or any combination thereof.
The memory is used as a non-transitory computer readable storage medium for storing non-transitory software programs, non-transitory computer executable programs, and units, such as corresponding program units in the above-described method embodiments of the invention. The processor executes the various functional applications of the processor and the processing of the composition data by running non-transitory software programs, instructions and modules stored in the memory, i.e., implementing the methods of the method embodiments described above.
The memory may include a memory program area and a memory data area, wherein the memory program area may store an operating system, at least one application program required for a function; the storage data area may store data created by the processor, etc. In addition, the memory may include high-speed random access memory, and may also include non-transitory memory, such as at least one magnetic disk storage device, flash memory device, or other non-transitory solid state storage device. In some embodiments, the memory may optionally include memory located remotely from the processor, the remote memory being connectable to the processor through a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The one or more units are stored in the memory, which when executed by the processor, performs the method in the above embodiments.
The details of the computer device may be correspondingly understood by referring to the corresponding relevant descriptions and effects in the above embodiments, and will not be repeated here.
To achieve the above object, according to another aspect of the present application, there is also provided a computer readable storage medium storing a computer program which when executed in a computer processor implements the steps in the SonarQube server cluster expansion method described above. It will be appreciated by those skilled in the art that implementing all or part of the above-described embodiment method may be implemented by a computer program to instruct related hardware, where the program may be stored in a computer readable storage medium, and the program may include the above-described embodiment method when executed. Wherein the storage medium may be a magnetic Disk, an optical Disk, a Read-Only Memory (ROM), a random access Memory (RandomAccessMemory, RAM), a Flash Memory (Flash Memory), a Hard Disk (HDD), a Solid State Drive (SSD), or the like; the storage medium may also comprise a combination of memories of the kind described above.
It will be apparent to those skilled in the art that the modules or steps of the invention described above may be implemented in a general purpose computing device, they may be concentrated on a single computing device, or distributed across a network of computing devices, or they may alternatively be implemented in program code executable by computing devices, such that they may be stored in a memory device for execution by the computing devices, or they may be separately fabricated into individual integrated circuit modules, or multiple modules or steps within them may be fabricated into a single integrated circuit module. Thus, the present invention is not limited to any specific combination of hardware and software.
The above description is only of the preferred embodiments of the present invention and is not intended to limit the present invention, but various modifications and variations can be made to the present invention by those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (11)

1. A SonarQube server cluster capacity expansion method is characterized by comprising the following steps:
determining the mobility corresponding to a target SonarQube server according to the total number of scanning tasks processed by the target SonarQube server in a preset time interval and the total number of scanning tasks processed by other SonarQube servers instead; the target SonarQube server is used for processing the scanning task of the corresponding application; the method comprises the steps that when a target SonarQube server is idle, a SonarQube client sends a scanning task corresponding to the target SonarQube server for processing, and when the target SonarQube server is not idle, the scanning task corresponding to the target SonarQube server is sent to other idle SonarQube servers for processing;
and if the mobility is greater than a preset threshold, migrating the scanning task processing of at least one application corresponding to the target SonarQube server to a new SonarQube server according to the total number of the processed scanning tasks of each application corresponding to the target SonarQube server.
2. The method for expanding the cluster of SonarQube servers according to claim 1, wherein the migrating the scan task process of at least one application corresponding to the target SonarQube server to a new SonarQube server according to the total number of processed scan tasks of each application corresponding to the target SonarQube server, includes:
and if each application corresponding to the target SonarQube server belongs to the same group, migrating the scanning task processing of the application with the largest total number of processed scanning tasks to a new SonarQube server.
3. The method for expanding the cluster of SonarQube servers according to claim 1, wherein the migrating the scan task process of at least one application corresponding to the target SonarQube server to a new SonarQube server according to the total number of processed scan tasks of each application corresponding to the target SonarQube server, includes:
if each application corresponding to the target SonarQube server does not belong to the same group, determining the total number of processed scanning tasks corresponding to each group in the target SonarQube server;
and migrating the scanning task processing of all the applications corresponding to the group with the largest total number of processed scanning tasks in the target SonarQube server to a new SonarQube server.
4. The SonarQube server cluster expansion method of claim 1, wherein migrating the application's scanning task process to a new SonarQube server specifically comprises:
transmitting a scanning rule set corresponding to the target SonarQube server to the new SonarQube server;
migrating a scanning task processing result applied to the target SonarQube server to the new SonarQube server;
and modifying the corresponding relation between the application and the SonarQube server from corresponding to the target SonarQube server to corresponding to the new SonarQube server.
5. The method for expanding the cluster of the SonarQube servers according to claim 1, wherein after the other idle SonarQube servers process the scan task generation corresponding to the target SonarQube server, a scan task processing result is sent to the target SonarQube server through a preset database synchronization tool.
6. The method for expanding the cluster of the SonarQube server according to claim 1, wherein the SonarQube client determines an application corresponding to a received scanning task when receiving the scanning task, determines an address of a SonarQube server corresponding to the application from a preset address table, determines an idle busy state of the corresponding SonarQube server according to the address, sends the received scanning task to the corresponding SonarQube server for processing when the corresponding SonarQube server is idle, and sends the received scanning task to other idle SonarQube servers for processing when the corresponding SonarQube server is not idle.
7. The SonarQube server cluster capacity expansion device is characterized by comprising:
the mobility determining unit is used for determining the mobility corresponding to the target SonarQube server according to the total number of scanning tasks processed by the target SonarQube server in a preset time interval and the total number of scanning tasks processed by other SonarQube servers; the target SonarQube server is used for processing the scanning task of the corresponding application; the method comprises the steps that when a target SonarQube server is idle, a SonarQube client sends a scanning task corresponding to the target SonarQube server for processing, and when the target SonarQube server is not idle, the scanning task corresponding to the target SonarQube server is sent to other idle SonarQube servers for processing;
and the application migration unit is used for migrating the scanning task processing of at least one application corresponding to the target SonarQube server to a new SonarQube server according to the total number of the processed scanning tasks of each application corresponding to the target SonarQube server when the mobility is greater than a preset threshold.
8. The SonarQube server cluster expansion device of claim 7, wherein the application migration unit comprises:
and the first migration module is used for migrating the scanning task processing of the application with the largest total number of processed scanning tasks to a new SonarQube server if each application corresponding to the target SonarQube server belongs to the same group.
9. The SonarQube server cluster expansion device of claim 7, wherein the application migration unit comprises:
the department task total number determining module is used for determining the total number of the processed scanning tasks corresponding to each department in the target SonarQube server if the applications corresponding to the target SonarQube server do not belong to the same group;
and the second migration module is used for migrating the scanning task processing of all the applications corresponding to the group with the largest total number of processed scanning tasks in the target SonarQube server to a new SonarQube server.
10. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor implements the method of any of claims 1 to 6 when executing the computer program.
11. A computer readable storage medium storing a computer program, characterized in that the computer program when executed in a computer processor implements the method of any one of claims 1 to 6.
CN202110153206.8A 2021-02-04 2021-02-04 SonarQube server cluster capacity expansion method and device Active CN112882714B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110153206.8A CN112882714B (en) 2021-02-04 2021-02-04 SonarQube server cluster capacity expansion method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110153206.8A CN112882714B (en) 2021-02-04 2021-02-04 SonarQube server cluster capacity expansion method and device

Publications (2)

Publication Number Publication Date
CN112882714A CN112882714A (en) 2021-06-01
CN112882714B true CN112882714B (en) 2024-01-30

Family

ID=76057123

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110153206.8A Active CN112882714B (en) 2021-02-04 2021-02-04 SonarQube server cluster capacity expansion method and device

Country Status (1)

Country Link
CN (1) CN112882714B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114153609B (en) * 2021-11-30 2024-10-11 中国电信股份有限公司 Resource control method and device, electronic equipment and computer readable storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105472034A (en) * 2016-01-04 2016-04-06 中国人民解放军国防科学技术大学 Load balancing method for reducing migration rate in multi-server DVE system
CN107992353A (en) * 2017-07-31 2018-05-04 南京邮电大学 A kind of container dynamic migration method and system based on minimum transition amount
CN108200218A (en) * 2018-03-09 2018-06-22 北京奇艺世纪科技有限公司 A kind of method, apparatus and electronic equipment for realizing load balancing
CN110990026A (en) * 2019-10-10 2020-04-10 武汉烽火信息集成技术有限公司 Automatic deployment method and system for PaaS platform

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9632840B2 (en) * 2014-04-22 2017-04-25 International Business Machines Corporation Load balancing with granularly redistributable workloads

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105472034A (en) * 2016-01-04 2016-04-06 中国人民解放军国防科学技术大学 Load balancing method for reducing migration rate in multi-server DVE system
CN107992353A (en) * 2017-07-31 2018-05-04 南京邮电大学 A kind of container dynamic migration method and system based on minimum transition amount
CN108200218A (en) * 2018-03-09 2018-06-22 北京奇艺世纪科技有限公司 A kind of method, apparatus and electronic equipment for realizing load balancing
CN110990026A (en) * 2019-10-10 2020-04-10 武汉烽火信息集成技术有限公司 Automatic deployment method and system for PaaS platform

Also Published As

Publication number Publication date
CN112882714A (en) 2021-06-01

Similar Documents

Publication Publication Date Title
US12393491B2 (en) Data access method and system, device, and storage medium
KR102081364B1 (en) Variable distributed rendering system for editing video based on cloud and method thereof
US20160306680A1 (en) Thread creation method, service request processing method, and related device
CN110096336B (en) Data monitoring method, device, equipment and medium
CN104461744A (en) Resource allocation method and device
CN106354559A (en) Method and device for processing cloud desktop resources
CN107818104B (en) A database deployment method, database deployment device, control device and system
CN111309443B (en) Virtualization method, device, equipment and storage medium of Internet of things equipment system
CN112433812B (en) Virtual machine cross-cluster migration method, system, equipment and computer medium
EP4383076A1 (en) Data processing method and apparatus, computer device, and computer-readable storage medium
US20170171301A1 (en) Method, device and system for load balancing configuration
WO2018054200A1 (en) Method and device for reading file
CN103581336B (en) Service flow scheduling method and system based on cloud computing platform
US20150112934A1 (en) Parallel scanners for log based replication
KR101765725B1 (en) System and Method for connecting dynamic device on mass broadcasting Big Data Parallel Distributed Processing
US20180349236A1 (en) Method for transmitting request message and apparatus
US20200382382A1 (en) Method and system for detecting service quality of cdn system
US8832215B2 (en) Load-balancing in replication engine of directory server
WO2017185615A1 (en) Method for determining service status of service processing device and scheduling device
US20220300477A1 (en) Data Read/Write Method and Apparatus for Database
US8458702B1 (en) Method for implementing user space up-calls on java virtual machine before/after garbage collection
CN112882714B (en) SonarQube server cluster capacity expansion method and device
CN107734050B (en) Load machine distribution method, computing equipment and load machine distribution system
CN113485828A (en) Distributed task scheduling system and method based on quartz
CN119415450A (en) Base address register resource management method, electronic device and medium

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