Deployment method, server, and storage medium

CN122431684APending Publication Date: 2026-07-21HENAN QINWEI DIGITAL TECHNOLOGY CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
HENAN QINWEI DIGITAL TECHNOLOGY CO LTD
Filing Date
2025-01-13
Publication Date
2026-07-21

AI Technical Summary

Technical Problem

Existing technologies for database cluster deployment are inefficient, mainly because users need to manually configure related files, resulting in a complex and inefficient deployment process.

Method used

By obtaining deployment scripts from a second server, including mutual trust scripts, tool scripts for preset operation and maintenance tools, and database installation packages, the system updates the installation packages using server information, establishes a mutual trust connection, and executes the installation packages using preset operation and maintenance tools, thereby achieving automated deployment of the database cluster.

Benefits of technology

It improves the deployment efficiency of database clusters, ensures the accuracy of installation and transmission efficiency, solves the deployment failure problem caused by missing dependency packages, and realizes automated monitoring of database clusters.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122431684A_ABST
    Figure CN122431684A_ABST
Patent Text Reader

Abstract

Embodiments of the present application provide a deployment method, a server and a storage medium. The method comprises: any first server obtaining a deployment script from a second server, the deployment script comprising a mutual trust script, a tool script corresponding to a preset operation and maintenance tool, and a database installation package of a preset database; updating the database installation package based on server information of a plurality of first servers; installing the preset operation and maintenance tool according to the tool script; executing the mutual trust script based on the server information to establish a mutual trust connection between any first server and other first servers; executing the updated database installation package by using the preset operation and maintenance tool based on the mutual trust connection, and sending the updated database installation package to other first servers to complete deployment of a database cluster. By using the method, the deployment efficiency of the database cluster can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, specifically to a deployment method, server, and storage medium. Background Technology

[0002] With the development of the internet industry, the demand for databases has surged. The service of a single database can no longer fully meet actual needs. Therefore, to meet the high reliability and high availability requirements of big data storage, it is necessary to deploy database clusters to cope with the dramatic increase in data volume. In related technologies, deploying a database cluster typically requires users to manually configure relevant files. Because the deployment process involves multiple steps, it leads to low deployment efficiency. Summary of the Invention

[0003] This application provides a deployment method, server, and storage medium that can solve the technical problem of low deployment efficiency of database clusters.

[0004] In a first aspect, embodiments of this application provide a deployment method for deploying a database on multiple first servers in a server system. The method includes: any first server obtaining a deployment script from a second server, the deployment script including a mutual trust script, a tool script corresponding to a preset operation and maintenance tool, and a database installation package for a preset database; updating the database installation package based on server information of the multiple first servers; installing the preset operation and maintenance tool according to the tool script; executing the mutual trust script based on the server information to establish a mutual trust connection between the any first server and other first servers; and, based on the mutual trust connection, using the preset operation and maintenance tool to execute the updated database installation package and send the updated database installation package to the other first servers to complete the deployment of the database cluster.

[0005] The above technical solution utilizes deployment scripts obtained directly from the second server for cluster deployment. Since manual script creation is unnecessary, the efficiency of obtaining deployment scripts is improved, thereby enhancing the deployment efficiency of the database cluster. Pre-set maintenance tools enable automated database installation based on updated database installation packages, further improving deployment efficiency. The mutual trust connection established through mutual trust scripts allows for passwordless access between the first servers, improving the transmission efficiency of database installation packages and further enhancing deployment efficiency.

[0006] In one possible implementation, the database installation package includes: a first dependency package for the preset database and a second dependency package for the operating system corresponding to the preset database, wherein the first dependency package and the second dependency package are generated by the second server.

[0007] By employing the above technical solution, since the database installation package includes a first dependency package and a second dependency package, the successful installation of the preset database can be ensured, thereby solving the problem of database cluster deployment failure due to the lack of dependency packages.

[0008] In one possible implementation, the method further includes: obtaining a container script and a monitoring deployment script from the second server, wherein the monitoring deployment script is used to install a monitoring tool; executing the container script and the monitoring deployment script using the preset operation and maintenance tool based on the mutual trust connection; and sending the container script and the monitoring deployment script to the other first server to complete the monitoring deployment of the database cluster.

[0009] The above technical solution, using container scripts and monitoring deployment scripts, enables the monitoring and deployment of a database cluster, thereby enabling the monitoring of each database server in the database cluster.

[0010] In one possible implementation, the database installation package includes a configuration file, the server information includes the server address and corresponding node role of each first server, and updating the database installation package based on the server information of the plurality of first servers includes: updating the server address of each first server to the corresponding position in the configuration file based on the node role of each first server.

[0011] By using the above technical solution, the configuration file is updated based on the node role and server address of each first server, so that the multiple first servers can be accurately associated with their corresponding node roles, thereby enabling accurate deployment of the database cluster.

[0012] Secondly, embodiments of this application provide a deployment method applied to a second server. The method includes: responding to a received script generation request, generating a deployment script based on a database identifier in the script generation request, and sending the deployment script to a first server. The deployment script includes a mutual trust script and a database installation package of a preset database corresponding to the database identifier. The deployment script is configured to complete the deployment of a database cluster on multiple first servers.

[0013] The above technical solution can generate deployment scripts based on database identifiers. Since there is no need to manually create scripts, the efficiency of deployment script generation can be improved, thereby improving the deployment efficiency of database clusters.

[0014] In one possible implementation, the database installation package includes: a first dependency package for the preset database and a second dependency package for the operating system corresponding to the preset database. The method further includes: configuring a first mirror source for the preset database and a second mirror source for the operating system based on the database identifier; updating the system configuration file of the operating system based on a preset value, the system configuration file being used to set the cache of a first directory; starting the preset database based on the first mirror source and the second mirror source; storing the dependency package corresponding to the prompt information obtained from the first directory into a pre-created second directory according to the prompt information during the startup process of the preset database; compressing the second directory, the compressed second directory including the first dependency package and the second dependency package.

[0015] By using the above technical solution and pre-setting the prompts during the database startup process, the required dependency packages can be accurately and reasonably obtained. Based on the obtained dependency packages, the first dependency package and the second dependency package can be generated, which is beneficial for the subsequent successful deployment of the database cluster.

[0016] In one possible implementation, the method further includes: clearing the cache in a pre-created third directory; installing the container using a package management tool and starting the container; if the container starts normally, obtaining all software packages from the cache-cleared third directory and storing the obtained software packages in a pre-created fourth directory; compressing the fourth directory to obtain the container script.

[0017] By employing the above technical solution and clearing the cache in the third directory, we can avoid obtaining interfering information during subsequent package retrieval, which could affect the generation of container scripts. Furthermore, retrieving packages only during normal container startup ensures that the packages can successfully run the container, improving the accuracy of the container scripts.

[0018] In one possible implementation, the process of generating the mutual trust script includes: generating an initial script based on a preset command, the initial script being used to send the public key in the key pair generated by the second server to the preset server; executing the initial script based on the address information of the third server, and verifying whether the second server and the third server have established a mutual trust connection; if the second server and the third server successfully establish a mutual trust connection, determining the initial script as the mutual trust script.

[0019] By using the above technical solution and executing the initial script through the address information of the third server, the initial script can be verified, thereby ensuring that the mutual trust script can successfully establish a mutual trust connection.

[0020] Thirdly, embodiments of this application provide a deployment apparatus for deploying a database on multiple first servers in a server system. The apparatus includes: an acquisition unit for acquiring a deployment script from a second server, the deployment script including a mutual trust script, a tool script corresponding to a preset operation and maintenance tool, and a database installation package of a preset database; an update unit for updating the database installation package based on server information of the multiple first servers; an installation unit for installing the preset operation and maintenance tool according to the tool script; an establishment unit for establishing a mutual trust connection between any one of the first servers and other first servers by executing the mutual trust script based on the server information; and an execution unit for executing the updated database installation package using the preset operation and maintenance tool based on the mutual trust connection, and sending the updated database installation package to the other first servers to complete the deployment of the database cluster.

[0021] Fourthly, embodiments of this application provide a deployment system running on a second server. The system includes a generation module, configured to respond to a received script generation request, generate a deployment script based on a database identifier in the script generation request, and send the deployment script to a first server. The deployment script includes a mutual trust script and a database installation package of the preset database. The deployment script is configured to complete the deployment of a database cluster on multiple first servers.

[0022] Fifthly, embodiments of this application provide a server, the server including a memory and a processor: wherein the memory is used to store program instructions; the processor is used to read and execute the program instructions stored in the memory, and when the program instructions are executed by the processor, the server performs the above-described deployment method.

[0023] Sixthly, embodiments of this application provide a computer storage medium storing program instructions that, when executed on a server, cause the server's processor to perform the aforementioned deployment method.

[0024] In a seventh aspect, embodiments of this application provide a program product including a computer program, which is executed by a server's processor to perform the deployment method described above.

