CN104486378B - A kind of cluster control method and device - Google Patents
A kind of cluster control method and device Download PDFInfo
- Publication number
- CN104486378B CN104486378B CN201410696957.4A CN201410696957A CN104486378B CN 104486378 B CN104486378 B CN 104486378B CN 201410696957 A CN201410696957 A CN 201410696957A CN 104486378 B CN104486378 B CN 104486378B
- Authority
- CN
- China
- Prior art keywords
- host
- execution
- login password
- control end
- main control
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 84
- 238000012795 verification Methods 0.000 claims description 48
- 238000010586 diagram Methods 0.000 description 11
- 238000012423 maintenance Methods 0.000 description 10
- 230000006870 function Effects 0.000 description 6
- 238000012790 confirmation Methods 0.000 description 2
- 238000004519 manufacturing process Methods 0.000 description 2
- 238000013475 authorization Methods 0.000 description 1
- 238000004590 computer program Methods 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 238000004880 explosion Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/02—Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
- H04L67/025—Protocols based on web technology, e.g. hypertext transfer protocol [HTTP] for remote control or remote monitoring of applications
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Storage Device Security (AREA)
- Testing And Monitoring For Control Systems (AREA)
Abstract
The embodiment of the invention discloses a kind of cluster control method and devices, method therein can include: main control end receives the host identification for respectively corresponding each host, host login password and the host that user is arranged in configuration file and executes command set, and the host for respectively corresponding each host executes command set for detecting the respective operating condition of each host;The main control end sends connection request to each host parallel corresponding with the host identification being arranged in the configuration file;After the main control end and each host establish connection respectively, the configuration file is sent to each host by the main control end.Using the present invention, the process of clustered control can be simplified, reduce the time of clustered control process, realize that master control end equipment controls multiple host simultaneously, be greatly improved working efficiency.
Description
Technical Field
The present invention relates to the field of electronic communications, and in particular, to a cluster control method and apparatus.
Background
With the advent of the Information explosion age, IT (Information Technology) systems become increasingly large, and today's IT systems have become a huge online system. For the operation and maintenance of the current IT system, an administrator often needs to maintain dozens or hundreds of hosts of different systems such as Unix, Windows, and the like, the requirement for the maintenance of the IT system is higher and higher, and the administrator needs to perform a series of complex links such as login, password input, instruction typing, result confirmation, system quitting, and the like on each host when maintaining the IT system, so basically most of the administrator time is consumed in the links of newly opening a window, login, password input, repeated command execution, window switching, result confirmation, and the like, thereby resulting in complicated operation steps and time consumption of the operation and maintenance.
Disclosure of Invention
The technical problem to be solved by the embodiments of the present invention is to provide a cluster control method and apparatus, which can simplify the flow of cluster control, reduce the time of the cluster control process, and implement that a master control device controls multiple hosts at the same time, so that the multiple hosts execute commands, implement automation of operation and maintenance operations, and greatly improve the work efficiency.
In a first aspect, an embodiment of the present invention provides a cluster control method, including: the method comprises the steps that a main control end receives a host identifier, a host login password and a host execution command set which are set in a configuration file by a user and respectively correspond to each host, wherein the host execution command set respectively corresponding to each host is used for detecting the respective running condition of each host;
the master control end sends connection requests to all the hosts corresponding to the host identifiers set in the configuration file in parallel;
and after the main control end establishes connection with each host respectively, the main control end sends the configuration file to each host.
With reference to the first aspect, in a first possible implementation manner, before the main control end receives the host identifier, the host login password, and the host execution command set, which are set in the configuration file by the user and respectively correspond to each host, the method further includes:
the main control end receives starting requests of a plurality of host computer execution commands sent by the user;
the main control end prompts the user to input an execution password;
the main control terminal verifies whether the execution password input by the user is matched with a preset execution password, and the preset execution password is stored in the main control terminal;
the main control end receives the host identifiers, the host login passwords and the host execution command set which are set in the configuration file by the user and respectively correspond to the hosts, and the main control end comprises the following steps:
and when the execution password input by the user is matched with the preset execution password, the main control end receives the host identification, the host login password and the host execution command set which are respectively corresponding to the hosts and are set in the configuration file by the user.
With reference to the first aspect, in a second possible implementation manner, after the main control terminal verifies whether the execution password input by the user matches a preset execution password, before the main control terminal receives the host identifier, the host login password, and the host execution command set, which are set in the configuration file by the user and respectively correspond to each host, the method further includes:
and the main control end receives a dangerous command set in a configuration file by the user, wherein the dangerous command is used for forcibly stopping the operation of each host.
With reference to the first aspect, in a third possible implementation manner, after the main control end sends a connection request to each host corresponding to the host identifier set in the configuration file in parallel, the method further includes:
the main control end sets the mode of executing the command by each host computer to be serial execution;
after the main control end establishes connection with each host respectively, the main control end sequentially sends the configuration files to each host according to a predefined sequence;
the main control end sends the configuration files to the hosts in parallel, and the method comprises the following steps:
and when the main control end does not set the mode of executing the command by each host computer to be serial execution, the main control end sends the configuration file to each host computer in parallel.
With reference to the first aspect, in a fourth possible implementation manner, after the main control end sends the configuration file to each host, the method further includes:
and the main control end receives the execution result returned by each host.
In a second aspect, an embodiment of the present invention provides a cluster control method, including:
the host receives a connection request sent by a main control end;
the host receives a configuration file sent by the main control end, wherein the configuration file comprises a host identifier, a host login password and a host execution command set, which are set by a user and respectively correspond to each host, and the host execution command set respectively corresponding to each host is used for detecting the respective running condition of each host;
the host acquires a host login password corresponding to the host identity and a host execution command set from the configuration file;
the host checks whether the obtained host login password corresponding to the host identity is matched with a preset host login password, and the preset host login password is stored in the host;
and when the host login password corresponding to the host identity of the host is matched with a preset host login password, the host executes a host execution command in the host execution command set corresponding to the host.
With reference to the second aspect, in a first possible implementation manner, the configuration file further includes: and the danger command is set by the user and used for forcibly stopping the operation of each host.
With reference to the second aspect, in a second possible implementation manner, after the host checks whether the obtained host login password corresponding to the host identifier of the host matches a preset host login password, the method further includes:
when the host login password corresponding to the host identity of the host is matched with a preset host login password and a host execution command in a host execution command set to be executed by the host is the dangerous command, the host does not execute the dangerous command and prompts a command error so as to generate an execution result of the command error;
the host executes the host execution command in the host execution command set, including:
when the host execution command to be executed by the host currently is a non-dangerous command, the host normally executes the host execution command in the host execution command set, and generates an execution result corresponding to the host execution command.
With reference to the second aspect, in a third possible implementation manner, after the host obtains the host login password corresponding to the host identifier and the host execution command set from the configuration file, before the host verifies whether the obtained host login password corresponding to the host identifier matches a preset host login password, the method further includes:
the host judges whether the number of times of the obtained host login password corresponding to the host identity and the preset host login password are matched exceeds a preset verification number threshold or not;
when the number of times that the host verifies whether the obtained host login password corresponding to the host identity is matched with the preset host login password exceeds a preset verification number threshold value, the host does not execute the verification of whether the obtained host login password corresponding to the host identity is matched with the preset host login password, and prompts that the verification number exceeds the limit, so that an execution result that the verification number exceeds the limit is generated;
the host checks whether the obtained host login password corresponding to the host identity is matched with a preset host login password or not, and the method comprises the following steps:
when the number of times that the host verifies whether the obtained host login password corresponding to the host identity is matched with the preset host login password does not exceed a preset verification number threshold value, the host verifies whether the obtained host login password corresponding to the host identity is matched with the preset host login password.
With reference to the second aspect, in a fourth possible implementation manner, after the host executes the host execution command set, the method further includes:
and when the time for executing the host execution command set by the host exceeds a preset time threshold, the host stops executing the host execution command set and prompts timeout, so that an overtime execution result is generated.
With reference to the second aspect, in a fifth possible implementation manner, after the host executes the host execution command set, the method further includes:
and the host returns the execution result of the host to the main control end.
In a third aspect, an embodiment of the present invention provides a cluster control apparatus, including:
the first receiving module is used for receiving a host identifier, a host login password and a host execution command set which are respectively corresponding to each host and are set in a configuration file by a user, wherein the host execution command set respectively corresponding to each host is used for detecting the respective running condition of each host;
a first sending module, configured to send, by the master control end, a connection request in parallel to each host corresponding to the host identifier set in the configuration file;
and the second sending module is used for sending the configuration file to each host by the main control end after the main control end and each host establish connection respectively.
With reference to the third aspect, in a first possible implementation manner, the apparatus further includes:
the second receiving module is used for receiving a starting request of a plurality of host execution commands sent by the user by the main control end;
the prompting module is used for prompting the user to input an execution password by the main control end;
the verification module is used for verifying whether the execution password input by the user is matched with a preset execution password or not by the main control terminal, and the preset execution password is stored in the main control terminal;
the first receiving module is specifically configured to, when the execution password input by the user matches a preset execution password, receive, by the main control end, a host identifier, a host login password, and a host execution command set, which are set in a configuration file by the user and respectively correspond to each host.
With reference to the third aspect, in a second possible implementation manner, the apparatus further includes:
and a third receiving module, configured to receive, by the master control end, a dangerous command set in a configuration file by the user, where the dangerous command is used to forcibly stop operation of each host.
With reference to the third aspect, in a third possible implementation manner, the apparatus further includes:
the setting module is used for setting the mode of executing the command by each host computer to be serial execution by the main control end;
a third sending module, configured to, after the master control end establishes connections with the hosts, sequentially send the configuration files to the hosts according to a predefined order;
the second sending module is specifically configured to, when the master control end does not set the manner in which the hosts execute the commands to be executed in serial, send the configuration file to the hosts in parallel by the master control end.
With reference to the third aspect, in a fourth possible implementation manner, the apparatus further includes:
and the fourth receiving module is used for receiving the execution result returned by each host by the main control end.
In a fourth aspect, an embodiment of the present invention provides a cluster control apparatus, including:
the first receiving module is used for receiving a connection request sent by the main control end by the host;
a second receiving module, configured to receive, by the host, a configuration file sent by the master control end, where the configuration file includes a host identifier, a host login password, and a host execution command set, where the host identification, the host login password, and the host execution command set are set by a user and respectively correspond to each host, and the host execution command set respectively corresponding to each host is used to detect respective operating conditions of each host;
the acquisition module is used for the host to acquire a host login password and a host execution command set corresponding to the host identity from the configuration file;
the verification module is used for verifying whether the obtained host login password corresponding to the host identity is matched with a preset host login password or not by the host, and the preset host login password is stored in the host;
and the execution module is used for executing the host execution command in the host execution command set corresponding to the host when the host login password corresponding to the host identifier of the host matches with the preset host login password.
With reference to the fourth aspect, in a first possible implementation manner, the configuration file further includes: and the danger command is set by the user and used for forcibly stopping the operation of each host.
With reference to the fourth aspect, in a second possible implementation manner, the apparatus further includes:
the first generation module is used for not executing the dangerous command and prompting a command error when the host login password corresponding to the host identity is matched with a preset host login password and a host execution command in a host execution command set to be executed by the host is the dangerous command, so that an execution result of the command error is generated;
the execution module is specifically configured to, when a host execution command to be executed by the host currently is a non-dangerous command, normally execute the host execution command in the host execution command set by the host, and generate an execution result corresponding to the host execution command.
With reference to the fourth aspect, in a third possible implementation manner, the apparatus further includes:
the judging module is used for judging whether the number of times of the obtained host login password corresponding to the host identity and the preset host login password for verifying whether matching exceeds a preset verification number threshold or not by the host;
the second generation module is used for not executing the verification of whether the acquired host login password corresponding to the host identity is matched with the preset host login password or not by the host when the number of times that the host verifies whether the acquired host login password corresponding to the host identity is matched with the preset host login password exceeds a preset verification number threshold value, and prompting that the verification number exceeds the limit, so that an execution result that the verification number exceeds the limit is generated;
the verification module is specifically configured to, when the number of times that the host verifies whether the obtained host login password corresponding to the host identifier of the host matches the preset host login password does not exceed a preset verification number threshold, verify by the host whether the obtained host login password corresponding to the host identifier of the host matches the preset host login password.
With reference to the fourth aspect, in a fourth possible implementation manner, the apparatus further includes:
and the third generation module is used for stopping executing the host execution command set and prompting timeout when the time for executing the host execution command set by the host exceeds a preset time threshold value, so that an overtime execution result is generated.
With reference to the fourth aspect, in a fifth possible implementation manner, the apparatus further includes:
and the return module is used for returning the execution result of the host to the main control end by the host.
By implementing the embodiment of the invention, the main control end equipment can simultaneously control a plurality of hosts, so that the plurality of hosts can execute the operation command in parallel, the execution result is returned to the main control end, the realization of one-time input and parallel multi-time execution can simplify the flow of cluster control, reduce the time of the cluster control process, realize the operation automation of operation and maintenance, greatly improve the working efficiency, really ensure the quick positioning of production faults by the return result of the plurality of hosts, and enable each host to shield the operation of dangerous commands.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
FIG. 1 is a schematic flow chart of a cluster control method provided by the present invention; (ii) a
Fig. 2 is a schematic flow chart of a cluster control method according to another embodiment of the present invention;
fig. 3 is a schematic flow chart of a cluster control method according to another embodiment of the present invention;
fig. 4 is a schematic flowchart of a cluster control method according to another embodiment of the present invention;
fig. 5 is a schematic flowchart of a cluster control method according to another embodiment of the present invention;
fig. 6 is a schematic flowchart of a cluster control method according to another embodiment of the present invention;
fig. 7 is a schematic structural diagram of a cluster control apparatus provided in the present invention;
fig. 8 is a schematic structural diagram of a cluster control apparatus according to another embodiment of the present invention;
fig. 9 is a schematic structural diagram of a cluster control apparatus according to another embodiment of the present invention;
fig. 10 is a schematic structural diagram of a cluster control apparatus according to another embodiment of the present invention;
fig. 11 is a schematic structural diagram of a cluster control apparatus according to another embodiment of the present invention;
fig. 12 is a schematic structural diagram of a cluster control apparatus according to another embodiment of the present invention.
Detailed Description
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 is to be understood that the terminology used in the embodiments of the invention herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. As used in the examples of the present invention and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items.
The embodiment of the invention provides a cluster control method and a cluster control device, which can simplify the process of cluster control, reduce the time of a cluster control process and realize that a master control end device simultaneously controls a plurality of hosts, so that the plurality of hosts execute commands, the operation automation of operation and maintenance is realized, and the working efficiency can be greatly improved. In order to facilitate understanding of the embodiments of the present invention, a cluster control method according to the embodiments of the present invention is described below.
Referring to fig. 1, it is a schematic flow chart of a cluster control method provided in the present invention, where the method is applied to a master control end, and the method includes:
step S101: the method comprises the steps that a main control end receives a host identifier, a host login password and a host execution command set which are set in a configuration file by a user and respectively correspond to each host, wherein the host execution command set respectively corresponding to each host is used for detecting the respective running condition of each host;
specifically, the master control end, that is, the control end that controls each host to execute commands, performs unified management on each host at the controlled end, so that each host at the controlled end performs operations and execution and the like according to the commands sent by the master control end, where each host may be in a different place or local place with respect to the master control end, and the system of the hosts includes but is not limited to: unix systems and Windows systems. The main control end receives a host identifier, a host login password and a host execution command set which are set in a configuration file by a user and respectively correspond to each host, wherein each host comprises at least one host, and the host identifier can include but is not limited to: the host number, the IP address of the host, and the MAC address of the host, and the host execution command sets of different hosts may be the same or different. The operation condition of each host can be reflected by each host through executing the host execution command in each host execution command set.
Step S103: the master control end sends connection requests to all the hosts corresponding to the host identifiers set in the configuration file in parallel;
specifically, the master control end retrieves the configuration file, obtains the host identifiers set in the configuration file, and simultaneously sends a connection establishment request to each host corresponding to the host identifiers.
Step S105: and after the main control end establishes connection with each host respectively, the main control end sends the configuration file to each host.
Specifically, after the master control end successfully establishes a connection with each host corresponding to each host identifier in the configuration file, the master control end sends the configuration file to each host respectively.
Further, as shown in fig. 2, a flowchart of a cluster control method according to another embodiment of the present invention is applied to a master control end, and the method includes:
step S201: the main control end receives starting requests of a plurality of host computer execution commands sent by the user;
specifically, the main control end receives a starting request of a command executed by a plurality of hosts sent by a user, so as to start a configuration flow of the command executed by the plurality of hosts in parallel.
Step S203: the main control end prompts the user to input an execution password;
specifically, the main control end displays an area for inputting the execution password on a display interface, and prompts the user to input the execution password.
Step S205: the main control terminal verifies whether the execution password input by the user is matched with a preset execution password, and the preset execution password is stored in the main control terminal;
specifically, a user inputs an execution password in an execution password input area in a display interface of a main control terminal, and the main control terminal verifies whether the execution password input by the user matches with an execution password pre-stored in the main control terminal.
Step S207: when the execution password input by the user is matched with a preset execution password, the main control end receives a host identifier, a host login password and a host execution command set which are set in a configuration file by the user and respectively correspond to each host;
specifically, when the execution password input by the user matches with the execution password pre-stored in the main control terminal, the main control terminal starts to receive the host identifier, the host login password, and the host execution command set, which are set in the configuration file by the user and respectively correspond to each host. The main control end is a control end for controlling each host to execute commands, and the host at the controlled end is managed in a unified way, so that each host at the controlled end operates and executes according to the commands sent by the main control end, and the like, wherein each host can be in different places or local places relative to the main control end, and the system of the host includes but is not limited to: unix systems and Windows systems. The main control end receives a host identifier, a host login password and a host execution command set which are set in a configuration file by a user and respectively correspond to each host, wherein each host comprises at least one host, and the host identifier can include but is not limited to: the host number, the IP address of the host, and the MAC address of the host, and the host execution command sets of different hosts may be the same or different. The operation condition of each host can be reflected by each host through executing the host execution command in each host execution command set.
Step S209: the master control end sends connection requests to all the hosts corresponding to the host identifiers set in the configuration file in parallel;
specifically, the master control end retrieves the configuration file, obtains the host identifiers set in the configuration file, and simultaneously sends a connection establishment request to each host corresponding to the host identifiers.
Step S211: after the main control end establishes connection with each host respectively, the main control end sends the configuration file to each host;
specifically, after the master control end successfully establishes a connection with each host corresponding to each host identifier in the configuration file, the master control end sends the configuration file to each host respectively.
Step S213: and the main control end receives the execution result returned by each host.
Specifically, the main control end receives execution results returned after all hosts corresponding to the host identifiers in the configuration file execute the host execution command set, and according to the execution results of the hosts, an operator of the main control end checks the execution results and quickly locates a faulty host according to the execution results.
Further, as shown in fig. 3, a flowchart of a cluster control method according to another embodiment of the present invention is applied to a master control end, and the method includes:
step S301: the main control end receives starting requests of a plurality of host computer execution commands sent by the user;
specifically, the main control end receives a starting request of a command executed by a plurality of hosts sent by a user, so as to start a configuration flow of the command executed by the plurality of hosts in parallel.
Step S303: the main control end prompts the user to input an execution password;
specifically, the main control end displays an area for inputting the execution password on a display interface, and prompts the user to input the execution password.
Step S305: the main control terminal verifies whether the execution password input by the user is matched with a preset execution password, and the preset execution password is stored in the main control terminal;
specifically, a user inputs an execution password in an execution password input area in a display interface of a main control terminal, and the main control terminal verifies whether the execution password input by the user matches with an execution password pre-stored in the main control terminal.
Step S307: the main control end receives a dangerous command set by the user in a configuration file, wherein the dangerous command is used for forcibly stopping the operation of each host;
specifically, the hazard command may include, but is not limited to: the user can independently set a dangerous command during halt operations such as halt, shutdown and the like, and when the host executes the host executing command, if the host encounters the dangerous command, the dangerous command can be automatically shielded, so that the phenomenon that the host needs to be restarted and further cannot be tested for a long time due to halt caused by the host executing the dangerous command is avoided.
Step S309: when the execution password input by the user is matched with a preset execution password, the main control end receives a host identifier, a host login password and a host execution command set which are set in a configuration file by the user and respectively correspond to each host;
specifically, when the execution password input by the user matches with the execution password pre-stored in the main control terminal, the main control terminal starts to receive the host identifier, the host login password, and the host execution command set, which are set in the configuration file by the user and respectively correspond to each host. The main control end is a control end for controlling each host to execute commands, and the host at the controlled end is managed in a unified way, so that each host at the controlled end operates and executes according to the commands sent by the main control end, and the like, wherein each host can be in different places or local places relative to the main control end, and the system of the host includes but is not limited to: unix systems and Windows systems. The main control end receives a host identifier, a host login password and a host execution command set which are set in a configuration file by a user and respectively correspond to each host, wherein each host comprises at least one host, and the host identifier can include but is not limited to: the host number, the IP address of the host, and the MAC address of the host, and the host execution command sets of different hosts may be the same or different. The operation condition of each host can be reflected by each host through executing the host execution command in each host execution command set.
Step S311: the master control end sends connection requests to all the hosts corresponding to the host identifiers set in the configuration file in parallel;
specifically, the master control end retrieves the configuration file, obtains the host identifier set in the configuration file, and simultaneously sends a connection request to each host corresponding to the host identifier.
Step S313: judging whether the main control end sets the mode of executing the commands of each host computer to be serial execution;
specifically, the command execution manner of each host may be serial execution or parallel execution, if the host sets the command execution manner of each host to be serial execution, the process proceeds to step S315, and if the host does not set the command execution manner of each host to be serial execution, the process proceeds to step S317.
Step S315: the main control end sequentially sends the configuration files to the hosts according to a predefined sequence;
specifically, the master control end sends the configuration files to the hosts one by one according to a predefined sequence.
Step S317: the main control end sends the configuration files to all the hosts in parallel;
specifically, when the master control end does not set the mode of executing the command by each host to be serial execution, the master control end simultaneously sends the configuration file to each host in a parallel mode.
Step S319: and the main control end receives the execution result returned by each host.
Specifically, the main control end receives execution results returned after all hosts corresponding to the host identifiers in the configuration file execute the host execution command set, and according to the execution results of the hosts, an operator of the main control end checks the execution results and quickly locates a faulty host according to the execution results.
Further, as shown in fig. 4, a flowchart of a cluster control method according to another embodiment of the present invention is applied to a host, and the method includes:
step S401: the host receives a connection request sent by a main control end;
specifically, each host receives a connection establishment request sent by a master control end, the host is a controlled end, that is, is controlled by the master control end, so as to perform corresponding operations and execution according to a command sent by the master control end, the host may be in a different place or local place relative to the master control end, and a system of the host includes but is not limited to: unix systems and Windows systems.
Step S403: the host receives a configuration file sent by the main control end, wherein the configuration file comprises a host identifier, a host login password and a host execution command set, which are set by a user and respectively correspond to each host, and the host execution command set respectively corresponding to each host is used for detecting the respective running condition of each host;
specifically, each host receives the configuration file sent by the master control end, where the host identifier may include but is not limited to: the host number, the IP address of the host, and the MAC address of the host, and the host execution command sets of different hosts may be the same or different. The operation condition of each host can be reflected by each host through executing the host execution command in each host execution command set.
Step S405: the host acquires a host login password corresponding to the host identity and a host execution command set from the configuration file;
specifically, the host parses the configuration file, so as to obtain a host login password and a host execution command set corresponding to the host identifier in the configuration file.
Specifically, the host parses the configuration file, and obtains a host login password and a host execution command set corresponding to the host identifier of the host from the configuration file according to the host identifier such as the host number of the host, the IP address of the host, or the MAC address of the host.
Step S407: the host checks whether the obtained host login password corresponding to the host identity is matched with a preset host login password, and the preset host login password is stored in the host;
specifically, the host checks whether the acquired host login password corresponding to the host identifier of the host matches a host login password pre-stored in the host.
Step S409: and when the host login password corresponding to the host identity of the host is matched with a preset host login password, the host executes a host execution command in the host execution command set corresponding to the host.
Specifically, when the host verifies that the obtained host login password corresponding to the host identifier of the host matches a host login password pre-stored in the host, the host executes a host execution command in the host execution command set corresponding to the host obtained from the configuration file.
Further, as shown in fig. 5, a flowchart of a cluster control method according to another embodiment of the present invention is applied to a host, and the method includes:
step S501: the host receives a connection request sent by a main control end;
specifically, each host receives a connection establishment request sent by a master control end, the host is a controlled end, that is, is controlled by the master control end, so as to perform corresponding operations and execution according to a command sent by the master control end, the host may be in a different place or local place relative to the master control end, and a system of the host includes but is not limited to: unix systems and Windows systems.
Step S503: the host receives a configuration file sent by the master control end, the configuration file includes a host identifier, a host login password and a host execution command set, the host identification, the host login password and the host execution command set are respectively corresponding to each host, the host execution command set respectively corresponding to each host is used for detecting respective operation conditions of each host, and the configuration file further includes: the dangerous command is used for forcibly stopping the operation of each host;
specifically, each host receives the configuration file sent by the master control end, where the host identifier may include but is not limited to: the host number, the IP address of the host, and the MAC address of the host, and the host execution command sets of different hosts may be the same or different. Each host can reflect the operation condition of each host by executing the host execution command in each host execution command set, and the dangerous command can include but is not limited to: the user can independently set a dangerous command during halt operations such as halt, shutdown and the like, and when the host executes the host executing command, if the host encounters the dangerous command, the dangerous command can be automatically shielded, so that the phenomenon that the host needs to be restarted and further cannot be tested for a long time due to halt caused by the host executing the dangerous command is avoided.
Step S505: the host acquires a host login password corresponding to the host identity and a host execution command set from the configuration file;
specifically, the host parses the configuration file, so as to obtain a host login password and a host execution command set corresponding to the host identifier in the configuration file.
Specifically, the host parses the configuration file, and obtains a host login password and a host execution command set corresponding to the host identifier of the host from the configuration file according to the host identifier such as the host number of the host, the IP address of the host, or the MAC address of the host.
Step S507: the host checks whether the obtained host login password corresponding to the host identity is matched with a preset host login password, and the preset host login password is stored in the host;
specifically, the host checks whether the obtained host login password corresponding to the host identifier of the host matches a host login password pre-stored in the host, if the host checks that the obtained host login password corresponding to the host identifier of the host matches a preset host login password, the step S509 is performed, and if the obtained host login password corresponding to the host identifier of the host does not match the preset host login password, the step S503 is performed to re-receive the configuration file retransmitted by the master control end.
Step S509: judging whether a host execution command in a host execution command set to be executed by the host currently is the dangerous command or not;
specifically, if the host execution command in the host execution command set to be executed by the host currently is the dangerous command, the process proceeds to step S511, and if the host execution command in the host execution command set to be executed by the host currently is not the dangerous command, the process proceeds to step S513.
Step S511: the host does not execute the dangerous command and prompts a command error, so that an execution result of the command error is generated;
specifically, when a host execution command in a host execution command set to be executed by the host currently is the dangerous command, the host shields the dangerous command, pops up a prompt box with a command error in the host, and generates an execution result with the command error.
Step S513: the host normally executes the host execution command in the host execution command set and generates an execution result corresponding to the host execution command;
specifically, when the host execution command in the host execution command set to be executed by the host currently is a non-dangerous command, the host normally executes the host execution command set, sequentially executes the host execution commands in the host execution command set according to the sequence of the host execution commands in the host command set, and generates an execution result corresponding to the host execution command according to the sequence of the host execution commands.
Step S515: the host returns the execution result of the host to the main control end;
specifically, after the host executes all host execution commands in the host execution command set, the host returns all execution results to the master control end.
Further, as shown in fig. 6, a flowchart of a cluster control method according to another embodiment of the present invention is applied to a host, and the method includes:
step S601: the host receives a connection request sent by a main control end;
specifically, each host receives a connection establishment request sent by a master control end, the host is a controlled end, that is, is controlled by the master control end, so as to perform corresponding operations and execution according to a command sent by the master control end, the host may be in a different place or local place relative to the master control end, and a system of the host includes but is not limited to: unix systems and Windows systems.
Step S603: the host receives a configuration file sent by the master control end, the configuration file includes a host identifier, a host login password and a host execution command set, the host identification, the host login password and the host execution command set are respectively corresponding to each host, the host execution command set respectively corresponding to each host is used for detecting respective operation conditions of each host, and the configuration file further includes: the dangerous command is used for forcibly stopping the operation of each host;
specifically, each host receives the configuration file sent by the master control end, where the host identifier may include but is not limited to: the host number, the IP address of the host, and the MAC address of the host, and the host execution command sets of different hosts may be the same or different. Each host can reflect the operation condition of each host by executing the host execution command in each host execution command set, and the dangerous command can include but is not limited to: the user can independently set a dangerous command during halt operations such as halt, shutdown and the like, and when the host executes the host executing command, if the host encounters the dangerous command, the dangerous command can be automatically shielded, so that the phenomenon that the host needs to be restarted and further cannot be tested for a long time due to halt caused by the host executing the dangerous command is avoided.
Step S605: the host acquires a host login password corresponding to the host identity and a host execution command set from the configuration file;
specifically, the host parses the configuration file, so as to obtain a host login password and a host execution command set corresponding to the host identifier in the configuration file.
Specifically, the host parses the configuration file, and obtains a host login password and a host execution command set corresponding to the host identifier of the host from the configuration file according to the host identifier such as the host number of the host, the IP address of the host, or the MAC address of the host.
Step S607: the host judges whether the number of times of the obtained host login password corresponding to the host identity and the preset host login password are matched exceeds a preset verification number threshold or not;
specifically, the host may preset a verification number threshold, and if the host determines that the number of times for verifying whether the obtained host login password corresponding to the host identifier matches the preset host login password exceeds the preset verification number threshold, the process proceeds to step S609, and if the host determines that the number of times for verifying whether the obtained host login password corresponding to the host identifier matches the preset host login password does not exceed the preset verification number threshold, the process proceeds to step S611.
Step S609: the host does not execute the verification to determine whether the obtained host login password corresponding to the host identity is matched with a preset host login password or not, and prompts that the verification times are over, so that an execution result that the verification times are over is generated;
specifically, when the host determines that the number of times for verifying whether the obtained host login password corresponding to the host identity is matched with the preset host login password exceeds a preset verification number threshold, the host does not perform the step of verifying whether the obtained host login password corresponding to the host identity is matched with the preset host login password, and pops up a prompt box that the verification number is over-limit in the host to generate an execution result that the verification number is over-limit.
Step S611: the host checks whether the obtained host login password corresponding to the host identity is matched with a preset host login password or not;
specifically, the host checks whether the obtained host login password corresponding to the host identifier of the host matches a host login password pre-stored in the host, if the host checks that the obtained host login password corresponding to the host identifier of the host matches a preset host login password, the step S613 is performed, and if the obtained host login password corresponding to the host identifier of the host does not match the preset host login password, the step S603 is performed to re-receive the configuration file retransmitted by the main control end.
Step S613: judging whether a host execution command in a host execution command set to be executed by the host currently is the dangerous command or not;
specifically, if the host execution command in the host execution command set to be executed by the host is the dangerous command, the process proceeds to step S615, and if the host execution command in the host execution command set to be executed by the host is not the dangerous command, the process proceeds to step S617.
Step S615: the host does not execute the dangerous command and prompts a command error, so that an execution result of the command error is generated;
specifically, when a host execution command in a host execution command set to be executed by the host currently is the dangerous command, the host shields the dangerous command, pops up a prompt box with a command error in the host, and generates an execution result with the command error.
Step S617: the host normally executes the host execution command in the host execution command set and generates an execution result corresponding to the host execution command;
specifically, when the host execution command in the host execution command set to be executed by the host currently is a non-dangerous command, the host normally executes the host execution command set, sequentially executes the host execution commands in the host execution command set according to the sequence of the host execution commands in the host command set, and generates an execution result corresponding to the host execution command according to the sequence of the host execution commands.
Step S619: judging whether the time for the host to execute the host execution command set exceeds a preset time threshold value or not;
specifically, the host may preset a time threshold for the host to execute the host execution command set, and if the time for the host to execute the host execution command set exceeds a preset time threshold, step S621 is performed, and if the time for the host to execute the host execution command set does not exceed the preset time threshold, step S617 is continuously performed.
Step S621: the host stops executing the host execution command set and prompts timeout, so that an overtime execution result is generated;
specifically, when the time for executing the host execution command set by the host exceeds a preset time threshold, the host stops executing the host execution command set, and pops up an overtime prompt box in the host to generate an overtime execution result.
Step S623: and the host returns the execution result of the host to the main control end.
Specifically, after the host executes all host execution commands in the host execution command set, the host returns all execution results to the master control end.
While the method of the embodiments of the present invention has been described in detail, in order to better implement the above-described aspects of the embodiments of the present invention, the following also provides related apparatus for implementing the aspects.
As shown in fig. 7, the cluster control device 70 includes: a first receiving module 701, a first sending module 703 and a second sending module 705, wherein:
a first receiving module 701, configured to receive, by a master control end, a host identifier, a host login password, and a host execution command set, where the host identifier, the host login password, and the host execution command set are set in a configuration file by a user and respectively correspond to each host, where the host execution command set respectively corresponding to each host is used to detect respective operating conditions of each host;
a first sending module 703, configured to send, by the master control end, a connection request to each host corresponding to the host identifier set in the configuration file in parallel;
a second sending module 705, configured to send the configuration file to each host by the master control end after the master control end establishes a connection with each host.
It is understood that the functions of the functional modules of the cluster control device 70 of this embodiment can be specifically implemented according to the method of the embodiment of fig. 1, and are not described herein again.
Further, as shown in fig. 8, which is a schematic structural diagram of a cluster control apparatus according to another embodiment of the present invention, the cluster control apparatus 80 includes: the first receiving module 701, the first sending module 703 and the second sending module 705 further include a second receiving module 707, a prompting module 709, a checking module 711 and a fourth receiving module 713, where:
the first receiving module is specifically configured to, when the execution password input by the user matches a preset execution password, receive, by the main control end, a host identifier, a host login password, and a host execution command set, which are set in a configuration file by the user and respectively correspond to each host.
A second receiving module 707, configured to receive, by the master controller, a start request for executing a command by multiple hosts sent by the user;
a prompting module 709, configured to prompt the user to input an execution password by the main control end;
a verification module 711, configured to verify, by the master control end, whether an execution password input by the user matches a preset execution password, where the preset execution password is stored in the master control end;
a fourth receiving module 713, configured to receive, by the master controller, the execution result returned by each host.
It is understood that the functions of the functional modules of the cluster control device 80 of this embodiment can be specifically implemented according to the method of the embodiment of the method in fig. 2, and are not described herein again.
Further, as shown in fig. 9, which is a schematic structural diagram of a cluster control apparatus according to another embodiment of the present invention, a cluster control apparatus 90 includes: the system comprises a first receiving module 701, a first sending module 703, a second sending module 705, a second receiving module 707, a prompting module 709, a checking module 711 and a fourth receiving module 713, and further comprises a third receiving module 715, a setting module 717 and a third sending module 719, wherein:
a third receiving module 715, configured to receive, by the master controller, a dangerous command set in a configuration file by the user, where the dangerous command is used to forcibly stop operation of each host;
a setting module 717, configured to set, by the master controller, a manner in which the host executes the commands to be serial execution;
a third sending module 719, configured to, after the master control end establishes connections with the hosts, sequentially send the configuration files to the hosts according to a predefined order;
the second sending module 705 is specifically configured to, when the master control end does not set the manner in which the host executes the command to be serial execution, send the configuration file to the hosts in parallel by the master control end.
It is understood that the functions of the functional modules of the cluster control device 90 of this embodiment can be specifically implemented according to the method of the embodiment of the method in fig. 3, and are not described herein again.
Further, as shown in fig. 10, which is a schematic structural diagram of a cluster control apparatus according to another embodiment of the present invention, the cluster control apparatus 100 includes: a first receiving module 1001, a second receiving module 1003, an obtaining module 1005, a checking module 1007 and an executing module 1009, wherein:
a first receiving module 1001, configured to receive, by a host, a connection request sent by a master control end;
a second receiving module 1003, configured to receive, by the host, a configuration file sent by the master control end, where the configuration file includes a host identifier, a host login password, and a host execution command set, where the host identification, the host login password, and the host execution command set are set by a user and respectively correspond to each host, and the host execution command set respectively corresponding to each host is used to detect respective operating conditions of each host;
an obtaining module 1005, configured to obtain, by the host, a host login password and a host execution command set corresponding to a host identifier of the host from the configuration file;
a checking module 1007, configured to check, by the host, whether the obtained host login password corresponding to the host identifier of the host matches a preset host login password, where the preset host login password is stored in the host;
the executing module 1009 is configured to, when the host login password corresponding to the host identifier matches a preset host login password, execute a host execution command in the host execution command set corresponding to the host by the host.
It is understood that the functions of the functional modules of the cluster control apparatus 100 of the present embodiment can be specifically implemented according to the method of the embodiment of the method in fig. 4, and are not described herein again.
Further, as shown in fig. 11, which is a schematic structural diagram of a cluster control apparatus according to another embodiment of the present invention, the cluster control apparatus 110 includes: the system comprises a first generation module 1011 and a return module 1013 in addition to the first receiving module 1001, the second receiving module 1003, the obtaining module 1005, the checking module 1007 and the executing module 1009, wherein:
a first generating module 1011, configured to, when the host login password corresponding to the host identifier matches a preset host login password, and a host execution command in a host execution command set to be executed by the host currently is the dangerous command, not execute the dangerous command by the host, and prompt a command error, so as to generate an execution result of the command error;
the executing module 1009 is specifically configured to, when the host execution command that the host currently needs to execute is a non-dangerous command, normally execute the host execution command in the host execution command set by the host, and generate an execution result corresponding to the host execution command;
a returning module 1013, configured to return, by the host, an execution result of the host to the master.
It is understood that the functions of the functional modules of the cluster control device 110 in this embodiment can be specifically implemented according to the method in the embodiment of the method in fig. 5, and are not described herein again.
Further, as shown in fig. 12, which is a schematic structural diagram of a cluster control apparatus according to another embodiment of the present invention, the cluster control apparatus 120 includes: the system comprises a first receiving module 1001, a second receiving module 1003, an obtaining module 1005, a checking module 1007, an executing module 1009, a first generating module 1011, and a returning module 1013, and further comprises a judging module 1015, a second generating module 1017, and a third generating module 1019, wherein:
a determining module 1015, configured to determine whether the number of times for verifying whether the obtained host login password corresponding to the host identifier matches a preset host login password exceeds a preset verification number threshold;
a second generating module 1017, configured to, when the number of times that the host verifies whether the obtained host login password corresponding to the host identifier of the host matches the preset host login password exceeds the preset verification number threshold, the host does not perform the verification whether the obtained host login password corresponding to the host identifier of the host matches the preset host login password, and prompts that the verification number is exceeded, thereby generating an execution result that the verification number is exceeded;
the checking module 1007 is specifically configured to, when the number of times that the host checks whether the obtained host login password corresponding to the host identifier matches the preset host login password does not exceed a preset check number threshold, check by the host whether the obtained host login password corresponding to the host identifier matches the preset host login password;
a third generating module 1019, configured to, when the time for the host to execute the host execution command set exceeds a preset time threshold, stop executing the host execution command set by the host, and prompt timeout, so as to generate a timeout execution result.
It is understood that the functions of the functional modules of the cluster control device 120 of this embodiment can be specifically implemented according to the method of the embodiment of the method in fig. 6, and are not described herein again.
In summary, by implementing the embodiments of the present invention, it is achieved that the master device can control multiple hosts simultaneously, thereby realizing the parallel execution of the operation commands by a plurality of hosts and returning the execution result to the main control end, simplifying the flow of cluster control by realizing one-time input and parallel multi-time execution, reducing the time of the cluster control process, realizing the operation automation of operation and maintenance, can greatly improve the working efficiency, and simultaneously ensure the quick positioning of production faults through the return results of a plurality of hosts, the implementation of the embodiment of the invention can greatly save the operation and maintenance manpower for the operation and maintenance of the IT system, improve the quality and the working efficiency of the operation and maintenance of the IT system, and greatly improve the security of the cluster system by realizing a double authorization mechanism of the execution password of the main control end and the login password of each host.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by a computer program, which can be stored in a computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. The storage medium may be a magnetic disk, an optical disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), or the like.
While the invention has been described with reference to a preferred embodiment, it will be understood by those skilled in the art that various changes in form and detail may be made therein without departing from the spirit and scope of the invention as defined by the appended claims.
Claims (14)
1. A cluster control method, comprising:
the method comprises the steps that a main control end receives a host identifier, a host login password and a host execution command set which are set in a configuration file by a user and respectively correspond to each host, wherein the host execution command set respectively corresponding to each host is used for detecting the respective running condition of each host;
the master control end sends connection requests to all the hosts corresponding to the host identifiers set in the configuration file in parallel;
after the main control end establishes connection with each host respectively, the main control end sends the configuration file to each host;
the main control end receives the execution result returned by each host; if the number of times that each host judges whether the host login password corresponding to the host identifier obtained from the host login password is matched with the preset host login password exceeds the preset verification number threshold value, the execution result is that the verification number exceeds the limit; if the host execution command in the host execution command set to be executed by each host currently is a dangerous command, the execution result is a command error; if the host executing commands in the host executing command set are normally executed by the hosts, the executing result is the executing result of the host executing commands executed by the hosts; and if the time for executing the host execution command set by each host exceeds a preset time threshold, the execution result is that the execution command is overtime, and the execution result is used for positioning the fault machine by the main control end.
2. The method according to claim 1, wherein before the host receives the host identifier, the host login password, and the host execution command set, which are set in the configuration file and respectively correspond to each host by the user, the method further comprises:
the main control end receives starting requests of a plurality of host computer execution commands sent by the user;
the main control end prompts the user to input an execution password;
the main control terminal verifies whether the execution password input by the user is matched with a preset execution password, and the preset execution password is stored in the main control terminal;
the main control end receives the host identifiers, the host login passwords and the host execution command set which are set in the configuration file by the user and respectively correspond to the hosts, and the main control end comprises the following steps:
and when the execution password input by the user is matched with the preset execution password, the main control end receives the host identification, the host login password and the host execution command set which are respectively corresponding to the hosts and are set in the configuration file by the user.
3. The method according to claim 2, wherein after the master terminal verifies whether the execution password input by the user matches a preset execution password, before the master terminal receives the host identifier, the host login password, and the host execution command set, which are set in the configuration file and respectively correspond to each host, of the user, the method further comprises:
and the main control end receives a dangerous command set in a configuration file by the user, wherein the dangerous command is used for forcibly stopping the operation of each host.
4. The method according to claim 1, wherein after the master controller sends connection requests to the hosts corresponding to the host identifiers set in the configuration file in parallel, the method further comprises:
the main control end sets the mode of executing the command by each host computer to be serial execution;
after the main control end establishes connection with each host respectively, the main control end sequentially sends the configuration files to each host according to a predefined sequence;
the main control end sends the configuration files to the hosts in parallel, and the method comprises the following steps:
and when the main control end does not set the mode of executing the command by each host computer to be serial execution, the main control end sends the configuration file to each host computer in parallel.
5. A cluster control method, comprising:
the host receives a connection request sent by a main control end;
the host receives a configuration file sent by the main control end, wherein the configuration file comprises a host identifier, a host login password and a host execution command set, which are set by a user and respectively correspond to each host, and the host execution command set respectively corresponding to each host is used for detecting the respective running condition of each host;
the host acquires a host login password corresponding to the host identity and a host execution command set from the configuration file;
the host checks whether the obtained host login password corresponding to the host identity is matched with a preset host login password, and the preset host login password is stored in the host;
when the host login password corresponding to the host identity of the host is matched with a preset host login password, the host executes a host execution command in a host execution command set corresponding to the host;
when the host login password corresponding to the host identity of the host is matched with a preset host login password and a host execution command in a host execution command set to be executed by the host is a dangerous command, the host does not execute the dangerous command and prompts a command error so as to generate an execution result of the command error;
or,
when the host execution command to be executed by the host currently is a non-dangerous command, the host normally executes the host execution command in the host execution command set and generates an execution result corresponding to the host execution command;
or,
the host judges whether the number of times of the obtained host login password corresponding to the host identity and the preset host login password are matched exceeds a preset verification number threshold or not;
when the number of times that the host verifies whether the obtained host login password corresponding to the host identity is matched with the preset host login password exceeds a preset verification number threshold value, the host does not execute the verification of whether the obtained host login password corresponding to the host identity is matched with the preset host login password, and prompts that the verification number exceeds the limit, so that an execution result that the verification number exceeds the limit is generated;
or,
when the time for executing the host computer execution command set by the host computer exceeds a preset time threshold value, the host computer stops executing the host computer execution command set and prompts overtime, so that an overtime execution result is generated;
and the host returns the execution result to the main control end, and the execution result is used for the main control end to position the fault machine.
6. The method of claim 5, wherein the configuration file further comprises: and the danger command is set by the user and used for forcibly stopping the operation of each host.
7. The method according to claim 5, wherein the host checks whether the obtained host login password corresponding to the host identity matches a preset host login password, including:
when the number of times that the host verifies whether the obtained host login password corresponding to the host identity is matched with the preset host login password does not exceed a preset verification number threshold value, the host verifies whether the obtained host login password corresponding to the host identity is matched with the preset host login password.
8. A cluster control apparatus, comprising:
the first receiving module is used for receiving a host identifier, a host login password and a host execution command set which are respectively corresponding to each host and are set in a configuration file by a user, wherein the host execution command set respectively corresponding to each host is used for detecting the respective running condition of each host;
a first sending module, configured to send, by the master control end, a connection request in parallel to each host corresponding to the host identifier set in the configuration file;
the second sending module is used for sending the configuration file to each host by the main control end after the main control end establishes connection with each host respectively;
a fourth receiving module, configured to receive, by the master control end, an execution result returned by each host; if the number of times that each host judges whether the host login password corresponding to the host identifier obtained from the host login password is matched with the preset host login password exceeds the preset verification number threshold value, the execution result is that the verification number exceeds the limit; if the host execution command in the host execution command set to be executed by each host currently is a dangerous command, the execution result is a command error; if the host executing commands in the host executing command set are normally executed by the hosts, the executing result is the executing result of the host executing commands executed by the hosts; and if the time for executing the host execution command set by each host exceeds a preset time threshold, the execution result is that the execution command is overtime, and the execution result is used for positioning the fault machine by the main control end.
9. The apparatus of claim 8, further comprising:
the second receiving module is used for receiving a starting request of a plurality of host execution commands sent by the user by the main control end;
the prompting module is used for prompting the user to input an execution password by the main control end;
the verification module is used for verifying whether the execution password input by the user is matched with a preset execution password or not by the main control terminal, and the preset execution password is stored in the main control terminal;
the first receiving module is specifically configured to, when the execution password input by the user matches a preset execution password, receive, by the main control end, a host identifier, a host login password, and a host execution command set, which are set in a configuration file by the user and respectively correspond to each host.
10. The apparatus of claim 9, further comprising:
and a third receiving module, configured to receive, by the master control end, a dangerous command set in a configuration file by the user, where the dangerous command is used to forcibly stop operation of each host.
11. The apparatus of claim 8, further comprising:
the setting module is used for setting the mode of executing the command by each host computer to be serial execution by the main control end;
a third sending module, configured to, after the master control end establishes connections with the hosts, sequentially send the configuration files to the hosts according to a predefined order;
the second sending module is specifically configured to, when the master control end does not set the manner in which the hosts execute the commands to be executed in serial, send the configuration file to the hosts in parallel by the master control end.
12. A cluster control apparatus, comprising:
the first receiving module is used for receiving a connection request sent by the main control end by the host;
a second receiving module, configured to receive, by the host, a configuration file sent by the master control end, where the configuration file includes a host identifier, a host login password, and a host execution command set, where the host identification, the host login password, and the host execution command set are set by a user and respectively correspond to each host, and the host execution command set respectively corresponding to each host is used to detect respective operating conditions of each host;
the acquisition module is used for the host to acquire a host login password and a host execution command set corresponding to the host identity from the configuration file;
the verification module is used for verifying whether the obtained host login password corresponding to the host identity is matched with a preset host login password or not by the host, and the preset host login password is stored in the host;
the execution module is used for executing a host execution command in the host execution command set corresponding to the host when the host login password corresponding to the host identifier of the execution module is matched with a preset host login password;
the device further comprises:
the first generation module is used for not executing the dangerous command and prompting a command error when the host login password corresponding to the host identity is matched with a preset host login password and a host execution command in a host execution command set to be executed by the host is a dangerous command, so that an execution result of the command error is generated;
or,
the execution module is specifically configured to, when a host execution command to be executed by the host currently is a non-dangerous command, normally execute the host execution command in the host execution command set by the host, and generate an execution result corresponding to the host execution command;
alternatively, the apparatus further comprises:
the judging module is used for judging whether the number of times of the obtained host login password corresponding to the host identity and the preset host login password for verifying whether matching exceeds a preset verification number threshold or not by the host;
the second generation module is used for not executing the verification of whether the acquired host login password corresponding to the host identity is matched with the preset host login password or not by the host when the number of times that the host verifies whether the acquired host login password corresponding to the host identity is matched with the preset host login password exceeds a preset verification number threshold value, and prompting that the verification number exceeds the limit, so that an execution result that the verification number exceeds the limit is generated;
alternatively, the apparatus further comprises:
a third generation module, configured to, when the time for the host to execute the host execution command set exceeds a preset time threshold, stop executing the host execution command set by the host, and prompt timeout, so as to generate a timeout execution result;
the device further comprises:
and the return module is used for returning the execution result of the host to the main control end by the host, and the execution result is used for positioning the fault machine by the main control end.
13. The apparatus of claim 12, wherein the configuration file further comprises: and the danger command is set by the user and used for forcibly stopping the operation of each host.
14. The apparatus according to claim 12, wherein the checking module is specifically configured to, when the number of times that the host checks whether the obtained host login password corresponding to the host identifier matches the preset host login password does not exceed a preset check number threshold, check by the host whether the obtained host login password corresponding to the host identifier matches the preset host login password.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410696957.4A CN104486378B (en) | 2014-11-26 | 2014-11-26 | A kind of cluster control method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410696957.4A CN104486378B (en) | 2014-11-26 | 2014-11-26 | A kind of cluster control method and device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN104486378A CN104486378A (en) | 2015-04-01 |
CN104486378B true CN104486378B (en) | 2019-08-13 |
Family
ID=52760882
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201410696957.4A Active CN104486378B (en) | 2014-11-26 | 2014-11-26 | A kind of cluster control method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN104486378B (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106444935A (en) * | 2016-11-24 | 2017-02-22 | 李慧杰 | Environmental parameter acquisition and control system for sheep house |
CN109558256B (en) * | 2017-09-26 | 2023-04-07 | 北京国双科技有限公司 | Controlled terminal automatic recovery method and device |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1364262A (en) * | 1999-05-26 | 2002-08-14 | 富士通株式会社 | Network Element Management System |
CN101360309A (en) * | 2007-08-03 | 2009-02-04 | 华为技术有限公司 | Method, device and system for executing a service activation command |
CN102457555A (en) * | 2010-10-28 | 2012-05-16 | 中兴通讯股份有限公司 | Security system and method for distributed storage |
CN102662731A (en) * | 2010-12-15 | 2012-09-12 | 韩国电子通信研究院 | Service providing method and device using the same |
CN102917348A (en) * | 2012-10-30 | 2013-02-06 | 广东欧珀移动通信有限公司 | A multi-user smart phone and its login method |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103905373B (en) * | 2012-12-24 | 2018-02-16 | 珠海市君天电子科技有限公司 | Method and device for intercepting network attack based on cloud |
-
2014
- 2014-11-26 CN CN201410696957.4A patent/CN104486378B/en active Active
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1364262A (en) * | 1999-05-26 | 2002-08-14 | 富士通株式会社 | Network Element Management System |
CN101360309A (en) * | 2007-08-03 | 2009-02-04 | 华为技术有限公司 | Method, device and system for executing a service activation command |
EP2109335A1 (en) * | 2007-08-03 | 2009-10-14 | Huawei Technologies Co., Ltd. | Performing method, device and system of service open instructions |
CN102457555A (en) * | 2010-10-28 | 2012-05-16 | 中兴通讯股份有限公司 | Security system and method for distributed storage |
CN102662731A (en) * | 2010-12-15 | 2012-09-12 | 韩国电子通信研究院 | Service providing method and device using the same |
CN102917348A (en) * | 2012-10-30 | 2013-02-06 | 广东欧珀移动通信有限公司 | A multi-user smart phone and its login method |
Also Published As
Publication number | Publication date |
---|---|
CN104486378A (en) | 2015-04-01 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110838953B (en) | Test method, test system, electronic equipment and storage medium | |
US20180287889A1 (en) | Network Service Configuration Method and Network Management Device | |
CN103970650A (en) | Distributed testing method and device | |
US8955101B2 (en) | Upper-order computer, lower-order computer, monitoring system and monitoring method | |
US8639985B2 (en) | USB testing apparatus and method | |
CN107347017A (en) | The method, apparatus and configuration point device of a kind of device upgrade | |
EP2544397A1 (en) | Method and communication device for accessing to devices in security | |
CN106534130A (en) | Method and system for debugging set-top box based on embedded web | |
CN106796642B (en) | Device detection method and system, electronic device, cloud robot system and computer program product | |
CN104486378B (en) | A kind of cluster control method and device | |
CN105373417A (en) | Method and system for virtual machine management in cloud computing | |
CN110781512A (en) | Server user permission control method, device and system and springboard machine | |
CN107769952B (en) | Remote management system and method thereof | |
CN102929649B (en) | The configuration-system of PCS7 software systems and collocation method | |
US10263422B2 (en) | Shutdown controlling method for power system | |
US10452519B2 (en) | Integrated resource scheduler, configurator, and visualizer | |
WO2019137139A1 (en) | Air conditioning equipment, control device, and display screen fault handling method | |
CN105373477B (en) | Capacity testing method | |
CN104965422A (en) | Cloud service platform control system | |
CN115842405A (en) | High-pressure energy storage valve system, control unit of power module of high-pressure energy storage valve system and upgrading method of control unit | |
CN108762774A (en) | A kind of method of firmware burning and the equipment of firmware burning | |
CN110011817B (en) | Network element upgrading method and device and computer readable storage medium | |
CN118175575A (en) | Near-end operation and maintenance method, device, equipment and medium of equipment | |
CN109560970A (en) | A kind of network failure healing process, device and system | |
CN106156627A (en) | The treating method and apparatus of automatic information system leak risk |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |