CN109426559B - Command issuing method and device, storage medium and processor - Google Patents

Command issuing method and device, storage medium and processor Download PDF

Info

Publication number
CN109426559B
CN109426559B CN201710721247.6A CN201710721247A CN109426559B CN 109426559 B CN109426559 B CN 109426559B CN 201710721247 A CN201710721247 A CN 201710721247A CN 109426559 B CN109426559 B CN 109426559B
Authority
CN
China
Prior art keywords
command
server
commands
type
class
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
CN201710721247.6A
Other languages
Chinese (zh)
Other versions
CN109426559A (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.)
Beijing Gridsum Technology Co Ltd
Original Assignee
Beijing Gridsum Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Gridsum Technology Co Ltd filed Critical Beijing Gridsum Technology Co Ltd
Priority to CN201710721247.6A priority Critical patent/CN109426559B/en
Publication of CN109426559A publication Critical patent/CN109426559A/en
Application granted granted Critical
Publication of CN109426559B publication Critical patent/CN109426559B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5083Techniques for rebalancing the load in a distributed system

Abstract

The invention discloses a command issuing method and device, a storage medium and a processor. Wherein, the method comprises the following steps: acquiring a first type server list, wherein the first type server list lists all online first type servers; acquiring a plurality of first commands, wherein the first commands are commands which need to be issued to a second type server by a first type server in a first type server list; and traversing the first-class server list, and sequentially pushing a first command to the first-class servers, wherein one first command is pushed to one first-class server each time. The invention solves the technical problem of resource waste caused by the idle server in a multi-master architecture.

Description