[0025] Furthermore, the technical effects brought about by the third to seventh aspects can be found in the descriptions of the methods in the above-mentioned method section, and will not be repeated here. Attached Figure Description

[0026] Figure 1 This is a schematic diagram illustrating an application scenario of the deployment method provided in an embodiment of this application.

[0027] Figure 2 This is a flowchart of a deployment method provided in an embodiment of this application.

[0028] Figure 3 This is a detailed flowchart of deploying a database cluster based on an updated database installation package, provided in one embodiment of this application.

[0029] Figure 4 This is a flowchart of a deployment method provided in another embodiment of this application.

[0030] Figure 5 This is a flowchart of a deployment method provided in another embodiment of this application.

[0031] Figure 6 This is a detailed flowchart of generating deployment scripts provided in one embodiment of this application.

[0032] Figure 7 This is a functional block diagram of a deployment device provided in an embodiment of this application.

[0033] Figure 8 This is a functional block diagram of a deployment system provided in an embodiment of this application.

[0034] Figure 9 This is a software architecture diagram of a server provided in one embodiment of this application.

[0035] Figure 10 This is a hardware architecture diagram of a server provided in one embodiment of this application. Detailed Implementation

[0036] In one embodiment of this application, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more features. In the description of embodiments of this application, words such as "exemplary" or "for example" are used to indicate examples, illustrations, or descriptions. Any embodiment or design described as "exemplary" or "for example" in one embodiment of this application should not be construed as being more preferred or advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present the relevant concepts in a concrete manner.

[0037] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which the embodiments of this application pertain. The terminology used in the description of the embodiments of this application is for the purpose of describing particular embodiments only and is not intended to limit the embodiments of this application. It should be understood that, unless otherwise stated, " / " in the embodiments of this application means "or". For example, A / B can mean A or B. "And / or" in the embodiments of this application is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, and B alone. "At least one" refers to one or more. "More than one" refers to two or more. For example, at least one of a, b, or c can represent: a, b, c, a and b, a and c, b and c, and a, b, and c. Where there is no conflict, the following embodiments and features can be combined with each other.

[0038] The deployment method provided in this application can be applied to various database cluster deployment scenarios, such as MySQL database cluster deployment scenarios, MongoDB database cluster deployment scenarios, etc., and this application does not limit it. See also Figure 1 The diagram shown illustrates an application scenario of a deployment method provided in an embodiment of this application. This scenario may include a server system 10 and a second server 200, and the server system 10 may include multiple first servers 100.

[0039] Each of the first server 100 and the second server 200 can be an independent physical server, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, i.e., content delivery network (CDN), as well as big data and artificial intelligence platforms, but is not limited to these.

[0040] It should be noted that the method in this embodiment can be executed individually by multiple first servers 100 or multiple second servers 200, or jointly by multiple first servers 100 and multiple first servers 100. When executed individually by multiple first servers 100 or multiple second servers 200, the script generation process and the database cluster deployment process can be implemented independently by each of the multiple first servers 100 or multiple second servers 200. For example, a deployment script can be generated on any one of the first servers 100 using the database identifier in the received script generation request. After the deployment script is generated, any one of the first servers 100 can use the deployment script to deploy the database on multiple first servers 100 in the server system. The above process can also be executed individually by multiple second servers 200. When executed jointly by a second server 200 and any one of the first servers 100, the second server 200 can generate the deployment script based on the database identifier in the received script generation request. After the deployment script is generated, multiple first servers 100 implement the database cluster deployment process. In practical applications, specific configurations can be made according to the situation, and no specific limitations are made here.

[0041] It should be noted that when the deployment method provided in this application embodiment is executed individually by multiple second servers 200 or multiple first servers 100, the above application scenario may also include only multiple servers 200 or multiple first servers 100, or multiple second servers 200 and multiple first servers 100 may be considered as the same device. In practical applications, when the deployment method provided in this application embodiment is jointly executed by second servers 200 and multiple first servers 100, the second server 200 may be any one of the multiple first servers 100, and the second server 200 and any one of the first servers 100 may also be a virtual device virtualized by the same physical device.

[0042] In this embodiment of the application, any first server 100 and second server 200 can be directly or indirectly connected via one or more networks. This network can be a wired network or a wireless network; for example, the wireless network can be a mobile cellular network or a Wireless-Fidelity (Wi-Fi) network, and of course, it can be other possible networks. This embodiment of the application does not limit this. It should be noted that... Figure 1 The examples shown are merely illustrative; in reality, the number of terminal devices and servers is unlimited and is not specifically limited in the embodiments of this application.

[0043] The deployment method provided by the embodiments of this application will be described below with reference to the accompanying drawings and the application scenarios described above. It should be noted that the application scenarios described above are only shown to facilitate understanding of the spirit and principle of the embodiments of this application, and the embodiments of this application are not limited in any way.

[0044] See Figure 2 The diagram shown is a flowchart of a deployment method provided in an embodiment of this application. The deployment method can be used to deploy a database on multiple first servers in a server system. Each first server can communicate with a second server. For example, the multiple first servers can be as follows: Figure 1 The first server 100 shown is shown, and the second server can be as follows: Figure 1 The second server 200 shown in the figure, the method specifically includes the following process.

[0045] S201, either the first server obtains the deployment script from the second server.

[0046] In some embodiments of this application, the deployment script includes a mutual trust script, a tool script corresponding to a preset operation and maintenance tool, and a database installation package for a preset database. The deployment script can be generated by a second server.

[0047] Trust scripts are used to establish a trust connection between one server and another, allowing one server to access another server without a password.

[0048] Pre-defined operation and maintenance tools may include, but are not limited to, the Ansible tool, the Expect tool, and other automated operation and maintenance tools. Pre-defined operation and maintenance tools may include one or more tools; for example, pre-defined operation and maintenance tools may include only the Ansible tool, or they may include both the Ansible and Expect tools. The Expect tool allows users to write scripts to simulate interaction with command-line programs, automating task processing. The Ansible tool is primarily used for automating system configuration and management.

[0049] The default database can include, but is not limited to, MySQL, MongoDB, and other similar databases. The corresponding operating system can be any operating system capable of running the default database. The database installation package includes: the first dependency package for the default database and the second dependency package for the corresponding operating system. Because the database installation package includes both the first and second dependency packages, it ensures successful installation of the default database, thus resolving the issue of database cluster deployment failure due to missing dependency packages.

[0050] This application embodiment performs cluster deployment by directly obtaining the deployment script from the second server. Since there is no need to manually create the script, the efficiency of obtaining the deployment script can be improved, thereby improving the deployment efficiency of the database cluster.

[0051] S202, based on server information from multiple primary servers, updates the database installation package.

[0052] In some embodiments of this application, the server information of multiple first servers may include, but is not limited to, the server address and corresponding node role of each first server. For example, the server information of first server A may be [IP1, master node], the server information of first server B may be [IP2, slave node], and the server information of first server C may be [IP3, voting node].

[0053] The database installation package also includes configuration files, which contain database installation scripts, initialization scripts, and master-slave configuration scripts. Each primary server, based on its node role, updates the server address of each primary server to the corresponding location in the master-slave configuration script.

[0054] The node roles include master node, slave node, and voting node roles. The master-slave configuration script includes a first script file corresponding to the master node role, a second script file corresponding to the slave node role, and a third script file corresponding to the voting node role. For example, if server A is a master node, server B is a slave node, and server C is a voting node, the script updates the server address of server A to the first script file; updates the server address of server B to the second script file; and updates the server address of server C to the third script file.

[0055] This application embodiment updates the configuration file by assigning node roles and server addresses to each first server, enabling multiple first servers to be accurately associated with their corresponding node roles, thereby allowing for accurate deployment of the database cluster.

[0056] S203, install the preset operation and maintenance tools according to the tool script.

[0057] In some embodiments of this application, any first server executes a tool script to complete the installation of a preset operation and maintenance tool. The tool script may include a tool script for the expect tool, which is primarily used for handling interactive tasks. The expect tool allows users to write scripts to simulate interaction with command-line programs, thereby automating task processing. The tool script may also include a tool script for the ansible tool, which is primarily used for automating system configuration and management. The expect and ansible tools can be used in combination to achieve more complex automated tasks. For example, when deploying a preset database using the ansible tool, the expect tool can be used to import the database installation script for the preset database to achieve automatic installation of the preset database.

[0058] S204, based on server information, execute the mutual trust script to establish a mutual trust connection between any first server and other first servers.

[0059] In some embodiments of this application, in a trusted connection, any first server sends its generated public key to a designated file on the other first server. When any first server attempts to log in to the other first server via the SSH (Secure Shell) protocol, the other first server checks whether the public key of any first server exists in the designated file. If the public key of any first server exists in the designated file of the other first server, users of any first server are allowed to log in to the other first server without a password.

[0060] In some embodiments of this application, any first server executes a mutual trust script based on server information from multiple first servers. After the mutual trust script is executed, it verifies whether users of any first server are allowed to log in to other first servers without a password. If users of any first server are allowed to log in to other first servers without a password, it is determined that a mutual trust connection has been successfully established between any first server and the other first servers. The server information can be the IP addresses of multiple first servers.

[0061] In this embodiment of the application, after the mutual trust script is executed, it verifies whether users of any first server are allowed to log in to other first servers without a password, thus ensuring that a mutual trust connection is successfully established between any first server and other first servers. The mutual trust connection established through the mutual trust script enables passwordless access between first servers, improving the efficiency of any first server accessing other first servers.

[0062] S205, based on mutual trust connection, uses preset operation and maintenance tools to execute the updated database installation package and send the updated database installation package to other primary servers, thus completing the deployment of the database cluster.

[0063] In some embodiments of this application, the updated database installation package includes an offline source script, a database installation script, an initialization script, and an updated master-slave configuration script. The offline source script includes a first dependency package, a second dependency package, a container script, and a utility script.

[0064] In some embodiments of this application, the specific process of deploying the database cluster, based on a mutual trust connection and using preset operation and maintenance tools, executing the updated database installation package, and sending the updated database installation package to other first servers, to complete the deployment, can be found in the following description. Figure 3 Detailed explanation of the process shown.

[0065] The deployment method provided in this application embodiment directly obtains the deployment script from the second server for cluster deployment. Since no manual script creation is required, the efficiency of obtaining the deployment script is improved, thereby increasing the deployment efficiency of the database cluster. By using pre-set operation and maintenance tools, automated installation of the database based on the updated database installation package can be achieved, further improving the deployment efficiency of the database cluster. The mutual trust connection established through the mutual trust script enables passwordless access between the first servers, thereby improving the transmission efficiency of the database installation package and further enhancing the deployment efficiency of the database cluster.

[0066] See Figure 3 The diagram shown is a detailed flowchart of a database cluster deployment based on an updated database installation package according to an embodiment of this application, which specifically includes the following process.

[0067] S301, any first server, based on a mutual trust connection, uses preset operation and maintenance tools to deploy offline image sources on multiple first servers in the server system according to the offline source script.

[0068] In some embodiments of this application, any first server starts a shell process using the Ansible tool to execute the offline source script. Based on a mutual trust connection, any first server uses a preset operation and maintenance tool to send the offline source script to other first servers. The other first servers execute the offline source script, thus completing the deployment of the offline image source on multiple first servers in the server system.

[0069] This application embodiment, through pre-set operation and maintenance tools, can automate the deployment of offline image sources based on offline source scripts, further improving the deployment efficiency of the database cluster. The mutual trust connection established through mutual trust scripts enables passwordless communication between the first servers, thereby improving the transmission efficiency of offline source scripts and further enhancing the deployment efficiency of the database cluster.

[0070] S302, any first server, based on a mutual trust connection, uses a preset operation and maintenance tool and a database installation script to deploy a preset database on multiple first servers in the server system.

[0071] In some embodiments of this application, any first server starts a shell process using the Ansible tool to execute a database installation script. Based on a mutual trust connection, any first server uses a pre-defined maintenance tool to send the database installation script to other first servers. The other first servers execute the database installation script, completing the deployment of the pre-defined database on multiple first servers within the server system.

[0072] This application embodiment utilizes pre-set operation and maintenance tools to automate the installation of a pre-set database based on a database installation script, further improving the deployment efficiency of the database cluster. The mutual trust connection established through the mutual trust script enables passwordless access between the first servers, thereby improving the transmission efficiency of the database installation script and further enhancing the deployment efficiency of the database cluster.

[0073] S303, any first server, based on a mutual trust connection, uses preset operation and maintenance tools and an initialization script to initialize preset databases deployed on multiple first servers.

[0074] In some embodiments of this application, any first server starts a shell process using the Ansible tool to execute an initialization script. Based on a mutual trust connection, any first server uses a preset maintenance tool to send the initialization script to other first servers. The other first servers execute the initialization script to complete the initialization of preset databases deployed on multiple first servers.

[0075] The mutual trust connection established through the mutual trust script in this embodiment enables passwordless access between the first servers, thereby improving the transmission efficiency of the initialization script. By using pre-set operation and maintenance tools, the initialization script can be used to initialize pre-set databases deployed on multiple first servers, further improving the deployment efficiency of the database cluster.

[0076] S304: Any first server, based on a mutual trust connection, uses preset operation and maintenance tools and an updated master-slave configuration script to perform master-slave configuration on multiple first servers in the server system.

[0077] In some embodiments of this application, any first server starts a shell process using the Ansible tool to execute the updated master-slave configuration script. Based on a mutual trust connection, any first server uses a preset maintenance tool to send the updated master-slave configuration script to other first servers. The other first servers execute the updated master-slave configuration script, thus completing the master-slave configuration for multiple first servers.

[0078] The mutual trust connection established through the mutual trust script in this embodiment enables passwordless access between first servers, thereby improving the transmission efficiency of the updated master-slave configuration script. With pre-set operation and maintenance tools, master-slave configuration can be performed on multiple first servers based on the updated master-slave configuration script, further improving the deployment efficiency of the database cluster.

[0079] In some embodiments of this application, after multiple first servers in the server system have completed master-slave configuration, the database cluster is determined to be deployed.

[0080] In some embodiments of this application, preset parameters are set for each database server in the database cluster, and the preset parameters corresponding to each database server are stored in a preset text file. These preset parameters include, but are not limited to: the database server's server address, port number, database account, and database password. The database server's port number can be used to distinguish different services running on the same database server. By storing the declared preset parameters in a preset text file, this application allows users to quickly understand relevant information about the database cluster from the preset text file.

[0081] This application embodiment installs preset operation and maintenance tools via a tool script, enabling automated deployment of the database cluster. The mutual trust connection established through the mutual trust script allows passwordless access between the first servers, thereby improving script transmission efficiency and further enhancing the deployment efficiency of the database cluster. Furthermore, the offline source script in this application embodiment includes a first dependency package and a second dependency package, which solves the problem of database cluster deployment failure due to missing dependency packages.

[0082] See Figure 4 The diagram shown is a flowchart of a deployment method provided in another embodiment of this application. The deployment method is used to deploy a database and monitoring on multiple first servers in a server system. The multiple first servers can be as follows: Figure 1 The method for the first server 100 shown includes the following specific steps.

[0083] S401, any first server obtains the deployment script from the second server.

[0084] S402 updates the database installation package based on server information from multiple primary servers.

[0085] S403, install the preset operation and maintenance tools according to the tool script.

[0086] S404, based on server information, executes a mutual trust script to establish a mutual trust connection between any first server and other first servers.

[0087] S405, based on a mutual trust connection, uses pre-set operation and maintenance tools to execute the updated database installation package and send the updated database installation package to other primary servers, thus completing the deployment of the database cluster.

[0088] For details on steps S401-S405, please refer to the above text. Figure 2 The detailed description of steps S201-S205 is provided in the previous section and will not be repeated here.

[0089] S406 retrieves container scripts and monitoring deployment scripts from the second server.

[0090] In some embodiments of this application, container scripts can be used to create containers, and monitoring deployment scripts can be used to install monitoring tools.

[0091] S407, based on mutual trust connection, uses preset operation and maintenance tools to execute container scripts and monitoring deployment scripts, and sends container scripts and monitoring deployment scripts to other first servers to complete the monitoring and deployment of the database cluster.

[0092] In some embodiments of this application, any first server starts a shell process using the Ansible tool to execute container scripts and monitoring deployment scripts. Based on a mutual trust connection, any first server uses preset operation and maintenance tools to send the container scripts and monitoring deployment scripts to other first servers. The other first servers execute the container scripts and monitoring deployment scripts, thus completing the deployment of monitoring tools on multiple first servers in the server system.

[0093] In some embodiments of this application, the monitoring server can be used to monitor the status information of multiple first servers. The status information of the multiple first servers may include, but is not limited to: the memory information of the multiple first servers, the CPU information of the multiple first servers, and database metrics such as the number of connections and cache of the database cluster corresponding to the multiple first servers.

[0094] In some embodiments of this application, the monitoring server updates the information corresponding to preset tags in its monitoring configuration file based on the server information of multiple first servers, thus obtaining an updated monitoring configuration file. The monitoring server executes the updated monitoring configuration file to complete the association between the monitoring server and the monitoring tools of the multiple first servers. The preset tags can be tags indicating server addresses or server names. This embodiment of the application updates the monitoring configuration file using the server information of multiple first servers, enabling the association of monitoring tools deployed on multiple first servers with the monitoring server, thereby facilitating the monitoring server's monitoring of multiple first servers.

[0095] In some embodiments of this application, the status information of multiple first servers can be displayed in real time on the visualization panel of the monitoring server.

