CN113157823A - Cluster system deployment method and device - Google Patents
Cluster system deployment method and device Download PDFInfo
- Publication number
- CN113157823A CN113157823A CN202110484695.5A CN202110484695A CN113157823A CN 113157823 A CN113157823 A CN 113157823A CN 202110484695 A CN202110484695 A CN 202110484695A CN 113157823 A CN113157823 A CN 113157823A
- Authority
- CN
- China
- Prior art keywords
- server
- cluster system
- deployed
- mha
- mysql
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/28—Databases characterised by their database models, e.g. relational or object models
- G06F16/284—Relational databases
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/25—Integrating or interfacing systems involving database management systems
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/27—Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
Landscapes
- Engineering & Computer Science (AREA)
- Databases & Information Systems (AREA)
- Theoretical Computer Science (AREA)
- Data Mining & Analysis (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Computing Systems (AREA)
- Stored Programmes (AREA)
Abstract
The invention discloses a method and a device for deploying a cluster system, which relate to the field of automatic program design, and the method comprises the following steps: importing a software program package of a cluster system to be deployed; acquiring parameter information of each server of a cluster system to be deployed; and logging in each server according to the parameter information of each server, installing a software program package of the cluster system to be deployed, and completing the deployment of the cluster system to be deployed. The invention can realize the rapid deployment of the cluster system, reduce the difficulty of the cluster deployment work and improve the efficiency of the cluster deployment work.
Description
Technical Field
The present invention relates to the field of automatic program design, and in particular, to a method and an apparatus for deploying a cluster system.
Background
This section is intended to provide a background or context to the embodiments of the invention that are recited in the claims. The description herein is not admitted to be prior art by inclusion in this section.
MySQL is a relational database management system that keeps data in different tables instead of putting all the data in one large repository, which increases speed and flexibility. In an actual production environment, the MySQL server cluster with a certain load balancing function is deployed and realized, and the method has an obvious effect of improving the performance, speed and stability of a user database application system.
Currently, when MySQL server clusters are deployed in various places (provinces, cities, branches, and the like), DBAs, operation and maintenance, and technicians in various places implement deployment on site for various layer reasons. Due to the fact that deployment modes, methods and configurations of various regions are different, the internet cannot be connected under the influence of local network environments, in addition, technical levels of operators are different, so that deployment construction periods are greatly different, the MySQL server cluster can be caused by the factors, and serious accidents can be caused to the online database if a lot of omissions or errors occur during deployment.
Disclosure of Invention
The embodiment of the invention provides a cluster system deployment method, which is used for solving the technical problems that the existing MySQL high-availability cluster deployment operation is complicated and is easy to make mistakes, so that serious accidents possibly occur to an online database, and comprises the following steps: importing a software program package of a cluster system to be deployed; acquiring parameter information of each server of a cluster system to be deployed; and logging in each server according to the parameter information of each server, installing a software program package of the cluster system to be deployed, and completing the deployment of the cluster system to be deployed.
Further, the cluster system to be deployed is a MySQL high-availability architecture cluster system.
Further, the software package at least comprises: MySQL configuration files, MySQL installation packages, MHA configuration files, MHA dependency packages and MHA installation packages.
Further, the software package further comprises: and the one-key installation script is used for installing the MySQL installation package according to a MySQL configuration file, and installing the MHA dependent package and the MHA installation package according to the MHA configuration file.
Further, the one-key installation script is also used for parameter information of each server, determining a MySQL server and an MHA server of the cluster system to be deployed, and setting configuration parameters of the MySQL server and the MHA server.
Further, the parameter information of each server at least comprises: the CPU utilization rate and the memory utilization rate of each server; the configuration parameters of the MySQL server and the MHA server set by the one-key installation script at least comprise: reading data thread number, writing data thread number, refreshing data thread number and caching upper limit value.
Further, the software package further comprises: and the switching script is used for switching the service provided by the downtime server to other normal servers under the condition that the downtime server exists in the cluster.
Furthermore, the user logs in to each server in an SSH password-free login mode.
Further, the deployment of the cluster system to be deployed is completed in a copying mode.
Further, the deployment of the cluster system to be deployed is completed in a copying mode: deploying the MHA management node on a single server; and the system is deployed on MHA data nodes and MySQL master and slave databases on other servers.
Further, after logging in each server according to the parameter information of each server, installing a software package of the cluster system to be deployed, and completing the deployment of the cluster system to be deployed, the method further includes: receiving a database access request from a client; and connecting the databases of the deployed cluster systems through the VIP address according to the database access request.
The embodiment of the invention also provides a cluster system deployment device, which is used for solving the technical problems that the existing MySQL high-availability cluster deployment operation is complicated and easy to make mistakes, so that serious accidents possibly happen to an online database, and comprises the following components: the cluster software package importing module is used for importing a software package of a cluster system to be deployed; the server parameter information acquisition module is used for acquiring parameter information of each server of the cluster system to be deployed; and the cluster deployment module is used for logging in each server according to the parameter information of each server, installing a software program package of the cluster system to be deployed and finishing the deployment of the cluster system to be deployed.
Further, the cluster system to be deployed is a MySQL high-availability architecture cluster system.
Further, the software package at least comprises: MySQL configuration files, MySQL installation packages, MHA configuration files, MHA dependency packages and MHA installation packages.
Further, the software package further comprises: and the one-key installation script is used for installing the MySQL installation package according to a MySQL configuration file, and installing the MHA dependent package and the MHA installation package according to the MHA configuration file.
Further, the one-key installation script is also used for parameter information of each server, determining a MySQL server and an MHA server of the cluster system to be deployed, and setting configuration parameters of the MySQL server and the MHA server.
Further, the parameter information of each server at least comprises: the CPU utilization rate and the memory utilization rate of each server; the configuration parameters of the MySQL server and the MHA server set by the one-key installation script at least comprise: reading data thread number, writing data thread number, refreshing data thread number and caching upper limit value.
Further, the software package further comprises: and the switching script is used for switching the service provided by the downtime server to other normal servers under the condition that the downtime server exists in the cluster.
Further, the cluster deployment module is further configured to log in to each server in an SSH password-free login manner.
Further, the cluster deployment module is further configured to complete deployment of the cluster system to be deployed in a replication manner.
Further, the cluster deployment module is further configured to: deploying the MHA management node on a single server; and the system is deployed on MHA data nodes and MySQL master and slave databases on other servers.
Further, the apparatus further comprises: the request receiving module is used for receiving a database access request from a client; and the database access module is used for connecting the database of the deployed cluster system through the VIP address according to the database access request.
The embodiment of the invention also provides electronic equipment, which is used for solving the technical problems that the existing MySQL high-availability cluster deployment operation is complicated and is easy to make mistakes, so that serious accidents can happen to an online database.
The embodiment of the invention also provides a computer readable storage medium, which is used for solving the technical problem that serious accidents may occur to an online database due to complex operation and easy error of the conventional MySQL high-availability cluster deployment.
According to the cluster system deployment method, the cluster system deployment device, the electronic device and the computer readable storage medium, the software program package of the cluster system to be deployed is led into the central control server, the central control server logs in each server according to the parameter information of each server, the software program package of the cluster system to be deployed is installed, deployment of the cluster system to be deployed is completed, rapid deployment of the cluster system can be achieved without connection to the Internet, difficulty of cluster deployment work is reduced, and efficiency of the cluster deployment work is improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts. In the drawings:
fig. 1 is a flowchart of a cluster system deployment method provided in an embodiment of the present invention;
fig. 2 is a flowchart of an optional cluster system deployment method provided in the embodiment of the present invention;
FIG. 3 is a schematic diagram of a MySQL high-availability architecture provided in an embodiment of the present invention;
FIG. 4 is a flowchart of an application of MySQL high availability architecture provided in the embodiment of the present invention;
FIG. 5 is a flow chart of the MySQL high-availability architecture deployment provided in the embodiment of the present invention;
fig. 6 is a schematic diagram of a cluster system deployment apparatus provided in an embodiment of the present invention;
fig. 7 is a schematic diagram of an electronic device provided in an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention more apparent, the embodiments of the present invention are further described in detail below with reference to the accompanying drawings. The exemplary embodiments and descriptions of the present invention are provided to explain the present invention, but not to limit the present invention.
The embodiment of the invention provides a cluster system deployment method, which is used for solving the technical problem that serious accidents may occur to an online database due to the fact that the existing MySQL high-availability cluster deployment operation is complicated and errors are easy to occur.
Fig. 1 is a flowchart of a method for deploying a cluster system in an embodiment of the present invention, as shown in fig. 1, the method includes the following steps:
s101, importing a software program package of the cluster system to be deployed.
It should be noted that, in the cluster system, a plurality of servers are collected to provide a certain service, and the client appears as if there is only one server. The cluster system to be deployed in the embodiment of the present invention may be, but is not limited to, a MySQL high-availability architecture cluster system. The software package imported in S101 includes all software installation packages and dependency packages required for deploying the cluster system to be deployed.
Optionally, when the cluster system to be deployed is a MySQL high-availability architecture cluster system, the software package at least includes: MySQL configuration files, MySQL installation packages, MHA configuration files, MHA dependency packages and MHA installation packages.
Further, in order to simplify the deployment operation of the cluster system and implement one-key installation deployment, in an embodiment, the software package may further include a one-key installation script, where the one-key installation script is used to install the MySQL installation package according to the MySQL configuration file, and install the MHA dependency package and the MHA installation package according to the MHA configuration file.
S102, acquiring parameter information of each server of the cluster system to be deployed.
In one embodiment, in order to implement optimal deployment of the cluster system, the one-key installation script is further used for parameter information of each server, determining a MySQL server and an MHA server of the cluster system to be deployed, and setting configuration parameters of the MySQL server and the MHA server.
Since the CPU utilization and the memory utilization of the servers may affect the performance of the cluster system, in one implementation, the parameter information of each server acquired in the above step S102 at least includes: the CPU utilization rate and the memory utilization rate of each server; the configuration parameters of the MySQL server and the MHA server set by the one-key installation script at least comprise: reading data thread number, writing data thread number, refreshing data thread number and caching upper limit value.
S103, logging in each server according to the parameter information of each server, installing a software program package of the cluster system to be deployed, and completing the deployment of the cluster system to be deployed.
It should be noted that the foregoing S101 to S103 may be applied to one central control server, that is, the software package of the cluster system to be deployed is imported into one central control server, and the central control server logs in to another server to perform deployment of the cluster system.
In one embodiment, the central control server can log in to each server in an SSH password-free login mode. When the central control server deploys the cluster system, the deployment of the cluster system to be deployed can be rapidly completed in a copying mode.
As can be seen from the above, in the cluster system deployment method provided in the embodiment of the present invention, the software package of the cluster system to be deployed is imported into the central control server, and the central control server logs in each server according to the parameter information of each server, installs the software package of the cluster system to be deployed, completes the deployment of the cluster system to be deployed, and is not required to be connected to the internet, thereby achieving the rapid deployment of the cluster system, reducing the difficulty of the cluster deployment, and improving the efficiency of the cluster deployment.
Since a certain server may be down in the cluster system frequently, in an embodiment, the software package imported in S01 may further include: and the switching script is used for switching the service provided by the downtime server to other normal servers under the condition that the downtime server exists in the cluster.
When the cluster system deployment method provided in the embodiment of the present invention is applied to a MySQL high-availability architecture cluster system, the deployment of the cluster system to be deployed may be completed through the following steps: deploying the MHA management node on a single server; and the system is deployed on MHA data nodes and MySQL master and slave databases on other servers.
It should be noted that mha (master High availability) is a relatively mature solution in terms of MySQL High availability at present, and is an excellent set of High-availability software for failover and master-slave promotion in the MySQL High-availability environment. In the MySQL fault switching process, the MHA can automatically complete the fault switching operation of the database within 0-30 seconds, and in the fault switching process, the MHA can ensure the consistency of data to the maximum extent so as to achieve high availability in the true sense.
The software consists of two parts: MHA Manager and MHA Node. Node runs on each MySQL server, that is, whether MySQL master server or MySQL slave server, Node is installed, and Manager usually runs on a separate server, but if hardware resources are tight, one MySQL slave server can also play the role of Manager. The MHA Manager will periodically detect the Master node in the cluster, when the Master fails, it can automatically promote the latest data Slave to the new Master, and then redirect all other Slave to the new Master. The entire failover process is completely transparent to the application.
In an embodiment, as shown in fig. 2, after logging in each server according to parameter information of each server, installing a software package of a cluster system to be deployed, and completing deployment of the cluster system to be deployed, the cluster system deployment method provided in the embodiment of the present invention may further include the following steps:
s104, receiving a database access request from a client;
and S105, connecting the databases of the deployed cluster systems through the VIP addresses according to the database access request.
Fig. 3 is a schematic diagram of a MySQL high-availability architecture provided in an embodiment of the present invention, as shown in fig. 3, including: MHA management node, a master-slave replication group 1, a master-slave replication group 2 and a master-slave replication group 3.
The MHA management node is usually deployed on an independent machine or directly on one of the MySQL Slave. Managing a plurality of Master/Slave clusters or a cluster, wherein each Master/Slave cluster is called application; the main roles of MHA manager are: master automatic switching and failover command operation. 2. Other maintenance scripts run, such as manual switch Master, Master/Slave status checks. Is the brain and command of the MHA high-availability cluster.
Master and Slave in the Master-Slave copy group 1, the Master-Slave copy group 2 and the Master-Slave copy group 3 refer to Master and Slave libraries of MySQL, and a MySQL binlog copy mode is adopted. Meanwhile, node applications of the MHA are also deployed on the master libraries and the slave libraries. The MHA data nodes are operated on each MySQL server, and accelerate the fault transfer by monitoring scripts with the functions of analyzing and cleaning logs. The main functions are as follows: a. binding log data of the solid execution host node; b. comparing the relay log files of the slave nodes; c. the relay log is deleted regularly without stopping the SQL thread of the slave node. The MHA data nodes are carriers and executors of the MHA high-availability cluster.
The working principle of MHA is as follows:
saving binary log events (binlog events) from a Master that crashes the downtime;
identifying the Slave containing the latest update;
thirdly, applying the relay log (relay log) of the difference to other Slave;
(iv) applying binary log events (binlog events) saved from Master;
fifthly, one Slave is promoted to be a new Master;
and sixthly, connecting other Slave to a new Master for copying.
Fig. 4 is a flowchart of an application of MySQL high availability architecture provided in the embodiment of the present invention, and as shown in fig. 4, the application server may be a Web application server or an APP application server. When a user makes requests from a Web application or APP application, the application server will accept these requests for the first time.
And when the application server receives the request, processing the information, and if the request of the back-end MySQL needs to be accessed, connecting the database through the VIP. The VIP layer has the effect that when the rear-end MySQL main library is down switched, the externally exposed IP address is not changed, and the application program does not need to switch the MySQL main library and change the IP address.
The MySQL master-slave replication group shown in fig. 4 is a cluster built up by MySQL master-slave replication. By default, the VIP is bound to the Master node, and the Master is requested to be connected by default. Meanwhile, MHA node applications are deployed in both master and slave libraries in the cluster.
The MHA manager shown in fig. 4 is a node outside the MySQL master slave replication group, and is deployed independently. The deployment has the advantages that the deployment is not influenced by the availability of the copy group, and one manager node can be used for controlling a plurality of MySQL master-slave copy groups. When the disadvantage is that there is only one set of MySQL master-slave copies, this deployment wastes one machine. At this time, it is better to deploy one of the Slave together.
As shown in fig. 5, a MySQL high-availability architecture deployment flow provided in the embodiment of the present invention is shown, and as can be seen from fig. 5, the cluster system deployment method provided in the embodiment of the present invention can implement one-key deployment of a cluster.
The central server shown in fig. 5 can log on to all other servers in an SSH password-free login manner. And the central control server stores all installation packages and dependency packages which are needed to be used by the MySQL high-availability cluster deployment. The method comprises the following steps: the system comprises a one-key installation script, a MySQL configuration file, a MySQL installation package, an MHA configuration file, an MHA dependency package, an MHA installation package, a switching script and the like.
The MySQL installation package is an installation package which is re-tar packaged after directory structure adjustment, redundant module filtration and adjustment by combining the content of the configuration file according to a binary installation package provided by a MySQL official network. The method is mainly used for installing MySQL; MHA dependent packets mainly include createrepo rpm (rpm packet for making local image), perl rpm (installation packet of perl language environment required by MHA), telnet rpm (for testing port connectivity). The MHA installation package mainly comprises two installation packages of MHA4MySQL-manager-0.58-0.el7. centros. nanoch. rpm and MHA4MySQL-node-0.58-0.el7. centros. nanoch. rpm, and is mainly used for installing MHA.
The one-key installation script can determine the MySQL server and the MHA server which need to be deployed according to the transmitted parameters; determining a master-slave relationship according to the incoming parameters; setting the optimal configuration of the MySQL configuration parameters according to the parameters; the MHA parameter configuration is adjusted according to the incoming parameters.
The required incoming parameters are:
-c 1: the number of cores that allow MySQL to use cpu at most is specified.
-m 4: specifying the size that allows MySQL to use the content at most. The unit G.
-p/data/: the path of the MySQL installation is specified.
-Mip: the master library ip is specified.
-Sip 1; ip 2: the slave library ip is specified.
-Uroot: mha manage accounts for MySQL instances.
-Ppasswd: mha password to MySQL instance.
-t mha: the parameters can be selected from mha, ms and alone. The start mha selects that a-v parameter must be added. ms is the master-slave relationship. And the Alone is a single machine.
-vip: the designation vip, mha will be used. T parameter selection mha before the parameter becomes valid.
The MySQL configuration parameters and MHA configuration parameters mentioned above have most of the parameters set to the optimal configuration, which is placed in the installation package. The optimal configuration of a small part of parameters is related to the resource configuration of the server, so that in the parameters transmitted by the one-key installation script, the cpu and the memory index are particularly important, and the optimal configuration can be carried out according to the index by the nested optimization scheme in the script. The method comprises the read-write thread number (related to the cpu number) of MySQL, the thread number (related to the cpu) of MySQL refreshing log and the preset cache upper limit (related to the memory) of MySQL.
For example, when a cluster deployment worker deploys a set of MySQL clusters, after determining the base version, the cluster deployment worker needs to confirm and grasp the information such as: MySQL configuration parameters, high available architecture solutions, how to deploy MySQL high available architecture, etc. The deployment is strictly limited in time, for example, the deployment needs to be completed in half a day, at the moment, the knowledge system of cluster deployment workers is limited, the skills are not completely mastered, and the online teaching documents are difficult to digest in half a day. The company or the first party is urging to be urgent.
By the cluster system deployment method provided by the embodiment of the invention, cluster deployment workers can determine all problems of cluster deployment within a few minutes by simply transmitting parameters, inputting parameter information of the server and clicking to enter, so that tasks can be quickly completed, and the deployment can be completed in an optimal mode.
Based on the same invention concept, the embodiment of the invention also provides a cluster system deployment device, which is used for solving the technical problem that the existing MySQL high-availability cluster deployment operation is complicated and is easy to make mistakes, so that serious accidents may occur to the online database. As described in the examples below. Because the principle of solving the problems of the device is similar to the cluster system deployment method, the implementation of the device can be referred to the implementation of the cluster system deployment method, and repeated details are not repeated.
Fig. 6 is a schematic diagram of a cluster system deployment apparatus provided in an embodiment of the present invention, and as shown in fig. 6, the apparatus includes: the system comprises a cluster software package importing module 61, a server parameter information obtaining module 62 and a cluster deploying module 63.
The cluster software package importing module 61 is configured to import a software package of a cluster system to be deployed; a server parameter information obtaining module 62, configured to obtain parameter information of each server of the cluster system to be deployed; and the cluster deployment module 63 is configured to log in to each server according to the parameter information of each server, install a software package of the cluster system to be deployed, and complete deployment of the cluster system to be deployed.
It should be noted here that the cluster software package importing module 61, the server parameter information obtaining module 62, and the cluster deploying module 63 correspond to S101 to S103 in the method embodiment, and the modules are the same as the examples and application scenarios realized by the corresponding steps, but are not limited to the disclosure in the method embodiment. It should be noted that the modules described above as part of an apparatus may be implemented in a computer system such as a set of computer-executable instructions.
As can be seen from the above, in the cluster system deployment device provided in the embodiment of the present invention, the software package of the cluster system to be deployed is imported into the central control server, and the central control server logs in to each server according to the parameter information of each server, installs the software package of the cluster system to be deployed, completes the deployment of the cluster system to be deployed, and is not required to be connected to the internet, thereby achieving the rapid deployment of the cluster system, reducing the difficulty of the cluster deployment, and improving the efficiency of the cluster deployment.
In an embodiment, in the cluster system deployment apparatus provided in the embodiment of the present invention, the software package imported by the cluster software package importing module 61 is a software package of a MySQL high-availability architecture cluster system.
In an embodiment, in the cluster system deployment apparatus provided in the embodiment of the present invention, the software package at least includes: MySQL configuration files, MySQL installation packages, MHA configuration files, MHA dependency packages and MHA installation packages.
In an embodiment, in the cluster system deployment apparatus provided in the embodiment of the present invention, the software package further includes: and the one-key installation script is used for installing the MySQL installation package according to the MySQL configuration file, and installing the MHA dependency package and the MHA installation package according to the MHA configuration file.
In an embodiment, in the cluster system deployment apparatus provided in the embodiment of the present invention, the one-key installation script is further used for parameter information of each server, determining a MySQL server and an MHA server of the cluster system to be deployed, and setting configuration parameters of the MySQL server and the MHA server.
In an embodiment, in the cluster system deployment apparatus provided in the embodiment of the present invention, the parameter information of each server at least includes: the CPU utilization rate and the memory utilization rate of each server; the configuration parameters of the MySQL server and the MHA server set by the one-key installation script at least comprise: reading data thread number, writing data thread number, refreshing data thread number and caching upper limit value.
In an embodiment, in the cluster system deployment apparatus provided in the embodiment of the present invention, the software package further includes: and the switching script is used for switching the service provided by the downtime server to other normal servers under the condition that the downtime server exists in the cluster.
In an embodiment, in the cluster system deployment apparatus provided in the embodiment of the present invention, the cluster deployment module 63 is further configured to log in to each server in an SSH password-free login manner.
In an embodiment, in the cluster system deployment apparatus provided in the embodiment of the present invention, the cluster deployment module 63 is further configured to complete deployment of the cluster system to be deployed in a replication manner.
In an embodiment, in the cluster system deployment apparatus provided in the embodiment of the present invention, the cluster deployment module 63 is further configured to: deploying the MHA management node on a single server; and the system is deployed on MHA data nodes and MySQL master and slave databases on other servers.
In an embodiment, the cluster system deployment apparatus provided in the embodiment of the present invention may further include: a request receiving module 64 and a database access module 65.
The request receiving module 64 is configured to receive a database access request from a client; and the database access module 65 is used for connecting the databases of the deployed cluster system through the VIP address according to the database access request.
It should be noted here that the request receiving module 64 and the database accessing module 65 correspond to S104 to S105 in the method embodiment, and the modules are the same as the examples and application scenarios implemented by the corresponding steps, but are not limited to the disclosure of the method embodiment. It should be noted that the modules described above as part of an apparatus may be implemented in a computer system such as a set of computer-executable instructions.
Based on the same inventive concept, the embodiment of the present invention further provides an embodiment of an electronic device for implementing all or part of the contents in the above cluster system deployment method, so as to solve the technical problem that the existing MySQL high-availability cluster deployment operation is tedious and is prone to error, thereby causing a serious accident to possibly occur to the online database. The electronic device specifically comprises the following contents:
a processor (processor), a memory (memory), a communication Interface (Communications Interface), and a bus; the processor, the memory and the communication interface complete mutual communication through the bus; the communication interface is used for realizing information transmission between related devices; the electronic device may be a desktop computer, a tablet computer, a mobile terminal, and the like, but the embodiment is not limited thereto. In this embodiment, the electronic device may be implemented with reference to the embodiment of the embodiment for implementing the cluster system deployment method and the embodiment for implementing the cluster system deployment apparatus, and the contents of the embodiments are incorporated herein, and repeated details are not described herein.
Fig. 7 is a schematic diagram of a system configuration structure of an electronic device according to an embodiment of the present invention. As shown in fig. 7, the electronic device 70 may include a processor 701 and a memory 702; a memory 702 is coupled to the processor 701. Notably, this fig. 7 is exemplary; other types of structures may also be used in addition to or in place of the structure to implement telecommunications or other functions.
In one embodiment, the functions implemented by the cluster system deployment method may be integrated into the processor 701. Wherein, the processor 701 may be configured to control as follows: importing a software program package of a cluster system to be deployed; acquiring parameter information of each server of a cluster system to be deployed; and logging in each server according to the parameter information of each server, installing a software program package of the cluster system to be deployed, and completing the deployment of the cluster system to be deployed.
As can be seen from the above, in the electronic device provided in the embodiment of the present invention, the software package of the cluster system to be deployed is imported into the central control server, and the central control server logs in to each server according to the parameter information of each server, installs the software package of the cluster system to be deployed, completes the deployment of the cluster system to be deployed, and is not required to be connected to the internet, so that the rapid deployment of the cluster system can be realized, the difficulty of the cluster deployment work is reduced, and the efficiency of the cluster deployment work is improved.
In another embodiment, the cluster system deployment apparatus may be configured separately from the processor 701, for example, the cluster system deployment apparatus may be configured as a chip connected to the processor 701, and the functions of the cluster system deployment method may be implemented by the control of the processor.
As shown in fig. 7, the electronic device 70 may further include: a communication module 703, an input unit 704, an audio processing unit 705, a display 706, and a power supply 707. It is noted that the electronic device 70 does not necessarily include all of the components shown in fig. 7; furthermore, the electronic device 70 may also comprise components not shown in fig. 7, which can be referred to in the prior art.
As shown in fig. 7, the processor 701, which is sometimes referred to as a controller or operational control, may include a microprocessor or other processor device and/or logic device, and the processor 701 receives input and controls the operation of the various components of the electronic device 70.
The memory 702 may be, for example, one or more of a buffer, a flash memory, a hard drive, a removable media, a volatile memory, a non-volatile memory, or other suitable device. The information relating to the failure may be stored, and a program for executing the information may be stored. And the processor 701 may execute the program stored in the memory 702 to realize information storage or processing, or the like.
The input unit 704 provides input to the processor 701. The input unit 704 is, for example, a key or a touch input device. The power supply 707 is used to supply power to the electronic device 70. The display 706 is used for displaying display objects such as images and characters. The display may be, for example, an LCD display, but is not limited thereto.
The memory 702 may be a solid state memory such as Read Only Memory (ROM), Random Access Memory (RAM), a SIM card, or the like. There may also be a memory that holds information even when power is off, can be selectively erased, and is provided with more data, an example of which is sometimes called an EPROM or the like. The memory 702 may also be some other type of device. Memory 702 includes a buffer memory 7021 (sometimes referred to as a buffer). The memory 702 may include an application/function storage portion 7022, the application/function storage portion 7022 being used to store application programs and function programs or procedures for performing operations of the electronic device 70 by the processor 701.
The memory 702 may also include a data store 7023, the data store 7023 being for storing data, such as contacts, digital data, pictures, sounds, and/or any other data used by the electronic device. The driver storage portion 7024 of the memory 702 may include various drivers of the electronic device for communication functions and/or for performing other functions of the electronic device (e.g., messaging application, address book application, etc.).
The communication module 703 is a transmitter/receiver that transmits and receives signals via the antenna 708. A communication module (transmitter/receiver) 703 is coupled to the processor 701 to provide an input signal and receive an output signal, which may be the same as in the case of a conventional mobile communication terminal.
Based on different communication technologies, a plurality of communication modules 703, such as a cellular network module, a bluetooth module, and/or a wireless local area network module, may be provided in the same electronic device. The communication module (transmitter/receiver) 703 is also coupled to a speaker 709 and a microphone 710 via an audio processing unit 705 to provide audio output via the speaker 709 and receive audio input from the microphone 710 to implement general telecommunication functions. The audio processing unit 705 may include any suitable buffers, decoders, amplifiers and so forth. Additionally, an audio processing unit 705 is also coupled to the processor 701 to enable recording of sound locally through a microphone 710 and to enable playing of locally stored sound through a speaker 709.
The embodiment of the invention also provides a computer-readable storage medium for realizing all the steps in the cluster system deployment method in the embodiment, which is used for solving the technical problems that the existing MySQL high-availability cluster deployment operation is complicated and easy to make mistakes, so that serious accidents may occur to an online database. The computer-readable storage medium has stored thereon a computer program which, when executed by a processor, implements all the steps of the cluster system deployment method in the above embodiments, for example, the processor, when executing the computer program, implements the following steps: importing a software program package of a cluster system to be deployed; acquiring parameter information of each server of a cluster system to be deployed; and logging in each server according to the parameter information of each server, installing a software program package of the cluster system to be deployed, and completing the deployment of the cluster system to be deployed.
As can be seen from the above, in the computer-readable storage medium provided in the embodiment of the present invention, the software package of the cluster system to be deployed is imported into the central control server, and the central control server logs in each server according to the parameter information of each server, installs the software package of the cluster system to be deployed, completes the deployment of the cluster system to be deployed, and is not required to be connected to the internet, so that the rapid deployment of the cluster system can be realized, the difficulty of the cluster deployment is reduced, and the efficiency of the cluster deployment is improved.
Although the present invention provides method steps as described in the examples or flowcharts, more or fewer steps may be included based on routine or non-inventive labor. The order of steps recited in the embodiments is merely one manner of performing the steps in a multitude of orders and does not represent the only order of execution. When an actual apparatus or client product executes, it may execute sequentially or in parallel (e.g., in the context of parallel processors or multi-threaded processing) according to the embodiments or methods shown in the figures.
As will be appreciated by one skilled in the art, embodiments of the present description may be provided as a method, apparatus (system) or computer program product. Accordingly, embodiments of the present description may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the system embodiment, since it is substantially similar to the method embodiment, the description is simple, and for the relevant points, reference may be made to the partial description of the method embodiment. In this document, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. The terms "upper", "lower", and the like, indicate orientations or positional relationships based on the orientations or positional relationships shown in the drawings, and are only for convenience in describing the present invention and simplifying the description, but do not indicate or imply that the referred devices or elements must have a specific orientation, be constructed and operated in a specific orientation, and thus, should not be construed as limiting the present invention. Unless expressly stated or limited otherwise, the terms "mounted," "connected," and "connected" are intended to be inclusive and mean, for example, that they may be fixedly connected, detachably connected, or integrally connected; can be mechanically or electrically connected; they may be connected directly or indirectly through intervening media, or they may be interconnected between two elements. The specific meanings of the above terms in the present invention can be understood by those skilled in the art according to specific situations. It should be noted that the embodiments and features of the embodiments may be combined with each other without conflict. The present invention is not limited to any single aspect, nor is it limited to any single embodiment, nor is it limited to any combination and/or permutation of these aspects and/or embodiments. Each aspect and/or embodiment of the invention can be used alone or in combination with one or more other aspects and/or embodiments.
The above embodiments are only used to illustrate the technical solution of the present invention, and not to limit the same; while the invention has been described in detail and with reference to the foregoing embodiments, it will be understood by those skilled in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; such modifications and substitutions do not depart from the spirit and scope of the present invention, and they should be construed as being included in the following claims and description.
Claims (24)
1. A method for deploying a cluster system, comprising:
importing a software program package of a cluster system to be deployed;
acquiring parameter information of each server of a cluster system to be deployed;
and logging in each server according to the parameter information of each server, installing a software program package of the cluster system to be deployed, and completing the deployment of the cluster system to be deployed.
2. The method of claim 1, wherein the cluster system to be deployed is a MySQL high availability architecture cluster system.
3. The method of claim 2, wherein the software package comprises at least: MySQL configuration files, MySQL installation packages, MHA configuration files, MHA dependency packages and MHA installation packages.
4. The method of claim 3, wherein the software package further comprises: and the one-key installation script is used for installing the MySQL installation package according to a MySQL configuration file, and installing the MHA dependent package and the MHA installation package according to the MHA configuration file.
5. The method of claim 4, wherein the one-touch installation script is further used for parameter information of each server, determining a MySQL server and an MHA server of the cluster system to be deployed, and setting configuration parameters of the MySQL server and the MHA server.
6. The method of claim 5, wherein the parameter information of each server at least comprises: the CPU utilization rate and the memory utilization rate of each server; the configuration parameters of the MySQL server and the MHA server set by the one-key installation script at least comprise: reading data thread number, writing data thread number, refreshing data thread number and caching upper limit value.
7. The method of claim 4, wherein the software package further comprises: and the switching script is used for switching the service provided by the downtime server to other normal servers under the condition that the downtime server exists in the cluster.
8. The method of claim 1, wherein logging into each server is by SSH password-free login.
9. The method of claim 1, wherein deployment of the cluster system to be deployed is accomplished in a replication manner.
10. The method of claim 9, wherein the deployment of the cluster system to be deployed is completed in a replication manner:
deploying the MHA management node on a single server;
and the system is deployed on MHA data nodes and MySQL master and slave databases on other servers.
11. The method of claim 1, wherein after logging in each server according to the parameter information of each server, installing a software package of the cluster system to be deployed, and completing deployment of the cluster system to be deployed, the method further comprises:
receiving a database access request from a client;
and connecting the databases of the deployed cluster systems through the VIP address according to the database access request.
12. A cluster system deployment apparatus, comprising:
the cluster software package importing module is used for importing a software package of a cluster system to be deployed;
the server parameter information acquisition module is used for acquiring parameter information of each server of the cluster system to be deployed;
and the cluster deployment module is used for logging in each server according to the parameter information of each server, installing a software program package of the cluster system to be deployed and finishing the deployment of the cluster system to be deployed.
13. The apparatus of claim 12, in which the cluster system to be deployed is a MySQL high availability architecture cluster system.
14. The apparatus of claim 13, wherein the software package comprises at least: MySQL configuration files, MySQL installation packages, MHA configuration files, MHA dependency packages and MHA installation packages.
15. The apparatus of claim 14, wherein the software package further comprises: and the one-key installation script is used for installing the MySQL installation package according to a MySQL configuration file, and installing the MHA dependent package and the MHA installation package according to the MHA configuration file.
16. The apparatus of claim 15, wherein the one-touch installation script is further used for parameter information of each server, determining a MySQL server and an MHA server of the cluster system to be deployed, and setting configuration parameters of the MySQL server and the MHA server.
17. The apparatus of claim 16, wherein the parameter information of each server comprises at least: the CPU utilization rate and the memory utilization rate of each server; the configuration parameters of the MySQL server and the MHA server set by the one-key installation script at least comprise: reading data thread number, writing data thread number, refreshing data thread number and caching upper limit value.
18. The apparatus of claim 15, wherein the software package further comprises: and the switching script is used for switching the service provided by the downtime server to other normal servers under the condition that the downtime server exists in the cluster.
19. The apparatus of claim 12, wherein the cluster deployment module is further configured to log into the servers by SSH password-free login.
20. The apparatus of claim 12, wherein the cluster deployment module is further configured to complete deployment of the cluster system to be deployed in a replication manner.
21. The apparatus of claim 20, wherein the cluster deployment module is further to:
deploying the MHA management node on a single server;
and the system is deployed on MHA data nodes and MySQL master and slave databases on other servers.
22. The apparatus of claim 12, wherein the apparatus further comprises:
the request receiving module is used for receiving a database access request from a client;
and the database access module is used for connecting the database of the deployed cluster system through the VIP address according to the database access request.
23. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the method of cluster system deployment as claimed in any one of claims 1 to 11 when executing the computer program.
24. A computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program for executing the cluster system deployment method of any one of claims 1 to 11.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110484695.5A CN113157823A (en) | 2021-04-30 | 2021-04-30 | Cluster system deployment method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110484695.5A CN113157823A (en) | 2021-04-30 | 2021-04-30 | Cluster system deployment method and device |
Publications (1)
Publication Number | Publication Date |
---|---|
CN113157823A true CN113157823A (en) | 2021-07-23 |
Family
ID=76873134
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110484695.5A Pending CN113157823A (en) | 2021-04-30 | 2021-04-30 | Cluster system deployment method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113157823A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114024841A (en) * | 2021-08-04 | 2022-02-08 | 统信软件技术有限公司 | Server cluster deployment method and device, computing equipment and storage medium |
-
2021
- 2021-04-30 CN CN202110484695.5A patent/CN113157823A/en active Pending
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114024841A (en) * | 2021-08-04 | 2022-02-08 | 统信软件技术有限公司 | Server cluster deployment method and device, computing equipment and storage medium |
CN114024841B (en) * | 2021-08-04 | 2023-09-19 | 统信软件技术有限公司 | Server cluster deployment method and device, computing equipment and storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US8386501B2 (en) | Dynamically splitting multi-tenant databases | |
US8296267B2 (en) | Upgrade of highly available farm server groups | |
EP2021937B1 (en) | Techniques to perform gradual upgrades | |
US8799453B2 (en) | Managing networks and machines for an online service | |
US7720800B2 (en) | Method and approach to hosting versioned web services | |
US20140007092A1 (en) | Automatic transfer of workload configuration | |
US8612553B2 (en) | Method and system for dynamically purposing a computing device | |
US8751656B2 (en) | Machine manager for deploying and managing machines | |
US20130226973A1 (en) | Online database availability during upgrade | |
US20120102480A1 (en) | High availability of machines during patching | |
KR20140038450A (en) | Automatic configuration of a recovery service | |
US20120102220A1 (en) | Routing traffic in an online service with high availability | |
US9268737B2 (en) | Managing virtual computing services | |
CN105450759A (en) | System mirror image management method and device | |
CN112783646A (en) | Stateful application containerization deployment method and device | |
CN111858050A (en) | Server cluster mixed deployment method, cluster management node and related system | |
CN113157823A (en) | Cluster system deployment method and device | |
CN116028463A (en) | Method for constructing large data platform with separated storage and calculation | |
CN113377385A (en) | Client automatic deployment method and device | |
WO2021254280A1 (en) | Disk mounting method and device, storage medium, and electronic device | |
CN115357558A (en) | Method and system for lossless migration of multiple data sources during service migration | |
CN111414232A (en) | Method and device for processing template data of virtual machine | |
CN115543963A (en) | Database service supply method and device | |
CN118413446A (en) | Hybrid cloud virtual machine management method, device, terminal and storage medium | |
CN115913940A (en) | Network upgrading method, electronic equipment and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |