Distributed cluster rapid deployment method and device based on cloud server
By automatically verifying configuration files and network testing in cloud servers, nodes that do not meet the requirements are eliminated, rapid deployment of distributed clusters is achieved, problems of cumbersome deployment process and poor stability are solved, and deployment efficiency and resource utilization are improved.
Patent Information
- Application Number
- CN202411302267.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-18
- Publication Date
- 2025-01-03
AI Technical Summary
In the prior art, the deployment process of distributed clusters based on cloud servers is cumbersome, and there are problems of duplicate labor and complex network control, which leads to the deployment quality being limited by the technical level of the personnel and it is difficult to ensure the high availability and stability of the cluster.
By selecting a master node in the cloud server as the control server, uploading configuration files, program files and script files, automatically verifying configuration file status and network tests, eliminating work nodes that do not meet the requirements, performing distributed cluster deployment according to the dependencies, and adjusting Resources to meet user needs.
It improves the speed and stability of distributed cluster deployment, reduces manual intervention, improves resource utilization and deployment efficiency, reduces dependence on the quality of deployment personnel, and ensures high availability and stability of the cluster.
Smart Images

Figure CN119254630A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of distributed cluster deployment, and in particular relates to a distributed cluster rapid deployment method and device based on a cloud server. Background Art
[0002] With the rapid development of cloud computing technology, the implementation of large-scale distributed projects has become increasingly common. The deployment of distributed clusters based on cloud servers has become the first step in project implementation. The quality of distributed cluster deployment directly affects the subsequent operation and maintenance work and the overall progress of the project.
[0003] At present, large-scale distributed cluster projects are often deployed based on cloud servers. The process of deploying product programs on multiple working nodes in the selected cloud server is cumbersome and fragmented, and there is a lot of repetitive work. In the actual production environment, the network control hierarchy is complex, the network quality is difficult to guarantee, and the deployment quality of distributed clusters is severely limited by the technical level of personnel. How to effectively deploy and manage complex distributed clusters, how to ensure the high availability and stability of clusters, and how to improve resource utilization and work efficiency have become key issues faced by many organizations and enterprises.
[0004] In addition, traditional cluster deployment methods have many problems, such as slow deployment progress and irregular operations, which not only bring huge obstacles to project advancement, but also bury hidden dangers for subsequent operation and maintenance work, and cannot guarantee the stability of cluster operation. For example, system administrators may need to manually install operating systems and software for each working node, configure network and security settings, and start and stop services. This method is not only time-consuming and labor-intensive, but also difficult to cope with large-scale and rapidly changing environments. Summary of the invention
[0005] The present invention provides a method and device for rapid deployment of a distributed cluster based on a cloud server, so as to solve the problems of repeated work caused by the deployment of multiple working nodes in a distributed cluster, and the deployment quality being limited by the technical level of personnel and poor cluster operation stability due to the complex network control hierarchy of multiple working nodes.
[0006] The technical solution adopted by the present invention is:
[0007] A distributed cluster rapid deployment method based on a cloud server, wherein the cloud server includes a master node and a working node, and the distributed cluster includes a control server and multiple target servers, wherein the control server is connected to the multiple target servers, including:
[0008] S101: confirming one of the master nodes as the control server, selecting a plurality of the working nodes as the target servers, and the sum of the resource amounts of the selected working nodes is greater than the resource amount required by the user;
[0009] S201: Upload configuration files, program files and script files to the control server, and verify the existence of the configuration files through the script files;
[0010] S301: testing the network between the control server and the plurality of target servers according to the existence status of the configuration file;
[0011] S401: According to the network test result, the working nodes that do not meet the network test requirements are eliminated, and the dependency relationship is issued to the target server through the control server to control the target server to execute the program file according to the dependency relationship to complete the distributed cluster deployment.
[0012] Verify the existence of the configuration file through the script file, specifically:
[0013] Run the script file and input a first parameter into the script file, where the first parameter is the storage location of the configuration file;
[0014] If the first parameter is valid, continue to run the script file to perform the distributed cluster rapid deployment steps;
[0015] If the first parameter does not exist, or the first parameter is empty, further detection of the status of the configuration file is performed.
[0016] Further detection of the status of the configuration file is performed, specifically:
[0017] Detecting whether the configuration file is located in a default location, where the default location is a default storage location of files initially set in the script file;
[0018] If the configuration file is located in the default location, run the script file and perform subsequent steps;
[0019] If the configuration file is not located in the default location, the deployment is terminated and a user is fed back that the configuration file is not found.
[0020] According to the existence status of the configuration file, testing the network between the control server and the plurality of target servers is specifically:
[0021] If the configuration file exists, testing the network between the control server and the plurality of target servers;
[0022] If the configuration file does not exist, the deployment is terminated and the user is fed back that the configuration file is not found.
[0023] Testing the network between the control server and the plurality of target servers at least includes:
[0024] Performing a packet loss test between the control server and the target server, wherein the control server pings the target server;
[0025] And / or, a connectivity test is performed between the control server and the target server, wherein the control server telnets the target server.
[0026] According to the network test results, the working nodes that do not meet the network test requirements are eliminated, and the dependency relationship is issued to the target server through the control server to control the target server to execute the program file according to the dependency relationship to complete the distributed cluster deployment, specifically:
[0027] If the network test result of the target server meets the network test requirement, issuing the dependency relationship to the target server through the control server;
[0028] If the network test result of the target server does not meet the network test requirement, the working node that does not meet the network test requirement is eliminated.
[0029] The control server issues the dependency relationship to the target server, specifically:
[0030] The configuration file is read to locate the target address of the target server, and the control server sequentially copies the configuration file and the program file to the target address of the target server.
[0031] The control server issues the dependency relationship to the target server to control the target server to execute the program file according to the dependency relationship to complete the distributed cluster deployment, and further includes:
[0032] If the target server dependency release fails, remove the corresponding working node from the cluster formed by the target server;
[0033] If the target server dependency is issued successfully, the target server is controlled to execute the program file according to the dependency to complete the distributed cluster deployment.
[0034] The distributed cluster rapid deployment method based on cloud servers also includes:
[0035] Compare the sum of the resource amounts of the target server that has been deployed with the resource amounts required by the user, and adjust the resource amounts of the target server;
[0036] If the sum of the resources of the target servers that have completed deployment is greater than the resources required by the user, remove some of the working nodes corresponding to the target servers so that the sum of the resources of the target servers is equal to the resources required by the user;
[0037] If the sum of the resources of the target servers that have completed deployment is less than the resources required by the user, redeployment is performed in sequence from back to front in the order of the elimination time of the working nodes until the sum of the resources of the target servers that have completed deployment is equal to the resources required by the user.
[0038] The present invention also provides a distributed cluster rapid deployment device based on a cloud server, comprising:
[0039] Memory for storing computer programs;
[0040] A processor is used to implement the steps of a distributed cluster rapid deployment method based on a cloud server when executing the computer program.
[0041] Due to the adoption of the above technical solution, the beneficial effects achieved by the present invention are as follows:
[0042] 1. In the present invention, the sum of the resources of the selected working nodes is greater than the resources required by the user, that is, the working nodes in the called cloud server have a certain degree of redundancy. In the process of rapid deployment of distributed clusters, by eliminating working nodes that do not meet the requirements, not only can the optimal resource utilization be achieved, but also working nodes that better meet the deployment requirements can be selected for deployment. In addition, the speed of distributed cluster deployment can be improved. In the deployment process, working nodes that do not meet the requirements are eliminated, and steps such as re-debugging and re-deployment of working nodes that do not meet the requirements are not involved or are less involved. Only working nodes that meet the requirements are selected as target servers, thereby improving the speed of distributed cluster deployment.
[0043] It can also improve the stability of distributed cluster deployment. Through network testing, it can ensure that the communication between the control server and the target server is normal, avoiding deployment failures caused by network problems. In addition, when the target server does not meet the network test requirements, the working node will be automatically removed from the target server list, preventing unstable working nodes from joining the cluster and ensuring the stability of distributed cluster deployment.
[0044] 2. In the present invention, a master node in the cloud server is confirmed as the control server, and multiple working nodes are selected as target servers. By running the script file, the deployment of multiple target servers can be automatically completed by using the configuration files, program files and script files uploaded in the control server. The modification of the deployment can be completed by only modifying the configuration files and program files uploaded in the control server, which greatly improves the deployment speed and work efficiency. Especially for the simultaneous deployment of multiple distributed clusters, and the overall architecture of multiple distributed clusters is similar, the IP of the target server corresponding to the working node in the configuration file can be used to realize the reuse of the deployment method in the present invention in the deployment of multiple distributed clusters, which improves the versatility of the deployment method in the present invention.
[0045] 3. In the present invention, the distributed cluster rapid deployment method integrates multiple work steps in the deployment process. The user only needs to perform the steps of uploading the configuration file, program file and script file to the control server. By running the script file, the network test, dependency distribution, deployment and other steps can be automatically completed until the distributed cluster deployment is completed. In this way, the deployment efficiency is improved, working time is saved, and the workload of the target user is reduced. In addition, the demand for manual intervention in the distributed cluster rapid deployment method is reduced, errors that may be caused by manual operation are avoided, deployment efficiency is improved, deployment stability is improved, and the dependence of the distributed cluster rapid deployment on the quality and ability of the deployment personnel is reduced. Different deployment personnel can obtain the same deployment effect for the same deployment task. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:
[0047] Figure 1 A schematic diagram of a process of a distributed cluster rapid deployment method based on a cloud server in one embodiment of the present invention;
[0048] Figure 2 It is a structural schematic diagram of a distributed cluster rapid deployment device based on a cloud server in one embodiment of the present invention.
[0049] in:
[0050] 110 memory; 120 processor. DETAILED DESCRIPTION
[0051] In order to more clearly illustrate the overall concept of the present invention, a detailed description is given below in an exemplary manner in conjunction with the accompanying drawings.
[0052] In the following description, many specific details are set forth to facilitate a full understanding of the present invention. However, the present invention may also be implemented in other ways different from those described herein. Therefore, the protection scope of the present invention is not limited to the specific embodiments disclosed below.
[0053] like Figure 1 As shown, a distributed cluster rapid deployment method based on a cloud server, the cloud server includes a master node and a working node, the distributed cluster includes a control server and multiple target servers, the control server is connected to the multiple target servers, including:
[0054] S101: confirming one of the master nodes as the control server, selecting a plurality of the working nodes as the target servers, and the sum of the resource amounts of the selected working nodes is greater than the resource amount required by the user.
[0055] This step aims to select nodes in the cloud server for cluster configuration based on the amount of resources required by the user. Among them, a master node in the cloud server is confirmed as the control server. The master node is responsible for the overall management of the cluster, including but not limited to scheduling, configuration updates, service discovery and other functions. Usually, the master node has sufficient computing power and storage space to undertake functional tasks. Select multiple working nodes as target servers. The working node is the computing node in the cluster, which is used to execute the actual application load. According to the actual needs of the cluster, multiple working nodes can be selected. Factors such as the node's hardware resources (CPU, memory, storage), network bandwidth, etc. should be considered when selecting.
[0056] The target user can remotely configure multiple target servers by controlling the server, without the need to manually configure multiple target servers individually, thus reducing repetitive work and improving work efficiency.
[0057] It should be noted that in this step, the sum of the resources of the selected working nodes is greater than the resources required by the user. That is to say, the working nodes in the called cloud server have a certain degree of redundancy. In the process of rapid deployment of distributed clusters, by eliminating working nodes that do not meet the requirements, not only can the optimal resource utilization be achieved, but also working nodes that better meet the deployment requirements can be selected for deployment. It can also increase the speed of distributed cluster deployment. During the deployment process, working nodes that do not meet the requirements are eliminated, and steps such as re-debugging and re-deployment of working nodes that do not meet the requirements are not involved or are less involved. Only working nodes that meet the requirements are selected as target servers, thereby increasing the speed of distributed cluster deployment.
[0058] Specifically, to deploy a distributed cluster for a Web application, the target user is expected to need 3 working nodes, each node is configured with a 4-core CPU and 8GB memory. In this method, in order to quickly deploy the distributed cluster, you can choose the following configuration:
[0059] Control server: Choose a machine with higher configuration as the master node, such as an 8-core CPU and 16GB memory.
[0060] Target server: Considering the requirements of this method, we can choose 4 working nodes instead of 3, and the configuration of each node remains unchanged (4-core CPU and 8GB memory). In this way, the total resource amount of the working node is 16-core CPU and 32GB memory, which is greater than the current demand (12-core CPU and 24GB memory), and also provides a certain degree of redundancy. Of course, other numbers of working nodes can also be selected as target servers, and the present invention does not limit this.
[0061] S201: Upload a configuration file, a program file and a script file to the control server, and verify the existence of the configuration file through the script file.
[0062] This step is intended to transfer configuration files, program files and script files from the local machine to a specified directory on the control server, and automatically verify the existence of the configuration files by running the script files. The present invention does not limit the file upload method, for example, the file can be transferred to the specified directory on the control server via SSH.
[0063] It should be noted that the configuration file contains the IP address of the control server, the IP addresses of multiple target servers, and other necessary configuration information, such as network settings, storage paths, etc. The program file contains the software packages, application code, and other files required for the cluster to run. The script file contains a series of automated instructions for verifying the configuration file, testing the network connection, distributing dependent files, and executing the final program deployment.
[0064] The script file can be written using shell technology, or implemented using Python scripts or other programming languages. As long as it can be executed in the control server, it only needs to obtain the control server operating system administrator privileges, parse the configuration file, and execute the program logic.
[0065] The target user can automatically complete the deployment of multiple target servers by uploading configuration files, program files and script files in the control server and executing the script files. The deployment can be modified by simply modifying the configuration files and program files uploaded in the control server, which greatly improves the deployment speed and work efficiency. Especially for the simultaneous deployment of multiple distributed clusters, and when the overall architecture of multiple distributed clusters is similar, the deployment method of the present invention can be reused in multiple distributed cluster deployments through the IP of the working node corresponding to the target server in the configuration file, which improves the versatility of the deployment method of the present invention.
[0066] The user only needs to upload the configuration file, program file and script file to the control server. By running the script file, the network test, dependency distribution, deployment and other steps can be automatically completed until the distributed cluster deployment is completed. This improves the deployment efficiency, saves working time, and reduces the workload of the target users. It also reduces the need for manual intervention in the distributed cluster rapid deployment method, avoids errors that may be caused by manual operation, improves deployment efficiency, improves deployment stability, and reduces the dependence of distributed cluster rapid deployment on the quality and ability of deployment personnel. Different deployment personnel can get the same deployment effect for the same deployment task.
[0067] When the script file starts to execute, it first checks the existence of the configuration file to ensure that the subsequent operations have a valid configuration file as a basis. If there is a lack of a valid configuration file, the deployment process may encounter various problems. This step can avoid these problems. By verifying the configuration file, you can reduce deployment failures caused by missing configuration files, thereby increasing the success rate of deployment.
[0068] S301: testing the network between the control server and the plurality of target servers according to the existence status of the configuration file.
[0069] This step is to verify the existence of the configuration file, and then perform a network test on each target server to check whether the target server meets the network test requirements. The network test requirements include at least indicators such as network latency, packet loss rate, and whether the target server responds. If any network test indicator of the target server does not meet the requirements, the corresponding working node will be removed and will not be used as the target server. If the target server meets the network test requirements, continue to perform subsequent deployment steps.
[0070] Network testing can identify and remove working nodes that do not meet the requirements, ensuring that only working nodes that meet the network test requirements are deployed as target servers, avoiding failures caused by network problems in the subsequent deployment process, thereby increasing the probability of successful deployment. After the deployment is completed, avoiding fluctuations caused by network problems helps improve the stability and availability of the cluster. In addition, removing working nodes that do not meet network requirements can make full use of working nodes with good network conditions and improve resource utilization efficiency.
[0071] S401: According to the network test result, the working nodes that do not meet the network test requirements are eliminated, and the dependency relationship is issued to the target server through the control server to control the target server to execute the program file according to the dependency relationship to complete the distributed cluster deployment.
[0072] This step aims to distribute dependencies to the target server through the control server and execute program files according to the dependencies to complete the deployment of the target server.
[0073] Specifically, the control server reads the configuration file and obtains the IP address and other necessary information of the target server from it. The control server uses the scp command or other file transfer tools to distribute the configuration file and program file to the target server.
[0074] If the file is successfully distributed to the target server, the control server will record the success information; if the file distribution fails on any target server, the control server will record the failure information and remove the working node from the target server list.
[0075] After successfully distributing the dependencies, the control server will remotely execute the deployment scripts on the target server through SSH or other means. These scripts will perform the necessary program deployment operations according to the previously distributed configuration files.
[0076] After the deployment is complete, a log file is generated to record the deployment results of each working node and feedback the information to the user.
[0077] This step reduces the need for manual operations and improves deployment efficiency and accuracy by automatically distributing dependencies and executing script files. The automatic distribution of dependencies reduces human errors and ensures that each target server has a preset configuration file, thereby reducing deployment problems caused by inconsistent files. In addition, the distribution of dependencies and the deployment results of each target server are logged to promptly detect and handle failures, making it easier for maintenance engineers to maintain the corresponding working nodes.
[0078] As a preferred implementation of the present invention, the existence status of the configuration file is verified by the script file, specifically:
[0079] Run the script file and input a first parameter into the script file, where the first parameter is the storage location of the configuration file;
[0080] If the first parameter is valid, continue to run the script file to perform the distributed cluster rapid deployment steps;
[0081] If the first parameter does not exist, or the first parameter is empty, further detection of the status of the configuration file is performed.
[0082] This step is intended to input the storage location of the configuration file in the control server (i.e., the first parameter) into the script file. The subsequent execution logic is determined by the validity status of the first parameter. If the first parameter is valid, the deployment step is continued. If the first parameter is invalid, the detection step is continued.
[0083] Specifically, the target user provides the script file with a specific path of the configuration file, which is an absolute path or a relative path of the configuration file on the control server.
[0084] The script checks whether the first parameter provided is valid. If the first parameter exists and points to a valid file path, the script will continue to execute; if the first parameter does not exist or is empty, the script will perform further checks.
[0085] As a preferred embodiment of this implementation, further detection of the status of the configuration file is performed, specifically:
[0086] Detecting whether the configuration file is located in a default location, where the default location is a default storage location of files initially set in the script file;
[0087] If the configuration file is located in the default location, run the script file and perform subsequent steps;
[0088] If the configuration file is not located in the default location, the deployment is terminated and a user is fed back that the configuration file is not found.
[0089] The purpose of this step is that when the user does not enter the first parameter or the first parameter is entered incorrectly, the script file will default to the default file storage location initially set in the script file, and verify again whether the configuration file is saved in the default file storage location. If the configuration file is found in the default file storage location, the script file continues to execute; if not, the deployment will be terminated.
[0090] This step not only enables the target user to automatically set the storage location of the configuration file in the control server, but also only needs to upload the storage path as the first parameter to the script file, thereby achieving the target user's balanced configuration of files in the control server storage space, avoiding problems such as lag caused by excessive occupancy of some storage space in the control server.
[0091] When the target user does not set the storage location, that is, when the configuration file is uploaded to the default storage location of the control server, the user does not need to upload the first parameter. This step can automatically detect whether the configuration file is located in the default storage location of the file, thereby comprehensively determining the existence status of the configuration file.
[0092] In this step, when the user forgets to provide the first parameter or the provided first parameter is invalid, the script file will automatically take remedial measures and check the default storage location of the file, thereby increasing the robustness of the script file. The deployment step will only be continued when the configuration file is ensured to exist, avoiding errors or failures caused by the lack of configuration files. And when the configuration file is not in the preset directory, the target user is promptly reminded of the information that the configuration file is not found, helping the target user to correct the error in time and reducing the time the target user waits for deployment.
[0093] As a preferred implementation manner of the present invention, according to the existence status of the configuration file, the network between the control server and the plurality of target servers is tested, specifically:
[0094] If the configuration file exists, testing the network between the control server and the plurality of target servers;
[0095] If the configuration file does not exist, the deployment is terminated and the user is fed back that the configuration file is not found.
[0096] This step is to selectively perform subsequent network test steps based on the existence of the configuration file. If a valid configuration file is missing, the deployment process may encounter various problems, and this step can avoid these problems. By verifying the configuration file, you can reduce deployment failures caused by missing configuration files, thereby increasing the success rate of deployment.
[0097] If the configuration file is not found in the preset directory, the distributed cluster deployment is stopped and the user is fed back that the configuration file is not found. If the configuration file is missing, the deployment should not continue because the subsequent steps will not be executed normally. By checking the existence of the configuration file in advance, unnecessary resource waste can be avoided. Feedback that the configuration file is not found can help users quickly locate the problem and take appropriate measures, such as re-uploading the configuration file to the preset directory.
[0098] As a preferred embodiment of this implementation, testing the network between the control server and the plurality of target servers at least includes:
[0099] A packet loss test is performed between the control server and the target server, and the control server pings the target server. The ping command is used to detect whether there is packet loss in the network connection between the control server and the target server. A high packet loss rate may affect the stability and performance of the cluster.
[0100] And / or, a connectivity test is performed between the control server and the target server, wherein the control server telnets the target server. A TCP connection is attempted to test whether the port between the control server and the target server is open, particularly the port for SSH connection (the default port is port 22). The connectivity test can ensure that the control server can establish communication with the target server.
[0101] Specifically, the control server sends a ping command to the target server and obtains the packet loss rate.
[0102] The control server attempts to establish a connection with the target server’s SSH port and ends the connection by sending the “quit” command.
[0103] If the packet loss rate is greater than 0 or the telnet command fails to connect to the SSH port, the network test is considered to have failed and the corresponding working node is removed from the target server list.
[0104] This step uses packet loss testing to detect the stability of the network connection and ensure network quality. A high packet loss rate may cause poor data transmission and affect cluster performance. Verifying port openness through connectivity testing ensures that the control server can establish a connection with the target server through the SSH port, which is a prerequisite for executing subsequent deployment steps.
[0105] As a preferred implementation of the present invention, according to the network test results, the working nodes that do not meet the network test requirements are eliminated, and the control server issues dependencies to the target server to control the target server to execute the program file according to the dependencies to complete the distributed cluster deployment, specifically:
[0106] If the network test result of the target server meets the network test requirement, issuing the dependency relationship to the target server through the control server;
[0107] If the network test result of the target server does not meet the network test requirement, the working node that does not meet the network test requirement is eliminated.
[0108] This step is to selectively execute subsequent logic based on the network test results. If any network test indicator of the target server does not meet the requirements, the corresponding working node will be removed and will not be used as the target server. If the target server meets the network test requirements, continue to execute the subsequent deployment steps.
[0109] Network testing can identify and remove working nodes that do not meet the requirements, ensuring that only working nodes that meet the network test requirements are deployed as target servers, avoiding failures caused by network problems in the subsequent deployment process, thereby increasing the probability of successful deployment. After the deployment is completed, avoiding fluctuations caused by network problems helps improve the stability and availability of the cluster. In addition, removing working nodes that do not meet network requirements can make full use of working nodes with good network conditions and improve resource utilization efficiency.
[0110] In addition, log files are generated based on the network test results, so that users can check which working nodes have been eliminated due to network testing, and maintenance engineers can also maintain working nodes that do not meet network test requirements.
[0111] As an example of this implementation, the control server issues the dependency relationship to the target server, specifically:
[0112] The configuration file is read to locate the target address of the target server, and the control server sequentially copies the configuration file and the program file to the target address of the target server.
[0113] The configuration file is provided with the IP address of the control server and the IP addresses of the plurality of target servers, so as to facilitate the deployment of the target servers by the control server.
[0114] This step aims to distribute dependencies to target servers through the control server, which not only ensures that each node has preset configuration and program files, but also improves the efficiency and reliability of deployment, simplifies maintenance work, and improves user experience.
[0115] Specifically, the script file reads the configuration file to obtain the IP address and user name of the target server. Then, the scp command is used to copy the configuration file and program file to the corresponding directory of each target server through SSH key authentication.
[0116] It should be noted that the control server uses a secure file transfer protocol (such as scp or sftp) to copy the configuration files and program files to the designated directory of each target server in sequence. The present invention does not limit this.
[0117] As another embodiment of this implementation, the control server issues a dependency to the target server to control the target server to execute the program file according to the dependency to complete the distributed cluster deployment, further comprising:
[0118] If the target server dependency release fails, remove the corresponding working node from the cluster formed by the target server;
[0119] If the target server dependency is issued successfully, the target server is controlled to execute the program file according to the dependency to complete the distributed cluster deployment.
[0120] This step aims to selectively execute subsequent deployment steps based on the dependency distribution results. If the file is successfully distributed to the target server, the control server will record the success information; if the file distribution fails on any target server, the control server will record the failure information and remove the working node from the target server list.
[0121] After successfully distributing the dependencies, the control server will remotely execute the deployment scripts on the target server through SSH or other means. These scripts will perform the necessary program deployment operations according to the previously distributed configuration files.
[0122] After the deployment is complete, a log file is generated to record the deployment results of each working node and feedback the information to the user.
[0123] This step reduces the need for manual operations and improves deployment efficiency and accuracy by automatically distributing dependencies and executing script files. The automatic distribution of dependencies reduces human errors and ensures that each target server has a preset configuration file, thereby reducing deployment problems caused by inconsistent files. In addition, monitoring and feedback of dependency distribution and deployment results for each target server can timely detect and handle failures, making it easier for maintenance engineers to maintain the corresponding working nodes.
[0124] As a preferred embodiment of the present invention, the distributed cluster rapid deployment method based on the cloud server also includes:
[0125] Compare the sum of the resource amounts of the target server that has been deployed with the resource amounts required by the user, and adjust the resource amounts of the target server;
[0126] If the sum of the resources of the target servers that have completed deployment is greater than the resources required by the user, remove some of the working nodes corresponding to the target servers so that the sum of the resources of the target servers is equal to the resources required by the user;
[0127] If the sum of the resources of the target servers that have completed deployment is less than the resources required by the user, redeployment is performed in sequence from back to front in the order of the elimination time of the working nodes until the sum of the resources of the target servers that have completed deployment is equal to the resources required by the user.
[0128] This step aims to reasonably configure the target server's resources so that the target server's resources are equal to the resources required by the user, thereby avoiding the problem of excess or insufficient resources.
[0129] Specifically, as described in the previous steps, the target user is expected to need 3 working nodes, each node is configured with a 4-core CPU and 8GB memory. Select 4 working nodes as the target server for configuration.
[0130] If during the deployment process, all four working nodes pass the test and are deployed as target servers, but the user actually only needs three working nodes, the script file will identify the redundant working nodes and remove them. In this way, only three working nodes are called as target servers, with a total of 12 CPU cores and 24GB of memory, meeting user needs.
[0131] If less than 3 working nodes pass the test during the deployment process and are deployed as the target server, the resource volume does not meet the user's needs. The log files of the distribution dependency and network test step feedback are read in sequence, and the removed working nodes are reconfigured and deployed until the sum of the resource volume of the deployed target server is equal to the resource volume required by the user.
[0132] This step ensures that resources are neither excessive nor insufficient by precisely controlling the number of working nodes in the cluster, maximizing resource utilization efficiency and avoiding resource waste. In the case of excess resources, removing redundant working nodes can reduce unnecessary expenses, especially in a cloud environment, where allocating resources on demand can effectively control costs.
[0133] In addition, the result files of the distribution dependency and network test step feedback are read in sequence to reconfigure and deploy the removed working nodes. Because the working nodes removed in the distribution dependency step have passed the network test, only the dependency distribution problem needs to be solved to complete the redeployment, which reduces the difficulty of reconfiguring and deploying the removed working nodes.
[0134] like Figure 2 As shown, a distributed cluster rapid deployment device based on a cloud server includes a memory 110 for storing a computer program and a processor 120 for implementing the steps of the above-mentioned distributed cluster rapid deployment method based on a cloud server when executing the computer program. The effect produced is the same as above.
[0135] Anything not described in the present invention can be achieved by adopting or drawing on existing technologies.
[0136] The various embodiments in this specification are described in a progressive manner, and the same or similar parts between the various embodiments can be referenced to each other, and each embodiment focuses on the differences from other embodiments.
[0137] The above description is only an embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent substitution, improvement, etc. made within the spirit and principle of the present invention should be included in the scope of the claims of the present invention.
Claims
1. A distributed cluster rapid deployment method based on a cloud server, wherein the cloud server includes a master node and a working node, and the distributed cluster includes a control server and multiple target servers, wherein the control server is connected to the multiple target servers, characterized in that: Confirm one of the master nodes as the control server, select multiple working nodes as the target servers, and the sum of the resource amounts of the selected working nodes is greater than the resource amount required by the user; Upload configuration files, program files and script files to the control server, and verify the existence of the configuration files through the script files; According to the existence status of the configuration file, testing the network between the control server and the plurality of target servers; According to the network test results, the working nodes that do not meet the network test requirements are eliminated, and the dependency relationship is issued to the target server through the control server to control the target server to execute the program file according to the dependency relationship to complete the distributed cluster deployment.
2. The distributed cluster rapid deployment method based on cloud server according to claim 1 is characterized in that: Verify the existence of the configuration file through the script file, specifically: Run the script file and input a first parameter into the script file, where the first parameter is the storage location of the configuration file; If the first parameter is valid, continue to run the script file to perform the distributed cluster rapid deployment steps; If the first parameter does not exist, or the first parameter is empty, further detection of the status of the configuration file is performed.
3. The distributed cluster rapid deployment method based on cloud server according to claim 2 is characterized in that: Further detection of the status of the configuration file is performed, specifically: Detecting whether the configuration file is located in a default location, where the default location is a default storage location of files initially set in the script file; If the configuration file is located in the default location, run the script file and perform subsequent steps; If the configuration file is not located in the default location, the deployment is terminated and a user is fed back that the configuration file is not found.
4. The distributed cluster rapid deployment method based on cloud server according to claim 1 is characterized in that: According to the existence status of the configuration file, testing the network between the control server and the plurality of target servers is specifically: If the configuration file exists, testing the network between the control server and the plurality of target servers; If the configuration file does not exist, the deployment is terminated and the user is fed back that the configuration file is not found.
5. The method for rapid deployment of a distributed cluster based on a cloud server according to claim 4, characterized in that: Testing the network between the control server and the plurality of target servers at least includes: Performing a packet loss test between the control server and the target server, wherein the control server pings the target server; And / or, a connectivity test is performed between the control server and the target server, wherein the control server telnets the target server.
6. The distributed cluster rapid deployment method based on cloud server according to claim 1 is characterized in that: According to the network test results, the working nodes that do not meet the network test requirements are eliminated, and the dependency relationship is issued to the target server through the control server to control the target server to execute the program file according to the dependency relationship to complete the distributed cluster deployment, specifically: If the network test result of the target server meets the network test requirement, issuing the dependency relationship to the target server through the control server; If the network test result of the target server does not meet the network test requirement, the working node that does not meet the network test requirement is eliminated.
7. The distributed cluster rapid deployment method based on cloud server according to claim 6 is characterized in that: The control server issues the dependency relationship to the target server, specifically: The configuration file is read to locate the target address of the target server, and the control server sequentially copies the configuration file and the program file to the target address of the target server.
8. The method for rapid deployment of a distributed cluster based on a cloud server according to claim 6, characterized in that: The control server issues the dependency relationship to the target server to control the target server to execute the program file according to the dependency relationship to complete the distributed cluster deployment, and further includes: If the target server dependency release fails, remove the corresponding working node from the cluster formed by the target server; If the target server dependency is issued successfully, the target server is controlled to execute the program file according to the dependency to complete the distributed cluster deployment.
9. The distributed cluster rapid deployment method based on cloud server according to claim 1, characterized in that: Also includes: Compare the sum of the resource amounts of the target server that has been deployed with the resource amounts required by the user, and adjust the resource amounts of the target server; If the sum of the resources of the target servers that have completed deployment is greater than the resources required by the user, remove some of the working nodes corresponding to the target servers so that the sum of the resources of the target servers is equal to the resources required by the user; If the sum of the resources of the target servers that have completed deployment is less than the resources required by the user, redeployment is performed in sequence from back to front in the order of the elimination time of the working nodes until the sum of the resources of the target servers that have completed deployment is equal to the resources required by the user.
10. A distributed cluster rapid deployment device based on a cloud server, characterized in that: include: Memory for storing computer programs; A processor, configured to implement the steps of the cloud server-based distributed cluster rapid deployment method as described in any one of claims 1 to 9 when executing the computer program.