Deployment method, device and equipment of database cluster and readable storage medium
The server provides dependency package libraries and installation libraries, and generates deployment scripts, which solves the problems of low database cluster deployment efficiency and high maintenance costs, and achieves automated deployment and efficiency improvement.
Patent Information
- Application Number
- CN202410978158.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-19
- Publication Date
- 2024-10-11
AI Technical Summary
The deployment efficiency of database clusters in the existing technology is low and maintenance costs are high, and there is a lack of mature deployment methods.
The server provides dependency package libraries and installation libraries, identifies client conditions and generates deployment scripts to realize automated deployment, supports database cluster deployment of different types of servers, and allows server reuse.
It improves the deployment efficiency of database clusters, reduces maintenance costs, realizes automated deployment, and is suitable for different types of servers.
Smart Images

Figure CN118760447A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of databases, and in particular to a deployment method, device, equipment and readable storage medium of a database cluster. Background Art
[0002] A database cluster is a virtual single database logical image composed of at least two servers. It can provide transparent data services like a single database system. The deployment of a database cluster is a complicated task. The related technology lacks a mature database cluster deployment method, which leads to low efficiency and high maintenance cost when deploying a database cluster.
[0003] Therefore, how to provide a solution to the above technical problems is a problem that those skilled in the art need to solve at present. Summary of the invention
[0004] The purpose of the present invention is to provide a deployment method, device, equipment and readable storage medium for a database cluster. Since the server provides a dependency package library and an installation program library of the database software, and the server can perform relevant condition judgments on the client and generate a deployment script that can be used by the client, the database cluster can be automatically deployed on different types of servers through the server, and the server can be reused, which not only improves the efficiency of the database cluster, but also has a low maintenance cost for the deployment method.
[0005] In order to solve the above technical problems, the present invention provides a database cluster deployment method, which is applied to a server, and includes:
[0006] Identify each client that is connected to the server and belongs to the database cluster to be deployed;
[0007] Determining whether each of the clients meets the preset installation conditions of the database software;
[0008] If each of the clients meets the preset installation conditions, determining a specified version of the database software of the database cluster to be deployed;
[0009] Determine a deployment script according to the server information of the specified category and the specified version of each of the clients;
[0010] Sending the deployment script to each of the clients respectively, so that when each of the clients executes the deployment script, based on the dependency packages in the dependency package library and the source code installation program in the installation program library, the deployment process of the database cluster of the specified version of the database software is performed;
[0011] The server includes the preset dependency package library and the installation program library, wherein the dependency package library includes various dependency packages that may be required by the database software, and the installation program library includes source code installation programs of various versions of the database software.
[0012] On the other hand, according to the server information of the specified category and the specified version of each of the clients, determining the deployment script includes:
[0013] Constructing a deployment script common to each of the clients according to the server information of the specified category and the specified version of each of the clients;
[0014] The deployment script is used to deploy the database cluster of the specified version of the database software for any of the clients when executed by the clients;
[0015] The deployment of the database cluster of the specified version of the database software includes:
[0016] The preparation work before deploying the database cluster, installation of database software, initialization of the database cluster and startup of the database.
[0017] On the other hand, the clients that are connected to the server and belong to the database cluster to be deployed are determined to include:
[0018] Determine each client connected to itself through communication handshake;
[0019] For any of the clients that are connected to the client for communication, determine whether the client meets the preset legitimacy verification index;
[0020] If satisfied, the client is determined to be a server of the database cluster to be deployed;
[0021] If not, it is determined that the client is not a server of the database cluster to be deployed;
[0022] The legitimacy verification index includes that the network address is in a specified network segment and / or the operating system is a specified operating system.
[0023] On the other hand, determining whether each of the clients meets the preset installation conditions of the database software includes:
[0024] Obtaining server information of a specified category for each of the clients;
[0025] For any of the clients, judging whether the client meets the preset installation conditions of the database software according to the server information of the client;
[0026] The preset installation conditions include: the remaining memory space is not less than a first preset threshold, the remaining storage space is not less than a second preset threshold, and the server architecture is at least one of the preset architectures.
[0027] In order to solve the above technical problems, the present invention also provides a method for deploying a database cluster, which is applied to a client and includes:
[0028] Receive a deployment script sent by the server, wherein the deployment script is determined by the server according to server information of a specified category of each client and a specified version of database software of the database cluster to be deployed, and the client refers to a server of the database cluster to be deployed that is in communication connection with the server and meets preset installation conditions of the database software;
[0029] Through the deployment script, based on the dependency packages in the dependency package library and the source code installation program in the installation program library, the deployment process of the database cluster of the specified version of the database software is executed in itself;
[0030] The dependency package library and the installation program library are preset on the server side, the dependency package library includes various dependency packages that may be required by the database software, and the installation program library includes source code installation programs of various versions of the database software.
[0031] On the other hand, through the deployment script, based on the dependency packages in the dependency package library and the source code installation program in the installation program library, the deployment process of the database cluster of the specified version of the database software is executed by itself, including:
[0032] Trigger the execution of the deployment script to perform preparations before deploying the database cluster;
[0033] After the preparation work is completed, the database software of the specified version is installed;
[0034] After the database software is installed, initializing the database cluster;
[0035] After initialization is complete, start the database;
[0036] The database software to be installed includes:
[0037] Determine the target dependency packages required to install the specified version of the database software;
[0038] Determine a list of dependent packages in a dependent package library of the server;
[0039] If each of the target dependent packages is in the dependent package list, obtain each of the target dependent packages from the dependent package library;
[0040] Install each of the target dependency packages using a preset dependency package installation tool;
[0041] Obtaining a source code installation program of a specified version of database software from an installation program library on the server side, wherein the installation program library pre-stores source code installation programs of multiple versions of database software;
[0042] Compile the obtained source code installation program and install the specified version of the database software.
[0043] On the other hand, initializing the database cluster includes:
[0044] Initialize the database instance in itself;
[0045] Configure the parameter files required when running the database software;
[0046] Starting the initialized database instance;
[0047] In response to the configuration instructions received through the human-machine interface, the database cluster is configured.
[0048] In order to solve the above technical problems, the present invention also provides a deployment device for a database cluster, comprising:
[0049] A first determination module is used to determine each client that is in communication connection with itself and belongs to a server of a database cluster to be deployed;
[0050] A first determination module is used to determine whether each of the clients meets the preset installation conditions of the database software, and if each of the clients meets the preset installation conditions, trigger a second determination module;
[0051] A second determination module is used to determine a specified version of database software of a database cluster to be deployed;
[0052] A third determination module is used to determine a deployment script according to the server information of the specified category and the specified version of each client;
[0053] A first sending module is used to send the deployment script to each of the clients respectively, so that when each of the clients executes the deployment script, based on the dependency packages in the dependency package library and the source code installation program in the installation program library, the deployment process of the database cluster of the specified version of the database software is performed;
[0054] The server includes the preset dependency package library and the installation program library, wherein the dependency package library includes various dependency packages that may be required by the database software, and the installation program library includes source code installation programs of various versions of the database software.
[0055] In order to solve the above technical problems, the present invention further provides a deployment device for a database cluster, comprising:
[0056] Memory for storing computer programs;
[0057] The processor is used to implement the steps of the above-mentioned database cluster deployment method when executing the computer program.
[0058] To solve the above technical problem, the present invention further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the above database cluster deployment method are implemented.
[0059] Beneficial effect: The present invention provides a method for deploying a database cluster. The server in the present invention can determine each client that is connected to the server for communication with itself and belongs to the database cluster to be deployed, and judge whether each client satisfies the preset installation conditions of the database software. If all of them are satisfied, a deployment script can be determined according to the server information of the specified category of each client and the specified version of the database software, and the deployment script can be distributed to the client, so that when each client executes the deployment script, the deployment process of the database cluster of the specified version of the database software is executed based on the dependency package library and the installation program library provided by the server. Since the server provides the dependency package library and the installation program library of the database software, and the server can perform relevant condition judgment on the client and generate a deployment script available to the client, the database cluster can be automatically deployed for different types of servers through the server, and the server can be reused, which not only improves the efficiency of the database cluster, but also has a low maintenance cost.
[0060] The present invention also provides a database cluster deployment device, equipment and computer-readable storage medium, which have the same beneficial effects as the above database cluster deployment method. BRIEF DESCRIPTION OF THE DRAWINGS
[0061] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the relevant technologies and the drawings required for use in the embodiments are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0062] Figure 1 A schematic diagram of a process flow of a database cluster deployment method provided by the present invention;
[0063] Figure 2A schematic diagram of the structure of a data cluster deployment system provided by the present invention;
[0064] Figure 3 A schematic diagram of a flow chart of another method for deploying a database cluster provided by the present invention;
[0065] Figure 4 A schematic diagram of a process of installing database software provided by the present invention;
[0066] Figure 5 A schematic diagram of a process for initializing a database cluster provided by the present invention;
[0067] Figure 6 A schematic diagram of the structure of a deployment device for a database cluster provided by the present invention;
[0068] Figure 7 A schematic diagram of the structure of a deployment device for a database cluster provided by the present invention;
[0069] Figure 8 A schematic diagram of the structure of a computer-readable storage medium provided by the present invention. DETAILED DESCRIPTION
[0070] The core of the present invention is to provide a deployment method, device, equipment and readable storage medium for a database cluster. Since the server provides a dependency package library and an installation program library of the database software, and the server can perform relevant condition judgments on the client and generate a deployment script that can be used by the client, the database cluster can be automatically deployed on different types of servers through the server, and the server can be reused, which not only improves the efficiency of the database cluster, but also has a low maintenance cost for the deployment method.
[0071] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0072] Please refer to Figure 1 , Figure 1 A schematic diagram of a process flow of a database cluster deployment method provided by the present invention, wherein the database cluster deployment method is applied to a server, and includes:
[0073] S101: Determine each client that is connected to the server and belongs to the server of the database cluster to be deployed;
[0074] Specifically, considering the technical problems in the above background technology, and considering that the server of the database cluster to be deployed can be used as a client in the computer system, and the automatic deployment of the database cluster can be realized through the execution of the program by the server, the deployment method of the database cluster in the embodiment of the present invention is first applied to the server, and considering that one of the prerequisites for the server to deploy the client is that "the client can communicate with the server", and not all clients communicated with the server are used for the database cluster to be deployed. Therefore, in order to deploy the server of the database cluster to be deployed, in this step, first determine the clients that are communicated with itself and belong to the server of the database cluster to be deployed.
[0075] The service end may be of various types, such as a server, etc., which is not limited in the embodiment of the present invention.
[0076] To better illustrate the embodiments of the present invention, please refer to Figure 2 , Figure 2 This is a schematic diagram of the structure of a data cluster deployment system provided by the present invention. The deployment system includes a server and several clients, and the server can communicate with each client.
[0077] Specifically, the server of the database cluster to be deployed in the embodiment of the present invention may be of various types, for example, a domestic server, etc., and the embodiment of the present invention does not limit this.
[0078] S102: Determine whether each client meets the preset installation conditions of the database software;
[0079] Specifically, considering that satisfying the preset installation conditions of the database software is one of the important conditions for the successful deployment of the server, if the preset installation conditions of the database software are not met, there is no need to carry out the subsequent deployment process. Therefore, the installation conditions can be pre-set in the steps of the present invention, and it can be determined whether each client satisfies the preset installation conditions of the database software, so as to trigger the actions of the subsequent steps according to the determination results.
[0080] S103: If each client satisfies the preset installation conditions, a specified version of the database software of the database cluster to be deployed is determined;
[0081] Specifically, when all clients meet the preset installation conditions, the deployment of the database cluster can begin. Considering that the database software required by the database cluster may have multiple different versions, and before installing the database software, it is necessary to determine which version to install, therefore, in the steps of the present invention, when all clients meet the preset installation conditions, the specified version of the database software of the database cluster to be deployed can be determined, and used as the data basis for subsequent steps.
[0082] There may be many specific ways to determine the specified version of the database software of the database cluster to be deployed, such as receiving the specified version of the database software through a human-machine interface, etc., which is not limited in the embodiment of the present invention.
[0083] S104: Determine a deployment script according to the server information of the specified category and the specified version of each client;
[0084] Specifically, in order to determine the deployment script applicable to each client, in this step, the deployment script can be determined according to the server information of the specified category and the specified version of each client, and used as the data basis for subsequent steps.
[0085] S105: Sending the deployment script to each client, so that each client executes the deployment process of the database cluster of the specified version of the database software based on the dependency packages in the dependency package library and the source code installation program in the installation program library when executing the deployment script;
[0086] The server includes a preset dependency package library and an installation program library. The dependency package library includes various dependency packages that may be required by the database software, and the installation program library includes source code installation programs of various versions of the database software.
[0087] Specifically, considering that when installing database software, not only different versions of installation programs may be required, but also various different dependency packages, different servers or different scenarios have different requirements for the version of the database software, and different versions of database software or different servers have different requirements for dependency packages. In order to adapt to the requirements of various different database software versions, in an embodiment of the present invention, a dependency package library and an installation program library can be preset on the server side. In this case, based on the deployment script determined in the aforementioned steps, each client can, when executing the deployment script, execute the deployment process of the database cluster for the specified version of the database software based on the dependency packages in the dependency package library and the source code installation program in the installation program library. Therefore, in this step, the deployment script can be sent to each client separately so that each client can perform the deployment process of the database cluster.
[0088] It is worth mentioning that the database cluster to be deployed may be of various types, for example, it may be a pg citus database cluster, and the database software involved may be a citus plug-in source code software, which is not limited in the embodiment of the present invention.
[0089] The present invention provides a method for deploying a database cluster. The server in the present invention can determine each client of a server that is connected to itself for communication and belongs to a database cluster to be deployed, and judge whether each client satisfies the preset installation conditions of the database software. If all of them are satisfied, a deployment script can be determined according to the server information of the specified category of each client and the specified version of the database software, and the deployment script can be distributed to the client, so that when each client executes the deployment script, the deployment process of the database cluster of the specified version of the database software is executed based on the dependency package library and the installation program library provided by the server. Since the server provides the dependency package library and the installation program library of the database software, and the server can perform relevant condition judgment on the client and generate a deployment script available to the client, the database cluster can be automatically deployed for different types of servers through the server, and the server can be reused, which not only improves the efficiency of the database cluster, but also has a low maintenance cost.
[0090] Based on the above embodiments:
[0091] As an optional embodiment, determining the deployment script according to the server information of the specified category and the specified version of each client includes:
[0092] Build a deployment script common to all clients based on the server information of the specified category and the specified version of each client;
[0093] The deployment script is used to deploy a database cluster of a specified version of database software for any client when executed by the client;
[0094] The deployment of a database cluster with a specified version of database software includes:
[0095] Preparation work before deploying the database cluster, installation of database software, initialization of the database cluster, and startup of the database.
[0096] Specifically, considering that the steps of the deployment process design of the database cluster are basically the same for each client, and the differences therein may include differences in simple parameters (such as IP addresses, server architectures, or storage directories), in order to improve the efficiency and simplicity of the deployment work, in an embodiment of the present invention, a deployment script common to each client can be constructed based on the server information of a specified category and a specified version of each client. When the deployment script is executed by any client, it can deploy the database cluster of the specified version of the database software for the client.
[0097] Among them, the preparation work before deploying the database cluster, the installation of the database software, the initialization of the database cluster and the startup of the database involve all the steps that a single client needs to perform when deploying the database cluster.
[0098] Of course, in addition to the above steps, the deployment work of the database cluster of the specified version of the database software may also include other steps, which are not limited in the embodiment of the present invention.
[0099] As an optional embodiment, determining each client that is in communication connection with itself and belongs to a server of the database cluster to be deployed includes:
[0100] Determine each client connected to itself through communication handshake;
[0101] For any client connected to itself, determine whether the client meets the preset legitimacy verification index;
[0102] If the conditions are met, the client is determined to be a server of the database cluster to be deployed;
[0103] If not, it is determined that the client is not a server of the database cluster to be deployed;
[0104] Among them, the legitimacy verification indicators include that the network address is in a specified network segment and / or the operating system is a specified operating system.
[0105] Specifically, in order to efficiently and accurately determine each client connected to itself for communication, in an embodiment of the present invention, the server can determine each client connected to itself for communication by means of a communication handshake. Then, in order to efficiently and accurately determine whether the client connected to itself for communication is a server of a database cluster to be deployed, in an embodiment of the present invention, legitimacy verification indicators for the client are pre-set, which may include a network address being in a specified network segment and / or an operating system being a specified operating system. If the preset legitimacy verification indicators are met, the client can be determined to be a server of a database cluster to be deployed.
[0106] In addition to the communication handshake method, the method of determining the client connected to the communication device may also be in other forms, which are not limited in the embodiment of the present invention.
[0107] Specifically, in addition to the legality verification indicators listed above, the legality verification indicators may also be in other specific forms, for example, may also include CA (Certificate Authority) authentication, etc., which is not limited in the embodiment of the present invention.
[0108] As an optional embodiment, determining whether each client meets the preset installation conditions of the database software includes:
[0109] Get server information of specified categories for each client;
[0110] For any client, judging whether the client meets the preset installation conditions of the database software according to the server information of the client;
[0111] Among them, the preset installation conditions include: the remaining memory space is not less than a first preset threshold, the remaining storage space is not less than a second preset threshold, and the server architecture is at least one of the preset architectures.
[0112] To better illustrate the embodiments of the present invention, please refer to Figure 3 , Figure 3 A schematic diagram of a process flow of another database cluster deployment method provided by the present invention, in Figure 3 In the server, the server can obtain the server information of the specified category of each client, and judge whether each client meets the preset installation conditions of the database software according to the server information of the client. Figure 1 , the server can terminate the installation and output an error log when there is a client that does not meet the preset installation conditions of the database software.
[0113] Specifically, considering that the server information of the client can reflect whether the client meets the corresponding preset installation conditions, in the embodiment of the present invention, for any client, based on the server information of the client, it can be judged whether the client meets the preset installation conditions of the database software. This method is relatively simple and efficient.
[0114] Of course, in addition to this specific method, other methods may be used to determine whether each client meets the preset installation conditions of the database software, which is not limited in the embodiment of the present invention.
[0115] Specifically, in order to efficiently and accurately determine whether the client meets the installation conditions of the database software, a preset installation condition is provided in an embodiment of the present invention, including: the remaining memory space is not less than a first preset threshold, the remaining storage space is not less than a second preset threshold, and the server architecture is at least one of the preset architectures.
[0116] Of course, in addition to this specific form, the preset installation condition may also be in other forms, which are not limited in the embodiment of the present invention.
[0117] Specifically, after receiving a request to obtain server information, the client can use a self-check program to detect server information of its own specified category. The specified category can be set independently, for example, it can include server architecture, domestic server model, host name, business IP (Internet Protocol), memory size, drive letter and disk size, kernel parameter configuration and firewall information, etc., which are not limited in the embodiments of the present invention; the client can generate an information file with a fixed format based on the detected server information of itself, and send it to the server through an SSL (Secure Socket Layer) connection or the like; the server parses the information file, performs a syntax check first, and reports an error when a syntax error occurs. After the syntax check passes, a deployment script can be generated based on the server information of each client and the specified version of the database software.
[0118] In addition, it is worth mentioning that, considering that in the case where a small number of clients do not meet the preset installation conditions, in theory, the database cluster can still be deployed based on other clients that meet the preset installation conditions. At this time, if the deployment of the database cluster is directly terminated, the work efficiency will be affected. Therefore, in the embodiment of the present invention, the threshold requirement index for the deployment of the database cluster for the server cluster can be pre-set. The threshold requirement index can specify the minimum requirements for the server cluster to deploy the database cluster, for example, it can include the threshold number of servers and the memory capacity threshold, storage capacity threshold and network communication capability threshold, etc. The embodiment of the present invention does not limit this; then:
[0119] When there are clients that do not meet the preset installation conditions, it is possible to determine whether the clients that meet the preset installation conditions can meet various threshold requirements through the server information of the clients that meet the preset installation conditions. If the clients that meet the preset installation conditions can meet various threshold requirements, a special deployment request and the identification of the clients that do not meet the preset installation conditions can be sent through the human-computer interface. If an instruction to allow special deployment is received through the human-computer interface, the database cluster can be deployed based on each client that meets the preset installation conditions.
[0120] In order to solve the above technical problems, the present invention also provides a method for deploying a database cluster, which is applied to a client and includes:
[0121] Receive a deployment script sent by the server, wherein the deployment script is determined by the server according to the server information of the specified category of each client and the specified version of the database software of the database cluster to be deployed, and the client refers to a server of the database cluster to be deployed that is connected to the server in communication and meets the preset installation conditions of the database software;
[0122] Through the deployment script, based on the dependency packages in the dependency package library and the source code installation program in the installation program library, the deployment process of the database cluster of the specified version of the database software is executed on its own;
[0123] Among them, the dependency package library and the installation program library are preset on the server side. The dependency package library includes various dependency packages that may be required by the database software, and the installation program library includes source code installation programs of various versions of the database software.
[0124] Specifically, the database cluster deployment method in the embodiment of the present invention is applied to the client, that is, the server on which the database cluster is to be deployed. For the client, it can receive the deployment script sent by the server, and through the deployment script, based on the dependency packages in the dependency package library and the source code installation program in the installation program library, it can execute the deployment process of the database cluster of the specified version of the database software on its own, thereby completing the deployment of the database cluster on each client.
[0125] For the introduction of the database cluster deployment method provided by the embodiment of the present invention, reference can be made to the aforementioned embodiment of the database cluster deployment method applied to the server, and the embodiment of the present invention will not be described in detail here.
[0126] As an optional embodiment, by using a deployment script, based on the dependency packages in the dependency package library and the source code installation program in the installation program library, the deployment process of the database cluster of the specified version of the database software is executed by itself, including:
[0127] Trigger the execution of the deployment script to perform the preparation work before deploying the database cluster;
[0128] After the preparation work is completed, install the specified version of the database software;
[0129] After the database software is installed, initialize the database cluster;
[0130] After initialization is complete, start the database;
[0131] The database software to be installed includes:
[0132] Determine the target dependency packages required to install the specified version of the database software;
[0133] Determine the list of dependent packages in the server's dependent package library;
[0134] If each target dependency package is in the dependency package list, obtain each target dependency package from the dependency package library;
[0135] Install each target dependency package through the preset dependency package installation tool;
[0136] Obtaining a source code installation program of a specified version of database software from an installation program library on the server, wherein the installation program library pre-stores source code installation programs of multiple versions of database software;
[0137] Compile the obtained source code installation program and install the specified version of the database software.
[0138] To better illustrate the embodiments of the present invention, please refer to Figure 4 , Figure 4 A schematic diagram of a process for installing database software provided by the present invention.
[0139] Specifically, the actions that can be achieved when the deployment script is executed include: triggering the deployment script to perform the preparation work before deploying the database cluster; after the preparation work is completed, installing the specified version of the database software; after the database software is installed, initializing the database cluster; after the initialization is completed, starting the database. The client can perform this set of actions after executing the deployment script, so that the initialization of the database cluster can be realized simply and efficiently.
[0140] Specifically, when installing a specified version of database software, after the client determines the target dependency packages required to install the specified version of the database software, it can know from the dependency package list in the dependency package library of the server whether the target dependency packages it needs are included. If the target dependency packages are in the dependency package list, each target dependency package is obtained from the dependency package library, and then each target dependency package is installed through a preset dependency package installation tool; then the source code installation program of the specified version of the database software can be obtained from the installation program library of the server, and finally the obtained source code installation program can be compiled to install the specified version of the database software.
[0141] The client can actively request a list of dependency packages in the dependency package library of the server, and the server can inform each client of the list of dependency packages through a response file.
[0142] Specifically, the preset dependency package installation tool may be of various types, such as a yum tool, etc., which is not limited in the embodiment of the present invention.
[0143] Specifically, the dependency packages may be of various types, for example, may include cmake (an open source, cross-platform automated build system for controlling the software compilation process), gcc (GNU Compiler Collection), gcc-c++, ncurses (providing a character terminal processing library), ncurses-devel (an advanced version of ncurses), openSSL-devel (an advanced version of an open source software library package), rpcgen (a source program in C language), libtirpc and libtirpc-devel, etc., which are not limited in the embodiments of the present invention.
[0144] The preparation work before deploying the database cluster may include multiple contents, for example, generating a password-free login through ssh-keygen (a Linux command), disabling the firewall, SElinux (Security-Enhanced Linux), configuring limit file restrictions, etc., which are not limited in the embodiments of the present invention.
[0145] Specifically, each link in the embodiment of the present invention can log the results, such as the result of judging whether a condition is passed or not and the result of success or failure when requesting a certain content, etc. The embodiment of the present invention is not limited here.
[0146] As an optional embodiment, initializing the database cluster includes:
[0147] Initialize the database instance in itself;
[0148] Configure the parameter files required when running the database software;
[0149] Start the initialized database instance;
[0150] In response to the configuration instructions received through the human-machine interface, the database cluster is configured.
[0151] To better illustrate the embodiments of the present invention, please refer to Figure 5 , Figure 5 A schematic diagram of a process for initializing a database cluster provided by the present invention.
[0152] Specifically, an embodiment of the present invention provides an indirect and efficient database cluster initialization process. When initializing the database cluster, each client can initialize the database instance itself, and then configure the parameter files (such as postgresql.conf and pg_hba.conf, etc.) required when running the database software. Then, the initialized database instance can be started. At this point, the user can log in to the database management system and send configuration instructions through the human-computer interface to perform corresponding configuration management on the database cluster.
[0153] Of course, in addition to the above specific forms, the database cluster may also be initialized in other ways, which are not limited in the embodiment of the present invention.
[0154] Please refer to Figure 6 , Figure 6 A schematic diagram of a database cluster deployment device provided by the present invention, wherein the database cluster deployment device comprises:
[0155] A first determination module 61 is used to determine each client that is in communication connection with itself and belongs to a server of a database cluster to be deployed;
[0156] A first determination module 62 is used to determine whether each client meets the preset installation conditions of the database software, and if each client meets the preset installation conditions, a second determination module 63 is triggered;
[0157] A second determination module 63 is used to determine a specified version of the database software of the database cluster to be deployed;
[0158] The third determination module 64 is used to determine the deployment script according to the server information of the specified category and the specified version of each client;
[0159] The first sending module 65 is used to send the deployment script to each client, so that each client executes the deployment process of the database cluster of the specified version of the database software based on the dependency packages in the dependency package library and the source code installation program in the installation program library when executing the deployment script;
[0160] The server includes a preset dependency package library and an installation program library. The dependency package library includes various dependency packages that may be required by the database software, and the installation program library includes source code installation programs of various versions of the database software.
[0161] As an optional embodiment, the third determining module 64 is specifically configured to:
[0162] Build a deployment script common to all clients based on the server information of the specified category and the specified version of each client;
[0163] The deployment script is used to deploy a database cluster of a specified version of database software for any client when executed by the client;
[0164] The deployment of a database cluster with a specified version of database software includes:
[0165] Preparation work before deploying the database cluster, installation of database software, initialization of the database cluster, and startup of the database.
[0166] As an optional embodiment, the first determining module 61 includes:
[0167] A first determination submodule is used to determine each client connected to the communication module by means of a communication handshake;
[0168] The second judgment module is used to judge whether any client connected to the communication module satisfies the preset legitimacy verification index, and if so, trigger the first judgment module; if not, trigger the second judgment module;
[0169] A first determination module, used to determine that the client is a server of a database cluster to be deployed;
[0170] A second determination module is used to determine that the client is not a server of the database cluster to be deployed;
[0171] Among them, the legitimacy verification indicators include that the network address is in a specified network segment and / or the operating system is a specified operating system.
[0172] As an optional embodiment, the first determination module 62 includes:
[0173] A first acquisition module is used to acquire server information of a specified category of each client;
[0174] The first judgment submodule is used to judge, for any client, whether the client meets the preset installation conditions of the database software according to the server information of the client;
[0175] Among them, the preset installation conditions include: the remaining memory space is not less than a first preset threshold, the remaining storage space is not less than a second preset threshold, and the server architecture is at least one of the preset architectures.
[0176] For an introduction to the database cluster deployment device provided in an embodiment of the present invention, please refer to the aforementioned embodiment of the database cluster deployment method, and the embodiment of the present invention will not be described in detail here.
[0177] Please refer to Figure 7 , Figure 7A schematic diagram of a database cluster deployment device provided by the present invention, wherein the database cluster deployment device comprises:
[0178] A memory 71, used for storing computer programs;
[0179] The processor 72 is used to implement the steps of the database cluster deployment method in the above-mentioned embodiment when executing the computer program.
[0180] For an introduction to the database cluster deployment device provided in the embodiment of the present invention, please refer to the aforementioned embodiment of the database cluster deployment method, and the embodiment of the present invention will not be described in detail here.
[0181] Please refer to Figure 8 , Figure 8 This is a schematic diagram of the structure of a computer-readable storage medium provided by the present invention. A computer program 82 is stored on the computer-readable storage medium 81. When the computer program 82 is executed by a processor, the steps of the database cluster deployment method in the aforementioned embodiment are implemented.
[0182] For an introduction to the computer-readable storage medium provided in the embodiment of the present invention, please refer to the aforementioned embodiment of the method for deploying a database cluster, and the embodiment of the present invention will not be described in detail here.
[0183] The present invention also provides a computer program product, including a computer program / instruction, which implements the steps of the database cluster deployment method in the above-mentioned embodiment when executed by a processor.
[0184] For an introduction to the computer program product provided by the embodiment of the present invention, please refer to the aforementioned embodiment of the method for deploying a database cluster, and the embodiment of the present invention will not be described in detail here.
[0185] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments, and the same and similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part description. It should also be noted that in this specification, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply that there is any such actual relationship or order between these entities or operations. Moreover, the term "include", "comprise" or any other variant thereof is intended to cover non-exclusive inclusion, so that the process, method, article or equipment including a series of elements includes not only those elements, but also includes other elements that are not explicitly listed, or also includes elements inherent to such process, method, article or equipment. In the absence of more restrictions, the elements defined by the sentence "including one..." do not exclude the existence of other identical elements in the process, method, article or equipment including the element.
[0186] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for deploying a database cluster. It is characterized in that Applied to the server, including: Identify each client that is connected to the server and belongs to the database cluster to be deployed; Determining whether each of the clients meets the preset installation conditions of the database software; If each of the clients meets the preset installation conditions, determining a specified version of the database software of the database cluster to be deployed; Determine a deployment script according to the server information of the specified category and the specified version of each of the clients; Sending the deployment script to each of the clients respectively, so that when each of the clients executes the deployment script, based on the dependency packages in the dependency package library and the source code installation program in the installation program library, the deployment process of the database cluster of the specified version of the database software is performed; The server includes the preset dependency package library and the installation program library, wherein the dependency package library includes various dependency packages that may be required by the database software, and the installation program library includes source code installation programs of various versions of the database software.
2. The method for deploying a database cluster according to claim 1, It is characterized in that Determining the deployment script according to the server information of the specified category and the specified version of each client includes: Constructing a deployment script common to each of the clients according to the server information of the specified category and the specified version of each of the clients; The deployment script is used to deploy the database cluster of the specified version of the database software for any of the clients when executed by the clients; The deployment of the database cluster of the specified version of the database software includes: The preparation work before deploying the database cluster, installation of database software, initialization of the database cluster and startup of the database.
3. The method for deploying a database cluster according to claim 2, It is characterized in that The clients that are connected to the server and belong to the database cluster to be deployed include: Determine each client connected to itself through communication handshake; For any of the clients that are connected to the client for communication, determine whether the client meets the preset legitimacy verification index; If satisfied, the client is determined to be a server of the database cluster to be deployed; If not, it is determined that the client is not a server of the database cluster to be deployed; The legitimacy verification index includes that the network address is in a specified network segment and / or the operating system is a specified operating system.
4. The method for deploying a database cluster according to any one of claims 1 to 3, It is characterized in that Determining whether each of the clients meets the preset installation conditions of the database software includes: Obtaining server information of a specified category for each of the clients; For any of the clients, judging whether the client meets the preset installation conditions of the database software according to the server information of the client; The preset installation conditions include: the remaining memory space is not less than a first preset threshold, the remaining storage space is not less than a second preset threshold, and the server architecture is at least one of the preset architectures.
5. A method for deploying a database cluster. It is characterized in that Applied to the client, including: Receive a deployment script sent by the server, wherein the deployment script is determined by the server according to server information of a specified category of each client and a specified version of database software of the database cluster to be deployed, and the client refers to a server of the database cluster to be deployed that is in communication connection with the server and meets preset installation conditions of the database software; Through the deployment script, based on the dependency packages in the dependency package library and the source code installation program in the installation program library, the deployment process of the database cluster of the specified version of the database software is executed in itself; The dependency package library and the installation program library are preset on the server side, the dependency package library includes various dependency packages that may be required by the database software, and the installation program library includes source code installation programs of various versions of the database software.
6. The method for deploying a database cluster according to claim 5, It is characterized in that By means of the deployment script, based on the dependency packages in the dependency package library and the source code installation program in the installation program library, the deployment process of the database cluster of the specified version of the database software is executed by itself, including: Trigger the execution of the deployment script to perform preparations before deploying the database cluster; After the preparation work is completed, the database software of the specified version is installed; After the database software is installed, initializing the database cluster; After initialization is complete, start the database; The database software to be installed includes: Determine the target dependency packages required to install the specified version of the database software; Determine a list of dependent packages in a dependent package library of the server; If each of the target dependent packages is in the dependent package list, obtain each of the target dependent packages from the dependent package library; Install each of the target dependency packages using a preset dependency package installation tool; Obtaining a source code installation program of a specified version of database software from an installation program library on the server, wherein the installation program library pre-stores source code installation programs of multiple versions of database software; Compile the obtained source code installation program and install the specified version of the database software.
7. The method for deploying a database cluster according to claim 6, It is characterized in that Initializing the database cluster includes: Initialize the database instance in itself; Configure the parameter files required when running the database software; Starting the initialized database instance; In response to the configuration instructions received through the human-machine interface, the database cluster is configured.
8. A deployment device for a database cluster, It is characterized in that include: A first determination module is used to determine each client that is in communication connection with itself and belongs to a server of a database cluster to be deployed; A first determination module is used to determine whether each of the clients meets the preset installation conditions of the database software, and if each of the clients meets the preset installation conditions, triggering a second determination module; A second determination module is used to determine a specified version of database software of a database cluster to be deployed; A third determination module is used to determine a deployment script according to the server information of the specified category and the specified version of each client; A first sending module is used to send the deployment script to each of the clients respectively, so that when each of the clients executes the deployment script, based on the dependency packages in the dependency package library and the source code installation program in the installation program library, the deployment process of the database cluster of the specified version of the database software is performed; The server includes the preset dependency package library and the installation program library, wherein the dependency package library includes various dependency packages that may be required by the database software, and the installation program library includes source code installation programs of various versions of the database software.
9. A deployment device for a database cluster, It is characterized in that include: Memory for storing computer programs; A processor, configured to implement the steps of the database cluster deployment method according to any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method for deploying a database cluster as claimed in any one of claims 1 to 7 are implemented.
Citation Information
Cited By
Method and device for automatically installing dependency of accelerator card in off-line environment and storage medium
CN120162054A