[0096] The embodiments of this application establish a mutual trust connection through a mutual trust script, enabling passwordless access between the first servers, thereby improving the transmission efficiency of container scripts and monitoring deployment scripts. By pre-setting operation and maintenance tools, automated deployment of monitoring tools can be achieved, further improving the monitoring and deployment efficiency of the database cluster, and also enabling monitoring of each database server in the database cluster.

[0097] See Figure 5 The diagram shown illustrates a deployment method according to another embodiment of this application. The deployment method can be applied to a second server, which may be, for example, a... Figure 1 The second server 200 shown in the figure, the method specifically includes the following process.

[0098] S501, in response to the received script generation request, generates a deployment script based on the database identifier in the script generation request, and sends the deployment script to the first server.

[0099] In some embodiments of this application, the script generation request can be triggered by an electronic device. For example, the electronic device displays a visual interface, and based on the database identifier entered by the user in the visual interface, the electronic device generates a script generation request. The deployment script is configured to complete the deployment of a database cluster across multiple first servers. The deployment script includes a mutual trust script, a tool script corresponding to a preset operation and maintenance tool, and a database installation package for a preset database corresponding to the database identifier. The database installation package also includes a configuration file, which includes a database installation script, an initialization script, and a master-slave configuration script.

[0100] In some embodiments of this application, the specific process by which the second server generates a deployment script based on the database identifier in the script generation request can be referred to the following description. Figure 6 Detailed explanation of the process shown.

[0101] In some other embodiments of this application, the second server can also generate a monitoring deployment script. The generation process of the monitoring deployment script includes: decompressing the third software package in the monitoring software package to a pre-created monitoring directory; starting the monitoring server based on the decompressed third software package; logging into a preset node on the monitoring server; the preset node running a preset database; and the preset node being any of the master node, slave node, or voting node. On the preset node, decompressing the first and second software packages in the monitoring software package to the pre-created monitoring directory, and starting node monitoring and database monitoring. If node monitoring and database monitoring start successfully, compressing the monitoring directory to obtain the monitoring deployment script. The method for generating the monitoring software package can be referred to below. Figure 6 Detailed explanation of step S604.

[0102] The deployment method provided in this application embodiment can generate deployment scripts based on database identifiers. Since there is no need to manually create the scripts, the efficiency of generating deployment scripts can be improved, thereby improving the deployment efficiency of the database cluster.

[0103] See Figure 6 The diagram shown is a detailed flowchart of generating a deployment script according to an embodiment of this application, which specifically includes the following process.

[0104] S601, in response to the received script generation request, the second server generates a first dependency package for a preset database corresponding to the database identifier and a second dependency package for the operating system corresponding to the preset database, based on the database identifier in the script generation request.

[0105] In some embodiments of this application, the information carried in the script generation request includes, but is not limited to, a database identifier. The database identifier indicates the type of the preset database. For example, if the database identifier is PG, the corresponding preset database can be a PostgreSQL database; if the database identifier is MySQL, the corresponding preset database can be a MySQL database; and if the database identifier is MongoDB, the corresponding preset database can be a MongoDB database.

[0106] In some embodiments of this application, the second server generates a first dependency package for a preset database and a second dependency package for an operating system corresponding to the preset database, based on the database identifier in the script generation request. This includes: the second server configuring a first mirror source for the preset database and a second mirror source for the operating system based on the database identifier; the second server updating the operating system's system configuration file based on preset values, the system configuration file being used to set the cache of the first directory; the second server starting the preset database based on the first and second mirror sources, and storing the dependency packages corresponding to the prompts obtained from the first directory into a pre-created second directory according to the prompts during the startup process of the preset database; and the second server compressing the second directory, the compressed second directory including the first dependency package and the second dependency package, the first dependency package being identified as a DB RPM dependency package and the second dependency package being identified as an OS RPM dependency package.

[0107] The configuration process for the first mirror source includes: determining the first mirror address corresponding to the database identifier; determining the database package name corresponding to the database identifier based on the language corresponding to the first mirror address; generating a first configuration script based on the first configuration command, the first mirror address, and the database package name; and executing the first configuration script to complete the configuration of the first mirror source. For example, if the database identifier is mongodb, the first mirror address is http: / / pypi.XX.com / simple / , the language corresponding to the first mirror address is Python, the database package name corresponding to the database identifier could be pymongo, and the first configuration command is pip install -i mirror address + package name, then the first configuration script could be pip install -i http: / / pypi.douban.com / simple / pymongo.

[0108] The operating system corresponding to the preset database can be an operating system capable of starting the preset database. The configuration process of the second image source is similar to that of the first image source, and will not be described again in this embodiment.

[0109] In one example of this application's embodiment, the initial value of keepcache in the system configuration file can be set to 0. If keepcache = 0, it indicates that the cache of software packages downloaded during installation or update is not retained. The preset value can be set to 1. The second server updates the keepcache in the system configuration file based on the preset value. If keepcache = 1, it indicates that the cache of software packages downloaded during installation or update is retained.

[0110] The error message indicates which dependencies are missing during the startup process of the default database. The message can include the dependency identifiers of the missing packages. For example, the message could be: "Default database startup failed because the following dependencies are missing:"

[0111] - Package name 1 (Version requirements: X, Y, Z);

[0112] - Package name 2 (Version requirements: A, B, C);

[0113] "Please search for and install the missing dependency packages using a package management tool (such as yum, dnf, etc.)". Based on the prompt, the dependency package identifiers of the missing packages include: package name 1 and package name 2.

[0114] This application embodiment can accurately and reasonably obtain the required dependency packages by pre-setting the prompt information of the database during the startup process, thereby generating the first dependency package and the second dependency package based on the obtained dependency packages, which is beneficial to the subsequent successful deployment of the database cluster.

[0115] S602, the second server generates a binary installation package for a preset database based on the database identifier.

[0116] In some embodiments of this application, the binary installation package of the preset database can be a software package generated by successfully compiling the source code package of the preset database. The source code package of the preset database can be a code package written by the user according to a specific format or syntax.

[0117] In some embodiments of this application, the second server determines the database download link of a preset database based on a database identifier, parses the database download link of the preset database to obtain the storage location of the software package corresponding to the preset database, establishes a connection between the second server and the storage server corresponding to the storage location, and obtains the software package corresponding to the preset database from the storage location based on the connection relationship, compresses it, and obtains the binary installation package of the preset database. By parsing the database download link of the preset database, the embodiments of this application can accurately determine the storage location, and then accurately establish a connection between the second server and the storage server based on the storage location, thereby obtaining the software package corresponding to the preset database from the storage location. Therefore, the generation efficiency of the binary installation package can be improved.

[0118] S603, the second server generates the container script.

[0119] In some embodiments of this application, the container script can be used to create containers, for example, to create Docker containers. The second server generates the container script by: clearing the cache in a pre-created third directory, installing the container using a package management tool, and starting the container. If the container starts normally, the second server retrieves all software packages from the cache-cleared third directory, stores the retrieved packages in a pre-created fourth directory, compresses the fourth directory, and obtains the container script. The package management tool may include, but is not limited to, the yum tool. The software packages retrieved from the third directory can be RPM packages for the Docker container. By clearing the cache in the third directory, this embodiment of the application avoids obtaining interfering information during subsequent package retrieval, which could affect the generation of the container script. Furthermore, retrieving the software packages only when the container starts normally ensures that the packages can successfully run the container, improving the accuracy of the container script.

[0120] S604, the second server generates the monitoring software package.

[0121] In some embodiments of this application, the monitoring software package can be used to monitor the health status of a server. For example, the monitoring software package can be used to monitor the server's memory information and CPU information. The monitoring software package can also be used to monitor the health status of a database. For example, the monitoring software package can be used to monitor database metrics such as the number of database connections and database cache.

[0122] In some embodiments of this application, the second server generates a monitoring software package, including: determining a first download link for node monitoring from a first preset address, determining a second download link for database monitoring from a second preset address, and determining a third download link for server monitoring from a third preset address. A first software package corresponding to the first download link is obtained, a second software package corresponding to the second download link is obtained, and a third software package corresponding to the third download link is obtained. The first, second, and third software packages are stored in a pre-created fifth directory, and the fifth directory is compressed to obtain the monitoring software package. The method of obtaining the first, second, and third software packages is similar to the method by which the second server obtains the software package corresponding to a preset database based on the database download link, and will not be described again in this embodiment.

[0123] The first, second, and third preset addresses can be set and adjusted according to user needs. For example, if the first preset address is https: / / prometheus.io / download / , the first download link for node monitoring can be the download link for node_exporter; if the second preset address is https: / / github.com / prometheus / mongodb_exporter, the second download link for database monitoring can be the second download link for mongodb_exporter; if the third preset address is https: / / prometheus.io / download / #prometheus, the third download link for server monitoring can be the download link for prometheus-2.54.1.linux-amd64.tar.gz.