Command issuing method and device, storage medium and processor
Technical Field
The invention relates to the field of internet, in particular to a command issuing method and device, a storage medium and a processor.
Background
The Salt official provides a multi-master HA framework, and the Minion can receive tasks/commands issued by a plurality of different masters, so that the usability of the masters can be improved, and in normal work, an operator only uses one master to issue the tasks/commands, and other masters do not operate. However, if the commonly used master suddenly appears to be unavailable, the operator can also use other masters to issue commands.
In the multi-master architecture, if the same command is issued on both master a and master b, the minion will execute the command twice, resulting in the execution of command duplicates.
In order to avoid the minion from repeatedly executing the same command, only one master can work at the same time in the multi-master architecture. This mode of operation is inefficient, especially when there are large numbers of commands to be issued.
In view of the above problems, no effective solution has been proposed.
Disclosure of Invention
The embodiment of the invention provides a command issuing method and device, a storage medium and a processor, which are used for at least solving the technical problem of resource waste caused by idle servers in a multi-master architecture.
According to an aspect of an embodiment of the present invention, there is provided a command issuing method, including: acquiring a first server list, wherein the first server list lists all online first servers; acquiring a plurality of first commands, wherein the first commands are commands which need to be issued to a second server by a first server in the first server list; traversing the first-class server list, and sequentially pushing the first command to the first-class servers, wherein one first command is pushed to one first-class server at a time.
Further, obtaining the plurality of first commands comprises: acquiring a second command to be issued, wherein the second command carries identification information of a plurality of second servers; and splitting each second command into a plurality of first commands, wherein each first command carries identification information of one second type server.
Furthermore, there are N first-class servers in the first-class server list, and there are M first commands, traversing the first-class servers in the first-class server list, and sequentially pushing the first commands to the first-class servers includes: sorting the M first commands to obtain a 1 st first command, a 2 nd first command, a 8230command, an ith first command, a 8230command and an Mth first command; and pushing the ith first command to the ith first type server in the first type server list, wherein i sequentially takes 1 to M.
Further, the obtaining the first type server list comprises: polling the IP in the first type server list; sending a test command to a target server to obtain a test result, wherein the target server is the first type server corresponding to the polled IP; and determining whether to update the first type server list according to the test result.
Further, determining whether to update the first class server list according to the test result includes: if the test result indicates that the target server can work normally, keeping the first type server list unchanged; and if the test result indicates that the working state of the target server is abnormal, deleting the target server from the first class server list.
According to another aspect of the embodiments of the present invention, there is also provided a command issuing apparatus, including: the server management system comprises a first acquisition unit, a second acquisition unit and a third acquisition unit, wherein the first acquisition unit is used for acquiring a first server list, and the first server list lists all online first servers; a second obtaining unit, configured to obtain a plurality of first commands, where the first commands are commands that need to be issued to a second server by the first servers in the first server list; and the traversing unit is used for traversing the first-class server list and sequentially pushing the first command to the first-class servers, wherein one first command is pushed to one first-class server at a time.
Further, the second acquisition unit includes: the acquiring subunit is configured to acquire a second command to be issued, where the second command carries identification information of multiple second servers; and the splitting subunit is configured to split each second command into multiple first commands, where each first command carries identification information of one second server.
Further, there are N first servers in the first server list, and there are M first commands, and the traversal unit includes: the sorting subunit is used for sorting the M first commands to obtain a 1 st first command, a 2 nd first command, a 8230command, an ith first command, an 8230command and an Mth first command; and the pushing subunit is used for pushing the ith first command to the ith first-class server in the first-class server list, wherein i is sequentially from 1 to M.
Further, the first acquisition unit includes: the polling subunit is used for polling the IP in the first-class server list; the sending subunit is configured to send a test command to a target server to obtain a test result, where the target server is the first type of server corresponding to the polled IP; and the updating subunit is used for determining whether to update the first-class server list according to the test result.
Further, if the test result indicates that the target server can work normally, the updating subunit keeps the first-class server list unchanged; and if the test result indicates that the working state of the target server is abnormal, the updating subunit deletes the target server from the first type server list.
According to another aspect of the embodiments of the present invention, there is also provided a storage medium including a stored program, wherein the program executes the above-described command issuing method.
According to another aspect of the embodiments of the present invention, there is also provided a processor, configured to execute a program, where the program executes the above command issuing method.
In the embodiment of the invention, the first command is a command which needs to be issued to the second type server by the first type server in the first type server list, the first type server list lists all online first type servers, the first type server list is traversed, and the first commands are sequentially pushed to the first type servers, wherein one first command is pushed to one first type server each time, after the first type server receives the first command, the first command is issued to the second type server, and the first commands pushed to each first type server are different, so that the first commands issued to the second type server by each first type server are also different, the problem that the second type server repeatedly executes the same command is avoided, and the first type servers work at the same time, so that the technical effect of improving the working efficiency of a multi-master architecture is achieved, and the technical problem of resource waste caused by the idle servers in the multi-master architecture is further solved.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this specification, illustrate embodiments of the invention and together with the description serve to explain the invention and not to limit the invention. In the drawings:
FIG. 1 is a flow diagram of an alternative command issuing method according to an embodiment of the invention;
fig. 2 is a schematic diagram of an alternative command issuing device according to an embodiment of the present invention.
Detailed Description
In order to make those skilled in the art better understand the technical solutions of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that the terms "first," "second," and the like in the description and claims of the present invention and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the invention described herein are capable of operation in sequences other than those illustrated or described herein. Moreover, the terms "comprises," "comprising," and "having," and any variations thereof, 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, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
In accordance with an embodiment of the present invention, there is provided an embodiment of a command issuing method, it should be noted that the steps shown in the flowchart of the figure may be executed in a computer system such as a set of computer executable instructions, and that although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in an order different from that here.
Fig. 1 is a flow chart of an alternative command issuing method according to an embodiment of the present invention. As shown in fig. 1, the method comprises the steps of:
step S102, a first server list is obtained, wherein the first server list lists all online first servers.
Step S104, a plurality of first commands are obtained, wherein the first commands are commands which need to be issued to a second type server by a first type server in a first type server list.
Step S106, traversing the first-class server list, and sequentially pushing a first command to the first-class servers, wherein one first command is pushed to one first-class server each time.
The first type of server may be a master and the second type of server may be a minus, the functions of the first type of server and the second type of server are different.
In the embodiment of the invention, the first command is a command which needs to be issued to the second server by the first server in the first server list, the first server list lists all online first servers, the first command is pushed to the first servers in sequence by traversing the first server list, wherein one first command is pushed to one first server at a time, after the first server receives the first command, the first command is issued to the second server, and the first commands pushed to the first servers are different, so that the first commands issued to the second servers by each first server are different, the problem that the second server repeatedly executes the same command is avoided, and the first servers work at the same time, the problem of resource waste caused by idle first servers is avoided, and the technical effect of improving the working efficiency of the multi-master architecture is achieved.
Optionally, the obtaining the plurality of first commands comprises: acquiring a second command to be issued, wherein the second command carries identification information of a plurality of second servers; and splitting each second command into a plurality of first commands, wherein each first command carries identification information of one second type server.
The number of the split first commands is equal to the number of the identification information of the second type server carried by the second commands.
The second command may be a command entered by the operation and maintenance personnel.
And splitting the second command into R first commands under the assumption that the second command carries the identification information of R second-class servers, wherein each first command carries the identification information of one second-class server.
The following examples illustrate:
a second command: salt-L 'mini 1, mini 2, mini 3' cmd.run "ipconfig"
The second command means that a command for executing the shell is issued to the time 1, time 2, and time 3.
Splitting the second command into 3 first commands:
1 st first command: salt 'finish 1' cmd.
Second command: run "ipconfig" in Salt 'finish 2' cmd.
The 3 rd first command: run "ipconfig" with Salt 'finish 3' cmd.
Wherein, the 1 st first command carries the identification information of a second type server (minus 1); the 2 nd first command carries identification information of a second type server (minus 2); the 3 rd first command carries identification information of a second type server (minus 3).
Optionally, there are N first-class servers in the first-class server list, and there are M first commands, traversing the first-class server list, and sequentially pushing the first commands to the first-class servers, where the method includes: sequencing the M first commands to obtain a 1 st first command, a 2 nd first command, a 8230command, an ith first command, an 8230command and an Mth first command; and pushing an ith first command to an ith first type server in the first type server list, wherein i sequentially takes 1 to M.
The following description is divided into two cases.
The first condition is as follows: n is greater than or equal to M, namely, the number of the first type servers is greater than or equal to the number of the first commands. In this case, the first-class server list is traversed, and a first command is pushed to each first-class server in sequence for distribution.
For example, as shown in table 1, there are 5 first type servers in the first type server list and 4 first commands. Pushing a 1 st first command to a 1 st first type server in the first type server list; pushing a 2 nd first command to a 2 nd first server in the first server list; pushing a 3 rd first command to a 3 rd first server in the first server list; and pushing a 4 th first command to a 4 th first server in the first server list.
TABLE 1
A first command First class server
1 st first command 1 st first type server
2 nd first command 2 nd first type server
3 rd first command 3 rd first type server
4 th first command 4 th first type server
Case two: n is less than M, i.e., the number of first class servers is less than the number of first commands. In this case, the first-class server list is traversed, and a first command is pushed to each first-class server in sequence for distribution. And when the first-class server list is traversed and the first commands are not completely pushed, continuously traversing the first-class server list again, sequentially pushing a first command to each first-class server, and distributing until all the first commands are pushed to the first-class servers.
For example, as shown in table 2, there are 5 first-class servers in the first-class server list, and there are 12 first commands. Pushing a 1 st first command to a 1 st first type server in the first type server list; pushing a 2 nd first command to a 2 nd first server in the first server list; pushing a 3 rd first command to a 3 rd first server in the first server list; pushing a 4 th first command to a 4 th first server in the first server list; pushing a 5 th first command to a 5 th first server in the first server list; pushing a 6 th first command to a 1 st first type server in a first type server list; pushing a 7 th first command to a 2 nd first-class server in the first-class server list; pushing an 8 th first command to a 3 rd first-class server in a first-class server list; pushing a 9 th first command to a 4 th first type server in the first type server list; pushing a 10 th first command to a 5 th first-class server in the first-class server list; pushing an 11 th first command to a 1 st first-class server in a first-class server list; and pushing a 12 th first command to a 2 nd first server in the first server list.
TABLE 2
Figure BDA0001384608420000061
Figure BDA0001384608420000071
Optionally, the obtaining the first type server list includes: polling the IP in the first type server list; sending a test command to a target server to obtain a test result, wherein the target server is a first type server corresponding to the IP polled; and determining whether to update the first type server list according to the test result.
Optionally, determining whether to update the first server list according to the test result includes: if the test result indicates that the target server can work normally, keeping the first type of server list unchanged; and if the test result indicates that the working state of the target server is abnormal, deleting the target server from the first-class server list.
And after receiving the test command, the target server tests whether the target server can normally work to obtain a test result.
There are many methods for the target server to test whether it can work normally, and one of them is listed below. For example, a salt test command is sent to the target server, after the target server receives the salt test command, a simple HELLO test is performed on any one of the second type servers, and if the result is returned to True, it is proved that the target server can normally operate, that is, the test result indicates that the target server can normally operate, and in this case, the list of the first type servers is kept unchanged. And if the link returns to the Flase link or the ssh link cannot be carried out at all, the target server is proved to be incapable of working normally, namely the test result indicates that the working state of the target server is abnormal, and in this case, the target server is deleted from the first-class server list.
By deleting the first-class server with abnormal working state from the first-class server list, the first-class server list is updated in time, and the usability of the multi-master framework is guaranteed to be improved.
This scheme includes 4 parts:
1. available master list (first class server list)
The method is a list of server ip, records the ip of all available masters (first class servers) at present, and when a task needs to be issued, the task distribution module needs to rely on the list.
Master monitoring module
This module is an active monitoring program, the deployment location does not need to be specified, but the program needs to be put together with an "available master list", which continuously actively polls the IP in the available master list and sends a salt test command (i.e. the test command mentioned above) to the target machine (target server) through ssh, and judges the availability of the master by returning the result True or False or no response. Ping, which will cause the master to perform a simple HELLO test on any of the minions (servers of the second type), if True is returned, the master is certified as available, if either fiase or ssh link is returned, the master is considered as unavailable, and when an unavailable condition occurs, this module will update the "available master list" and delete the IP of the unavailable master from the list.
3. Task receiving module
The module is used as a use module of salt, when an operation and maintenance person needs to issue a task, the module is used to fill in a command to be issued and a target minus ion (a plurality of) lists, after the module receives the command, the module traverses the target minus ion list specified in the command, and changes the command (a second command) which is transmitted by the operation and maintenance and needs to be issued to a plurality of minus ions into a single salt '< traversed target machine >' cmd style small task (a first command) which is directed to a single minus ion. Examples are:
the commands input by the operation and maintenance personnel are as follows:
Salt-L 'finish 1, finish 2, finish 3' cmd.run "ipconfig" (second command)
The above-mentioned command means that the machine of minus 1, minus 2, minus 3 issues the command for executing shell
The commands after the disassembly of the modules are as follows:
salt 'creation 1' cmd.run "ipconfig" (first command)
Salt 'finish 2' cmd.run "ipconfig" (first command)
Salt 'finish 3' cmd.run "ipconfig" (first command)
All commands for single station Minion are obtained by disassembling, and all the commands (first commands) are transmitted to the task distribution module.
4. Task distribution module
And traversing the 'available master list' after obtaining all commands facing to the single station Minion, pushing one command by each master according to the sequence of the tasks for distribution, and continuing traversing until all the commands are pushed to the masters if the 'available master list' is traversed and the commands are not completely pushed.
The push uses ssh remote linking, which is not described here.
When a large amount of tasks need to be issued, only one machine works in a multi-master framework in the prior art, other machines are idle, a plurality of machines share the work together in the scheme, the execution efficiency is improved, and the fault master can be monitored, so that the tasks are not born, and the task loss is avoided.
The embodiment of the invention also provides a command issuing device, which is used for executing the command issuing method, and the command issuing method can be executed by the command issuing device. Fig. 2 is a schematic diagram of an alternative command issuing device according to an embodiment of the present invention. As shown in fig. 2, the command issuing apparatus includes: a first acquisition unit 10, a second acquisition unit 20, and a traversal unit 30.
The first obtaining unit 10 is configured to obtain a first-class server list, where the first-class server list lists all online first-class servers. The second obtaining unit 20 is configured to obtain a plurality of first commands, where the first commands are commands that need to be issued by the first class servers in the first class server list to the second class servers. The traversing unit 30 is configured to traverse the first-class server list and sequentially push a first command to the first-class servers, where one first command is pushed to one first-class server at a time.
Optionally, the second obtaining unit 20 includes: acquiring a subunit and splitting the subunit. And the obtaining subunit is configured to obtain a second command to be issued, where the second command carries identification information of multiple second servers. And the splitting subunit is used for splitting each second command into a plurality of first commands, wherein each first command carries identification information of one second type server.
Optionally, there are N first-type servers in the first-type server list, there are M first commands, and the traversal unit 30 includes: a sorting subunit and a pushing subunit. The sorting subunit is configured to sort the M first commands to obtain 1 st first command, 2 nd first command, \8230;, ith first command, \8230;, and mth first command. And the pushing subunit is used for pushing the ith first command to the ith first-class server in the first-class server list, wherein i is sequentially from 1 to M.
Optionally, the first obtaining unit 10 includes: a polling subunit, a sending subunit and an updating subunit. And the polling subunit is used for polling the IP in the first-class server list. And the sending subunit is used for sending the test command to the target server to obtain a test result, wherein the target server is a first-class server corresponding to the IP polled. And the updating subunit is used for determining whether to update the first-class server list according to the test result.
Optionally, if the test result indicates that the target server can work normally, the updating subunit keeps the first-class server list unchanged; and if the test result indicates that the working state of the target server is abnormal, the updating subunit deletes the target server from the first-class server list.
The command issuing device comprises a processor and a memory, wherein the first acquiring unit 10, the second acquiring unit 20, the traversing unit 30 and the like are stored in the memory as program units, and the processor executes the program units stored in the memory to realize corresponding functions.
The processor comprises a kernel, and the kernel calls the corresponding program unit from the memory. The kernel can set one or more than one, and the issuing of a plurality of tasks is executed by adjusting the kernel parameters.
The memory may include volatile memory in a computer readable medium, random Access Memory (RAM) and/or nonvolatile memory such as Read Only Memory (ROM) or flash memory (flash RAM), and the memory includes at least one memory chip.
An embodiment of the present invention provides a storage medium on which a program is stored, the program implementing the command issuing method when executed by a processor.
The embodiment of the invention provides a processor, which is used for running a program, wherein the command issuing method is executed when the program runs.
The embodiment of the invention provides equipment, which comprises a processor, a memory and a program which is stored on the memory and can run on the processor, wherein the processor executes the program and realizes the following steps:
acquiring a first server list, wherein the first server list lists all online first servers; acquiring a plurality of first commands, wherein the first commands are commands which need to be issued to a second type server by a first type server in the first type server list; traversing the first type servers in the first type server list, and sequentially pushing the first command to the first type servers, wherein one first command is pushed to one first type server at a time.
Acquiring a second command to be issued, wherein the second command carries identification information of a plurality of second servers; and splitting each second command into a plurality of first commands, wherein each first command carries identification information of one second type server.
Sequencing the M first commands to obtain a 1 st first command, a 2 nd first command, a 8230command, an ith first command, a 8230command and an Mth first command; and pushing the ith first command to the ith first server in the first server list, wherein i sequentially takes 1 to M.
Polling the IP in the first type server list; sending a test command to a target server to obtain a test result, wherein the target server is the first type server corresponding to the polled IP; and determining whether to update the first type server list according to the test result.
If the test result indicates that the target server can work normally, keeping the first type server list unchanged; and if the test result indicates that the working state of the target server is abnormal, deleting the target server from the first class server list.
The device herein may be a server, a PC, a PAD, a mobile phone, etc.
The present application further provides a computer program product adapted to perform a program for initializing the following method steps when executed on a data processing device:
acquiring a first type server list, wherein the first type server list lists all online first type servers; acquiring a plurality of first commands, wherein the first commands are commands which need to be issued to a second server by a first server in the first server list; traversing the first class servers in the first class server list, and sequentially pushing the first command to the first class servers, wherein one first command is pushed to one first class server at a time.
Acquiring a second command to be issued, wherein the second command carries identification information of a plurality of second servers; and splitting each second command into a plurality of first commands, wherein each first command carries identification information of one second type server.
Sorting the M first commands to obtain a 1 st first command, a 2 nd first command, a 8230command, an ith first command, a 8230command and an Mth first command; and pushing the ith first command to the ith first server in the first server list, wherein i sequentially takes 1 to M.
Polling the IP in the first type server list; sending a test command to a target server to obtain a test result, wherein the target server is the first type server corresponding to the polled IP; and determining whether to update the first type server list according to the test result.
If the test result indicates that the target server can work normally, keeping the first type server list unchanged; and if the test result indicates that the working state of the target server is abnormal, deleting the target server from the first class server list.
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 flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations 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, including both non-transitory and non-transitory, removable and non-removable media, may implement 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 a," "8230," "8230," or "comprising" does not exclude the presence of additional identical elements in the process, method, article, or apparatus comprising the element.
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 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 to which the present application pertains. 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 (8)

1. A method for issuing a command, comprising:
acquiring a first server list, wherein the first server list lists all online first servers;
acquiring a plurality of first commands, wherein the first commands are commands which need to be issued to a second type server by a first type server in the first type server list;
traversing the first-class server list, and sequentially pushing the first command to the first-class servers, wherein one first command is pushed to one first-class server at a time;
wherein obtaining the plurality of first commands comprises:
acquiring a second command to be issued, wherein the second command carries identification information of a plurality of second servers;
and splitting each second command into a plurality of first commands, wherein each first command carries identification information of one second type server.
2. The method according to claim 1, wherein there are N first type servers in the first type server list, and there are M first commands, traversing the first type servers in the first type server list, and sequentially pushing the first commands to the first type servers includes:
sorting the M first commands to obtain a 1 st first command, a 2 nd first command, a 8230command, an ith first command, a 8230command and an Mth first command;
and pushing the ith first command to the ith first type server in the first type server list, wherein i sequentially takes 1 to M.
3. The method of claim 1, wherein obtaining the list of servers of the first type comprises:
polling the IP in the first type server list;
sending a test command to a target server to obtain a test result, wherein the target server is the first type server corresponding to the polled IP;
and determining whether to update the first type server list according to the test result.
4. The method of claim 3, wherein determining whether to update the first type of server list according to the test result comprises:
if the test result indicates that the target server can work normally, keeping the first type server list unchanged;
and if the test result indicates that the working state of the target server is abnormal, deleting the target server from the first class server list.
5. A command issuing apparatus, comprising:
the server management system comprises a first acquisition unit, a second acquisition unit and a third acquisition unit, wherein the first acquisition unit is used for acquiring a first server list, and the first server list lists all online first servers;
a second obtaining unit, configured to obtain a plurality of first commands, where the first commands are commands that need to be issued by the first class servers in the first class server list to a second class server;
the traversing unit is used for traversing the first-class server list and sequentially pushing the first command to the first-class servers, wherein one first command is pushed to one first-class server at a time;
wherein the second acquisition unit includes:
the acquiring subunit is configured to acquire a second command to be issued, where the second command carries identification information of multiple second servers;
and the splitting subunit is configured to split each second command into multiple first commands, where each first command carries identification information of one second server.
6. The apparatus of claim 5, wherein there are N servers of the first class in the list of servers of the first class, and wherein there are M first commands, and wherein the traversal unit comprises:
the sorting subunit is used for sorting the M first commands to obtain a 1 st first command, a 2 nd first command, a 8230command, an ith first command, an 8230command and an Mth first command;
and the pushing subunit is used for pushing the ith first command to the ith first-class server in the first-class server list, wherein i is sequentially from 1 to M.
7. A storage medium characterized by comprising a stored program, wherein the program executes the command issuing method of any one of claims 1 to 4.
8. An electronic device comprising one or more processors and memory storing one or more programs, wherein the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the command issuing method of any one of claims 1 to 4.
CN201710721247.6A 2017-08-21 2017-08-21 Command issuing method and device, storage medium and processor Active CN109426559B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710721247.6A CN109426559B (en) 2017-08-21 2017-08-21 Command issuing method and device, storage medium and processor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710721247.6A CN109426559B (en) 2017-08-21 2017-08-21 Command issuing method and device, storage medium and processor

Publications (2)

Publication Number Publication Date
CN109426559A CN109426559A (en) 2019-03-05
CN109426559B true CN109426559B (en) 2022-10-04

Family

ID=65497627

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710721247.6A Active CN109426559B (en) 2017-08-21 2017-08-21 Command issuing method and device, storage medium and processor

Country Status (1)

Country Link
CN (1) CN109426559B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115051918B (en) * 2021-03-09 2024-03-12 大唐移动通信设备有限公司 Control method, server, device and storage medium of network equipment

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101282249A (en) * 2007-04-27 2008-10-08 清华大学 Automatic log-on and management method for distributed internet measurement server
CN103024050A (en) * 2012-12-17 2013-04-03 北京奇虎科技有限公司 Distributor and distributing method for multiple servers
US8856211B1 (en) * 2010-09-30 2014-10-07 Amazon Technologies, Inc. Flexible network testing
CN105956481A (en) * 2015-09-17 2016-09-21 中国银联股份有限公司 Data processing method and device

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2003223444A (en) * 2002-01-30 2003-08-08 Fuji Photo Film Co Ltd Computer system and program to control computer system
US20070055768A1 (en) * 2005-08-23 2007-03-08 Cisco Technology, Inc. Method and system for monitoring a server

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101282249A (en) * 2007-04-27 2008-10-08 清华大学 Automatic log-on and management method for distributed internet measurement server
US8856211B1 (en) * 2010-09-30 2014-10-07 Amazon Technologies, Inc. Flexible network testing
CN103024050A (en) * 2012-12-17 2013-04-03 北京奇虎科技有限公司 Distributor and distributing method for multiple servers
CN105956481A (en) * 2015-09-17 2016-09-21 中国银联股份有限公司 Data processing method and device

Also Published As

Publication number Publication date
CN109426559A (en) 2019-03-05

Similar Documents

Publication Publication Date Title
CN107451147B (en) Method and device for dynamically switching kafka clusters
US9535754B1 (en) Dynamic provisioning of computing resources
CN107491371B (en) Deployment monitoring method and device
US10296411B1 (en) Endpoint call backoff in a computing service environment
CN109561128B (en) Data transmission method and device
CN111045811A (en) Task allocation method and device, electronic equipment and storage medium
CN112737800A (en) Service node fault positioning method, call chain generation method and server
CN109951326B (en) Data processing method, device, storage medium and processor
CN113656245A (en) Data inspection method and device, storage medium and processor
CN112583944B (en) Processing method and device for updating domain name certificate
CN109426559B (en) Command issuing method and device, storage medium and processor
CN112131196A (en) Distributed log processing method and device, terminal equipment and storage medium
CN104579753A (en) User data statistical method, access layer server and statistical server
CN115080309A (en) Data backup system, method, storage medium, and electronic device
CN114860432A (en) Method and device for determining information of memory fault
CN114691445A (en) Cluster fault processing method and device, electronic equipment and readable storage medium
CN112596974A (en) Full link monitoring method, device, equipment and storage medium
CN102868594B (en) Method and device for message processing
CN112579189A (en) Configuration file updating method and device
CN109428914B (en) Monitoring method and device, storage medium and processor
CN116567095B (en) Cloud computing distributed scheduling third party service grid system and method
CN112579145A (en) Application deployment method and device
CN117056583A (en) Method for analyzing message track data, first server and storage medium
CN114301709B (en) Message processing method and device, storage medium and computing equipment
CN117349384B (en) Database synchronization method, system and equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information

Address after: 100083 No. 401, 4th Floor, Haitai Building, 229 North Fourth Ring Road, Haidian District, Beijing

Applicant after: BEIJING GRIDSUM TECHNOLOGY Co.,Ltd.

Address before: 100086 Beijing city Haidian District Shuangyushu Area No. 76 Zhichun Road cuigongfandian 8 layer A

Applicant before: BEIJING GRIDSUM TECHNOLOGY Co.,Ltd.

CB02 Change of applicant information
GR01 Patent grant
GR01 Patent grant