Disclosure of Invention
The embodiment of the invention aims to provide a deployment method, a device and equipment based on a distributed system and the distributed system so as to reduce error rate in the deployment process.
To achieve the above object, an embodiment of the present invention provides a deployment method based on a distributed system, applied to a first management node of the distributed system, where the method includes:
acquiring a management node deployment file and a storage node deployment file from a server according to the address of the server contained in the pre-acquired configuration file;
installing the management node deployment file to the first management node;
Restarting the first management node;
after the restarting of the first management node is detected through restarting the self-starting service, the storage node deployment file is sent to the storage nodes in the distributed system;
and controlling the storage nodes in the distributed system to install the storage node deployment file after acquiring the storage node deployment file.
Optionally, the obtaining, from the server, the management node deployment file and the storage node deployment file according to the address of the server included in the pre-obtained configuration file includes:
reading addresses of servers storing management node deployment files and storage node deployment files, identity information of the servers and deployment file version information in a pre-acquired configuration file;
accessing the address of the server, and acquiring a management node deployment file and a storage node deployment file corresponding to the version information by utilizing the identity information.
Optionally, after the management node deployment file is installed to the first management node, the method may further include:
sending the management node deployment file to management nodes except the first management node in the distributed system;
And controlling the management nodes in the distributed system to install the management node deployment file and restart the management nodes after acquiring the management node deployment file.
Optionally, the sending the management node deployment file to a management node in the distributed system except for the first management node includes:
and calling a secure shell protocol, and transmitting the management node deployment file to management nodes except the first management node in the distributed system by using a file transmission instruction in the secure shell protocol.
Optionally, the installing the management node deployment file to the first management node includes:
unloading an original deployment file installed in the first management node;
restarting the first management node after detecting that the unloading is completed;
and after the first management node is detected to be restarted by restarting the self-starting service, the shell command is called by python, and the management node deployment file is installed to the first management node.
Optionally, the sending the storage node deployment file to a storage node in the distributed system includes:
Calling https protocol, and establishing connection with web program in storage node in the distributed system;
invoking the https protocol, and transmitting the storage node deployment file to a storage node in the distributed system through the web program;
after the storage node in the distributed system is controlled to acquire the storage node deployment file, the storage node deployment file is installed, and the method further comprises the following steps:
and performing configuration operation on the storage nodes in the distributed system through the web program.
Optionally, after controlling the storage node in the distributed system to install the storage node deployment file, the method may further include:
and configuring the management relationship between the management node and the storage node in the distributed system according to the configuration information in the configuration file.
Optionally, after controlling the storage node in the distributed system to obtain the storage node deployment file and install the storage node deployment file, the method may further include:
controlling the management node in the distributed system to delete the management node deployment file stored in the management node;
and controlling the storage nodes in the distributed system to delete the storage node deployment files stored in the management nodes.
To achieve the above object, an embodiment of the present invention further provides a deployment device based on a distributed system, which is applied to a first management node of the distributed system, and the device includes:
the acquisition module is used for acquiring a management node deployment file and a storage node deployment file from a server according to the address of the server contained in the pre-acquired configuration file;
the installation module is used for installing the management node deployment file to the first management node;
the restarting module is used for restarting the first management node;
the first sending module is used for sending the storage node deployment file to the storage nodes in the distributed system after detecting that the first management node is restarted through restarting the self-starting service;
the first control module is used for controlling the storage nodes in the distributed system to install the storage node deployment files after the storage node deployment files are acquired.
Optionally, the acquiring module may specifically be configured to:
reading addresses of servers storing management node deployment files and storage node deployment files, identity information of the servers and deployment file version information in a pre-acquired configuration file;
Accessing the address of the server, and acquiring a management node deployment file and a storage node deployment file corresponding to the version information by utilizing the identity information.
Optionally, the apparatus may further include:
the second sending module is used for sending the management node deployment file to management nodes except the first management node in the distributed system;
the second control module is used for controlling the management node in the distributed system to install the management node deployment file and restart the management node after the management node deployment file is acquired.
Optionally, the second sending module may specifically be configured to:
and calling a secure shell protocol, and transmitting the management node deployment file to management nodes except the first management node in the distributed system by using a file transmission instruction in the secure shell protocol.
Optionally, the installation module may be specifically configured to:
unloading an original deployment file installed in the first management node;
restarting the first management node after detecting that the unloading is completed;
and after the first management node is detected to be restarted by restarting the self-starting service, the shell command is called by python, and the management node deployment file is installed to the first management node.
Optionally, the first sending module may be specifically configured to:
calling https protocol, and establishing connection with web program in storage node in the distributed system;
invoking the https protocol, and transmitting the storage node deployment file to a storage node in the distributed system through the web program;
the apparatus further comprises:
and the first configuration module is used for performing configuration operation on the storage nodes in the distributed system through the web program.
Optionally, the apparatus may further include:
the second configuration module is used for configuring the management relationship between the management node and the storage node in the distributed system according to the configuration information in the configuration file after the first control module controls the storage node in the distributed system to install the storage node deployment file.
Optionally, the apparatus may further include:
the third control module is used for controlling the management node in the distributed system to delete the management node deployment file stored in the management node; and controlling the storage nodes in the distributed system to delete the storage node deployment files stored in the management nodes.
In order to achieve the above object, an embodiment of the present invention further provides an electronic device, including a processor and a memory;
a memory for storing a computer program;
and the processor is used for realizing any deployment method based on the distributed system when executing the program stored on the memory.
To achieve the above object, an embodiment of the present invention further provides a computer program stored in the computer readable storage medium, where the computer program when executed by a processor implements any one of the deployment methods based on a distributed system.
To achieve the above object, an embodiment of the present invention further provides a distributed system, including: a first management node, a server and a storage node, wherein,
the first management node is used for acquiring a management node deployment file and a storage node deployment file from a server according to the address of the server contained in the pre-acquired configuration file; installing the management node deployment file to the first management node; restarting the first management node; after the restarting of the first management node is detected through restarting the self-starting service, the storage node deployment file is sent to the storage nodes in the distributed system; controlling storage nodes in the distributed system to install the storage node deployment file after acquiring the storage node deployment file;
The server is used for providing a management node deployment file and a storage node deployment file for the first management node;
the storage node is used for acquiring the storage node deployment file and installing the storage node deployment file under the control of the first management node.
Optionally, the system further comprises one or more management nodes in addition to the first management node, wherein,
the first management node is further configured to send the management node deployment file to a management node in the distributed system except for the first management node; after the management node in the distributed system acquires the management node deployment file, the management node deployment file is installed and the management node is restarted;
the one or more management nodes are used for acquiring the management node deployment file, installing the management node deployment file under the control of the first management node, and restarting.
By applying the embodiment of the invention, the first management node performs the deployment operation of the distributed system: the first management node acquires a management node deployment file and a storage node deployment file from a server; the first management node is used for restarting the management node deployment file after installing the management node deployment file on the first management node; after the self-starting service is restarted, the first management node sends the storage node deployment file to the storage nodes in the distributed system and controls the storage nodes to install the storage node deployment file; therefore, in the scheme, the automatic deployment of the distributed system is realized, and compared with manual operation, the error rate is reduced.
Of course, it is not necessary for any one product or method of practicing the invention to achieve all of the advantages set forth above at the same time.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present invention, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
In order to solve the technical problems, the embodiment of the invention provides a deployment method, a device and equipment based on a distributed system and the distributed system. The method and the device can be applied to any management node in a distributed system, and for convenience of description, the management node applying the method or the device is called a first management node, and one or more first management nodes can be provided.
The following first describes a deployment method based on a distributed system in detail.
Fig. 1 is a schematic flow chart of a first method for deploying a distributed system according to an embodiment of the present invention, including:
s101: and acquiring a management node deployment file and a storage node deployment file from the server according to the address of the server in the pre-acquired configuration file.
The first management node may be provided with a deployment program, and the deployment program executes the embodiment of the present invention. The deployment program may be a software, a tool, etc., and is not particularly limited. The deployment program can be added to the restart self-starting service of the first management node, so that the deployment program can be automatically operated after the first management node is restarted, and the deployment operation is continuously executed.
For example, if the operating system in the first management node is centOS7, the deployment program may be added to the systemd service, and if the operating system in the first management node is suse, the deployment program may be added to the/etc/init. D/boot/. Local script.
For example, the first management node may have a configuration file stored in advance, for example, the first management node may obtain the configuration file from the user equipment and store the first configuration file.
As an embodiment, S101 may include: reading addresses of servers storing management node deployment files and storage node deployment files, identity information of the servers and deployment file version information in a pre-acquired configuration file; accessing the address of the server, and acquiring a management node deployment file and a storage node deployment file corresponding to the version information by utilizing the identity information.
In this embodiment, the server refers to a server storing a management node deployment file and a storage node deployment file; the server may be an FTP (File Transfer Protocol ) based server (alternatively referred to as an FTP server); or the server may be a server (or referred to as an svn server) that provides an svn (software project version control management system) service, etc., and the type of the server is not particularly limited.
For example, the configuration file stored in the first management node may include an IP address of the server, and the configuration file further includes identity information for accessing the server, such as a user name, password information, and the like, which are required when accessing the file in the server; the configuration file can also contain version information and the like of the deployment file; the first management node and the server can communicate through a Telnet protocol, so that the configuration file can also comprise a Telnet protocol port, a user name and a password under the Telnet protocol, and the like.
The first management node (or the deployment program in the first management node) may access the IP address of the server and download the deployment file of the corresponding version stored in the server by accessing the identity information of the server. The deployment file comprises a management node deployment file and a storage node deployment file.
For example, after reading the IP address contained in the configuration file, the IP address, i.e., the server to which the IP address corresponds, may be accessed using a public library in the ftplib module of python (an object oriented interpreted computer programming language).
S102: the management node deployment file is installed to the first management node.
As an implementation manner, the original deployment file installed in the first management node may be uninstalled first; restarting the first management node after detecting that the unloading is completed; and after the first management node is detected to be restarted by restarting the self-starting service, the shell command is called by python, and the management node deployment file is installed to the first management node.
It can be understood that if the deployment file is already installed in the first management node, the installed deployment file is uninstalled, and then the management node deployment file acquired in S102 is installed; if the deployment file is not installed in the first management node, the management node deployment file acquired in S102 is directly installed. For the sake of distinguishing descriptions, the deployment file installed in the management node is referred to herein as the original deployment file.
After the original deployment file is unloaded, the first management node can be restarted. As described above, the deployment program is added to the restart self-starting service of the first management node, so that after the first management node is restarted, the deployment program automatically operates, and the management node deployment file is installed to the first management node by calling a shell command through python.
S103: and restarting the first management node.
And after the management node deployment file is installed to the first management node, restarting the first management node. That is, if the deployment file is already installed in the first management node before S102, the first management node needs to be restarted twice, once after the original deployment file is uninstalled, once after the management node deployment file is installed.
As described above, the deployment program is added to the restart self-starting service of the first management node, so that after the first management node is restarted, the deployment program automatically runs, and the remaining deployment work, that is, the subsequent steps of the present embodiment, continues to be executed.
If there are other management nodes in the distributed system besides the first management node, sending the management node deployment file to the management nodes in the distributed system except the first management node after S102 or after S103; and controlling the management nodes in the distributed system to install the management node deployment file and restart the management nodes after acquiring the management node deployment file.
That is, the order of the steps of "installing the management node deployment file to the first management node" and "transmitting the management node deployment file to the other management nodes" is not limited; or after the first management node is restarted, the management node deployment file is sent to other management nodes, and other management nodes are controlled to install the management node deployment file and restart; or, the management node deployment file may be sent to other management nodes first, and the other management nodes are controlled to install the management node deployment file and restart, and then the first management node is controlled to restart.
Specifically, a first management node (or a deployment program in the first management node) may invoke a secure shell protocol (SSH, secure Shell Protocol) and send the management node deployment file to management nodes in the distributed system other than the first management node using a file transfer instruction in the secure shell protocol.
The process of the first management node (or the deployment program in the first management node) controlling other management nodes to install the management node deployment file is similar to S102, and it is assumed that, in addition to the first management node, there is a management node B in the distributed system, and the deployment program is used to describe the control of the management node B as an example:
The deployment program can control the original deployment file installed in the unloading management node B; restarting the management node B after the deployment program detects that the unloading is finished; and after the deployment program detects that the management node B is restarted, the management node deployment file is installed to the management node B through a python call shell command.
It can be understood that if the deployment file is already installed in the management node B, the installed deployment file is uninstalled, and then the management node deployment file acquired in S102 is installed; if the deployment file is not installed in the first management node, the management node deployment file acquired in S102 is directly installed. For the sake of distinguishing descriptions, the deployment file installed in the management node is referred to herein as the original deployment file.
After the original deployment file is unloaded, the deployment program can control the management node B to restart. After the deployment program detects that the management node B is restarted, the management node deployment file can be installed to the management node B by calling a shell command through python.
And after the management node deployment file is installed to the management node B, restarting the management node B. That is, if the deployment file is already installed in the management node B, the management node B needs to be restarted twice, once after the original deployment file is uninstalled, and once after the management node deployment file is installed.
S104: and restarting the self-starting service, and after detecting that the first management node is restarted, sending the storage node deployment file to the storage nodes in the distributed system.
And after the management node deployment files are installed in the management nodes of the distributed system, the storage node deployment files are installed to the storage nodes in the distributed system. It will be appreciated that if there is only one management node in the distributed system, i.e. the first management node, in this case S103 is followed directly by S104; if only a plurality of management nodes exist in the distributed system, after each management node installs the management node deployment file, the storage node deployment file is sent to the storage nodes in the distributed system.
As an embodiment, the first management node (or the deployment program in the first management node) may invoke https protocol to establish a connection with the web program in the storage node in the distributed system; and calling the https protocol, and sending the storage node deployment file to a storage node in the distributed system through the web program.
In this embodiment, a web program may be run in each storage node in the distributed system, and the storage node provides web services through the web program.
The storage nodes in the distributed system may be deployed by a web program, and the first management node (or the deployment program in the first management node) may call the https protocol to connect with the web program in the storage node. After the connection is established, the deployment program may send the storage node deployment file acquired in S102 to each storage node through the https protocol.
S105: and controlling the storage nodes in the distributed system to install the storage node deployment file after acquiring the storage node deployment file.
It will be appreciated that in some cases, the storage node may need to be restarted after it has installed the storage node deployment file, and in other cases, the storage node may not need to be restarted after it has installed the storage node deployment file. For example, the information of "whether the storage node needs to be restarted after installing the storage node deployment file" may be added to the configuration file, so that the deployment program may control the storage node according to the configuration file.
Assume that a storage node a is included in the distributed system, and the control of the storage node a by the deployment program is described as an example:
the deployment program can control the original storage node deployment file installed in the unloading storage node A; restarting the storage node A after the deployment program detects that the unloading is finished; and after the deployment program detects that the storage node A is restarted, the storage node deployment file is installed to the storage node A through a python call shell command.
It can be understood that if the deployment file is already installed in the storage node a, the installed deployment file is uninstalled, and then the storage node deployment file acquired in S102 is installed; if the deployment file is not installed in the first storage node, the storage node deployment file acquired in S102 is directly installed. For purposes of distinguishing descriptions, the installed deployment file in a storage node will be referred to herein as the original storage node deployment file.
After the original storage node deployment file is unloaded, the deployment program can control the storage node A to restart. After the deployment program detects that the storage node A is restarted, the storage node deployment file can be installed to the storage node A by calling a shell command through python.
After the deployment program determines to install the storage node deployment file to the storage node a according to the configuration file, the storage node a needs to be restarted. That is, if the deployment file is already installed in the storage node a, the storage node a needs to be restarted twice, once after the original storage node deployment file is uninstalled, and once after the storage node deployment file is installed.
After the deployment program controls the storage node a to restart, the deployment program may perform configuration operations on the storage node a through the web program, where the configuration operations may include, without limitation, system formatting, disk formatting, component configuration, or other initialization operations.
If the deployment program determines that the storage node a needs not to be restarted after installing the storage node deployment file according to the configuration file, the deployment program controls the storage node a to install the storage node deployment file, and then the deployment program can perform configuration operation on the storage node a through the web program, where the configuration operation may include system formatting, disk formatting, component configuration or other initialization operations, and the like, and is not specifically limited.
After S105, a management relationship between a management node and a storage node in the distributed system may be configured according to the configuration information in the configuration file.
For example, after the first management node sets the deployment program, the web program of the first management node may be started, and the first management node may configure the management relationship between the management node and the storage node in the distributed system through the web program of the first management node.
If there is only one management node in the distributed system, information of each storage node in the distributed system, such as IP address, storage content, etc., may be sent to the management node, and information of the management node, such as IP address or other information, may be sent to each storage node.
If there are multiple management nodes in the distributed system, it is assumed that the configuration file includes management relationships between the management nodes and the storage nodes as follows: the management node 1 manages the storage nodes 1-3, and the management node 2 manages the storage nodes 4-6; information of the storage node 1-3, such as an IP address, storage content, etc., may be transmitted to the management node 1 and information of the management node 1, such as an IP address or other information, may be transmitted to the storage node 1-3, and similarly information of the storage node 4-6, such as an IP address, storage content, etc., may be transmitted to the management node 2 and information of the management node 2, such as an IP address or other information, may be transmitted to the storage node 4-6. In this way, deployment for the distributed system is completed.
As an implementation manner, after deployment is completed, the management node in the distributed system can be controlled to delete the management node deployment file stored in the management node; controlling storage nodes in the distributed system to delete storage node deployment files stored in management nodes; deleting the deployment program from the restarting self-starting service of the first management node, and stopping the operation of the deployment program.
In this embodiment, the management node deployment file stored in the management node is deleted, and is not the management node deployment file installed in the management node, and in this embodiment, the storage node deployment file stored in the storage node is deleted, and is not the storage node deployment file installed in the storage node.
It may be understood that, taking the management node as an example, after the management node obtains the deployment file of the management node, the management node stores the deployment file, installs the deployment file into the management node, and after the installation is successful, the stored deployment file may be deleted. In this way, storage space can be saved.
In addition, after the deployment is completed, the deployment program can delete itself from the restart self-starting service and exit operation, so that the memory space can be saved.
By applying the embodiment shown in the figure 1 of the invention, the deployment program is arranged in the first management node of the distributed system, the deployment program carries out deployment operation, and the deployment program adds the deployment program itself into the restarting self-starting service of the first management node, so that after the first management node is restarted, the deployment program can continue to carry out deployment operation. In addition, the operation interface in the manual deployment process is complex, such as a svn interface, an FTP interface, a shell interface and the like, and in the scheme, the automatic deployment is realized by a deployment program, so that the operation is simplified.
In some existing solutions, when deployment is performed based on a cloud storage system, intervention of a third party device is generally required, for example, when a cloud storage system deployment file is installed in a management node, the third party device is generally required to download the deployment file from a server, and the downloaded file is installed in the management node through the third party device. Compared with the scheme, the method and the device do not need intervention of third-party equipment, and operation is more convenient.
The embodiment of the invention also provides a flow diagram of another deployment method based on a distributed system, as shown in fig. 2, and the application scenario of the embodiment of fig. 2 may be as shown in fig. 3: the distributed system of fig. 3 includes an FTP server, two management nodes, and several storage nodes (storage node 1, storage node 2, … … storage node N); the FTP server is the server described in the embodiment of fig. 2; a deployment program is set in a management node, which is the first management node in the embodiment of fig. 2; each storage node runs a web program.
Fig. 2 is a second flowchart of a deployment method based on a distributed system according to an embodiment of the present invention, including:
S201: the deployment procedure is added to the restart self-starting service of the first management node. The deployment program performs the subsequent steps.
S202: and reading addresses of servers storing the management node deployment files and the storage node deployment files, identity information for accessing the servers and deployment file version information in the pre-acquired configuration files.
S203: accessing the address of the server, and acquiring a management node deployment file and a storage node deployment file corresponding to the version information by utilizing the identity information.
S204: installing the management node deployment file to a first management node; and restarting the first management node.
S205: and after the restarting self-starting service detects that the first management node is restarted, calling a secure shell protocol, and sending the management node deployment file to management nodes except the first management node in the distributed system by using a file transmission instruction in the secure shell protocol.
S206: and after the management node in the distributed system acquires the management node deployment file, installing the management node deployment file and restarting the management node.
As one embodiment, the process of installing the management node deployment file to the management node (including the first management node and other management nodes) may include:
Unloading an original deployment file installed in a management node;
restarting the management node after detecting that the unloading is completed;
and after detecting that the management node is restarted, installing the management node deployment file to the management node by calling a shell command through python.
S207: the https protocol is invoked to establish a connection with a web program in a storage node in the distributed system.
S208: and calling the https protocol, and sending the storage node deployment file to the storage nodes in the distributed system through the web program.
S209: and controlling the storage nodes in the distributed system to install the storage node deployment file after acquiring the storage node deployment file.
S210: through the web program, a configuration operation is performed on the storage nodes in the distributed system.
The configuration operation may include, without limitation, system formatting, disk formatting, component configuration, or other initialization operations.
S211: and configuring the management relationship between the management node and the storage node in the distributed system according to the configuration information in the configuration file.
If there is only one management node in the distributed system, information of each storage node in the distributed system, such as IP address, storage content, etc., may be sent to the management node, and information of the management node, such as IP address or other information, may be sent to each storage node.
If there are multiple management nodes in the distributed system, it is assumed that the configuration file includes management relationships between the management nodes and the storage nodes as follows: the management node 1 manages the storage nodes 1-3, and the management node 2 manages the storage nodes 4-6; information of the storage node 1-3, such as an IP address, storage content, etc., may be transmitted to the management node 1 and information of the management node 1, such as an IP address or other information, may be transmitted to the storage node 1-3, and similarly information of the storage node 4-6, such as an IP address, storage content, etc., may be transmitted to the management node 2 and information of the management node 2, such as an IP address or other information, may be transmitted to the storage node 4-6. In this way, deployment for the distributed system is completed.
S212: controlling a management node in the distributed system to delete a management node deployment file stored in the management node; controlling a storage node in the distributed system to delete a storage node deployment file stored in a management node; and deleting the deployment program from the restarting self-starting service of the first management node, and stopping the operation of the deployment program.
It may be understood that, taking the management node as an example, after the management node obtains the deployment file of the management node, the management node stores the deployment file, installs the deployment file into the management node, and after the installation is successful, the stored deployment file may be deleted. In this way, storage space can be saved.
In addition, after the deployment is completed, the deployment program can delete itself from the restart self-starting service and exit operation, so that the memory space can be saved.
The embodiment of the invention also provides a deployment device based on the distributed system, as shown in fig. 4, the device comprises:
an obtainingmodule 401, configured to obtain a management node deployment file and a storage node deployment file from a server according to an address of the server included in a configuration file obtained in advance;
aninstallation module 402, configured to install the management node deployment file to the first management node;
a restartingmodule 403, configured to restart the first management node;
afirst sending module 404, configured to send, by restarting the self-starting service, the storage node deployment file to a storage node in the distributed system after detecting that the first management node is restarted;
and thefirst control module 405 is configured to control a storage node in the distributed system to install the storage node deployment file after obtaining the storage node deployment file.
As an embodiment, the obtainingmodule 401 may specifically be configured to:
reading addresses of servers storing management node deployment files and storage node deployment files, identity information of the servers and deployment file version information in a pre-acquired configuration file;
Accessing the address of the server, and acquiring a management node deployment file and a storage node deployment file corresponding to the version information by utilizing the identity information.
As an embodiment, the apparatus may further include: a second transmission module and a second control module (not shown), wherein,
the second sending module is used for sending the management node deployment file to management nodes except the first management node in the distributed system;
the second control module is used for controlling the management node in the distributed system to install the management node deployment file and restart the management node after the management node deployment file is acquired.
As an embodiment, the second sending module may specifically be configured to:
and calling a secure shell protocol, and transmitting the management node deployment file to management nodes except the first management node in the distributed system by using a file transmission instruction in the secure shell protocol.
As an embodiment, theinstallation module 402 may be specifically used for:
unloading an original deployment file installed in the first management node;
Restarting the first management node after detecting that the unloading is completed;
and after the first management node is detected to be restarted by restarting the self-starting service, the shell command is called by python, and the management node deployment file is installed to the first management node.
As an embodiment, thefirst sending module 404 may specifically be used to:
calling https protocol, and establishing connection with web program in storage node in the distributed system;
invoking the https protocol, and transmitting the storage node deployment file to a storage node in the distributed system through the web program;
the apparatus may further include:
a first configuration module (not shown in the figure) is configured to perform a configuration operation on the storage nodes in the distributed system through the web program.
As an embodiment, the apparatus may further include:
and the second configuration module (not shown in the figure) is used for configuring the management relationship between the management node and the storage node in the distributed system according to the configuration information in the configuration file after the first control module controls the storage node in the distributed system to install the storage node deployment file.
As an embodiment, the apparatus may further include:
a third control module (not shown in the figure) for controlling the management node in the distributed system to delete the management node deployment file stored in the management node; and controlling the storage nodes in the distributed system to delete the storage node deployment files stored in the management nodes.
By applying the embodiment of the invention shown in fig. 4, the first management node performs the deployment operation of the distributed system: the first management node acquires a management node deployment file and a storage node deployment file from a server; the first management node is used for restarting the management node deployment file after installing the management node deployment file on the first management node; after the self-starting service is restarted, the first management node sends the storage node deployment file to the storage nodes in the distributed system and controls the storage nodes to install the storage node deployment file; therefore, in the scheme, the automatic deployment of the distributed system is realized, and compared with manual operation, the error rate is reduced.
The embodiment of the invention also provides an electronic device, as shown in fig. 5, comprising aprocessor 501 and amemory 502,
amemory 502 for storing a computer program;
Theprocessor 501 is configured to implement any of the deployment methods based on the distributed system when executing the program stored on thememory 502.
The Memory mentioned in the electronic device may include a random access Memory (Random Access Memory, RAM) or may include a Non-Volatile Memory (NVM), such as at least one magnetic disk Memory. Optionally, the memory may also be at least one memory device located remotely from the aforementioned processor.
The processor may be a general-purpose processor, including a central processing unit (Central Processing Unit, CPU), a network processor (Network Processor, NP), etc.; but also digital signal processors (Digital Signal Processing, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), field programmable gate arrays (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
The embodiment of the invention also provides a computer readable storage medium, wherein a computer program is stored in the computer readable storage medium, and the computer program realizes any deployment method based on the distributed system when being executed by a processor.
The embodiment of the invention also provides a distributed system, which comprises: a first management node, a server and a storage node, wherein,
the first management node is used for acquiring a management node deployment file and a storage node deployment file from a server according to the address of the server contained in the pre-acquired configuration file; installing the management node deployment file to the first management node; restarting the first management node; after the restarting of the first management node is detected through restarting the self-starting service, the storage node deployment file is sent to the storage nodes in the distributed system; controlling storage nodes in the distributed system to install the storage node deployment file after acquiring the storage node deployment file;
the server is used for providing a management node deployment file and a storage node deployment file for the first management node;
the storage node is used for acquiring the storage node deployment file and installing the storage node deployment file under the control of the first management node.
For example, as shown in fig. 6, the distributed system may set a deployment program in the first management node, and the deployment program performs the deployment operation. Firstly, the deployment program can be added into the restarting self-starting service of the first management node, so that after the first management node is restarted, the deployment program can be automatically operated, and the deployment operation is continuously executed.
In one embodiment, the system comprises one or more management nodes in addition to the first management node, wherein,
the first management node is further configured to send the management node deployment file to a management node in the distributed system except for the first management node; after the management node in the distributed system acquires the management node deployment file, the management node deployment file is installed and the management node is restarted;
the one or more management nodes are used for acquiring the management node deployment file, installing the management node deployment file under the control of the first management node, and restarting.
It is noted that relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
In this specification, each embodiment is described in a related manner, and identical and similar parts of each embodiment are all referred to each other, and each embodiment mainly describes differences from other embodiments. In particular, for the distributed system-based deployment apparatus embodiment shown in fig. 4, the electronic device embodiment shown in fig. 5, the above-described computer-readable storage medium embodiment, and the distributed system embodiment shown in fig. 6, since they are substantially similar to the distributed system-based deployment method embodiments shown in fig. 1-2, the description is relatively simple, and the relevant points are referred to the partial explanation of the distributed system-based deployment method embodiments shown in fig. 1-2.
The foregoing description is only of the preferred embodiments of the present invention and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention are included in the protection scope of the present invention.