CN110392080B - Deployment method and device based on distributed system and distributed system - Google Patents

Deployment method and device based on distributed system and distributed system Download PDF

Info

Publication number
CN110392080B
CN110392080B CN201810360212.9A CN201810360212A CN110392080B CN 110392080 B CN110392080 B CN 110392080B CN 201810360212 A CN201810360212 A CN 201810360212A CN 110392080 B CN110392080 B CN 110392080B
Authority
CN
China
Prior art keywords
management node
deployment file
management
file
distributed system
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201810360212.9A
Other languages
Chinese (zh)
Other versions
CN110392080A (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.)
Hangzhou Hikvision System Technology Co Ltd
Original Assignee
Hangzhou Hikvision System Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hangzhou Hikvision System Technology Co Ltd filed Critical Hangzhou Hikvision System Technology Co Ltd
Priority to CN201810360212.9A priority Critical patent/CN110392080B/en
Publication of CN110392080A publication Critical patent/CN110392080A/en
Application granted granted Critical
Publication of CN110392080B publication Critical patent/CN110392080B/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
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • 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/02Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
    • 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/1097Protocols in which an application is distributed across nodes in the network for distributed storage of data in networks, e.g. transport arrangements for network file system [NFS], storage area networks [SAN] or network attached storage [NAS]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/34Network arrangements or protocols for supporting network services or applications involving the movement of software or configuration parameters 

Abstract

The embodiment of the invention provides a deployment method and device based on a distributed system and the distributed system, wherein in the scheme, a first management node performs 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.

Description

Deployment method and device based on distributed system and distributed system
Technical Field
The present invention relates to the field of distributed technologies, and in particular, to a deployment method and apparatus based on a distributed system, and a distributed system.
Background
The distributed system comprises a plurality of devices which work cooperatively to provide data storage or other service functions together. Distributed systems are of various types, such as cloud storage systems, which typically include devices such as servers, management nodes, storage nodes, and the like.
Deployment based on cloud storage systems is typically achieved by manual operations: acquiring a deployment file from a server, wherein the deployment file comprises a management node deployment file, a storage node deployment file and the like; copying the management node deployment file into the management node, installing the copied file in the management node, and restarting the management node after the installation; copying the storage node deployment file into the storage node, and installing the copied file in the storage node to complete deployment.
The deployment scheme is realized by manual operation, and has more steps and higher error rate.
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.
Drawings
In order to more clearly illustrate the embodiments of the invention or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described, it being obvious that the drawings in the following description are only some embodiments of the invention, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a schematic flow chart of a first deployment method based on a distributed system according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of a second flow chart of a deployment method based on a distributed system according to an embodiment of the present invention;
fig. 3 is a schematic view of an application scenario provided in an embodiment of the present invention;
fig. 4 is a schematic structural diagram of a deployment device based on a distributed system according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of a distributed system according to an embodiment of the present invention.
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 obtaining module 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;
an installation module 402, configured to install the management node deployment file to the first management node;
a restarting module 403, configured to restart the first management node;
a first 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 the first 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 obtaining module 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, the installation 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, the first 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 a processor 501 and a memory 502,
a memory 502 for storing a computer program;
The processor 501 is configured to implement any of the deployment methods based on the distributed system when executing the program stored on the memory 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.

Claims (13)

1. A deployment method based on a distributed system, wherein the deployment method is applied to a first management node of the distributed system, and the method comprises:
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;
after the management node deployment file is installed to the first management node, further comprising:
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.
2. The method according to claim 1, wherein the obtaining the management node deployment file and the storage node deployment file from the server 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.
3. The method of claim 1, wherein the sending the management node deployment file to a management node in the distributed system other than the first management node comprises:
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.
4. The method of claim 1, wherein the installing the management node deployment file to the first management node comprises:
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.
5. The method of claim 1, wherein the sending the storage node deployment file to a storage node in the distributed system comprises:
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.
6. The method of claim 1, further comprising, after controlling a storage node in the distributed system to install the storage node deployment file:
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.
7. The method of claim 1, wherein after controlling the storage nodes in the distributed system to obtain the storage node deployment file and install the storage node deployment file, further comprising:
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.
8. A deployment apparatus based on a distributed system, characterized in that it is applied to a first management node of the distributed system, said apparatus comprising:
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;
the apparatus further comprises:
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.
9. The apparatus of claim 8, wherein the obtaining module is specifically 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.
10. The apparatus of claim 8, wherein the second transmitting module is specifically 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.
11. The device according to claim 8, characterized in that said mounting module is specifically adapted 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.
12. A distributed system, comprising: 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; sending the management node deployment file to management nodes except the first management node in the distributed system; 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 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.
13. The system of claim 12, further comprising 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.
CN201810360212.9A 2018-04-20 2018-04-20 Deployment method and device based on distributed system and distributed system Active CN110392080B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810360212.9A CN110392080B (en) 2018-04-20 2018-04-20 Deployment method and device based on distributed system and distributed system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810360212.9A CN110392080B (en) 2018-04-20 2018-04-20 Deployment method and device based on distributed system and distributed system

Publications (2)

Publication Number Publication Date
CN110392080A CN110392080A (en) 2019-10-29
CN110392080B true CN110392080B (en) 2023-06-06

Family

ID=68282715

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810360212.9A Active CN110392080B (en) 2018-04-20 2018-04-20 Deployment method and device based on distributed system and distributed system

Country Status (1)

Country Link
CN (1) CN110392080B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113067869B (en) * 2021-03-18 2022-12-27 北京字跳网络技术有限公司 Node control method and device, node management method and device and distributed system
CN114666348B (en) * 2022-05-25 2022-11-11 广东睿江云计算股份有限公司 Method for quickly constructing distributed system based on python language

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104978191A (en) * 2015-06-24 2015-10-14 小米科技有限责任公司 Application deployment method and server

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9418040B2 (en) * 2005-07-07 2016-08-16 Sciencelogic, Inc. Dynamically deployable self configuring distributed network management system
CN1731738A (en) * 2005-08-30 2006-02-08 西安交通大学 Automated quick deployment method for large-scale computer cluster node
CN105306237A (en) * 2014-06-26 2016-02-03 中兴通讯股份有限公司 Distributed management method and device for network management
CN104219099A (en) * 2014-09-25 2014-12-17 浪潮(北京)电子信息产业有限公司 Automatic server cluster deploying method and device
CN104219329A (en) * 2014-09-28 2014-12-17 浪潮软件集团有限公司 Method for deploying service through content distribution in cluster server
CN105791362B (en) * 2014-12-24 2019-07-26 联想(北京)有限公司 A kind of server operating system dispositions method and server
US10001981B2 (en) * 2016-05-26 2018-06-19 At&T Intellectual Property I, L.P. Autonomous server installation

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104978191A (en) * 2015-06-24 2015-10-14 小米科技有限责任公司 Application deployment method and server

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
"Towards Fault-Tolerant Energy-Efficient High Performance Computing in the Cloud";Kurt L. Keville等;《2012 IEEE International Conference on Cluster Computing》;全文 *
"基于Linux平台的高可用集群管理系统的研究与实现";刘思尧;《中国优秀硕士学位论文全文数据库》;全文 *

Also Published As

Publication number Publication date
CN110392080A (en) 2019-10-29

Similar Documents

Publication Publication Date Title
WO2021217871A1 (en) Method and apparatus for deploying micro service cluster, computer device and storage medium
JP6217034B2 (en) Related plug-in management method, apparatus and system
US20150067167A1 (en) Hot pluggable extensions for access management system
CN110445841B (en) Cloud disk mounting method and device for cloud physical machine and storage medium
TW201606648A (en) Processing method and device of application
CN110392080B (en) Deployment method and device based on distributed system and distributed system
CN108920157B (en) Nginx software installation method and device, computer equipment and storage medium
CN110855746A (en) Middleware management method, electronic device and storage medium
EP3848825A1 (en) Application client launch method, service server, and client device
CN108121578B (en) Method and device for generating application program, storage medium and electronic equipment
US11900089B2 (en) Automatically configuring and deploying a software operator in a distributed computing environment from a package
CN112688794A (en) YANG model management method, device, system, equipment and storage medium
CN110083366B (en) Application running environment generation method and device, computing equipment and storage medium
CN111488163B (en) Firmware updating method and device, electronic equipment and storage medium
CN112346765B (en) Application program upgrading method and device, electronic equipment and readable storage medium
CN107995033B (en) ONU configuration file upgrading method and device
CN111897565A (en) Data processing method, device and equipment based on Internet of things
US9665364B2 (en) Dual-bank telecommunication apparatus and method of upgrading firmware in dual-bank telecommunication apparatus
CN115758334A (en) Cloud application access method and device, electronic equipment and storage medium
CN113422791B (en) Cloud service configuration method and device, electronic equipment and computer readable storage medium
CN110266501B (en) Block chain node device and block chain network system
CN113093995A (en) Cloud disk data migration method and system
CN110389811B (en) Testing method and device based on distributed system
CN114615285B (en) Physical machine deployment method and device, electronic equipment and storage medium
CN114827127B (en) File management method, system, cloud server and terminal equipment

Legal Events

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