CN110971660B - Multi-server control method and device - Google Patents

Multi-server control method and device Download PDF

Info

Publication number
CN110971660B
CN110971660B CN201910985147.3A CN201910985147A CN110971660B CN 110971660 B CN110971660 B CN 110971660B CN 201910985147 A CN201910985147 A CN 201910985147A CN 110971660 B CN110971660 B CN 110971660B
Authority
CN
China
Prior art keywords
server
slave
slave server
master
information
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
CN201910985147.3A
Other languages
Chinese (zh)
Other versions
CN110971660A (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.)
Ping An Puhui Enterprise Management Co Ltd
Original Assignee
Ping An Puhui Enterprise Management 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 Ping An Puhui Enterprise Management Co Ltd filed Critical Ping An Puhui Enterprise Management Co Ltd
Priority to CN201910985147.3A priority Critical patent/CN110971660B/en
Publication of CN110971660A publication Critical patent/CN110971660A/en
Application granted granted Critical
Publication of CN110971660B publication Critical patent/CN110971660B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/104Peer-to-peer [P2P] networks
    • H04L67/1044Group management mechanisms 
    • H04L67/1046Joining mechanisms
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/08Network architectures or network communication protocols for network security for authentication of entities
    • H04L63/0815Network architectures or network communication protocols for network security for authentication of entities providing single-sign-on or federations
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/141Setup of application sessions

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computing Systems (AREA)
  • Computer Hardware Design (AREA)
  • Computer Security & Cryptography (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Mathematical Physics (AREA)
  • Theoretical Computer Science (AREA)
  • Computer And Data Communications (AREA)

Abstract

The invention provides a multi-server control method and a device, wherein the method comprises the following steps: the network management system screens a master server from a plurality of servers, and takes servers except the master server from the plurality of servers as slave servers; controlling the master server to start a master process and controlling the slave server to start a slave process; generating a slave server list according to the identity information and the configuration information of the slave server, and storing the slave server list to the master server; if the main server receives the target task, the main server sends a task instruction to the slave server through the main process according to the slave server list; and if the slave process of the slave server monitors the task instruction sent by the master process, controlling the slave server to execute the subtask corresponding to the task instruction according to the task instruction. The method can save manual operation time and workload and improve the management efficiency of the multiple servers.

Description

Multi-server control method and device
Technical Field
The invention relates to the technical field of multi-server operation, in particular to a multi-server control method and device.
Background
In the daily work of managing a plurality of servers, it is often necessary to log in different servers to perform different tasks. Such as cleaning up server space, launching a service, viewing a work log, installing tools, etc. When there are too many servers, these similar tasks always need to log in each server, and then complete the tasks one by one, which is a heavy operation. Increases the labor cost, and is long in time consumption and low in efficiency.
Disclosure of Invention
The invention provides a multi-server control method and device, which do not need to manually log in each server, save manual operation time and workload, and improve the management efficiency of multiple servers.
The present invention provides the following scheme:
a multi-server control method, comprising: the network management system screens out a master server from a plurality of servers, and takes the servers except the master server from the plurality of servers as slave servers; the network management system controls the master server to start a master process and controls the slave server to start a slave process; the network management system acquires the identity information and the configuration information of the slave server, generates a slave server list according to the identity information and the configuration information of the slave server, and stores the slave server list to the master server; if the main server receives the target task, the main server sends a task instruction to the slave server through the main process according to the slave server list; and if the slave process of the slave server monitors the task instruction sent by the master process, controlling the slave server to execute the subtask corresponding to the task instruction according to the task instruction.
In one embodiment, the configuration information of the slave server comprises task information of the subtask executed by the slave server, environment information of the slave server and command information of the slave server for executing the subtask;
the main server sends the task instruction to the slave server through the main process according to the slave server list, and the task instruction comprises the following steps:
the master server acquires task information of each slave server and the environment information and the command information of each slave server according to the slave server list, divides the target task into a plurality of subtasks according to the task information of each slave server, generates a task instruction of each slave server according to the subtasks, the environment information and the command information corresponding to each slave server, and sends the corresponding task instruction to each slave server through the master process according to the identity information of each slave server.
In one embodiment, the environment information comprises process set information of the slave server and machine environment information of the slave server; the command information includes time information and execution frequency information for executing the subtasks from the server;
the generating a task instruction of each slave server according to the sub-task, the environment information and the command information corresponding to each slave server includes:
determining a time starting point of each slave server for executing the corresponding subtask, a time period for executing the corresponding subtask and a frequency for executing in the time period according to the subtask corresponding to each slave server, the time information for the slave server to execute the subtask and the execution frequency information;
generating control information for starting the slave servers according to the subtasks, the process set information and the machine environment information corresponding to the slave servers;
and generating a task instruction of each slave server according to the control information of each slave server, the time starting point for executing the corresponding subtask, the time period for executing the corresponding subtask and the frequency of execution in the time period.
In one embodiment, after the controlling, according to the task instruction, the slave server to execute the sub-task corresponding to the task instruction if the slave process of the slave server monitors the task instruction sent by the master process, the method further includes:
and if the slave server confirms that the subtask corresponding to the task instruction is executed according to the task instruction, feeding back an execution result to the master server.
In one embodiment, the execution result comprises a result of successful execution and a result of failed execution, and the slave servers comprise a first slave server and a second slave server; after the master server sends the corresponding task instruction to each slave server through the master process according to the slave server list, the method further includes:
if the master process of the master server does not receive the execution result of the first slave server within the preset time or confirms that the execution result of the first slave server is received, the master server matches a second slave server with the highest similarity to the first slave server from other slave servers according to the environment information of the first slave server and the task instruction of the first slave server, and sends the task instruction of the first slave server to the second slave server.
In one embodiment, the matching, by the master server, a second slave server with the highest similarity to the first slave server from other slave servers according to the environment information of the first slave server and the task instruction of the first slave server includes:
the master server performs matching from other slave servers according to the time starting point of the sub task corresponding to the first slave server, the time period for executing the corresponding sub task and the frequency executed in the time period, and takes a plurality of matched slave servers as a similar slave server group;
and the master server matches the second slave server from the similar slave server group according to the environment information of the first slave server.
In one embodiment, the master process is further configured to listen for a connection request from the slave server; before the master server sends the task instruction to the slave server through the master process according to the slave server list, the method further includes:
if the master process monitors the connection request of the slave server, the network management system controls the master server to establish connection with the slave server;
the main server sends the task instruction to the slave server through the main process according to the slave server list, and the task instruction comprises the following steps:
and if the master server confirms that the connection with the slave server is established, the task instruction is sent to the slave server through the master process.
In one embodiment, the slave server list further includes a connection address, a login account and a login password of each slave server; when the master process monitors the connection request of the slave server, the network management system controls the master server to establish connection with the slave server, and the method comprises the following steps:
and when the master process monitors the connection request of the slave server, the network management system controls the master server to establish connection with the slave server according to the connection address, the login account and the login password of the slave server.
In one embodiment, the slave process is further configured to send status information of the slave server to the master server; the method further comprises the following steps:
if the master process monitors that the master server receives the state information of the slave server, the network management system confirms whether the master server contains the state updating information of the slave server or not according to the state information; if so, sending a state updating instruction containing the state updating information to the slave server;
and if the slave process monitors that the slave server receives the state updating instruction, the network management system controls the slave server to update the machine state according to the state updating instruction.
A multi-server control apparatus comprising:
the screening module is used for screening a master server from a plurality of servers and taking the servers except the master server from the plurality of servers as slave servers;
the starting module is used for controlling the master server to start a master process and controlling the slave server to start a slave process;
the storage module is used for acquiring the identity information and the configuration information of the slave server, generating a slave server list according to the identity information and the configuration information of the slave server, and storing the slave server list to the master server;
the execution module is used for sending a task instruction to the slave server through the master process according to the slave server list if the master server receives a target task; and if the slave process of the slave server monitors the task instruction sent by the master process, controlling the slave server to execute the subtask corresponding to the task instruction according to the task instruction.
The beneficial effect of this application:
the network management system is used for screening and setting the master server and the slave servers in the servers to generate a slave server list, and maintaining the slave server list on the master server to enable the master server to control the slave servers, monitoring each subtask in the slave server execution tasks through a master process of the master server, and executing the operation corresponding to the task instruction when the slave server receives the task instruction sent by the master server, so that when the task commonly executed by the servers is completed, other slave servers are controlled to execute the corresponding tasks through the master server, login operation is not needed to be carried out on each server, unified command management and task processing are achieved, manual operation time and workload are saved, and management efficiency of the servers is improved.
Additional aspects and advantages of the invention will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention.
Drawings
The above and/or additional aspects and advantages of the present invention will become apparent and readily appreciated from the following description of the embodiments, taken in conjunction with the accompanying drawings of which:
FIG. 1 is a flow chart of a method in an embodiment of a multi-server control method provided by the present invention;
FIG. 2 is a block diagram of a server cluster in an implementation scenario according to an embodiment of a multi-server control method provided in the present invention;
FIG. 3 is a flow chart of a method in another embodiment of a multi-server control method provided by the present invention;
fig. 4 is a block diagram of an embodiment of a multi-server control device according to the present invention.
Detailed Description
Reference will now be made in detail to embodiments of the present invention, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to the same or similar elements or elements having the same or similar function throughout. The embodiments described below with reference to the accompanying drawings are illustrative only for the purpose of explaining the present invention and are not to be construed as limiting the present invention.
It will be understood by those skilled in the art that, unless otherwise specified, the singular forms "a", "an", "the" and "the" may include the plural forms as well, and the "first" and "second" used herein are only used to distinguish one technical feature from another and are not intended to limit the order, number, etc. of the technical features. It will be further understood that the terms "comprises" and/or "comprising," when used in this specification, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
It will be understood by those skilled in the art that, unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs. It will be further understood that terms, such as those defined in commonly used dictionaries, should be interpreted as having a meaning that is consistent with their meaning in the context of the prior art and will not be interpreted in an idealized or overly formal sense unless expressly so defined herein.
The invention provides a multi-server control method, which is characterized in that a plurality of servers are uniformly managed by a network management system, different functional attributes are configured for different servers by the network management system, a plurality of steps of the multi-server control method are executed by the network management system, so that other slave servers are controlled by a configured main server to complete corresponding work, the time for carrying out manual operation on each server is saved, the manual operation amount is reduced, and the control efficiency of the multi-server is improved. In one embodiment, as shown in fig. 1, the multi-server control method includes the following steps:
s100, the network management system screens out a master server from a plurality of servers, and takes servers except the master server from the plurality of servers as slave servers.
In the actual use process, a plurality of servers are required to jointly execute a certain target task, each server needs to be configured to execute different subtasks in order to utilize the resource of each server to a greater extent, and an association relationship exists between the different subtasks. In this embodiment, the plurality of servers are divided into a master server and a slave server, specifically, as shown in fig. 2, the network management system screens out the master server 100 from the plurality of servers, and uses the servers except the master server 100 as the slave servers 200, in one embodiment, the network management system obtains the hardware configuration information of each server, and screens out the master server and the slave servers according to the hardware configuration information, for example, the network management system selects a server whose hardware configuration information of the CPU and the memory meets a first preset requirement as the master server, and selects a server whose hardware configuration information of the CPU and the memory meets a second preset requirement as the master server; in another embodiment, the network management system obtains the function attribute of each server, and screens out the master server and the slave server according to the function attribute. The master server 100 establishes a network connection with the slave server 200 to perform data communication with the slave server 200. Generally, there are one master server 100 and a plurality of slave servers 200, and in a specific implementation process, the number of master servers 100 and the number of slave servers 200 are not limited.
S200, the network management system controls the master server to start the master process and controls the slave server to start the slave process.
In this embodiment, each of the plurality of servers is provided with a corresponding process for executing a corresponding work task in the server. The master server 100 is provided with a master process for controlling all the slave servers 200 to execute corresponding work, and the slave server 200 is provided with a slave process for receiving a task instruction sent by the master process of the master server 100 and controlling the slave server 200 to execute a corresponding task according to the task instruction. In one embodiment, each server is provided with a master process and a slave process, if the server is selected as the master server, the network management system controls the server to start the master process, and if the server is selected as the slave server, the network management system controls the server to start the slave process, so that flexible allocation of the master server and the slave server is maintained.
S300, the network management system acquires the identity information and the configuration information of the slave server, generates a slave server list according to the identity information and the configuration information of the slave server, and stores the server list to the master server.
In this embodiment, the network management system obtains the identity information and the configuration information of the slave servers, then generates a slave server list according to the identity information and the configuration information of the slave servers, stores the server list in the master server, the master server 100 is configured to control each slave server to perform corresponding work, when the master server performs overall work on each slave server, the master server 100 needs to know the identity information of each slave server and the configuration information of each slave server, the identity information is used for uniquely identifying the slave server, and the master server 100 can directly identify and connect the corresponding slave server according to the identity information of the slave server; the configuration information is the sum of information required by the slave server to perform various configurations when the slave server executes task work, such as working environment information when the slave server executes subtasks. After the network management system stores the generated slave server list into the master server, the master server 100 can obtain the identity information of all the slave servers and the configuration information corresponding to each slave server according to the slave server list, and in the slave server list, the identity information of each slave server is correspondingly associated with the configuration information thereof, so that the master server 100 allocates each slave server to perform task work.
S400, if the main server receives a target task, the main server sends a task instruction to the slave server through the main process according to the slave server list; and if the slave process of the slave server monitors the task instruction sent by the master process, controlling the slave server to execute the subtask corresponding to the task instruction according to the task instruction.
In this embodiment, after the network management system sets a plurality of servers as the master server 100 and the slave server 200, a target task that needs to be completed together by a server cluster composed of the plurality of servers is set in the network management system, that is, the target task is sent to the master server, if the master server receives the target task, the master process of the master server 100 sends a task instruction of a sub-task that needs to be executed by the slave server to each slave server according to the identity information and the configuration information of each slave server in the slave server list, and if the slave process of the slave server monitors the task instruction sent by the master process, the slave process controls the slave server to execute the sub-task corresponding to the task instruction according to the task instruction. The network management system generates a slave server list, maintains the slave server list on a master server, records the address, account password, process set information, machine environment information, command set and other identity information and configuration information of all slave servers, writes commands and specified execution strategies (including specified time execution, immediate execution, frequency execution and the like) required to be executed by each slave server into target tasks, and sends the commands and the execution strategies to the slave servers after receiving the target tasks, and the slave servers work and execute the commands according to the configuration.
In the embodiment, a task is completed by a plurality of servers together, the network management system filters and sets the master server and the slave servers in the plurality of servers to generate the slave server list, and maintains the slave server list on the master server, so that the master server can control the plurality of slave servers, each sub-task in the slave server execution task is monitored by the master process of the master server, and when the slave server receives a task instruction sent by the master server, the operation corresponding to the task instruction is executed, so that when the task which is executed by the plurality of servers together is completed, other slave servers are controlled by the master server to execute the corresponding task, login operation for each server is not needed, unified command management and task processing are achieved, manual operation time and workload are saved, and management efficiency of the plurality of servers is improved.
In an implementation manner of this embodiment, the configuration information of the slave server includes task information of the slave task executed by the slave server, environment information of the slave server, and command information of the slave server to execute the slave task. The step S400 includes:
the master server acquires task information of each slave server and the environment information and the command information of each slave server according to the slave server list, divides the target task into a plurality of subtasks according to the task information of each slave server, generates a task instruction of each slave server according to the subtasks, the environment information and the command information corresponding to each slave server, and sends the corresponding task instruction to each slave server through the master process according to the identity information of each slave server.
In this embodiment, the configuration information of the slave server includes task information of a subtask executed by the slave server, environment information of the slave server, and command information of a subtask executed by the slave server, the network management system generates a slave service list from the acquired slave server configuration information and identity information and transmits the slave service list to the master server, the master server can maintain the slave server list, if the master server receives a target task, the master server acquires the task information of each slave server and the environment information and command information of each slave server according to the configuration information and identity information included in the slave server list, divides the target task into subtasks corresponding to each slave server according to the task information of each slave server, generates a task instruction of each slave server according to the subtasks, environment information, and command information corresponding to each slave server, and the master process transmits a corresponding task instruction to each slave server according to the identity information of each slave server, thereby improving task allocation and scheduling efficiency for the slave servers.
In one embodiment, the environment information includes process set information of the slave server and machine environment information of the slave server; the command information includes time information for executing the subtasks from the server and execution frequency information. As shown in fig. 3, the generating a task instruction of each slave server according to the sub-task, the environment information, and the command information corresponding to each slave server includes:
s511, determining a time starting point of each slave server for executing the corresponding subtask, a time period for executing the corresponding subtask and an execution frequency in the time period according to the subtask corresponding to each slave server, the time information of the slave server for executing the subtask and the execution frequency information;
s513, generating control information for starting the slave servers according to the subtasks, the process set information and the machine environment information corresponding to the slave servers;
and S515, generating a task instruction of each slave server according to the control information of each slave server, the time starting point for executing the corresponding subtask, the time period for executing the corresponding subtask, and the frequency of execution in the time period.
The slave server list transmitted by the network management system to the master server 100 records information on the task executed by each slave server, and environment information and command information for each slave server when executing the task. The environment information comprises process set information of the server and machine environment information of the server; the command information includes time information when the server performs the subtasks and execution frequency information. If the master server receives the target task, the master server 100 divides the received target task into a plurality of subtasks according to the task information of each slave server in the slave server list, further generates a task instruction of each slave server according to the subtask corresponding to each slave server, the environment information of each slave server, and the command information, and transmits the corresponding task instruction to each slave server. Specifically, the master server 100 determines a time starting point at which each slave server executes the corresponding sub-task, a time period for executing the corresponding sub-task, and a frequency of execution within the time period, according to the sub-task corresponding to each slave server, time information at which each slave server executes the sub-task, and execution frequency information. Then, control information for starting each slave server is generated based on the process set information of each slave server and the machine environment information of the server, based on the subtasks corresponding to the slave servers. Further, a task instruction of each slave server is generated according to the control information of each slave server, a time starting point for executing the corresponding subtask, a time period for executing the corresponding subtask, and a frequency of execution in the time period. And finally, sending corresponding task instructions to each slave server.
In a specific implementation process, the network management system filters and sets a master server and slave servers in a plurality of servers, generates a slave server list, maintains the slave server list on the master server, enables the master server to control the plurality of slave servers, records addresses, account numbers and passwords of all the slave servers and tasks executed by each slave server, records configuration information and identity information such as process set information, machine environment information and command sets for each slave server, monitors each sub task in the tasks executed by the slave servers through a master process of the master server, executes an operation corresponding to a task instruction when the slave server receives the task instruction sent by the master server, namely the master server sends the command and an execution strategy to the slave servers, and the slave servers work and execute the command according to the configuration.
In an embodiment, after step S600, the method further includes: and if the slave server confirms that the subtask corresponding to the task instruction is executed according to the task instruction, feeding back an execution result to the master server.
Specifically, the slave process of the slave server controls the slave server to execute the corresponding subtask according to the received task instruction, monitors whether the slave server executes the corresponding subtask, and feeds back the execution result to the master server after the slave server executes the corresponding subtask, so that the master server can uniformly know the result of the task executed by each slave server, and the analysis efficiency of the task executed result of the slave server is improved.
In an embodiment of the present application, the execution result includes a result of successful execution and a result of failed execution; the slave servers include a first slave server and a second slave server. After the master server sends the corresponding task instruction to each slave server through the master process according to the slave server list, the method further includes: if the master process of the master server does not receive the execution result of the first slave server within the preset time or confirms that the execution result of the first slave server is received, the master server matches a second slave server with the highest similarity to the first slave server from other slave servers according to the environment information of the first slave server and the task instruction of the first slave server, and sends the task instruction of the first slave server to the second slave server.
After sending the corresponding task instruction to each slave server, the master server 100 monitors whether an execution result fed back by the slave server is received, if the master process of the master server does not receive the execution result within a preset time, it may determine that the corresponding slave server executes a sub-task error, or if the master process of the master server receives a result of execution failure fed back by the slave server, at this time, the master server matches a second slave server with the highest similarity to the first slave server from other slave servers according to the environment information of the first slave server executing the sub-task and the task instruction of the first slave server, and sends the task instruction of the first slave server to the second slave server, so as to complete the scheduling of the task executed by the slave servers, thereby improving the task scheduling flexibility of the slave servers and improving the efficiency of the multi-server for completing the task.
In one embodiment, the matching, by the master server, a second slave server having the highest similarity to the first slave server from the other slave servers according to the environment information of the first slave server and the task instruction of the first slave server includes: the master server performs matching from other slave servers according to the time starting point of the sub task corresponding to the first slave server, the time period for executing the corresponding sub task and the frequency executed in the time period, and takes a plurality of matched slave servers as a similar slave server group; the master server matches out the second slave server from the group of similar slave servers according to the environment information of the first slave server.
In one embodiment, the master process is further configured to listen for a connection request from the slave server; before the master server sends the task instruction to the slave server through the master process according to the slave server list, the method further includes: if the master process monitors the connection request of the slave server, the network management system controls the master server to establish connection with the slave server; the main server sends the task instruction to the slave server through the main process according to the slave server list, and the task instruction comprises the following steps: and if the master server confirms that the connection with the slave server is established, the task instruction is sent to the slave server through the master process.
Specifically, each server in the plurality of servers is provided with a process, the master server is provided with a master process, the slave servers are provided with slave processes, the slave processes in the slave servers can send connection requests to the master server, and after the master process monitors the connection requests sent by the slave servers, the network management system controls the master server to establish connection with the slave servers and sends task instructions to the slave servers according to target tasks.
In an implementation manner of this embodiment, the slave server list further includes a connection address, a login account, and a login password of each slave server; when the master process monitors the connection request of the slave server, the network management system controls the server to connect with the slave server, and the method comprises the following steps: and when monitoring the connection request of the slave server, the master process controls the server to connect with the slave server according to the connection address, the login account and the login password of the slave server. Specifically, a server list in the master server records a connection address of each slave server, and a login account and a login password of each slave server. The master process can read the connection address of the server list slave server and is in communication connection with the slave server according to the connection address. Furthermore, the slave server is logged in according to the login account and the login password of the slave server, so that the master server can also log in the slave server while controlling the server to connect with the slave server so as to control the slave server to execute corresponding operation.
In an embodiment of the present application, the slave process is further configured to send status information of the slave server to the master server; the method further comprises the following steps:
s600, if the master process monitors that the master server receives the state information of the slave server, the network management system confirms whether the master server contains the state updating information of the slave server according to the state information; if yes, sending a state updating instruction containing the state updating information to the slave server; and if the slave process monitors that the slave server receives the state updating instruction, the network management system controls the slave server to update the machine state according to the state updating instruction.
In this embodiment, the slave process is further configured to send status information of the slave server to the master server, and when the master process monitors that the master server receives the status information of the slave server, the network management system determines, according to the status information, whether the master server includes status update information of the slave server; if so, the network management system sends a state updating instruction containing the state updating information to the slave server; and when the slave process monitors that the slave server receives the state updating instruction, controlling the slave server to update the machine state according to the state updating instruction. In a specific implementation process, a process program of the master process and/or the slave process is developed based on java and is operated in a jar package mode, specifically, the process program is developed based on java and is operated in the jar package mode, jenkins is used for automatic deployment, and when the jar package is updated, the jar package of the latest version can be synchronously updated in real time.
The invention also provides a multi-server control device. In one embodiment, as shown in fig. 4, the multi-server control apparatus includes a filtering module 10, an initiating module 20, a storing module 30, and an executing module 40.
The screening module 10 is configured to screen a master server from a plurality of servers, and use a server other than the master server from the plurality of servers as a slave server.
The starting module 20 is configured to control the master server to start a master process, and control the slave server to start a slave process.
The storage module 30 is configured to obtain the identity information and the configuration information of the slave server, generate a slave server list according to the identity information and the configuration information of the slave server, and store the slave server list in the master server.
The execution module is used for sending a task instruction to the slave server through the master process according to the slave server list if the master server receives a target task; and if the slave process of the slave server monitors the task instruction sent by the master process, controlling the slave server to execute the subtask corresponding to the task instruction according to the task instruction.
In other embodiments, each module in the multi-server control apparatus provided by the present invention is further configured to execute the operations executed in each step in the multi-server control method according to the present invention, and a detailed description thereof is omitted here.
In addition, functional units in the embodiments of the present invention may be integrated into one processing module, or each unit may exist alone physically, or two or more units are integrated into one module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode. The integrated module, if implemented in the form of a software functional module and sold or used as a stand-alone product, may also be stored in a computer readable storage medium.
Those skilled in the art will appreciate that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program instructing relevant hardware, and the program may be stored in a computer readable storage medium, and the storage medium may include a memory, a magnetic disk, an optical disk, or the like.
It should be understood that each functional unit in the embodiments of the present invention may be integrated into one processing module, each unit may exist alone physically, or two or more units may be integrated into one module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode.
The foregoing is only a partial embodiment of the present invention, and it should be noted that, for those skilled in the art, various modifications and decorations can be made without departing from the principle of the present invention, and these modifications and decorations should also be regarded as the protection scope of the present invention.

Claims (7)

1. A multi-server control method, comprising:
the network management system screens a master server from a plurality of servers, and takes servers except the master server from the plurality of servers as slave servers;
the network management system controls the master server to start a master process and controls the slave server to start a slave process;
the network management system acquires the identity information and the configuration information of the slave server, generates a slave server list according to the identity information and the configuration information of the slave server, and stores the slave server list to the master server;
if the main server receives the target task, the main server sends a task instruction to the slave server through the main process according to the slave server list; if the slave process of the slave server monitors a task instruction sent by the master process, controlling the slave server to execute a subtask corresponding to the task instruction according to the task instruction;
if the slave server confirms that the subtask corresponding to the task instruction is executed according to the task instruction, an execution result is fed back to the master server; the execution result comprises a result of successful execution and a result of failed execution, and the slave servers comprise a first slave server and a second slave server;
after the master server sends the corresponding task instruction to each slave server through the master process according to the slave server list, the method further includes:
if the master process of the master server does not receive the execution result of the first slave server within preset time or confirms that the execution result of the first slave server is received, the master server performs matching from other slave servers according to the time starting point of the sub-task corresponding to the first slave server, the time period for executing the corresponding sub-task and the frequency for executing within the time period, and a plurality of slave servers obtained through matching are used as similar slave server groups; and the master server matches a second slave server with the highest similarity with the first slave server from the similar slave server group according to the environmental information of the first slave server, and sends the task instruction of the first slave server to the second slave server.
2. The method according to claim 1, wherein the configuration information of the slave server includes task information of the slave server performing the subtask, environment information of the slave server, and command information of the slave server performing the subtask;
the main server sends the task instruction to the slave server through the main process according to the slave server list, and the task instruction comprises the following steps:
the master server acquires task information of each slave server and the environment information and the command information of each slave server according to the slave server list, divides the target task into a plurality of subtasks according to the task information of each slave server, generates a task instruction of each slave server according to the subtasks, the environment information and the command information corresponding to each slave server, and sends the corresponding task instruction to each slave server through the master process according to the identity information of each slave server.
3. The method of claim 2, wherein the environment information comprises process set information of the slave server and machine environment information of the slave server; the command information includes time information and execution frequency information for executing the subtasks from the server;
the generating a task instruction of each slave server according to the sub-task, the environment information and the command information corresponding to each slave server includes:
determining a time starting point of each slave server for executing the corresponding subtask, a time period for executing the corresponding subtask and a frequency for executing in the time period according to the subtask corresponding to each slave server, the time information for the slave server to execute the subtask and the execution frequency information;
generating control information for starting the slave servers according to the subtasks, the process set information and the machine environment information corresponding to the slave servers;
and generating a task instruction of each slave server according to the control information of each slave server, the time starting point for executing the corresponding subtask, the time period for executing the corresponding subtask and the frequency of execution in the time period.
4. The method of claim 1, wherein the master process is further configured to listen for a connection request from the slave server; before the master server sends the task instruction to the slave server through the master process according to the slave server list, the method further includes:
if the master process monitors the connection request of the slave server, the network management system controls the master server to establish connection with the slave server;
the main server sends the task instruction to the slave server through the main process according to the slave server list, and the task instruction comprises the following steps:
and if the master server confirms that the connection with the slave server is established, the task instruction is sent to the slave server through the master process.
5. The method according to claim 4, wherein the slave server list further comprises a connection address, a login account number and a login password of each slave server; when the master process monitors the connection request of the slave server, the network management system controls the master server to establish connection with the slave server, and the method comprises the following steps:
and when the master process monitors the connection request of the slave server, the network management system controls the master server to establish connection with the slave server according to the connection address, the login account and the login password of the slave server.
6. The method of claim 1, wherein the slave process is further configured to send status information of the slave server to the master server; the method further comprises the following steps:
if the master process monitors that the master server receives the state information of the slave server, the network management system confirms whether the master server contains the state updating information of the slave server or not according to the state information; if so, sending a state updating instruction containing the state updating information to the slave server;
and if the slave process monitors that the slave server receives the state updating instruction, the network management system controls the slave server to update the machine state according to the state updating instruction.
7. A multi-server control apparatus, comprising:
the screening module is used for screening a master server from a plurality of servers and taking the servers except the master server from the plurality of servers as slave servers;
the starting module is used for controlling the master server to start a master process and controlling the slave server to start a slave process;
the storage module is used for acquiring the identity information and the configuration information of the slave server, generating a slave server list according to the identity information and the configuration information of the slave server, and storing the slave server list to the master server;
the execution module is used for sending a task instruction to the slave server through the master process according to the slave server list if the master server receives a target task; if the slave process of the slave server monitors a task instruction sent by the master process, controlling the slave server to execute a subtask corresponding to the task instruction according to the task instruction;
the feedback module is used for feeding back an execution result to the main server if the slave server confirms that the subtask corresponding to the task instruction is executed according to the task instruction; the execution result comprises a result of successful execution and a result of failed execution, and the slave servers comprise a first slave server and a second slave server;
wherein the storage module is further configured to:
if the master process of the master server does not receive the execution result of the first slave server within preset time or confirms that the execution result of the first slave server is received, the master server performs matching from other slave servers according to the time starting point of the sub-task corresponding to the first slave server, the time period for executing the corresponding sub-task and the frequency for executing within the time period, and a plurality of slave servers obtained through matching are used as similar slave server groups; and the master server matches a second slave server with the highest similarity with the first slave server from the similar slave server group according to the environmental information of the first slave server, and sends the task instruction of the first slave server to the second slave server.
CN201910985147.3A 2019-10-16 2019-10-16 Multi-server control method and device Active CN110971660B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910985147.3A CN110971660B (en) 2019-10-16 2019-10-16 Multi-server control method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910985147.3A CN110971660B (en) 2019-10-16 2019-10-16 Multi-server control method and device

Publications (2)

Publication Number Publication Date
CN110971660A CN110971660A (en) 2020-04-07
CN110971660B true CN110971660B (en) 2022-10-11

Family

ID=70029677

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910985147.3A Active CN110971660B (en) 2019-10-16 2019-10-16 Multi-server control method and device

Country Status (1)

Country Link
CN (1) CN110971660B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114064274B (en) * 2021-11-11 2022-09-16 广州市保伦电子有限公司 Education resource management method and system based on cloud data

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107341051A (en) * 2016-05-03 2017-11-10 北京京东尚科信息技术有限公司 Cluster task coordination approach, system and device
CN108256118A (en) * 2018-02-13 2018-07-06 腾讯科技(深圳)有限公司 Data processing method, device, system, computing device and storage medium
CN109618000A (en) * 2019-01-09 2019-04-12 广州视源电子科技股份有限公司 Master-slave switching method, device and system of load balancing service and server

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8495193B2 (en) * 2010-02-23 2013-07-23 Microsoft Corporation Centralized management tool for remote presentation session server farms

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107341051A (en) * 2016-05-03 2017-11-10 北京京东尚科信息技术有限公司 Cluster task coordination approach, system and device
CN108256118A (en) * 2018-02-13 2018-07-06 腾讯科技(深圳)有限公司 Data processing method, device, system, computing device and storage medium
CN109618000A (en) * 2019-01-09 2019-04-12 广州视源电子科技股份有限公司 Master-slave switching method, device and system of load balancing service and server

Also Published As

Publication number Publication date
CN110971660A (en) 2020-04-07

Similar Documents

Publication Publication Date Title
US10509680B2 (en) Methods, systems and apparatus to perform a workflow in a software defined data center
US7979859B2 (en) Managing automated resource provisioning with a workload scheduler
US20160275123A1 (en) Pipeline execution of multiple map-reduce jobs
CN111897638B (en) Distributed task scheduling method and system
US20040031029A1 (en) Methods and systems for automatically updating software components in a network
CN104750549A (en) Computational task processing device, method and system
CN110489126B (en) Compiling task execution method and device, storage medium and electronic device
WO2006067026A1 (en) Method for remembering resource allocation in grids
CN113312161A (en) Application scheduling method, platform and storage medium
CN114610499A (en) Task scheduling method and device, computer readable storage medium and electronic equipment
CN110971660B (en) Multi-server control method and device
CN112416542A (en) Distributed task system, management method and device and computer equipment
CN117389843B (en) Intelligent operation and maintenance system, method, electronic equipment and storage medium
CN107659621B (en) RAID control card configuration method and device
US7240348B2 (en) Suspending scenario generation method, server device, and program therefor
CN111130920B (en) Hardware information acquisition method, device, server and storage medium
US20220091887A1 (en) System and method for finding and identifying computer nodes in a network
JP6051798B2 (en) Firmware verification system, firmware verification method, and firmware verification program
KR20210142829A (en) Edge computing system and method for distributing an application to a plurality of edge devices
KR102000984B1 (en) Automatic operating system providing automatic producing function to a plurality of server
CN117076409B (en) File sharing method, device, system, electronic equipment and storage medium
JP7456507B2 (en) Information distribution device, information distribution method and program
CN115454580B (en) Node host resource management method and device and computing equipment
JP6699286B2 (en) Schedule application device, schedule application method, backup device, and computer program
CN106528465B (en) A kind of Nand Flash controller and method

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant