CN112134950A - Method, device, maintenance server and medium for maintaining Linux cluster - Google Patents

Method, device, maintenance server and medium for maintaining Linux cluster Download PDF

Info

Publication number
CN112134950A
CN112134950A CN202011002427.7A CN202011002427A CN112134950A CN 112134950 A CN112134950 A CN 112134950A CN 202011002427 A CN202011002427 A CN 202011002427A CN 112134950 A CN112134950 A CN 112134950A
Authority
CN
China
Prior art keywords
maintenance
command
command execution
server
servers
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.)
Granted
Application number
CN202011002427.7A
Other languages
Chinese (zh)
Other versions
CN112134950B (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 Technology Shenzhen Co Ltd
Original Assignee
Ping An Technology Shenzhen 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 Technology Shenzhen Co Ltd filed Critical Ping An Technology Shenzhen Co Ltd
Priority to CN202011002427.7A priority Critical patent/CN112134950B/en
Publication of CN112134950A publication Critical patent/CN112134950A/en
Application granted granted Critical
Publication of CN112134950B publication Critical patent/CN112134950B/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/1001Protocols in which an application is distributed across nodes in the network for accessing one among a plurality of replicated servers
    • H04L67/1004Server selection for load balancing
    • H04L67/1023Server selection for load balancing based on a hash applied to IP addresses or costs
    • 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/083Network architectures or network communication protocols for network security for authentication of entities using passwords
    • 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/1001Protocols in which an application is distributed across nodes in the network for accessing one among a plurality of replicated servers
    • H04L67/1004Server selection for load balancing
    • H04L67/1008Server selection for load balancing based on parameters of servers, e.g. available memory or workload

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Hardware Design (AREA)
  • General Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computing Systems (AREA)
  • Debugging And Monitoring (AREA)
  • Hardware Redundancy (AREA)

Abstract

The application is applicable to the technical field of cloud, and provides a method, a device, a maintenance server and a medium for maintaining a Linux cluster. The method for maintaining the Linux cluster comprises the steps of obtaining a maintenance command, loading information of a plurality of cluster servers, filtering the information of the cluster servers to obtain server information of a plurality of command execution servers, combining the maintenance command and the server information of the command execution servers to generate a maintenance command execution work order, executing the work order according to the maintenance command, scheduling the command execution servers to execute the maintenance command, and improving the maintenance efficiency of the Linux cluster in the maintenance process. The application also relates to the technical field of block chains, and the maintenance command execution work order is stored in the preset block chain.

Description

Method, device, maintenance server and medium for maintaining Linux cluster
Technical Field
The present application relates to the field of cloud technologies, and in particular, to a method, an apparatus, a maintenance server, and a medium for maintaining a Linux cluster.
Background
The Secure Shell (SSH) is a security protocol established on an application layer basis, and is specifically configured to provide a security protocol for telnet sessions and other network services, so as to effectively prevent information leakage during remote management. The remote management is a process of controlling the remote server by enabling the remote server to execute an SSH command, and the remote server needs to be logged in before the SSH command is executed.
In the related art, the current command execution modes include a direct execution mode and a script execution mode, wherein the direct execution mode is to execute a command on a server after logging in the server through a client, and the script execution mode is to write the command into a script file and upload the script file to the logged server for execution after logging in the server. However, in the process of maintaining the Linux server by executing the SSH command, since a plurality of servers exist in the cluster, only the plurality of servers can be sequentially logged in to execute the SSH command, and the current login method requires manual operation by an administrator. Therefore, the current maintenance mode of the Linux cluster needs to consume a lot of time for logging in the server and for the cluster server to execute the SSH command, which finally results in the reduction of the maintenance efficiency of the Linux cluster.
Disclosure of Invention
In view of this, embodiments of the present application provide a method, an apparatus, a maintenance server, and a medium for maintaining a Linux cluster, so as to solve the problem in the prior art that the maintenance efficiency is low in the current Linux cluster maintenance process.
A first aspect of the embodiments of the present application provides a method for maintaining a Linux cluster, including:
obtaining a maintenance command and loading information of a plurality of cluster servers;
filtering the information of the cluster servers to obtain server information of a plurality of command execution servers;
combining the maintenance command with the server information of the command execution server to generate a maintenance command execution work order;
and executing the work order according to the maintenance command, and scheduling a plurality of command execution servers to execute the maintenance command.
The embodiment of the application provides a method for maintaining a Linux cluster, and the maintenance efficiency of the current Linux cluster maintenance process is reduced due to the fact that a server needs to be manually logged in when a secure shell protocol command is executed for a plurality of servers in the cluster. Therefore, in the embodiment, the maintenance command is acquired, the information of the plurality of cluster servers is loaded, the information of the plurality of cluster servers is filtered, the server information of the plurality of command execution servers is obtained, the command execution servers can be quickly screened out from a plurality of servers in the cluster by the maintenance server, the server information of each command execution server is obtained, and the server information can include a password for logging in the corresponding server, so that the maintenance server can log in the command execution servers in batch, and the maintenance efficiency of the Linux cluster is improved; and combining the maintenance command and the server information of the command execution server to generate a maintenance command execution work order, executing the work order according to the maintenance command, scheduling the command execution servers to execute the maintenance command to obtain the command execution work order, thereby providing feasibility for the maintenance servers to adopt a parallel scheduling mode, schedule the command execution servers to execute the maintenance command concurrently, and further improving the maintenance efficiency of the Linux cluster.
A second aspect of the embodiments of the present application provides an apparatus for maintaining a Linux cluster, including:
the acquisition module is used for acquiring the maintenance command and loading the information of the plurality of cluster servers;
the filtering module is used for filtering the information of the cluster servers to obtain the server information of the command execution servers;
the generating module is used for combining the maintenance command and the server information of the command execution server to generate a maintenance command execution work order;
and the scheduling module is used for executing the work order according to the maintenance command and scheduling the plurality of command execution servers to execute the maintenance command.
A third aspect of the embodiments of the present application provides a maintenance server, including a memory, a processor, and a computer program stored in the memory and executable on the maintenance server, where the processor implements the steps of the method for maintaining a Linux cluster provided in the first aspect when executing the computer program.
A fourth aspect of embodiments of the present application provides a computer-readable storage medium, which stores a computer program, and the computer program, when executed by a processor, implements the steps of the method for maintaining a Linux cluster provided in the first aspect.
A fifth aspect of the embodiments of the present application provides a computer program product, which, when running on a terminal device, causes the terminal device to execute the steps of the method for maintaining a Linux cluster provided in the above aspect.
It is understood that the beneficial effects of the second aspect to the fifth aspect can be referred to the related description of the first aspect, and are not described herein again.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the embodiments or the prior art descriptions will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without inventive exercise.
Fig. 1 is a flowchart illustrating an implementation of a method for maintaining a Linux cluster according to an embodiment of the present application;
fig. 2 is a flowchart illustrating an implementation of step S104 in a method for maintaining a Linux cluster according to an embodiment of the present application;
fig. 3 is a block diagram of a structure of an apparatus for maintaining a Linux cluster according to an embodiment of the present application;
fig. 4 is a block diagram of a maintenance server according to an embodiment of the present disclosure.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
It will be understood that the terms "comprises" and/or "comprising," when used in this specification and the appended claims, 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.
Furthermore, in the description of the present application and the appended claims, the terms "first," "second," "third," and the like are used for distinguishing between descriptions and not necessarily for describing or implying relative importance.
In the description of the embodiments of the present application, "/" means "or" unless otherwise specified, for example, a/B may mean a or B; "and/or" herein is merely an association describing an associated object, and means that there may be three relationships, e.g., a and/or B, which may mean: a exists alone, A and B exist simultaneously, and B exists alone. In addition, in the description of the embodiments of the present application, "a plurality" means two or more than two.
Reference throughout this specification to "one embodiment" or "some embodiments," or the like, means that a particular feature, structure, or characteristic described in connection with the embodiment is included in one or more embodiments of the present application. Thus, appearances of the phrases "in one embodiment," "in some embodiments," "in other embodiments," or the like, in various places throughout this specification are not necessarily all referring to the same embodiment, but rather "one or more but not all embodiments" unless specifically stated otherwise. The terms "comprising," "including," "having," and variations thereof mean "including, but not limited to," unless expressly specified otherwise.
As described in the background art, in the process of maintaining the Linux server by executing the SSH command, since a plurality of servers exist in the cluster, only a plurality of servers can be sequentially logged in to execute the SSH command, and the current login method requires manual operation by an administrator. Therefore, the current maintenance mode of the Linux cluster needs to consume a lot of time for logging in the server and for the cluster server to execute the SSH command, which finally results in the reduction of the maintenance efficiency of the Linux cluster.
Therefore, the embodiment of the application provides a method for maintaining a Linux cluster, which is characterized in that the information of a plurality of cluster servers is obtained by obtaining a maintenance command and loading the information of the plurality of cluster servers, and the information of the plurality of cluster servers is filtered to obtain the server information of a plurality of command execution servers, so that the maintenance server can quickly screen out the command execution servers from a plurality of servers in the cluster and obtain the server information of each command execution server, wherein the server information can comprise a password for logging in a corresponding server, so that the maintenance server can log in the command execution servers in batch, and the maintenance efficiency of the Linux cluster is improved; and combining the maintenance command and the server information of the command execution server to generate a maintenance command execution work order, executing the work order according to the maintenance command, scheduling the command execution servers to execute the maintenance command to obtain the command execution work order, thereby providing feasibility for the maintenance server to schedule the command execution servers to execute the maintenance command concurrently in a parallel scheduling mode, and further improving the maintenance efficiency of the Linux cluster.
Referring to fig. 1, fig. 1 is a flowchart illustrating an implementation of a method for maintaining a Linux cluster according to an embodiment of the present application. The execution main body of the method for maintaining the Linux cluster is a maintenance server in the Linux cluster. The method for maintaining the Linux cluster as shown in fig. 1 includes S101 to S104. The details are as follows:
s101, obtaining a maintenance command and loading information of a plurality of cluster servers.
In this embodiment, the maintenance server obtains the maintenance command and loads information of a plurality of cluster servers. The maintenance command is a command or a command set used for performing a maintenance operation on the cluster server, and includes, but is not limited to, a change command, an upgrade command, a software installation command, and the like, and may be a secure Shell protocol SSH command or a Shell script written by the SSH command. Wherein the SSH command can be sent to the maintenance server through a command window of an SSH tool (such as Putty, Xshell 5, Bitvise SSH Client, etc.) to be received by the maintenance server; shell scripts can be uploaded to the maintenance server through SSH tools.
The cluster server information is server information in the Linux cluster, and includes, but is not limited to, a server name, a server IP address, an account and a password required for logging in the server, a service project name to which the server belongs, information of a machine room in which the server is located, and the like. Among them, Linux is known as GNU/Linux, which is a free-running and freely-spreading UNIX-like operating system capable of running major UNIX tool software, application programs and network protocols, and Linux has hundreds of different releases, such as centros, Debian, ArchLinux based on community development, and Red Hat Enterprise Linux, SUSE, Oracle Linux based on commercial development, and the like. It can be understood that, depending on the business project, there may be a plurality of Linux clusters, and each cluster may include hundreds of servers. Illustratively, an SSH command is written into a Shell script, the Shell script is uploaded to a maintenance server through an SSH tool, and after the Shell script is obtained by the maintenance server, server information of a plurality of Linux clusters can be loaded according to business project names.
S102, filtering the information of the cluster servers to obtain the server information of the command execution servers.
In this embodiment, the system administrator previously logs in each Linux server needing maintenance through the SSH tool to execute the command, and as the number of the maintenance servers increases, the maintenance workload becomes larger and larger. Therefore, in this embodiment, the information of the plurality of cluster servers is filtered according to the preset filtering condition, so as to screen out the server information of the server executing the maintenance command. The preset filtering condition includes, but is not limited to, whether it is a preset server name, whether it is an Internet Protocol (IP) address of a preset server, whether it belongs to a preset machine room, and whether it belongs to a preset service project.
The command execution server is a server in the cluster that needs maintenance. For example, if the service logic in the policy service is changed, the server responsible for the policy service may be found from the plurality of cluster servers, and then one or more servers responsible for the corresponding service logic may be found from the server responsible for the policy service, and the server may be used as a command execution server.
In an embodiment, the cluster server information includes server IP addresses, and then, according to a preset IP address filtering condition, the cluster servers corresponding to the server IP addresses meeting the IP address filtering condition are used as command execution servers, and the server information of the command execution servers is obtained. Since the IP address of the server is unique, the server which needs to be ordered is screened out according to the IP address which needs to be maintained, so that the accuracy of the screening result is improved. The preset IP address filtering condition may be an IP address of a server to be maintained, which is sent to the maintenance server by the SSH tool in advance.
And S103, combining the maintenance command and the server information of the command execution server to generate a maintenance command execution work order.
In this embodiment, the maintenance command execution work order is a task work order of the maintenance server scheduling command execution server, and may include an SSH command execution work order or a Shell script execution work order according to different command forms. When the maintenance command is an SSH command, combining the SSH command with server information of a command execution server to generate an SSH command execution work order; and when the maintenance command is the Shell script, combining the Shell script with the server information of the command execution server to generate a Shell script execution work order.
It can be understood that different scheduling modes can be set for the command execution server according to different maintenance requirements, that is, the maintenance command execution work order can also include the scheduling mode of the command execution server. The scheduling mode can be a sequential scheduling mode and a parallel scheduling mode, the sequential scheduling mode is that the command execution server is sequentially scheduled according to a preset sequence to sequentially execute the SSH command or the command in the Shell script, and the parallel scheduling mode is that the command execution server is concurrently scheduled to concurrently execute the SSH command or the command in the Shell script. Illustratively, the SSH tool sends the maintenance command and the scheduling mode to the maintenance server together, so that the maintenance server generates a command execution work order by combining the maintenance command, the server information of the command execution server and the scheduling mode after screening out the command execution server. If the scheduling method is not specified, the maintenance server executes the maintenance command according to the scheduling command execution server of the default scheduling method.
And S104, executing the work order according to the maintenance command, and scheduling a plurality of command execution servers to execute the maintenance command.
In this embodiment, since the maintenance command execution work order includes the server information of the command execution servers, the command execution servers can be logged in batch according to the server information of the plurality of command execution servers in the maintenance command execution work order, and after logging in each command execution server, the maintenance server issues the ssh command to each command execution server for execution, so as to schedule the plurality of command execution servers for execution.
The embodiment of the application provides a method for maintaining a Linux cluster, which is characterized in that the information of a plurality of cluster servers is filtered by acquiring a maintenance command and loading the information of the cluster servers to obtain the server information of a plurality of command execution servers, so that the maintenance server can quickly screen out the command execution servers from a plurality of servers in the cluster and acquire the server information of each command execution server, and the server information can comprise a password for logging in a corresponding server, so that the maintenance server can log in the command execution servers in batches, and the maintenance efficiency of the Linux cluster is improved; and combining the maintenance command and the server information of the command execution server to generate a maintenance command execution work order, executing the work order according to the maintenance command, scheduling the command execution servers to execute the maintenance command to obtain the command execution work order, thereby providing feasibility for the maintenance server to schedule the command execution servers to execute the maintenance command concurrently in a parallel scheduling mode, and further improving the maintenance efficiency of the Linux cluster.
Referring to fig. 2, fig. 2 is a flowchart illustrating an implementation of step S104 in a method for maintaining a Linux cluster according to an embodiment of the present application. With respect to the embodiment corresponding to fig. 1, step S104 of the method for maintaining a Linux cluster provided in this embodiment includes steps S201 and S202. The details are as follows:
s201, according to the server information of a plurality of command execution servers in the maintenance command execution work order, the command execution servers are logged in batch.
In this embodiment, the general process of logging in the command execution server through the SSH tool is as follows: firstly, executing a command SSH username @192.168.1.x, wherein the system prompts whether to continue to connect for the first login, then 'yes' can be input in a command window of the SSH tool, and then after a period of time, the system prompts to input a password, and then a correct password can be input in the command window of the SSH tool to log in the command execution server. Therefore, the manual login process has two times of man-machine interaction, wherein one time is to input 'yes' and the other time is to input a password, the man-machine interaction is changed into automatic interaction, and the automatic interaction can be realized through a pexpect module of python.
S202, after logging in each command execution server, scheduling a plurality of command execution servers to execute maintenance commands.
In this embodiment, after logging in each command execution server, scheduling a plurality of command execution servers to execute a maintenance command includes: after logging in each command execution server, scheduling a first preset number of command execution servers each time and executing the maintenance commands until the execution of the maintenance commands is completed.
Because the Linux cluster has a load value and the number of servers to be maintained exceeds the load value that the Linux cluster can bear, in order to avoid Linux overload caused by scheduling too many servers concurrently to execute the maintenance command, the first preset number of command execution servers are scheduled each time to concurrently execute the maintenance command until the command execution servers in the command execution work order complete the execution of the maintenance command. It is understood that the specific value of the first preset number may be set according to an actual load value of the Linux cluster.
In one possible implementation manner, scheduling a first preset number of command execution servers at a time and executing the maintenance command concurrently includes: scheduling a first preset number of command execution servers each time, and connecting the command execution servers into a star model, wherein each command execution server is a connection node on the star model; and taking the central node of the star model as a starting point, and sequentially transmitting the maintenance command to each connecting node on the star model according to the connection sequence of the star model so that the command execution server corresponding to each connecting node executes the maintenance command.
In this embodiment, the star model is a transmission model for transmitting a maintenance command to the command execution server in a star manner, and is mainly used to implement upgrading, maintenance, querying, and detecting system configuration information. Specifically, the command execution servers deployed in different areas are connected into a star, the star takes one command execution server or a maintenance server as a star center, and other command execution servers are connected with the star center.
Illustratively, the first preset number is 32, 32 command execution servers are scheduled each time, one of the command execution servers is used as a star hub, and the other 31 command execution servers are connected with the star hub to form a star model. When the maintenance server issues the maintenance command to the command execution server, the maintenance command is sent to the star center, and then the maintenance command is sent to the other 31 command execution servers at the same time, so that the command execution server concurrently executes the maintenance command, and the maintenance efficiency of the Linux cluster is improved. It will be appreciated that for less than 32 cases of command execution servers, the maintenance server still connects the command execution servers into a star model.
In another possible implementation manner, scheduling a first preset number of command execution servers at a time and executing the maintenance command concurrently includes: scheduling a first preset number of command execution servers each time, and connecting the command execution servers into a tree model, wherein each command execution server is a connection node on the tree model; and taking the root node of the tree model as a starting point, and sequentially transmitting the maintenance command to each connecting node on the tree model according to the connection sequence of the tree model so that the command execution server corresponding to each connecting node executes the maintenance command.
In this embodiment, for maintenance commands such as a pulling command of a Docker image, a database installation command, a deployment command, an upgrade command, and the like, which carry data such as an image, an installation package, and the like, such maintenance commands need to instruct an execution server to receive the image or the installation package during execution, and if a traditional concurrency mode is adopted, network bandwidth is occupied at the moment of parallel execution, which greatly affects existing services. Therefore, in order to reduce the occupation of network bandwidth resources, the present embodiment connects the command execution servers as a tree model, which is a transmission model for transmitting the maintenance command to the command execution servers in a tree manner.
Specifically, the star type uses one command execution server or a maintenance server as a tree root, and other command execution servers are connected in sequence at an execution level of the command execution server, wherein the execution level of the command execution server is, for example, an installation command of a database, and the execution level of the command execution server executes the order of the installation command for each command execution server. It is understood that each node in the tree model may have a sub-node, that is, the next node, such as the root node, may have two or more command execution servers, that is, after the root node, two or more command execution servers are required to execute the maintenance command simultaneously.
Further, after scheduling a first preset number of command execution servers and executing the maintenance commands concurrently each time, the method further includes: if the load value of the Linux cluster is larger than the preset threshold value, scheduling a second preset number of command execution servers to execute the maintenance commands and executing the maintenance commands, wherein the second preset number is smaller than the first preset number; and if the load value of the Linux cluster is smaller than the preset threshold value, scheduling a third preset number of command execution servers to execute the maintenance commands in parallel, wherein the third preset number is larger than the first preset number.
In this embodiment, since there are a plurality of Linux clusters, the number of servers in each cluster is not necessarily the same, that is, the load value of each cluster is not necessarily the same. Therefore, for a cluster with a high load value, when a first preset number of command execution servers are scheduled, the load value of the cluster is greater than a preset threshold value, so that the cluster is overloaded, the cluster is subjected to balanced load, the phenomenon that the server is down due to the overload of the cluster is avoided, the execution process of the maintenance command is prevented from being influenced, and the safety of the execution process of the maintenance command is improved.
In all embodiments of the present application, the corresponding command execution work order is obtained based on the maintenance command and the server information of the command execution server, and specifically, the command execution work order is generated by combining the maintenance command and the server information of the command execution server. Uploading the command execution work order to the blockchain can ensure the safety and the fair transparency of the user. The command execution server can download the command execution work order from the blockchain so as to check whether the server information of the maintenance command and the command execution server is tampered. The blockchain referred to in this example is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, consensus mechanism, encryption algorithm, and the like. A block chain (Blockchain), which is essentially a decentralized database, is a series of data blocks associated by using a cryptographic method, and each data block contains information of a batch of network transactions, so as to verify the validity (anti-counterfeiting) of the information and generate a next block. The blockchain may include a blockchain underlying platform, a platform product service layer, an application service layer, and the like.
Referring to fig. 3, fig. 3 is a block diagram of a device for maintaining a Linux cluster according to an embodiment of the present application. In this embodiment, each unit included in the mobile terminal is configured to execute each step in the embodiments corresponding to fig. 1 to fig. 2. Please refer to fig. 1 to 2 and fig. 1 to 2 for the corresponding embodiments. For convenience of explanation, only the portions related to the present embodiment are shown. Referring to fig. 3, the apparatus for maintaining the Linux cluster includes:
an obtaining module 301, configured to obtain a maintenance command and load information of a plurality of cluster servers;
a filtering module 302, configured to filter information of multiple cluster servers to obtain server information of multiple command execution servers;
a generating module 303, configured to combine the maintenance command and the server information of the command execution server to generate a maintenance command execution work order;
and the scheduling module 304 is configured to schedule the multiple command execution servers to execute the maintenance command according to the maintenance command execution work order.
The embodiment of the application provides a device for maintaining a Linux cluster, wherein a maintenance command is obtained and information of a plurality of cluster servers is loaded through an obtaining module 301, the information of the plurality of cluster servers is filtered through a filtering module 302 to obtain server information of the plurality of command execution servers, so that the maintenance servers can quickly screen out the command execution servers from a plurality of servers in the cluster and obtain the server information of each command execution server, and the server information can comprise a password for logging in a corresponding server, so that the maintenance servers can log in the command execution servers in batch, and the maintenance efficiency of the Linux cluster is improved; the generating module 303 combines the maintenance command and the server information of the command execution server to generate a maintenance command execution work order, and executes the work order according to the maintenance command, and the scheduling module 304 schedules the plurality of command execution servers to execute the maintenance command to obtain the command execution work order, so that feasibility is provided for the maintenance servers to schedule the command execution servers to concurrently execute the maintenance command in a parallel scheduling manner, and the maintenance efficiency of the Linux cluster is further improved.
As an embodiment of the present application, the filtering model 302 is further configured to:
filtering the IP addresses of the servers according to preset IP address filtering conditions;
and taking the cluster server corresponding to the IP address of the server meeting the IP address filtering condition as a command execution server, and obtaining the server information of the command execution server.
As an embodiment of the present application, the scheduling module 304 is further configured to:
according to server information of a plurality of command execution servers in the maintenance command execution work order, logging in the command execution servers in batch;
after logging in each command execution server, scheduling a plurality of command execution servers to execute the maintenance command.
As an embodiment of the present application, the scheduling module 304 is further configured to:
after logging in each command execution server, scheduling a first preset number of command execution servers each time and executing the maintenance commands until the execution of the maintenance commands is completed.
As an embodiment of the present application, the scheduling module 304 is further configured to:
scheduling a first preset number of command execution servers each time, and connecting the command execution servers into a star model, wherein each command execution server is a connection node on the star model;
and taking the central node of the star model as a starting point, and sequentially transmitting the maintenance command to each connecting node on the star model according to the connection sequence of the star model so that the command execution server corresponding to each connecting node executes the maintenance command.
As an embodiment of the present application, the scheduling module 304 is further configured to:
scheduling a first preset number of command execution servers each time, and connecting the command execution servers into a tree model, wherein each command execution server is a connection node on the tree model;
and taking the root node of the tree model as a starting point, and sequentially transmitting the maintenance command to each connecting node on the tree model according to the connection sequence of the tree model so that the command execution server corresponding to each connecting node executes the maintenance command.
As an embodiment of the present application, the scheduling module 304 is further configured to:
if the load value of the Linux cluster is larger than the preset threshold value, scheduling a second preset number of command execution servers to execute the maintenance commands and executing the maintenance commands, wherein the second preset number is smaller than the first preset number;
and if the load value of the Linux cluster is smaller than the preset threshold value, scheduling a third preset number of command execution servers to execute the maintenance commands in parallel, wherein the third preset number is larger than the first preset number.
It should be understood that, in the structural block diagram of the apparatus for maintaining a Linux cluster shown in fig. 3, each unit is configured to execute each step in the embodiment corresponding to fig. 1 to 2, and each step in the embodiment corresponding to fig. 1 to 2 has been explained in detail in the above embodiment, and specific reference is made to the relevant description in the embodiment corresponding to fig. 1 to 2 and fig. 1 to 2, which is not repeated herein.
Fig. 4 is a block diagram of a maintenance server according to another embodiment of the present application. As shown in fig. 4, the maintenance server device 40 of this embodiment includes: a processor 41, a memory 42 and a computer program 43 stored in said memory 42 and executable on said processor 41, for example a program of a method of maintaining a Linux cluster. The processor 41 executes the computer program 43 to implement the steps in the embodiments of the methods for maintaining a Linux cluster, such as S101 to S104 shown in fig. 1 or S201 to S202 shown in fig. 2. Alternatively, when the processor 41 executes the computer program 43, the functions of the units in the embodiment corresponding to fig. 3, for example, the functions of the units 301 to 304 shown in fig. 3, are implemented, for which reference is specifically made to the relevant description in the embodiment corresponding to fig. 3, which is not repeated herein.
Illustratively, the computer program 43 may be divided into one or more units, which are stored in the memory 42 and executed by the processor 41 to accomplish the present application. The one or more units may be a series of computer program instruction segments capable of performing specific functions, which are used to describe the execution process of the computer program 43 in the maintenance server 40. For example, the computer program 43 may be divided into a first acquisition unit, a first determination unit, a first adjustment unit, a second adjustment unit, and an execution unit, each unit functioning specifically as described above.
It will be understood by those skilled in the art that fig. 4 is merely an example of the maintenance server apparatus 40, and does not constitute a limitation of the maintenance server apparatus 40, and may include more or less components than those shown, or some components in combination, or different components, for example, the maintenance server may also include input output devices, network access devices, buses, etc.
The Processor 41 may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic, discrete hardware components, etc. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The storage 42 may be an internal storage unit of the maintenance server device 40, such as a hard disk or a memory of the maintenance server device 40. The memory 42 may also be an external storage device of the maintenance server device 40, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like provided on the maintenance server device 40. Further, the memory 42 may also include both an internal storage unit and an external storage device of the maintenance server device 40. The memory 42 is used for storing the computer program and other programs and data required by the turntable device. The memory 42 may also be used to temporarily store data that has been output or is to be output.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not substantially depart from the spirit and scope of the embodiments of the present application and are intended to be included within the scope of the present application.

Claims (10)

1. A method for maintaining a Linux cluster, comprising:
obtaining a maintenance command and loading information of a plurality of cluster servers;
filtering the information of the cluster servers to obtain server information of a plurality of command execution servers;
combining the maintenance command with the server information of the command execution server to generate a maintenance command execution work order;
and scheduling a plurality of command execution servers to execute the maintenance command according to the maintenance command execution work order.
2. The method for maintaining the Linux cluster according to claim 1, wherein the cluster server information includes a server IP address, and the filtering the plurality of cluster server information to obtain the server information of the plurality of command execution servers comprises:
filtering the IP addresses of the servers according to preset IP address filtering conditions;
and taking the cluster server corresponding to the IP address of the server meeting the IP address filtering condition as a command execution server.
3. The method for maintaining the Linux cluster according to claim 1, wherein the combining the maintenance command and the server information of the command execution server to generate a maintenance command execution work order comprises:
if the maintenance command is a secure shell protocol (SSH) command, combining the SSH command with server information of the command execution server to generate an SSH command execution work order, and taking the SSH command execution work order as the maintenance command execution work order;
if the maintenance command is a Shell script consisting of a plurality of SSH commands, combining the Shell script with server information of the command execution server to generate a Shell script execution work order, and taking the Shell script execution work order as the maintenance command execution work order.
4. The method for maintaining the Linux cluster according to claim 1, wherein the scheduling the plurality of command execution servers to execute the maintenance command according to the maintenance command execution work order comprises:
according to the server information of the command execution servers in the maintenance command execution work order, logging in the command execution servers in batches;
after logging in each command execution server, scheduling a first preset number of command execution servers each time and executing the maintenance command until the execution of the maintenance command is completed.
5. The method for maintaining the Linux cluster according to claim 4, wherein the scheduling a first preset number of the command execution servers at a time and executing the maintenance command concurrently comprises:
scheduling a first preset number of command execution servers each time, and connecting the command execution servers into a star model, wherein each command execution server is a connection node on the star model;
and taking the central node of the star model as a starting point, and sequentially transmitting the maintenance command to each connecting node on the star model according to the connection sequence of the star model so as to enable the command execution server corresponding to each connecting node to execute the maintenance command.
6. The method for maintaining the Linux cluster according to claim 4, wherein the scheduling a first preset number of the command execution servers at a time and executing the maintenance command concurrently comprises:
scheduling a first preset number of command execution servers each time, and connecting the command execution servers into a tree model, wherein each command execution server is a connection node on the tree model;
and taking the root node of the tree model as a starting point, and sequentially transmitting the maintenance command to each connecting node on the tree model according to the connection sequence of the tree model, so that the command execution server corresponding to each connecting node executes the maintenance command.
7. The method for maintaining the Linux cluster according to any one of claims 4 to 6, wherein after scheduling a first preset number of the command execution servers each time and executing the maintenance command, further comprising:
if the load value of the Linux cluster is larger than a preset threshold value, scheduling a second preset number of command execution servers to execute the maintenance commands simultaneously, wherein the second preset number is smaller than the first preset number;
and if the load value of the Linux cluster is smaller than a preset threshold value, scheduling a third preset number of the command execution servers to execute the maintenance commands at the same time, wherein the third preset number is larger than the first preset number.
8. An apparatus for maintaining a Linux cluster, comprising:
the acquisition module is used for acquiring the maintenance command and loading the information of the plurality of cluster servers;
the filtering module is used for filtering the information of the cluster servers to obtain the server information of the command execution servers;
the generating module is used for combining the maintenance command and the server information of the command execution server to generate a maintenance command execution work order;
and the scheduling module is used for scheduling the command execution servers to execute the maintenance commands according to the maintenance command execution work order.
9. A maintenance server comprising a memory, a processor and a computer program stored in said memory and executable on said processor, characterized in that said processor implements the steps of the method according to any of claims 1 to 7 when executing said computer program.
10. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 7.
CN202011002427.7A 2020-09-22 2020-09-22 Method and device for maintaining Linux cluster, maintenance server and medium Active CN112134950B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011002427.7A CN112134950B (en) 2020-09-22 2020-09-22 Method and device for maintaining Linux cluster, maintenance server and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011002427.7A CN112134950B (en) 2020-09-22 2020-09-22 Method and device for maintaining Linux cluster, maintenance server and medium

Publications (2)

Publication Number Publication Date
CN112134950A true CN112134950A (en) 2020-12-25
CN112134950B CN112134950B (en) 2023-08-29

Family

ID=73842312

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011002427.7A Active CN112134950B (en) 2020-09-22 2020-09-22 Method and device for maintaining Linux cluster, maintenance server and medium

Country Status (1)

Country Link
CN (1) CN112134950B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114760179A (en) * 2022-03-28 2022-07-15 北京汇元网科技股份有限公司 Interface, method, terminal and medium for batch execution of operation by server

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107528708A (en) * 2016-06-21 2017-12-29 天脉聚源(北京)科技有限公司 A kind of method and system for arranging Linux server cluster
CN109861842A (en) * 2018-11-23 2019-06-07 阿里巴巴集团控股有限公司 O&M method, apparatus, electronic equipment and the storage medium of server cluster
CN110275872A (en) * 2019-07-18 2019-09-24 中国银行股份有限公司 Version automatic deployment method, device, computer equipment and storage medium

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107528708A (en) * 2016-06-21 2017-12-29 天脉聚源(北京)科技有限公司 A kind of method and system for arranging Linux server cluster
CN109861842A (en) * 2018-11-23 2019-06-07 阿里巴巴集团控股有限公司 O&M method, apparatus, electronic equipment and the storage medium of server cluster
CN110275872A (en) * 2019-07-18 2019-09-24 中国银行股份有限公司 Version automatic deployment method, device, computer equipment and storage medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114760179A (en) * 2022-03-28 2022-07-15 北京汇元网科技股份有限公司 Interface, method, terminal and medium for batch execution of operation by server

Also Published As

Publication number Publication date
CN112134950B (en) 2023-08-29

Similar Documents

Publication Publication Date Title
CN108549580B (en) Method for automatically deploying Kubernets slave nodes and terminal equipment
CN108536519B (en) Method for automatically building Kubernetes main node and terminal equipment
US8135989B2 (en) Systems and methods for interrogating diagnostic target using remotely loaded image
CN110719209B (en) Cluster network configuration method, system, equipment and readable storage medium
WO2015192651A1 (en) Method for implementing rapid configuration and rapid configuration server
US20120005325A1 (en) Systems and methods for automated processing of devices
CN109375933B (en) Method and equipment for upgrading client
US20220269539A1 (en) Redistributing update resources during update campaigns
US20170006131A1 (en) Managing users of cloud services with management tool
CN110636127B (en) Communication processing method and system between information data
CN114422618B (en) Cloud-protogenesis-based IOT platform protocol adaptation method, device, equipment and medium
CN110673938A (en) Task processing method, system, server and storage medium
CN111400041A (en) Server configuration file management method and device and computer readable storage medium
CN113794652A (en) Data processing method and device, electronic equipment and storage medium
CN112134950B (en) Method and device for maintaining Linux cluster, maintenance server and medium
CN115102877A (en) Virtual network card network detection method, device, equipment and medium
CN109936609B (en) Terminal chain type upgrading method and device and upgrading management server
US11663349B2 (en) System and method for managing data object creation
US20120072916A1 (en) Future system that can participate in systems management activities until an actual system is on-line
CN113238851A (en) Script automatic execution method, system, equipment and medium based on cloud platform
CN113177179A (en) Data request connection management method, device, equipment and storage medium
US9092295B2 (en) Managing software package updates using communication pipes
US8171302B2 (en) Method and system for creating a pre-shared key
US20240045733A1 (en) Method and apparatus for deploying deep learning system
US20220030079A1 (en) Methods and systems for recording user operations on a cloud management platform

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