[0124] This application embodiment uses a first preset address, a second preset address, and a third preset address to determine a first software package for node monitoring, a second software package for database monitoring, and a third software package for server monitoring, respectively. By storing the first, second, and third software packages in a pre-created fifth directory and compressing the fifth directory, monitoring software packages for monitoring both the server and the database can be obtained simultaneously, improving the comprehensiveness of the monitoring software packages.

[0125] S605, the second server generates the mutual trust script.

[0126] In some embodiments of this application, a mutual trust script is used to establish a mutual trust connection between one server and another server, through which one server can access another server without a password.

[0127] In some embodiments of this application, the second server generates a mutual trust script, including: the second server generating an initial script based on a preset command, the initial script being used to send the public key from the key pair generated by the second server to a preset server; the second server executing the initial script based on the address information of the third server, and verifying whether a mutual trust connection has been established between the second server and the third server; if the second server and the third server successfully establish a mutual trust connection, the initial script is determined to be a mutual trust script.

[0128] The second server generates a key pair based on the ssh-keygen command and sends the public key of the key pair to the preset server based on the ssh-copy-id command to obtain the initial script.

[0129] The third server can be any server other than the default server, and the address information of the third server can be its Internet Protocol address (IP address).

[0130] If the second server can access the third server without a password, it is determined that the second server and the third server have successfully established a mutual trust connection; if the second server cannot access the third server without a password, it is determined that the second server and the third server have not successfully established a mutual trust connection. Passwordless access means that the second server can access the third server without needing to log in to the third server's password.

[0131] This application embodiment executes the initial script using the address information of the third server, which enables the verification of the initial script and thus ensures that the mutual trust script can successfully establish a mutual trust connection.

[0132] S606, the second server generates tool scripts based on preset operation and maintenance tools.

[0133] In some embodiments of this application, the pre-defined operation and maintenance tools may include, but are not limited to, the Ansible tool, the Expect tool, and other automated operation and maintenance tools. The tool scripts corresponding to the Ansible tool can be used to install the Ansible tool, and the tool scripts corresponding to the Expect tool can be used to install the Expect tool.

[0134] In some embodiments of this application, the second server clears the cache in the pre-created sixth directory, installs a preset operation and maintenance tool using a package management tool, and verifies the preset operation and maintenance tool. If the preset operation and maintenance tool is successfully verified, the second server retrieves the dependency packages of the preset operation and maintenance tool from the cache-cleared sixth directory, stores the dependency packages of the preset operation and maintenance tool in the pre-created seventh directory, compresses the seventh directory, and obtains the tool script.

[0135] The verification method for the preset operation and maintenance tool can be as follows: obtain the installation version information of the preset operation and maintenance tool through the second configuration command. If the installation version information is the same as the configuration version information, the preset operation and maintenance tool is verified successfully.

[0136] Different default operation and maintenance tools correspond to different second configuration commands. For example, if the default operation and maintenance tool is Ansible, the corresponding second configuration command can be `ansible --version`; if the default operation and maintenance tool is Expect, the corresponding second configuration command can be `expect -v`. The configuration version information can be set and adjusted according to actual needs. Different default operation and maintenance tools correspond to different configuration version information. For example, the configuration version information for Ansible can be `ansible 2.9.27`; the configuration version information for Expect can be `expect version 5.45`.

[0137] This embodiment of the application clears the cache of the sixth directory, thus avoiding interference information obtained when subsequently acquiring the dependency packages of the preset operation and maintenance tool, which could affect the generation of the tool script. Furthermore, by acquiring the dependency packages of the preset operation and maintenance tool only after successful verification, it ensures that the tool script version corresponds to the preset operation and maintenance tool, improving the accuracy of the tool script.

[0138] S607, the second server generates offline source scripts based on the first dependency package, the second dependency package, the container script, and the tool script.

[0139] In some embodiments of this application, the second server stores the first dependency package, the second dependency package, the container script, and the tool script in a pre-created eighth directory, and compresses the eighth directory to obtain the offline source deployment script.

[0140] S608, the second server generates a database installation script based on the preset database binary installation package.

[0141] In some embodiments of this application, the binary installation package of the preset database is decompressed in the pre-created ninth directory, multiple preset directories corresponding to the preset database are created in the ninth directory, and the configuration of the preset database is updated based on preset information. After the configuration of the preset database is updated, the preset database is restarted. If the preset database restarts successfully, the ninth directory is compressed to obtain the database installation script.

[0142] The preset directories may include, but are not limited to, data storage directories and log directories. Preset information includes, but is not limited to, the log output path in the preset database, the storage path of the preset database, and the memory usage of the preset database.

[0143] S609, the second server generates the initialization script.

[0144] In some embodiments of this application, the process of generating the initialization script includes: starting a preset database based on a startup command, creating a database user and a cluster initialization file in a pre-created tenth directory, setting the permissions of the database user, executing the cluster initialization file, compressing the tenth directory, and obtaining the initialization script.

[0145] S610, the second server generates the master-slave configuration script.

[0146] In some embodiments of this application, the process of generating the master-slave configuration script includes: creating a first script file for the master node, a second script file for the slave node, and a third script file for the voting node; updating the first script file, the second script file, and the third script file based on the replica set mode; and compressing the updated first script file, the updated second script file, and the updated third script file to obtain the master-slave configuration script.

[0147] Since the embodiments of this application do not require manual script creation, the efficiency of deployment script generation can be improved, thereby improving the deployment efficiency of the database cluster.

[0148] See Figure 7 As shown, Figure 7 This is a functional block diagram of a deployment apparatus provided in one embodiment of this application. The deployment apparatus 71 is used to deploy a database on multiple first servers in a server system. The deployment apparatus 71 includes an acquisition unit 710, an update unit 711, an installation unit 712, a creation unit 713, and an execution unit 714. The module / unit referred to in this application refers to a module / unit that can be processed by a processor (e.g., ...). Figure 10 A series of computer-readable instruction segments acquired by the processor 110 shown, and capable of performing a fixed function, which are stored in memory (e.g., a memory processor 110). Figure 10 In the memory 121 shown.

[0149] The acquisition unit 710 is used to acquire the deployment script from the second server. The deployment script includes a mutual trust script, a tool script corresponding to the preset operation and maintenance tools, and a database installation package for the preset database. The update unit 711 is used to update the database installation package based on the server information of multiple first servers. The installation unit 712 is used to install the preset operation and maintenance tools according to the tool script. The establishment unit 713 is used to execute the mutual trust script based on the server information to establish a mutual trust connection between any first server and other first servers. The execution unit 714 is used to execute the updated database installation package using the preset operation and maintenance tools based on the mutual trust connection, and to send the updated database installation package to other first servers to complete the deployment of the database cluster.

[0150] In one embodiment, the database installation package includes: a first dependency package for a preset database and a second dependency package for an operating system corresponding to the preset database. The first dependency package and the second dependency package are generated by a second server.

[0151] In one embodiment, the acquisition unit 710 is further configured to acquire a container script and a monitoring deployment script from the second server, the monitoring deployment script being used to install monitoring tools; the execution unit 714 is further configured to execute the container script and the monitoring deployment script based on a mutual trust connection and using a preset operation and maintenance tool, and to send the container script and the monitoring deployment script to other first servers to complete the monitoring deployment of the database cluster.

[0152] In one embodiment, the database installation package includes a configuration file, and the server information includes the server address and corresponding node role of each first server. The update unit 711 is specifically used to update the server address of each first server to the corresponding position in the configuration file based on the node role of each first server.

[0153] In several embodiments of this application, cluster deployment is performed by directly obtaining deployment scripts from a second server. Since manual script creation is unnecessary, the efficiency of obtaining deployment scripts is improved, thereby increasing the deployment efficiency of the database cluster. By using pre-set operation and maintenance tools, automated installation of the database based on the updated database installation package can be achieved, further improving the deployment efficiency of the database cluster. The mutual trust connection established through mutual trust scripts enables passwordless access between the first servers, thereby improving the transmission efficiency of the database installation package and further enhancing the deployment efficiency of the database cluster.

[0154] See Figure 8 As shown, Figure 8 This is a functional block diagram of a deployment system provided in an embodiment of this application. The deployment system 81 runs on a second server and includes a generation module 810, a configuration module 811, an update module 812, a startup module 813, a storage module 814, a compression module 815, and a clearing module 816. The module / unit referred to in this application refers to a type of module that can be processed by a processor (e.g., ...). Figure 10 A series of computer-readable instruction segments acquired by the processor 110 shown, and capable of performing a fixed function, which are stored in memory (e.g., a memory processor 110). Figure 10 In the memory 121 shown.

[0155] The generation module 810 is used to respond to the received script generation request, generate a deployment script according to the database identifier in the script generation request, and send the deployment script to the first server. The deployment script includes a mutual trust script and a database installation package of a preset database. The deployment script is configured to complete the deployment of the database cluster on multiple first servers.

[0156] In one embodiment, the database installation package includes: a first dependency package for a preset database, a second dependency package for an operating system corresponding to the preset database, a configuration module 811 for configuring a first image source for the preset database and a second image source for the operating system based on a database identifier; an update module 812 for updating the operating system's system configuration file based on a preset value, the system configuration file being used to set the cache of a first directory; a startup module 813 for starting the preset database based on the first image source and the second image source; a storage module 814 for storing the dependency packages corresponding to the prompt information obtained from the first directory to a pre-created second directory according to the prompt information during the startup process of the preset database; and a compression module 815 for compressing the second directory, the compressed second directory including the first dependency package and the second dependency package.

[0157] In one embodiment, the clearing module 816 is used to clear the cache in the pre-created third directory; the startup module 813 is also used to install the container using a package management tool and start the container; the storage module 814 is also used to obtain all software packages from the third directory after clearing the cache if the container starts normally, and store the obtained software packages in the pre-created fourth directory; the compression module 815 is also used to compress the fourth directory to obtain the container script.

[0158] In one embodiment, the generation module 810 is specifically used to: generate an initial script based on a preset command, the initial script being used to send the public key in the key pair generated by the second server to the preset server; execute the initial script based on the address information of the third server, and verify whether the second server and the third server have established a mutual trust connection; if the second server and the third server have successfully established a mutual trust connection, the initial script is determined to be a mutual trust script.

[0159] In several embodiments of this application, deployment scripts can be generated using database identifiers. Since there is no need to manually create scripts, the efficiency of generating deployment scripts can be improved, thereby improving the deployment efficiency of the database cluster.

[0160] See Figure 9 As shown, Figure 9 This is a software architecture diagram of a server provided in one embodiment of this application. The layered architecture divides the software into several layers, each with a clear role and function. Layers communicate with each other through software interfaces. For example, the Android system, from top to bottom, consists of the application layer 901, framework layer 902, Android runtime and system libraries 903, hardware abstraction layer 904, kernel layer 905, and hardware layer 906.

[0161] Application layer 901 may include a series of application packages. For example, application packages may include applications such as camera, gallery, calendar, calling, map, navigation, WLAN, Bluetooth, music, video, SMS, device control services, etc.

[0162] The framework layer 902 provides an Application Programming Interface (API) and programming framework for applications in the application layer. The application framework layer includes predefined functions. For example, it may include a window manager, content provider, view system, phone manager, resource manager, notification manager, etc.

[0163] The window manager manages window programs. It can obtain screen size, determine the presence of a status bar, lock the screen, and capture screenshots. The content provider stores and retrieves data, making it accessible to applications. Data can include videos, images, audio, made and received calls, browsing history and bookmarks, phone books, etc. The view system includes visual controls, such as controls for displaying text and controls for displaying images. The view system can be used to build applications. A display interface can consist of one or more views. For example, a display interface including a text notification icon can include views for displaying text and views for displaying images. The call manager provides communication functionality to the server, such as managing call status (including connection, disconnection, etc.). The resource manager provides various resources to applications, such as localized strings, icons, images, layout files, and video files. The notification manager allows applications to display notifications in the status bar, conveying informational messages that disappear automatically after a short pause without user interaction. For example, the notification manager is used to notify of download completion or message alerts. The notification manager can also display notifications as icons or scrolling text in the system's top status bar, such as notifications from background applications, or as dialog boxes on the screen. Examples include displaying text messages in the status bar, emitting alert sounds, server vibrations, and flashing indicator lights.

[0164] The Android Runtime consists of the core libraries and the virtual machine. The Android runtime is responsible for the scheduling and management of the Android system. The core libraries consist of two parts: one part contains the functionalities that the Java language needs to call, and the other part contains the core Android libraries.

[0165] The application layer (901) and framework layer (902) run in a virtual machine. The virtual machine executes the Java files of the application layer and framework layer as binary files. The virtual machine is used to perform functions such as object lifecycle management, stack management, thread management, security and exception management, and garbage collection.

[0166] System Library 903 may include multiple functional modules. For example, a surface manager, media libraries, 3D graphics processing libraries (e.g., OpenGLES), and 2D graphics engines (e.g., SGL).

[0167] The Surface Manager manages the display subsystem and provides fusion of 2D and 3D layers for multiple applications. The Media Library supports playback and recording of various common audio and video formats, as well as still image files. It supports multiple audio and video encoding formats, such as MPEG4, H.264, MP3, AAC, AMR, JPG, and PNG. The 3D Graphics Processing Library implements 3D graphics drawing, image rendering, compositing, and layer processing. The 2D Graphics Engine is the drawing engine for 2D graphics.

[0168] Hardware Abstraction Layer 904 runs in user space, encapsulates kernel-level drivers, and provides calling interfaces to the upper layers.

[0169] Kernel layer 905 is the layer between hardware and software. Kernel layer 905 includes at least display drivers, touch drivers, audio drivers, and sensor drivers.

[0170] The kernel layer (905) is the core of the server's operating system. It's the first layer of software extension based on the hardware, providing the most basic functions of the operating system. It forms the foundation for the operating system's operation, managing system processes, memory, device drivers, files, and network systems, and determining system performance and stability. For example, the kernel layer can determine the timing of an application's operations on certain hardware components.

[0171] The kernel layer 905 includes hardware-dependent programs such as interrupt handlers and device drivers, as well as basic, common, and frequently used modules such as clock management and process scheduling modules, and critical data structures. The kernel layer can be located in the processor or embedded in internal memory.

[0172] The hardware layer 906 includes the server's hardware, such as displays, buttons, cameras, etc.

[0173] See Figure 10 As shown, Figure 10 This is a hardware architecture diagram of a server provided in one embodiment of this application.

[0174] Server 10 may include a processor 110, an external memory interface 120, an internal memory 121, a Universal Serial Bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, a headphone jack 170D, a sensor module 180, buttons 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a Subscriber Identification Module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, a barometric pressure sensor 180C, a magnetic sensor 180D, an accelerometer sensor 180E, a distance sensor 180F, a proximity sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.

[0175] It is understood that the structure illustrated in the embodiments of the present invention does not constitute a specific limitation on server 10. In other embodiments of this application, server 10 may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

[0176] Processor 110 may include one or more processing units, such as an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural network processing unit (NPU). These different processing units may be independent devices or integrated into one or more processors.

[0177] The controller can generate operation control signals based on the instruction opcode and timing signals to complete the control of instruction fetching and execution.

[0178] The processor 110 may also include a memory for storing instructions and data. In one embodiment of this application, the memory in the processor 110 is a cache memory. The memory can store instructions or data that the processor 110 has just used or that are used repeatedly. If the processor 110 needs to use the instructions or data again, it can directly retrieve them from the memory. This avoids repeated accesses, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.

[0179] In one embodiment of this application, the processor 110 may include one or more interfaces. These interfaces may include an Inter-integrated Circuit (I2C) interface, an Inter-integrated Circuit Sound (I2S) interface, a Pulse Code Modulation (PCM) interface, a Universal Asynchronous Receiver / Transmitter (UART) interface, a Mobile Industry Processor Interface (MIPI) interface, a General-Purpose Input / Output (GPIO) interface, a Subscriber Identity Module (SIM) interface, and / or a Universal Serial Bus (USB) interface, etc.

[0180] The I2C interface is a bidirectional synchronous serial bus, including a serial data line (SDA) and a serial clock line (SCL). In one embodiment of this application, the processor 110 may include multiple I2C buses. The processor 110 can couple to the touch sensor 180K, charger, flash, camera 193, etc., through different I2C bus interfaces. For example, the processor 110 can couple to the touch sensor 180K through the I2C interface, enabling the processor 110 and the touch sensor 180K to communicate through the I2C bus interface, thereby realizing the touch function of the server 10.

[0181] The I2S interface can be used for audio communication. In one embodiment of this application, the processor 110 may include multiple I2S buses. The processor 110 can be coupled to the audio module 170 via the I2S bus to realize communication between the processor 110 and the audio module 170. In one embodiment of this application, the audio module 170 can transmit audio signals to the wireless communication module 160 via the I2S interface to realize the function of answering phone calls through a Bluetooth headset.

[0182] The PCM interface can also be used for audio communication, sampling, quantizing, and encoding analog signals. In one embodiment of this application, the audio module 170 and the wireless communication module 160 can be coupled via the PCM bus interface. In another embodiment of this application, the audio module 170 can also transmit audio signals to the wireless communication module 160 via the PCM interface, enabling the function of answering phone calls through a Bluetooth headset. Both the I2S interface and the PCM interface can be used for audio communication.

[0183] The UART interface is a universal serial data bus used for asynchronous communication. The bus can be a bidirectional communication bus. It converts the data to be transmitted between serial and parallel communication. In one embodiment of this application, the UART interface is typically used to connect the processor 110 and the wireless communication module 160. For example, the processor 110 communicates with the Bluetooth module in the wireless communication module 160 via the UART interface to implement Bluetooth functionality. In one embodiment of this application, the audio module 170 can transmit audio signals to the wireless communication module 160 via the UART interface to enable music playback via Bluetooth headphones.

[0184] The MIPI interface can be used to connect the processor 110 to peripheral devices such as the display screen 194 and the camera 193. The MIPI interface includes a Camera Serial Interface (CSI) and a Display Serial Interface (DSI). In one embodiment of this application, the processor 110 and the camera 193 communicate via the CSI interface to realize the shooting function of the server 10. The processor 110 and the display screen 194 communicate via the DSI interface to realize the display function of the server 10.

[0185] The GPIO interface can be configured via software. It can be configured as a control signal or a data signal. In one embodiment of this application, the GPIO interface can be used to connect the processor 110 to a camera 193, a display screen 194, a wireless communication module 160, an audio module 170, a sensor module 180, etc. The GPIO interface can also be configured as an I2C interface, an I2S interface, a UART interface, a MIPI interface, etc.

[0186] USB port 130 is a USB standard compliant interface, specifically a Mini USB port, MicroUSB port, or USB Type-C port. USB port 130 can be used to connect a charger to charge server 10, and can also be used for data transfer between server 10 and peripheral devices. It can also be used to connect headphones for audio playback. Furthermore, the interface can be used to connect other devices to server 10, such as AR devices.

[0187] It is understood that the interface connection relationships between the modules illustrated in the embodiments of the present invention are merely illustrative and do not constitute a limitation on the structure of the server 10. In other embodiments of this application, the server 10 may also employ different interface connection methods or a combination of multiple interface connection methods as described in the above embodiments.

[0188] The charging management module 140 receives charging input from a charger. The charger can be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 receives charging input from the wired charger via the USB interface 130. In some wireless charging embodiments, the charging management module 140 receives wireless charging input via the wireless charging coil of the server 10. While charging the battery 142, the charging management module 140 can also supply power to the server 10 via the power management module 141.

[0189] The power management module 141 connects the battery 142, the charging management module 140, and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140, providing power to the processor 110, internal memory 121, display screen 194, camera 193, and wireless communication module 160, etc. The power management module 141 can also monitor parameters such as battery capacity, battery cycle count, and battery health status (leakage current, impedance). In some other embodiments, the power management module 141 may also be located within the processor 110. In other embodiments, the power management module 141 and the charging management module 140 may be located in the same device.

[0190] The wireless communication function of server 10 can be implemented through antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, modem processor, and baseband processor.

[0191] Antennas 1 and 2 are used to transmit and receive electromagnetic wave signals. Each antenna in server 10 can be used to cover one or more communication frequency bands. Different antennas can also be multiplexed to improve antenna utilization. For example, antenna 1 can be multiplexed as a diversity antenna for a wireless local area network. In some other embodiments, the antennas can be used in conjunction with tuning switches.

[0192] The mobile communication module 150 can provide wireless communication solutions, including 2G / 3G / 4G / 5G, for use on the server 10. The mobile communication module 150 may include at least one filter, switch, power amplifier, low-noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves via the antenna 1, and perform filtering, amplification, and other processing on the received electromagnetic waves before transmitting them to the modem processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modem processor and convert it into electromagnetic waves for radiation via the antenna 1. In one embodiment of this application, at least some functional modules of the mobile communication module 150 may be housed in the processor 110. In another embodiment of this application, at least some functional modules of the mobile communication module 150 and at least some modules of the processor 110 may be housed in the same device.

[0193] The modem processor may include a modulator and a demodulator. The modulator modulates the low-frequency baseband signal to be transmitted into a mid-to-high frequency signal. The demodulator demodulates the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After processing by the baseband processor, the low-frequency baseband signal is transmitted to the application processor. The application processor outputs sound signals through audio devices (not limited to speaker 170A, receiver 170B, etc.) or displays images or videos through the display screen 194. In one embodiment of this application, the modem processor may be a separate device. In other embodiments, the modem processor may be independent of the processor 110 and housed within the same device as the mobile communication module 150 or other functional modules.

[0194] The wireless communication module 160 can provide solutions for wireless communication applications on server 10, including Wireless Local Area Networks (WLAN) (such as Wireless Fidelity (Wi-Fi) networks), Bluetooth (BT), Global Navigation Satellite System (GNSS), Frequency Modulation (FM), Near Field Communication (NFC), and Infrared (IR) technologies. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via antenna 2, modulates and filters the electromagnetic wave signals, and sends the processed signal to processor 110. The wireless communication module 160 can also receive signals to be transmitted from processor 110, modulate and amplify them, and then convert them into electromagnetic waves for radiation via antenna 2.

[0195] In one embodiment of this application, antenna 1 of server 10 is coupled to mobile communication module 150, and antenna 2 is coupled to wireless communication module 160, enabling server 10 to communicate with networks and other devices via wireless communication technology. Wireless communication technologies may include Global System for Mobile Communications (GSM), General Packet Radio Service (GPRS), Code Division Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), Time-Division Code Division Multiple Access (TD-SCDMA), Long Term Evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technologies, etc. GNSS can include the Global Positioning System (GPS), the Global Navigation Satellite System (GLONASS), the Beidou Navigation Satellite System (BDS), the Quasi-Zenith Satellite System (QZSS), and / or Satellite Based Augmentation Systems (SBAS).

[0196] Server 10 implements display functions through a GPU, display screen 194, and application processor. The GPU is a deployed microprocessor that connects the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations and for graphics rendering. Processor 110 may include one or more GPUs, which execute program instructions to generate or modify display information.

[0197] Display screen 194 is used to display images, videos, etc. Display screen 194 includes a display panel. The display panel can be a Liquid Crystal Display (LCD), an Organic Light-Emitting Diode (OLED), an Active-Matrix Organic Light-Emitting Diode (AMOLED), a Flexible Light-Emitting Diode (FLED), Minied, Microled, Micro-OLED, Quantum Dot Light-Emitting Diodes (QLED), etc. In one embodiment of this application, server 10 may include one or N displays 194, where N is a positive integer greater than 1.

[0198] Server 10 can perform shooting functions through ISP, camera 193, video codec, GPU, display 194 and application processor.

[0199] The ISP is used to process data fed back from the camera 193. For example, when taking a picture, the shutter is opened, and light is transmitted through the lens to the camera's photosensitive element. The light signal is converted into an electrical signal, and the camera's photosensitive element transmits the electrical signal to the ISP for processing, converting it into an image visible to the naked eye. The ISP can also perform algorithmic optimization on image noise, brightness, and skin tone. The ISP can also optimize parameters such as exposure and color temperature of the shooting scene. In one embodiment of this application, the ISP can be set in the camera 193.

[0200] Camera 193 is used to capture still images or videos. An object is projected onto a photosensitive element by generating an optical image through the lens. The photosensitive element can be a charge-coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the light signal into an electrical signal, which is then transmitted to an ISP for conversion into a digital image signal. The ISP outputs the digital image signal to a DSP for processing. The DSP converts the digital image signal into image signals in standard RGB, YUV, or other formats. In one embodiment of this application, server 10 may include one or N cameras 193, where N is a positive integer greater than 1.

[0201] A digital signal processor (DSP) is used to process digital signals. Besides digital image signals, it can also process other digital signals. For example, when server 10 selects a frequency point, the DSP can perform Fourier transforms on the frequency energy.

[0202] Video codecs are used to compress or decompress digital video. Server 10 may support one or more video codecs. Thus, server 10 can play or record videos in various encoding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG 2, MPEG 3, MPEG 4, etc.

[0203] An NPU (Neural-Network) computing processor borrows from the structure of biological neural networks, such as the transmission patterns between neurons in the human brain, to rapidly process input information and continuously learn. Through an NPU, intelligent cognitive applications can be implemented on server 10, such as image recognition, facial recognition, information prompts, speech recognition, and text understanding.

[0204] Internal memory 121 may include one or more random access memory (RAM) and one or more non-volatile memory (NVM).

[0205] Random access memory can include static random-access memory (SRAM), dynamic random-access memory (DRAM), synchronous dynamic random-access memory (SDRAM), double data rate synchronous dynamic random-access memory (DDRSDRAM, for example, fifth-generation DDRSDRAM is generally called DDR5SDRAM), etc.

[0206] Non-volatile memory can include disk storage devices and flash memory.

[0207] Flash memory can be classified according to its operating principle, including NORFLASH, NANDFLASH, 3D NANDFLASH, etc.; according to the level of the storage cell, including single-level cell (SLC), multi-level cell (MLC), triple-level cell (TLC), quad-level cell (QLC), etc.; and according to the storage specification, including universal flash storage (UFS) and embedded multi-media card (eMMC), etc.

[0208] The random access memory can be directly read and written by the processor 110. It can be used to store executable programs (such as machine instructions) of the operating system or other running programs, as well as user and application data.

[0209] Non-volatile memory can also store executable programs and user and application data, and can be pre-loaded into random access memory for direct reading and writing by the processor 110.

[0210] The external memory interface 120 can be used to connect to external non-volatile memory, thereby expanding the storage capacity of the server 10. The external non-volatile memory communicates with the processor 110 through the external memory interface 120 to perform data storage functions. For example, music, video, and other files can be stored in the external non-volatile memory.

[0211] Internal memory 121 or external memory interface 120 is used to store one or more computer programs. The one or more computer programs are configured to be executed by processor 110. The one or more computer programs include multiple instructions, which, when executed by processor 110, can implement the screen display detection method executed on server 10 in the above embodiments, thereby realizing the screen display detection function of server 10.

[0212] Server 10 can implement audio functions such as music playback and recording through audio module 170, speaker 170A, receiver 170B, microphone 170C, headphone jack 170D, and application processor.

[0213] The audio module 170 is used to convert digital audio information into analog audio signals for output, and also to convert analog audio input into digital audio signals. The audio module 170 can also be used for encoding and decoding audio signals. In one embodiment of this application, the audio module 170 may be located in the processor 110, or some functional modules of the audio module 170 may be located in the processor 110.

[0214] The speaker 170A, also known as a "loudspeaker," is used to convert audio electrical signals into sound signals. The server 10 can listen to music or make hands-free calls through the speaker 170A.

[0215] The receiver 170B, also known as the "earpiece," is used to convert audio electrical signals into sound signals. When the server 10 receives a phone call or voice message, it can listen to the voice by bringing the receiver 170B close to the listener's ear.

[0216] Microphone 170C, also known as a "microphone" or "voice transducer," is used to convert sound signals into electrical signals. When making a phone call or sending a voice message, the user can speak by bringing their mouth close to microphone 170C, inputting the sound signal into microphone 170C. Server 10 can be equipped with at least one microphone 170C. In some embodiments, server 10 can be equipped with two microphones 170C, which, in addition to collecting sound signals, can also perform noise reduction. In other embodiments, server 10 can be equipped with three, four, or more microphones 170C, which can collect sound signals, reduce noise, identify the sound source, and perform directional recording, etc.

[0217] The 170D headphone jack is used to connect wired headphones. The 170D headphone jack can be a USB 130 interface or a 3.5mm Open Mobile Terminal Platform (OMTP) standard interface, a CTIA (Cellular Telecommunications Industry Association of the USA) standard interface.

[0218] Buttons 190 include a power button, volume buttons, etc. Buttons 190 can be mechanical buttons or touch-sensitive buttons. Server 10 can receive button input and generate key signal inputs related to user settings and function control of server 10.

[0219] Motor 191 can generate vibration alerts. Motor 191 can be used for incoming call vibration alerts or for touch vibration feedback. For example, different vibration feedback effects can correspond to touch operations performed on different applications (such as taking photos, playing audio, etc.). Motor 191 can also correspond to different vibration feedback effects for touch operations performed on different areas of the display screen 194. Different application scenarios (such as time reminders, receiving messages, alarm clocks, games, etc.) can also correspond to different vibration feedback effects. The touch vibration feedback effect can also be customized.

[0220] Indicator 192 can be an indicator light, used to indicate charging status, power changes, or to indicate messages, missed calls, notifications, etc.

[0221] The SIM card interface 195 is used to connect a SIM card. The SIM card can be inserted into or removed from the SIM card interface 195 to establish contact with and disconnect from the server 10. The server 10 can support one or N SIM card interfaces, where N is a positive integer greater than 1. The SIM card interface 195 can support Nano SIM cards, Micro SIM cards, SIM cards, etc. Multiple cards can be inserted into the same SIM card interface 195 simultaneously. The multiple cards can be of the same or different types. The SIM card interface 195 is also compatible with different types of SIM cards. The SIM card interface 195 is also compatible with external storage cards. The server 10 interacts with the network through the SIM card to achieve functions such as voice calls and data communication. In one embodiment of this application, the server 10 uses an eSIM, i.e., an embedded SIM card. The eSIM card can be embedded in the server 10 and cannot be separated from the server 10. This application also provides a computer storage medium storing computer instructions. When the computer instructions are executed on the server 10, the server 10 performs the aforementioned related method steps to implement the methods in the above embodiments.

[0222] This application also provides a computer program product that, when run on a computer, causes the computer to perform the aforementioned steps to implement the methods described in the above embodiments.

[0223] In addition, embodiments of this application also provide an apparatus, which may specifically be a chip, component or module. The apparatus may include a connected processor and a memory; wherein the memory is used to store computer execution instructions, and when the apparatus is running, the processor may execute the computer execution instructions stored in the memory to cause the chip to execute the methods in the above-described method embodiments.

[0224] In this embodiment, the terminal device, computer storage medium, computer program product or chip are all used to execute the corresponding methods provided above. Therefore, the beneficial effects they can achieve can be referred to the beneficial effects in the corresponding methods provided above, and will not be repeated here.

[0225] Through the above description of the embodiments, those skilled in the art can clearly understand that, for the sake of convenience and brevity, only the division of the above functional modules is used as an example. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.

[0226] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another device, or some features may be ignored or not executed. Furthermore, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.

[0227] The units described as separate components may or may not be physically separate. A component shown as a unit can be one or more physical units; that is, it can be located in one place or distributed in multiple different locations. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0228] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0229] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solutions of the embodiments of this application, essentially or in other words, the parts that contribute to the prior art, or all or part of the technical solutions, can be embodied in the form of a software product. The software product is stored in a storage medium and includes several instructions to cause a device (which may be a microcontroller, chip, etc.) or processor to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0230] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application and are not intended to limit it. Although this application has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of this application without departing from the spirit and scope of the technical solutions of this application.

Claims

1. A deployment method for deploying a database on multiple first servers in a server system, the deployment method being executed by any one of the first servers, characterized in that, The method includes: Obtain the deployment script, which includes a mutual trust script, a tool script corresponding to a preset operation and maintenance tool, and a database installation package for a preset database; Based on the server information of the plurality of first servers, update the database installation package; Install the preset operation and maintenance tool according to the tool script; Based on the server information, the mutual trust script is executed to establish a mutual trust connection between any of the first servers and other first servers; Based on the mutual trust connection, the updated database installation package is executed using the preset operation and maintenance tools, and the updated database installation package is sent to the other first servers to complete the deployment of the database cluster.

2. The deployment method according to claim 1, characterized in that, The database installation package includes: a first dependency package for the preset database and a second dependency package for the operating system corresponding to the preset database.

3. The deployment method according to claim 1, characterized in that, The method further includes: Obtain the container script and the monitoring deployment script, wherein the monitoring deployment script is used to install the monitoring tool; Based on the mutual trust connection, the container script and the monitoring deployment script are executed using the preset operation and maintenance tools, and the container script and the monitoring deployment script are sent to the other first servers to complete the monitoring deployment of the database cluster.

4. The deployment method according to claim 1, characterized in that, The database installation package includes a configuration file, and the server information includes the server address and corresponding node role of each first server. Updating the database installation package based on the server information of the plurality of first servers includes: Based on the node role of each first server, the server address of each first server is updated to the corresponding position in the configuration file.

5. A deployment method applied to a second server, characterized in that, The method includes: In response to a received script generation request, a deployment script is generated based on the database identifier in the script generation request, and the deployment script is sent to a first server. The deployment script includes a mutual trust script and a database installation package for a preset database corresponding to the database identifier. The deployment script is configured to complete the deployment of a database cluster on multiple first servers.

6. The deployment method according to claim 5, characterized in that, The database installation package includes: a first dependency package for the preset database and a second dependency package for the operating system corresponding to the preset database. The method further includes: Based on the database identifier, configure the first mirror source of the preset database and the second mirror source of the operating system; Based on preset values, update the system configuration file of the operating system, which is used to set the cache of the first directory; Based on the first mirror source and the second mirror source, the preset database is started; Based on the prompts from the preset database during startup, the dependency packages corresponding to the prompts obtained from the first directory are stored in a pre-created second directory; The second directory is compressed, and the compressed second directory includes the first dependency package and the second dependency package.

7. The deployment method according to claim 5, characterized in that, The method further includes: Clear the cache in the pre-created third directory; Install the container using a package management tool and then start the container; If the container starts normally, it retrieves all software packages from the third directory after clearing the cache and stores the retrieved software packages in the pre-created fourth directory; The fourth directory is compressed to obtain the container script.

8. The deployment method according to claim 5, characterized in that, The process of generating the mutual trust script includes: Based on a preset command, an initial script is generated, which is used to send the public key in the key pair generated by the second server to the preset server. Based on the address information of the third server, the initial script is executed, and it is verified whether the second server and the third server have established a mutual trust connection. If the second server and the third server successfully establish a mutual trust connection, the initial script will be identified as the mutual trust script.

9. A server, characterized in that, include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the computer program, implements the deployment method as described in any one of claims 1 to 4 or the deployment method as described in any one of claims 5 to 8.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the deployment method as described in any one of claims 1 to 4 or the deployment method as described in any one of claims 5 to 8.