CN110138577B - Cluster creation method, first server and readable storage medium - Google Patents

Cluster creation method, first server and readable storage medium Download PDF

Info

Publication number
CN110138577B
CN110138577B CN201810130371.XA CN201810130371A CN110138577B CN 110138577 B CN110138577 B CN 110138577B CN 201810130371 A CN201810130371 A CN 201810130371A CN 110138577 B CN110138577 B CN 110138577B
Authority
CN
China
Prior art keywords
cluster
members
parameter
created
server
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201810130371.XA
Other languages
Chinese (zh)
Other versions
CN110138577A (en
Inventor
李瑜洁
革心蕊
余伯平
张智
胡林红
罗朝亮
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201810130371.XA priority Critical patent/CN110138577B/en
Publication of CN110138577A publication Critical patent/CN110138577A/en
Application granted granted Critical
Publication of CN110138577B publication Critical patent/CN110138577B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/02Details
    • H04L12/16Arrangements for providing special services to substations
    • H04L12/18Arrangements for providing special services to substations for broadcast or conference, e.g. multicast
    • H04L12/185Arrangements for providing special services to substations for broadcast or conference, e.g. multicast with management of multicast group membership
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0803Configuration setting
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0889Techniques to speed-up the configuration process

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Stored Programmes (AREA)

Abstract

The invention discloses a cluster creating method, a first server and a readable storage medium.A user can input configuration parameters, such as a first parameter and a second parameter, of a cluster to be created in a first window interface, the cluster creating method can automatically create a corresponding cluster based on the configuration parameters, and because a cluster configuration script corresponding to a cluster type is preset and an application program for realizing corresponding functions of each cluster type is prestored, a target cluster configuration script corresponding to a target cluster type can be obtained in the process of creating the cluster, and the target cluster configuration script is at least used for indicating cluster members to install the application program for realizing the corresponding functions of the target cluster type; and controlling cluster members contained in the cluster to be created to execute the target cluster configuration script so as to obtain the cluster to be created. In the process of creating the cluster, personnel do not need to manually deploy cluster members, so that the time is greatly saved, and a user does not need to own physical machine resources.

Description

Cluster creation method, first server and readable storage medium
Technical Field
The present invention relates to the field of communications technologies, and in particular, to a cluster creation method, a first server, and a readable storage medium.
Background
A cluster is a set of mutually independent computing nodes interconnected by a high-speed network. The cluster type comprises a physical cluster and a virtual cluster, wherein each cluster member in the physical cluster is a physical machine, and each cluster member in the virtual cluster is a virtual machine.
At present, a cluster needs to have certain physical machine resources in the process of creating; in order to enable each cluster member in the cluster to cooperatively provide the cluster service, a technician is required to install a corresponding application program in each cluster member.
In summary, in the cluster creation process, technicians are required to manually deploy each cluster member, the time is long, and if resources such as a physical machine or a cluster member are not available, the cluster cannot be created.
Disclosure of Invention
In view of this, the present invention provides a cluster creating method, a first server, and a readable storage medium, so as to overcome the problems that in the prior art, a technician needs to manually deploy each cluster member during the cluster creating process, the time is long, and a cluster cannot be created without resources such as a physical machine or a cluster member.
In order to achieve the purpose, the invention provides the following technical scheme:
a cluster creation method applied to a first server comprises the following steps:
obtaining configuration parameters based on a first window interface displayed by a user terminal, wherein the configuration parameters comprise a first parameter and a second parameter, the first parameter is used for representing a target cluster type to which a cluster to be created belongs, and the second parameter is used for representing a first number of cluster members contained in the cluster to be created;
determining, from at least one physical machine, the first number of cluster members;
acquiring a target cluster configuration script corresponding to the target cluster type from a cluster configuration script corresponding to a pre-stored cluster type, wherein the target cluster configuration script is at least used for indicating cluster members to install an application program for realizing a corresponding function of the target cluster type;
and controlling the first number of cluster members to respectively execute the target cluster configuration script to obtain the cluster to be created.
A first server, comprising:
the system comprises a first obtaining module, a second obtaining module and a third obtaining module, wherein the first obtaining module is used for obtaining configuration parameters based on a first window interface displayed by a user terminal, the configuration parameters comprise a first parameter and a second parameter, the first parameter is used for representing a target cluster type to which a cluster to be created belongs, and the second parameter is used for representing a first number of cluster members contained in the cluster to be created;
a first determining module for determining the first number of cluster members from at least one physical machine;
a second obtaining module, configured to obtain a target cluster configuration script corresponding to the target cluster type from a cluster configuration script corresponding to a pre-stored cluster type, where the target cluster configuration script is at least used to instruct a cluster member to install an application program for implementing a function corresponding to the target cluster type;
and the control module is used for controlling the first number of cluster members to respectively execute the target cluster configuration script so as to obtain the cluster to be created.
A first server, comprising:
a memory for storing a program;
a processor configured to execute the program, the program specifically configured to:
obtaining configuration parameters based on a first window interface displayed by a user terminal, wherein the configuration parameters comprise a first parameter and a second parameter, the first parameter is used for representing a target cluster type to which a cluster to be created belongs, and the second parameter is used for representing a first number of cluster members contained in the cluster to be created;
determining, from at least one physical machine, the first number of cluster members;
acquiring a target cluster configuration script corresponding to the target cluster type from a cluster configuration script corresponding to a pre-stored cluster type, wherein the target cluster configuration script is at least used for indicating cluster members to install an application program for realizing a corresponding function of the target cluster type;
and controlling the first number of cluster members to respectively execute the target cluster configuration script to obtain the cluster to be created.
A readable storage medium having stored thereon a computer program which, when executed by a processor, carries out the steps of the cluster creation method as claimed in any one of the preceding claims.
Compared with the prior art, the cluster creating method disclosed by the invention has the advantages that the applicant of the cluster to be created needs to input configuration parameters of the cluster to be created, such as a first parameter (used for representing the type of the target cluster to which the cluster to be created belongs) and a second parameter (used for representing the first number of cluster members included in the cluster to be created) in the first window interface, and only needs to submit an application for creating the cluster, the cluster creating method provided by the embodiment of the invention automatically creates the corresponding cluster for the applicant, before creating the cluster, because the cluster configuration script corresponding to the cluster type is preset and the application program for realizing the corresponding function of each cluster type is stored in advance, the target cluster configuration script corresponding to the target cluster type can be obtained in the process of creating the cluster, the target cluster configuration script is at least used for indicating cluster members to install application programs for realizing corresponding functions of the target cluster type; and controlling cluster members contained in the cluster to be created to execute the target cluster configuration script so as to obtain the cluster to be created. According to the method provided by the embodiment, personnel do not need to manually deploy the cluster members, so that the time is greatly saved, and an applicant does not need to own physical machine resources.
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 embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
Fig. 1 is a schematic diagram of an implementation manner of a cluster creation system according to an embodiment of the present invention;
fig. 2 is a schematic diagram of another implementation manner of the cluster creation system according to the embodiment of the present invention;
fig. 3 is a signaling diagram of a cluster creation method according to an embodiment of the present invention;
FIG. 4a is a diagram illustrating a first window interface according to an embodiment of the present invention;
FIG. 4b is a diagram illustrating a third window interface according to an embodiment of the present invention;
fig. 5 is a signaling diagram of an implementation manner of step S304 according to an embodiment of the present invention;
fig. 6 is a flowchart of an implementation manner of step S503 according to an embodiment of the present invention;
FIG. 7 is a diagram illustrating a second window interface according to an embodiment of the present invention;
fig. 8 is a structural diagram of an implementation manner of a first server according to an embodiment of the present invention;
fig. 9 is another structural diagram of the first server according to the embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The cluster creation method provided by the embodiment of the application can be applied to a first server, and the first server can be one server, a server cluster formed by a plurality of servers, or a cloud computing service center. The first server belongs to a cluster creation system.
As shown in fig. 1, a schematic diagram of an implementation manner of a cluster creation system provided in an embodiment of the present invention is shown, where the cluster creation system includes:
a user terminal 11, a first server 12 and a plurality of physical machines 13.
The physical machine 13 may be an electronic device such as a desktop computer, a notebook computer, a server, and the like.
The user terminal 11 presents a first window interface, and the user may input configuration parameters (the configuration parameters include a first parameter and a second parameter, where the first parameter is used to characterize a target cluster type to which the cluster to be created belongs, and the second parameter is used to characterize a first number of cluster members included in the cluster to be created). The first server 12 determines a first number of cluster members included in a cluster to be created from the plurality of physical machines 13, and obtains a target cluster configuration script corresponding to the target cluster type from a cluster configuration script corresponding to a pre-stored cluster type based on a first parameter, where the target cluster configuration script is at least used to instruct the cluster members to install an application program for implementing a corresponding function of the target cluster type; the first server 12 controls the first number of cluster members to execute the target cluster configuration script, so as to obtain the cluster to be created.
The application programs may include: the system comprises an operating system and a first application program for realizing corresponding functions;
the operating system provides a basic operating environment for the cluster members, and the first application program may be an application program for implementing the cluster function to be created.
If the cluster to be created is a message queue cluster, the first application may be a rabbitmq application or a kafka application.
In an optional embodiment, the application program may further include: the cluster software monitors a first application program installed on a cluster member and cooperates with the first application program to provide required services, such as message queue services, for a user.
In an optional embodiment, after the cluster to be created is successfully created, in the running process, the cluster software installed on each cluster member is responsible for monitoring the running state of the first application program thereon, and the cluster members also perform periodic heartbeat detection, and if a failure occurs in one cluster member, another cluster member can take over the failure immediately and provide a service to the outside instead of the failure.
In an alternative embodiment, the first server 12 may be deployed on a cloud platform, such as a Tstack platform. In an alternative embodiment, the user terminal 11 may be installed with a second application program, which may expose the first window interface, and the second application program may be developed based on a cloud platform, such as a Tstack platform.
In the cluster creating system provided in the previous embodiment, the first server 12 may be configured with a metadata service interface, and the first server 12 may call the metadata service interface, and store one or more parameters in the configuration parameters and information corresponding to each of the first number of cluster members into a preset storage area of the first server 13.
The first server 12 controls the first number of cluster members to execute the target cluster configuration script, in the process of executing the target cluster configuration script, the first number of cluster members may call a metadata server interface to obtain the required parameters from the preset storage area of the first server 12, and the first number of cluster members execute the target cluster configuration script based on the required parameters obtained from the preset storage area of the first server 12, so as to obtain the to-be-created cluster.
As shown in fig. 2, a schematic diagram of another implementation manner of the cluster creation system provided in the embodiment of the present invention is shown, where the cluster creation system includes:
a user terminal 11, a first server 12, a second server 14 and a plurality of physical machines 13.
The user terminal 11 is installed with a second application program, a user may input configuration parameters (the configuration parameters include a first parameter and a second parameter, where the first parameter is used to characterize a target cluster type to which a cluster to be created belongs, and the second parameter is used to characterize a first number of cluster members included in the cluster to be created), the first server 12 determines, from the multiple physical machines 13, a first number of cluster members included in the cluster to be created, and obtains, from a cluster configuration script corresponding to a pre-stored cluster type, a target cluster configuration script corresponding to the target cluster type, where the target cluster configuration script is at least used to instruct the cluster members to install the application program for implementing a corresponding function of the target cluster type; the second server 14 may be provided with a metadata service interface, and the first server 12 may call the metadata service interface, and store one or more parameters of the configuration parameters and information corresponding to each of the first number of cluster members in the second server 14. The first server 12 controls the first number of cluster members to execute the target cluster configuration script, in the process of executing the target cluster configuration script, the first number of cluster members may call a metadata server interface to obtain the required parameters from the second server 14, and the first number of cluster members execute the target cluster configuration script based on the required parameters obtained from the preset storage area of the second server 14, so as to obtain the cluster to be created.
In the embodiment of the present invention, the second server 14 and the first server 12 may be the same server or different servers.
The cluster creating method provided in the embodiment of the present invention is described below with reference to the structure of the cluster creating system, and as shown in fig. 3, is a signaling diagram of the cluster creating method provided in the embodiment of the present invention, and the method includes:
step S301: the user terminal 11 displays a first window interface, receives configuration parameters input by a user through the first window interface, where the configuration parameters include a first parameter and a second parameter, the first parameter is used to characterize a target cluster type to which a cluster to be created belongs, and the second parameter is used to characterize a first number of cluster members included in the cluster to be created.
Fig. 4a is a schematic diagram of an implementation manner of a first window interface according to an embodiment of the present invention. The first window interface may include: a first parameter 41 and a second parameter 42.
In fig. 4a, "service type" is used to represent a first parameter 41, for example, "Rabbitmq" is input in a box corresponding to the service type in fig. 4a, and the cluster to be created is characterized as a Rabbitmq message queue cluster.
The second parameter 42 may comprise a number and/or a high availability as shown in fig. 4a, wherein if the "high availability" front □ is checked, it indicates that the cluster to be created is a high availability cluster, i.e. it indicates that each cluster member comprised by the cluster to be created has a cluster member that is a mirror image of itself, for example, if the cluster to be created comprises cluster member a, the cluster to be created also comprises a cluster member B that is a mirror image of cluster member a. In the embodiment of the invention, the cluster members which are mirror images of each other are called as a main cluster member, and the other cluster member is called as a backup cluster member.
In an alternative embodiment, the number may refer to the total number of primary cluster members other than the backup cluster member, or the number may refer to the total number of backup cluster members as well as the primary cluster member.
If the number is the total number of the main cluster members except the backup cluster member, and the number is 1, and □ in front of the "high availability" is checked, it indicates that the cluster to be created includes two cluster members, wherein one cluster member is the main cluster member, and the other cluster member is the backup cluster member; or, the cluster to be created may include three cluster members, where one cluster member is a primary cluster member and the other two are backup cluster members. If □ in the "high available" front is not checked, it indicates that the cluster to be created includes only one cluster member.
In an optional embodiment, the first window interface may further include: a third parameter 43 for characterizing the attribute information of the cluster members comprised by the cluster to be created.
As in FIG. 4a, the third parameter 43 is represented by "case type", 5 attribute information is shown in FIG. 4a, for example, Dev-VD0, Dev-VD1, Dev-VD2, Dev-VD3, Dev-VD4, an attribute information includes memory, and/or CPU core number, and/or capacity; the memories corresponding to different attribute information and/or the number of CPU cores and/or the capacity are different; for example, if Dev-VD0 is selected, the attribute information for the cluster members can be: memory: 5G, CPU: 2 core, capacity: 60G; if Dev-VD1 is selected, the attribute information for the cluster members may be: memory: 4G, CPU: 4 cores, capacity: 80G.
In an optional embodiment, the first window interface may further include: resource type 44, and/or service domain 45, and/or service module 46, and/or machine room location 47, and/or payment type 48, and/or age 49 of the cluster to be created, and/or usage description 40, and/or configuration cost 50, and/or immediate application button 51, and/or add list button 52.
Resource type 44 is used to indicate the purpose of the user application to create a cluster, including a variety of purposes, e.g., for DevNet resources, or for IT resources.
A service domain 45 for characterizing the detailed usage of the cluster to be created, e.g., an intranet development test virtualization area (DevNet) under DevNet resources.
The service module 46 is used to indicate the specific function of the cluster member included in the cluster to be created in the service domain, for example, the resource pool-DevNet operating area, and since the cluster to be created in fig. 4a includes only one cluster member, the service module 46 only selects one detailed purpose.
The machine room location 47 is used to indicate a location where a cluster member included in the cluster to be created is located, for example, "shanks of the rear goose" in fig. 4.
The resource type 44, the service domain 45, the service module 46, and the machine room location 47 may be recorded in the first server 12, so as to facilitate management of the cluster.
Payment type 48, including multiple payment types, fig. 4a shows 2 payment types, where "prepaid" means payment immediately after applying for the cluster to be created (whether or not the application is successful); "post-payment" means that payment is made after the cluster to be created is successfully created.
The service time 49 of the cluster to be created is 1 month in fig. 4a, that is, the cluster to be created runs for 1 month, and then is automatically deleted, that is, the cluster to be created does not exist after 1 month.
The usage instruction 40 may be filled in the usage instruction 40 if the user has other contents to be explained.
The configuration fee 50 is automatically displayed after the user selects or completes the selection, as shown in fig. 4a, and the user needs to pay 108 yuan after completing or selecting as shown in fig. 4 a.
The configuration parameters in the embodiment of the present invention do not include the first application program for implementing the corresponding function of the target cluster type.
Step S302: the first server 12 obtains the configuration parameters.
In an optional embodiment, if the second application program is developed based on a cloud platform, the first window interface is displayed through the cloud platform, and after a user submits an application for a cluster to be created through the first window interface displayed by the cloud platform, the method provided by the embodiment of the invention can automatically generate the corresponding cluster to be created. In the process, manual intervention is not needed, the message service cluster is taken as an example, and the establishment of the message service cluster can be completed within 2 hours on average through multiple experiments, so that the manpower is greatly saved, the time of a developer is saved, and the problems of time consumption of environmental deployment and the like are avoided.
After the user fills in the configuration parameters, the first server 12 can obtain the configuration parameters.
Step S302: the first server 12 determines the first number of cluster members from at least one physical machine 13.
The cluster members can be physical machines or virtual machines, and if the cluster members included in the cluster to be created are all physical machines, the cluster to be created is a physical cluster; and if the cluster members contained in the cluster to be created are all virtual machines, the cluster to be created is a virtual cluster.
If the cluster to be created is a physical cluster, different cluster members correspond to different physical machines; if the cluster to be created is a virtual cluster, different cluster members may be located in the same physical machine. If the cluster to be created includes a primary cluster member and a backup cluster member, in an optional embodiment, the primary cluster member and the backup cluster member are located in different physical machines.
If the first window interface includes the third parameter and the first number of cluster members are all virtual machines, step S302 may specifically be configured to: in the at least one physical machine, creating the first number of virtual machines with corresponding attribute information.
If the second parameter in the first window interface carries information on whether the cluster to be created is a high-availability cluster, creating the first number of virtual machines with corresponding attribute information in the at least one physical machine, including:
if the second parameter represents that the cluster to be created is a high-availability cluster, determining that the cluster to be created comprises at least two cluster members;
at least one cluster member with corresponding attribute information is respectively created in at least two physical machines, wherein a pair of a main cluster member and a backup cluster member are deployed in two different physical machines.
Step S303: the first server 12 obtains a target cluster configuration script corresponding to the target cluster type from a cluster configuration script corresponding to a pre-stored cluster type, where the target cluster configuration script is at least used to instruct cluster members to install an application program for implementing a function corresponding to the target cluster type.
The application program for implementing the function corresponding to the target cluster type may be stored in the first server 12, and may also be stored in the second server 14.
Each physical machine may be pre-stored with a cluster configuration script corresponding to a cluster type, and at this time, step S303 is to specifically control the physical machine where the first number of cluster members are located by the first server 12, and obtain the target cluster configuration script corresponding to the target cluster type from the pre-stored cluster configuration scripts corresponding to the cluster type.
Or, the first server 12 may store a cluster configuration script corresponding to the cluster type in advance, at this time, step S303 further includes: and respectively sending the target cluster configuration script to the first number of cluster members.
Step S304: the first server 12 controls the first number of cluster members to respectively execute the target cluster configuration script to obtain the cluster to be created.
In an alternative embodiment, the target cluster configuration script may include a storage path for an application program that implements a function corresponding to the target cluster type. And in the process that the first number of cluster members respectively execute the target cluster configuration script, obtaining an application program for realizing a corresponding function of the target cluster type from a corresponding storage path, and installing the application program.
In an alternative embodiment, if the cluster to be created is successfully created, the user terminal 11 may further display a third window interface as shown in fig. 4 b.
The third window interface shows "your application form (2017042112384192181616) has been created". Assume that the cluster to be created includes two cluster members, and that the two cluster members are: the primary cluster member and the backup cluster member, the IP addresses of the primary cluster member and the backup cluster member included in the created cluster to be created can be displayed in the third window interface.
The embodiment of the invention discloses a cluster creating method, wherein an applicant of a cluster to be created needs to input configuration parameters of the cluster to be created in a first window interface, for example, the first parameter (for characterizing the type of the target cluster to which the cluster to be created belongs) and the second parameter (for characterizing the first number of cluster members included in the cluster to be created) only need to submit the application for creating the cluster, and the cluster creating method provided by the embodiment of the present invention automatically creates a corresponding cluster for the application, before creating the cluster, because the cluster configuration script corresponding to the cluster type is preset and the application program for realizing the corresponding function of each cluster type is stored in advance, therefore, a target cluster configuration script corresponding to the target cluster type may be obtained in the process of creating the cluster, the target cluster configuration script is at least used for indicating cluster members to install application programs for realizing corresponding functions of the target cluster type; and controlling cluster members contained in the cluster to be created to execute the target cluster configuration script so as to obtain the cluster to be created. According to the method provided by the embodiment, personnel do not need to manually deploy the cluster members, so that the time is greatly saved, and an applicant does not need to own physical machine resources.
In connection with the cluster creation system shown in fig. 1 or fig. 2, a metadata service interface may be provided in the first server 12, or a metadata service interface may be provided in the second server 14. The second application program provided by the embodiment of the invention can interact with the target cluster configuration script through the metadata service interface.
In an alternative embodiment, as shown in fig. 5, a signaling diagram of an implementation manner of step S304 provided for the embodiment of the present invention is provided, where the method includes:
step S501: the first server 12 obtains identification information corresponding to the first number of cluster members respectively.
In an alternative embodiment, the identification information of a cluster member may include an IP (Internet Protocol Address) Address of the cluster member and a name of the cluster member.
In the embodiment of the invention, if the integrated member is a virtual machine, the name of the cluster member is the host name of the virtual machine; and if the cluster member is a physical machine, the name of the cluster member is the host name of the physical machine.
In an alternative embodiment, the host name may be a domain name that identifies the cluster member in the network by its name.
Step S502: the first server 12 stores the first parameter, the second parameter, and the identification information corresponding to the first number of cluster members to the second server 14 through the metadata service interface.
In an optional embodiment, if the second parameter indicates that the cluster to be created includes at least two cluster members, step S502 may further include: the first server 12 assigns role information (e.g., may be randomly assigned) to the first number of cluster members, respectively, the role information including: a primary cluster member role or a backup cluster member role.
In an alternative embodiment, step S502 may further include: after the first server 12 allocates the role information to the first number of cluster members, the metadata service interface may be called to store the role information corresponding to the first number of cluster members to the second server 14.
In an optional embodiment, after determining the first number of cluster members from the at least one physical machine, the first server 12 may obtain identification information corresponding to each of the first number of cluster members. The first server 12 may invoke the metadata service interface to store the identification information corresponding to each of the first number of cluster members to the second server 14. Therefore, step S502 may further include: the identification information corresponding to the first number of cluster members is obtained, the metadata service interface is called, and the identification information corresponding to the first number of cluster members is stored in the second server 14.
Optional steps are outlined in fig. 5 with dashed boxes.
The data stored by the second server 14 provided by the embodiment of the present invention is described below by taking an example that the cluster to be created includes two cluster members (e.g., cluster member a and cluster member B).
meta _ key [ 'maas _ hostname' ] -the name of cluster member a;
meta _ key [ 'bluetooth _ hostname' ] -the name of cluster member B;
meta _ key [ 'private _ IP' ] ═ the IP address of cluster member a;
meta _ key [ 'bluetooth _ IP' ], the IP address of cluster member B;
meta _ key1[ 'role' ], the role master of cluster member a;
meta _ key2[ 'role' ], the role of cluster member B, save;
meta _ key [ 'ha' ], the second parameter.
Wherein, master represents the role of the member of the main cluster, and save represents the role of the member of the backup cluster.
Step S503: the first server 12 controls the first number of cluster members 53 to execute the target cluster configuration script respectively based on the first parameter, the second parameter and the identification information corresponding to the first number of cluster members respectively, which are obtained by calling the metadata service interface and stored in the second server.
The second server may be the same server as the first server, and the second server may not be the same server as the first server.
In an alternative embodiment, as shown in fig. 6, a flowchart of an implementation manner of step S503 provided for the embodiment of the present invention includes:
for each cluster member of the first number of cluster members, step S601: and the cluster members acquire identification information respectively corresponding to the first number of cluster members from the metadata service interface and store the identification information.
Step S601 makes each cluster member know the identification information of other cluster members, i.e., makes each cluster member know the other cluster members.
Step S602: the cluster member calls the metadata service interface to obtain the second parameter from the second server 14.
Step S603: if the second parameter indicates that the cluster to be created comprises at least two cluster members, executing step S604; if the first parameter indicates that the cluster to be created only includes one cluster member, step S607 is executed.
For ease of drawing, the first number of cluster members that the cluster to be created contains is denoted by K.
Step S604: the cluster member calls the metadata service interface to obtain the role information of the cluster member from the second server 14.
Step S605: and the cluster member acquires first configuration information corresponding to the role information from the target cluster configuration script.
In an optional embodiment, the target cluster configuration script may include conf _ master configuration information and conf _ backup configuration information, and if the role information of the cluster member is a role of a master cluster member, the first configuration information corresponding to the cluster member is the conf _ master configuration information; if the role information of the cluster member is the backup cluster member role, the first configuration information corresponding to the cluster member is conf _ backup configuration information.
It is understood that the conf _ master configuration information and the conf _ backup configuration information each include: and indicating the cluster members to install the first application program for realizing the corresponding function of the target cluster type. The conf _ backup configuration information may further include: information for instructing the respective cluster member to join the to-be-created cluster.
Step S606: the cluster member deploys itself based on the first configuration information, and then the process proceeds to step S608.
The first number of cluster members after the target cluster configuration script is executed are obtained through steps S601 to S608.
In an optional embodiment, step S606 may specifically include:
the cluster member acquires a first application program to be installed by the cluster member and used for realizing the corresponding function of the target cluster type based on the first configuration information;
installing the first application in the cluster member.
In an alternative embodiment, step S606 may further include:
the cluster member acquires an operating system and cluster software to be installed by the cluster member based on the first configuration information;
and installing an operating system and cluster software in the cluster member.
In an alternative embodiment, step S606 may further include:
if the role information of the cluster member is the role of the main cluster member, a first application program, an operating system and cluster software are installed in the cluster member, and then the deployment work in the cluster member is completed.
If the role information of the cluster member is the role of the backup cluster member, in addition to installing the first application program, the operating system and the cluster software in the cluster member, first indication information for indicating synchronization between the data stored by the cluster member and the data stored by the main cluster member needs to be configured in the cluster member.
Since the first step only makes the cluster member know other cluster members, but the cluster member does not join the to-be-created cluster, it is also necessary to control the cluster member to join the to-be-created cluster.
The method for controlling the cluster member to join the cluster to be created comprises the following steps: and controlling the cluster member to send an instruction for joining the cluster to be created to the main cluster member, and after receiving the instruction, the main cluster member feeds back an instruction for allowing the cluster to be joined to the cluster member, so that the cluster member joins the cluster to be created.
Step S607: and the cluster members obtain second configuration information from the target cluster configuration script and deploy the cluster members based on the second configuration information.
The target cluster configuration script may further include single _ conf configuration information, and the second configuration information may be single _ conf configuration information. Because the cluster to be created only has one cluster member, the role information of the cluster member does not need to be judged.
In an optional embodiment, the method may further include:
step S608: and the cluster member generates user account information for managing the cluster to be created and sends the user account information to the user terminal.
In an optional embodiment, the user account information may include: a user name and a password, or biometric information of the user, or a user name and a user preset pattern.
In an optional embodiment, if the cluster to be created includes at least two cluster members, any cluster member may be controlled to perform the operation of step S608; if the cluster to be created includes only one cluster member, the cluster member may be controlled to perform the operation of step S608.
Steps S601 to S608 are all implemented by the first server 12 controlling the cluster members.
The user terminal 11 may be installed with a third application program that the user can log in using the user account information, and the third application program may display a second window interface as shown in fig. 7.
The user may control the operational state of the cluster to be created based on the second window interface.
In an optional embodiment, the cluster creating method further includes:
detecting that first user account information sent by the user terminal is matched with pre-allocated user account information, and controlling the user terminal to display a second window interface for guiding a user to control the running state of the cluster to be created;
obtaining a control instruction for controlling the running state of the cluster to be created based on the second window interface;
and controlling the running state of the cluster to be created based on the control instruction.
Assume that the cluster to be created includes two cluster members, which are: the created IP addresses of the main cluster member and the backup cluster member included in the cluster to be created, and/or the version of the first application installed by the main cluster member and the backup cluster member, such as Rabbitmq _3_6_6_ tlinx2.2 _ VS _ Ceph shown in fig. 7, may be displayed in the second window interface; and/or attribute information of the cluster members, namely case types, the attribute information of each cluster member contained in the cluster to be created shown in fig. 7 is the same and is Dev-VD 0; and/or the running state of the cluster to be created, and the cluster to be created is shown in a normal running state in fig. 7.
The user may select the operation state of the cluster to be created in the selection box 71 shown in fig. 7 to control the operation state of the cluster to be created. If the user selects to stop operating, the first server 12 may control the cluster to be created to be in a stop operating state; if the user selects normal operation, the first server 12 may control the cluster to be created to be in a normal operation state.
In an optional embodiment, the cluster creating method may further include: and mounting cloud hard disks for the first number of cluster members respectively, wherein the cloud hard disk of one cluster member is used for storing data in the cluster member.
For example, if the cluster to be created is a message queue cluster, the cloud hard disk of one cluster member may be used to store communication message data.
A Message Queue (MQ) is a method of communication by a communication application a (e.g., a WeChat application or a QQ application) to a communication application B (e.g., a WeChat application or a QQ application). The communication applications communicate by reading and writing communication message data to and from the message queue without requiring a dedicated connection to link them. The communication applications communicate with each other by sending communication message data in a message queue, rather than by directly invoking each other.
In an optional embodiment, during the process of creating the cluster, the creation may fail, and at this time, the cluster creation method further includes:
acquiring a first cluster member generating errors in the process that the first number of cluster members respectively execute the target cluster configuration script;
acquiring error codes and error information corresponding to the errors generated by the first cluster members;
storing the error code and the error information to the second server through the metadata service interface;
and controlling the user terminal to display a fourth window interface carrying the error code and the error code information, wherein the error code and the error code information displayed on the fourth window interface are obtained from the second server by calling the metadata service interface.
In an optional embodiment, if the first number of cluster members are all virtual machines, the cluster creating method further includes:
deleting the cluster member that generated the error, or deleting the first number of cluster members.
After deletion, the user can reapply to create the cluster to be created.
In an optional embodiment, in the process of creating a cluster, a creation progress of the cluster may also be shown at a user terminal, and the cluster creation method further includes:
acquiring task progress of the first number of cluster members for respectively executing the target cluster configuration script;
determining the creation progress of the cluster to be created based on the task progress respectively corresponding to the first number of cluster members;
storing the creation progress to the second server through the metadata service interface;
and controlling the user terminal to display a fifth window interface carrying the creation progress, wherein the creation progress displayed by the fifth window interface is obtained from the second server by calling the metadata service interface.
In order to make the skilled person more understand the embodiment of the present invention, the cluster creation method provided in the embodiment of the present invention is described below by taking the Rabbitmq message queue cluster as an example.
1. The user terminal 11 is installed with a second application that may display a first window interface as shown in fig. 4 a.
A user inputs or selects configuration parameters in a first window interface, and if the first parameter included in the configuration parameters is Rabbitmq, and the second parameter carries information that the message queue cluster is highly available, and the number of the information queue cluster is 1 (the number of the main cluster members is assumed), the second parameter represents that the message queue cluster has 2 virtual machines (the number of the main virtual machines and the backup virtual machines is 2 in total).
2. After the first server 12 receives the configuration parameters, it may be determined that the message queue includes two virtual machines in total based on the second parameter, and the message queue cluster is highly available, and to meet this requirement, the first server 12 creates one virtual machine in each of the two physical machines, assuming that virtual machine a is created in physical machine a and virtual machine B is created in physical machine B.
3. The first server 12 may obtain, based on the first parameter, a Rabbitmq cluster configuration script corresponding to the Rabbitmq cluster type from a cluster configuration script corresponding to a pre-stored cluster type.
The first server 12 may send Rabbitmq cluster configuration scripts to virtual machine a and virtual machine B.
Or, the cluster configuration scripts corresponding to the cluster types are stored in the physical machine a and the physical machine B in advance. The first server 12 may control the physical machine a and the physical machine B to obtain, based on the first parameter, a Rabbitmq cluster configuration script corresponding to the Rabbitmq cluster type from the cluster configuration scripts corresponding to the pre-stored cluster types, respectively.
4. After the first server 12 creates the two virtual machines, it may obtain the IP addresses corresponding to the two virtual machines, and the virtual machine names corresponding to the two virtual machines; suppose that the corresponding IP address of virtual machine a is: the IP address A and the name of the virtual machine corresponding to the virtual machine A are A; the corresponding IP address of the virtual machine B is as follows: and the IP address B and the virtual machine name corresponding to the virtual machine B are B.
5. Since the message queue cluster is a high-availability cluster, the first server 12 randomly allocates role information to the two virtual machines, and it is assumed that the virtual machine a is a primary virtual machine and the virtual machine B is a backup virtual machine.
The first server 12 calls the metadata service interface to store the first parameter, the second parameter, the virtual machine name and the IP address of the virtual machine a, and the virtual machine name and the IP address of the virtual machine B to the second server.
The data stored by the second server is as follows:
meta _ key [ 'maas _ hostname' ], the name a of virtual machine a;
meta _ key [ 'bluetooth _ hostname' ], the name B of virtual machine B;
meta _ key [ 'private _ IP' ] ═ IP address a of virtual machine a;
meta _ key [ 'bluetooth _ IP' ], i.e. IP address B of virtual machine B;
meta _ key1[ 'role' ] — the role master of virtual machine a;
meta _ key2[ 'role' ], virtual machine B role save;
meta _ key [ 'ha' ], the second parameter.
Wherein, master represents the role of the primary virtual machine, and save represents the role of the backup virtual machine.
6. The virtual machine A runs a Rabbitmq cluster configuration script, the Rabbitmq cluster configuration script can call a metadata service interface, and the name A of the virtual machine A and the IP address A of the virtual machine A are obtained from a second server through the metadata service interface; the name B of the virtual machine B and the IP address B of the virtual machine B are stored.
7. The Rabbitmq cluster configuration script in the virtual machine A obtains a second parameter from the second server through the metadata server interface, and because the second parameter represents that the message queue cluster is a high-availability cluster and the message queue cluster comprises two virtual machines, the role information of the virtual machine A is obtained from the second server through the metadata server interface, and because the role information of the virtual machine A is a master (a master virtual machine role), the Rabbitmq cluster configuration script runs conf _ master configuration information corresponding to the master virtual machine role.
The conf _ master configuration information may instruct the virtual machine a to install an application program for implementing a function corresponding to the Rabbitmq type, for example, a Rabbitmq application program, an operating system, and the like.
In an optional embodiment, the conf _ master configuration information may instruct the virtual machine a to generate user account information for managing the cluster to be created; and sending the user account information to the user terminal.
8. After the virtual machine A is installed, starting a Rabbitmq application program, so that the virtual machine A can have a Rabbitmq message service function.
9. The virtual machine B runs a Rabbitmq cluster configuration script, the Rabbitmq cluster configuration script can call a metadata service interface, and the name A of the virtual machine A and the IP address A of the virtual machine A are obtained from the second server through the metadata service interface; the name B of the virtual machine B and the IP address B of the virtual machine B are stored.
10. And acquiring a second parameter from a second server by a Rabbitmq cluster configuration script in the virtual machine B through a metadata server interface, wherein the second parameter represents that the message queue cluster is a high-availability cluster and comprises two virtual machines, acquiring role information of the virtual machine B from the second server through the metadata server interface, and operating conf _ backup configuration information corresponding to a backup virtual machine role by the Rabbitmq cluster configuration script because the role information of the virtual machine B is save (backup virtual machine role).
The conf _ backup configuration information may instruct the virtual machine B to install an application program for implementing a function corresponding to the Rabbitmq type, for example, a Rabbitmq application program, an operating system, and the like.
The conf _ backup configuration information is also used for indicating that the virtual machine B configures first indication information for indicating that the data stored by the virtual machine B is synchronous with the data stored by the virtual machine A.
The conf _ backup configuration information is also used for indicating the virtual machine B to join the cluster to be created.
11. And after the virtual machine B runs the Rabbitmq cluster configuration script, starting a Rabbitmq application program to enable the virtual machine B to have a Rabbitmq message service function.
In conclusion, the creation of the Rabbitmq message queue cluster is completed.
The method is described in detail in the embodiments disclosed above, and the method of the present invention can be implemented by various types of apparatuses, so that the present invention also discloses an apparatus, and the following detailed description will be given of specific embodiments.
As shown in fig. 8, a structure diagram of an implementation manner of a first server provided in the embodiment of the present invention is provided, where the first server includes:
a first obtaining module 81, configured to obtain configuration parameters based on a first window interface displayed by a user terminal, where the configuration parameters include a first parameter and a second parameter, the first parameter is used to characterize a target cluster type to which a cluster to be created belongs, and the second parameter is used to characterize a first number of cluster members included in the cluster to be created;
a first determining module 82, configured to determine the first number of cluster members from at least one physical machine;
a second obtaining module 83, configured to obtain, from a pre-stored cluster configuration script corresponding to a cluster type, a target cluster configuration script corresponding to the target cluster type, where the target cluster configuration script is at least used to instruct a cluster member to install an application program for implementing a function corresponding to the target cluster type;
a control module 84, configured to control the first number of cluster members to execute the target cluster configuration script respectively, so as to obtain the cluster to be created.
In an alternative embodiment, the control module includes:
a first obtaining unit, configured to obtain identification information corresponding to each of the first number of cluster members;
a first storage unit, configured to store, to a second server, the first parameter, the second parameter, and identification information corresponding to the first number of cluster members, respectively, through a metadata service interface;
a first control unit, configured to control the first number of cluster members to respectively execute the target cluster configuration script based on the first parameter, the second parameter, and identification information corresponding to the first number of cluster members, which are obtained by calling the metadata service interface and stored in the second server.
In an optional embodiment, the second server further stores role information corresponding to the first number of cluster members respectively; the first control unit includes:
a first obtaining subunit, configured to, for each cluster member of the first number of cluster members, obtain, from the metadata service interface, identification information corresponding to each cluster member of the first number of cluster members, and store the identification information;
the first calling subunit is used for calling the metadata service interface to obtain the second parameter from the second server;
the second calling subunit is configured to, if the second parameter indicates that the cluster to be created includes at least two cluster members, call the metadata service interface to obtain role information of the cluster member from the second server;
the second obtaining subunit is configured to obtain, from the target cluster configuration script, first configuration information corresponding to the role information;
and the first deployment subunit is configured to deploy the cluster members based on the first configuration information to obtain the first number of cluster members after the target cluster configuration script is executed respectively.
In an alternative embodiment, the first deployment subunit comprises:
the acquisition submodule is used for acquiring a first application program to be installed by the cluster member and used for realizing the corresponding function of the target cluster type based on the first configuration information;
and the installation submodule is used for installing the first application program in the cluster member.
In an optional embodiment, the first deployment subunit further comprises:
the configuration submodule is used for configuring first indication information for indicating the synchronization of data stored by the cluster member and data stored by a main cluster member in the cluster member if the role information of the cluster member is the role of a backup cluster member, wherein the role information corresponding to the main cluster member is the role of the main cluster member;
and the control sub-module is used for controlling the cluster members to join the cluster to be created.
In an alternative embodiment, the first control unit comprises:
a third obtaining subunit, configured to invoke the metadata service interface, obtain, from the second server, identification information corresponding to the first number of cluster members, and store the identification information;
a fourth obtaining subunit, configured to invoke the metadata service interface, and obtain the first parameter from the second server;
a fifth obtaining subunit, configured to obtain, if the first parameter indicates that the cluster to be created only includes one cluster member, second configuration information from the target cluster configuration script;
and the second deployment subunit is used for deploying the cluster member based on the second configuration information.
In an optional embodiment, further comprising:
the generating module is used for generating user account information for managing the cluster to be created;
and the sending module is used for sending the user account information to the user terminal.
In an optional embodiment, further comprising:
the control display module is used for detecting that first user account information sent by the user terminal is matched with the pre-allocated user account information, and controlling the user terminal to display a second window interface for guiding a user to control the running state of the cluster to be created;
a third obtaining module, configured to obtain, based on the second window interface, a control instruction for controlling an operating state of the cluster to be created;
and the control running state module is used for controlling the running state of the cluster to be created based on the control instruction.
In an optional embodiment, the first number of cluster members are all virtual machines, the configuration parameters further include a third parameter, the third parameter is used to characterize attribute information corresponding to each of the first number of cluster members, and the first determining module includes: a creating unit configured to create, in the at least one physical machine, the first number of virtual machines having corresponding attribute information.
In an optional embodiment, the second parameter carries information of whether the cluster to be created is a high-available cluster, and the creating unit includes:
a determining subunit, configured to determine that the cluster to be created includes at least two cluster members if the second parameter indicates that the cluster to be created is a high-availability cluster;
the creating subunit is used for creating at least one cluster member with corresponding attribute information in at least two physical machines respectively, wherein a pair of a main cluster member and a backup cluster member are deployed in two different physical machines.
As shown in fig. 9, another structure diagram of a first server provided in an embodiment of the present invention is shown, where the first server includes:
a memory 91 for storing a program;
a processor 92 configured to execute the program, the program being specifically configured to:
obtaining configuration parameters based on a first window interface displayed by a user terminal, wherein the configuration parameters comprise a first parameter and a second parameter, the first parameter is used for representing a target cluster type to which a cluster to be created belongs, and the second parameter is used for representing a first number of cluster members contained in the cluster to be created;
determining, from at least one physical machine, the first number of cluster members;
acquiring a target cluster configuration script corresponding to the target cluster type from a cluster configuration script corresponding to a pre-stored cluster type, wherein the target cluster configuration script is at least used for indicating cluster members to install an application program for realizing a corresponding function of the target cluster type;
and controlling the first number of cluster members to respectively execute the target cluster configuration script to obtain the cluster to be created.
The processor 92 may be a central processing unit CPU, or an application Specific Integrated circuit ASIC, or one or more Integrated circuits configured to implement embodiments of the present invention.
The first server may further comprise a communication interface 93 and a communication bus 94, wherein the memory 91, the processor 92 and the communication interface 93 are in communication with each other via the communication bus 94.
Alternatively, the communication interface may be an interface of a communication module, such as an interface of a GSM module.
An embodiment of the present invention further provides a readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the steps included in any one of the embodiments of the cluster creation method described above.
It should be noted that, in the present specification, the embodiments are all described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments may be referred to each other. For the device or system type embodiment, since it is basically similar to the method embodiment, the description is simple, and for the relevant points, refer to the partial description of the method embodiment.
It is further noted that, herein, 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. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The steps of a method or algorithm described in connection with the embodiments disclosed herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. A software module may reside in Random Access Memory (RAM), memory, Read Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (13)

1. A cluster creation method applied to a first server includes:
obtaining configuration parameters based on a first window interface displayed by a user terminal, wherein the configuration parameters comprise a first parameter and a second parameter, the first parameter is used for representing a target cluster type to which a cluster to be created belongs, and the second parameter is used for representing a first number of cluster members contained in the cluster to be created;
determining, from at least one physical machine, the first number of cluster members;
acquiring a target cluster configuration script corresponding to the target cluster type from a cluster configuration script corresponding to a pre-stored cluster type, wherein the target cluster configuration script is at least used for indicating cluster members to install an application program for realizing a corresponding function of the target cluster type;
obtaining identification information corresponding to the first number of cluster members respectively;
storing the first parameter, the second parameter and identification information corresponding to the first number of cluster members to a second server through a metadata service interface; the second server also stores role information corresponding to the first number of cluster members respectively;
for each cluster member in the first number of cluster members, obtaining identification information corresponding to the first number of cluster members from the metadata service interface, and storing the identification information;
calling the metadata service interface to obtain the second parameter from the second server;
if the second parameter represents that the cluster to be created comprises at least two cluster members, calling the metadata service interface to obtain role information of the cluster members from the second server;
obtaining first configuration information corresponding to the role information from the target cluster configuration script;
and deploying the cluster members based on the first configuration information to obtain the first number of cluster members after the target cluster configuration script is executed respectively.
2. The cluster creation method of claim 1, wherein said deploying the cluster member based on the first configuration information comprises:
acquiring a first application program to be installed by the cluster member and used for realizing the corresponding function of the target cluster type based on the first configuration information;
installing the first application in the cluster member.
3. The cluster creation method of claim 2, wherein the deploying the cluster member based on the first configuration information further comprises:
if the role information of the cluster member is the role of the backup cluster member, first indication information used for indicating that the data stored by the cluster member is synchronous with the data stored by a main cluster member is configured in the cluster member, and the role information corresponding to the main cluster member is the role of the main cluster member;
and controlling the cluster member to join the cluster to be created.
4. The cluster creation method of claim 1, wherein after obtaining and storing identification information corresponding to the first number of cluster members from the metadata service interface, the method further comprises:
calling the metadata service interface to obtain the first parameter from the second server;
if the first parameter represents that the cluster to be created only comprises one cluster member, obtaining second configuration information from the target cluster configuration script;
and deploying the cluster member based on the second configuration information.
5. The cluster creation method of any one of claims 1 to 4, further comprising:
generating user account information for managing the cluster to be created;
and sending the user account information to the user terminal.
6. The cluster creation method of claim 5, further comprising:
detecting that first user account information sent by the user terminal is matched with pre-allocated user account information, and controlling the user terminal to display a second window interface for guiding a user to control the running state of the cluster to be created;
obtaining a control instruction for controlling the running state of the cluster to be created based on the second window interface;
and controlling the running state of the cluster to be created based on the control instruction.
7. The cluster creation method according to any one of claims 1 to 4, wherein the first number of cluster members are all virtual machines, the configuration parameter further includes a third parameter, the third parameter is used to characterize attribute information corresponding to each of the first number of cluster members, and the determining the first number of cluster members from the at least one physical machine includes:
in the at least one physical machine, creating the first number of virtual machines with corresponding attribute information.
8. The method according to claim 7, wherein the second parameter carries information on whether the cluster to be created is a high-availability cluster, and creating the first number of virtual machines with corresponding attribute information in the at least one physical machine comprises:
if the second parameter represents that the cluster to be created is a high-availability cluster, determining that the cluster to be created comprises at least two cluster members;
at least one cluster member with corresponding attribute information is respectively created in at least two physical machines, wherein a pair of a main cluster member and a backup cluster member are deployed in two different physical machines.
9. The cluster creation method of claim 1, further comprising:
acquiring a first cluster member generating errors in the process that the first number of cluster members respectively execute the target cluster configuration script;
acquiring error codes and error information corresponding to the errors generated by the first cluster members;
storing the error code and the error information to the second server through the metadata service interface;
and controlling the user terminal to display a fourth window interface carrying the error code and the error code information, wherein the error code and the error code information displayed on the fourth window interface are obtained from the second server by calling the metadata service interface.
10. The cluster creation method of claim 1, further comprising:
acquiring task progress of the first number of cluster members for respectively executing the target cluster configuration script;
determining the creation progress of the cluster to be created based on the task progress respectively corresponding to the first number of cluster members;
storing the creation progress to the second server through the metadata service interface;
and controlling the user terminal to display a fifth window interface carrying the creation progress, wherein the creation progress displayed by the fifth window interface is obtained from the second server by calling the metadata service interface.
11. A first server, comprising:
the system comprises a first obtaining module, a second obtaining module and a third obtaining module, wherein the first obtaining module is used for obtaining configuration parameters based on a first window interface displayed by a user terminal, the configuration parameters comprise a first parameter and a second parameter, the first parameter is used for representing a target cluster type to which a cluster to be created belongs, and the second parameter is used for representing a first number of cluster members contained in the cluster to be created;
a first determining module for determining the first number of cluster members from at least one physical machine;
a second obtaining module, configured to obtain a target cluster configuration script corresponding to the target cluster type from a cluster configuration script corresponding to a pre-stored cluster type, where the target cluster configuration script is at least used to instruct a cluster member to install an application program for implementing a function corresponding to the target cluster type;
the control module is used for acquiring identification information corresponding to the first number of cluster members; storing the first parameter, the second parameter and identification information corresponding to the first number of cluster members to a second server through a metadata service interface; the second server also stores role information corresponding to the first number of cluster members respectively; for each cluster member in the first number of cluster members, obtaining identification information corresponding to the first number of cluster members from the metadata service interface, and storing the identification information; calling the metadata service interface to obtain the second parameter from the second server; if the second parameter represents that the cluster to be created comprises at least two cluster members, calling the metadata service interface to obtain role information of the cluster members from the second server; obtaining first configuration information corresponding to the role information from the target cluster configuration script; and deploying the cluster members based on the first configuration information to obtain the first number of cluster members after the target cluster configuration script is executed respectively.
12. A first server, comprising:
a memory for storing a program;
a processor configured to execute the program, the program specifically configured to:
obtaining configuration parameters based on a first window interface displayed by a user terminal, wherein the configuration parameters comprise a first parameter and a second parameter, the first parameter is used for representing a target cluster type to which a cluster to be created belongs, and the second parameter is used for representing a first number of cluster members contained in the cluster to be created;
determining, from at least one physical machine, the first number of cluster members;
acquiring a target cluster configuration script corresponding to the target cluster type from a cluster configuration script corresponding to a pre-stored cluster type, wherein the target cluster configuration script is at least used for indicating cluster members to install an application program for realizing a corresponding function of the target cluster type;
obtaining identification information corresponding to the first number of cluster members respectively;
storing the first parameter, the second parameter and identification information corresponding to the first number of cluster members to a second server through a metadata service interface; the second server also stores role information corresponding to the first number of cluster members respectively;
for each cluster member in the first number of cluster members, obtaining identification information corresponding to the first number of cluster members from the metadata service interface, and storing the identification information;
calling the metadata service interface to obtain the second parameter from the second server;
if the second parameter represents that the cluster to be created comprises at least two cluster members, calling the metadata service interface to obtain role information of the cluster members from the second server;
obtaining first configuration information corresponding to the role information from the target cluster configuration script;
and deploying the cluster members based on the first configuration information to obtain the first number of cluster members after the target cluster configuration script is executed respectively.
13. A readable storage medium having stored thereon a computer program for implementing the steps of the cluster creation method according to any of claims 1 to 10 when executed by a processor.
CN201810130371.XA 2018-02-08 2018-02-08 Cluster creation method, first server and readable storage medium Active CN110138577B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810130371.XA CN110138577B (en) 2018-02-08 2018-02-08 Cluster creation method, first server and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810130371.XA CN110138577B (en) 2018-02-08 2018-02-08 Cluster creation method, first server and readable storage medium

Publications (2)

Publication Number Publication Date
CN110138577A CN110138577A (en) 2019-08-16
CN110138577B true CN110138577B (en) 2021-09-21

Family

ID=67567891

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810130371.XA Active CN110138577B (en) 2018-02-08 2018-02-08 Cluster creation method, first server and readable storage medium

Country Status (1)

Country Link
CN (1) CN110138577B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112751687B (en) * 2019-10-30 2023-03-24 北京车和家信息技术有限公司 Cluster creation method and device
CN110890987A (en) * 2019-11-29 2020-03-17 北京首都在线科技股份有限公司 Method, device, equipment and system for automatically creating cluster
CN111290712B (en) * 2020-01-22 2021-06-18 腾讯科技(深圳)有限公司 Block device creating method and device, cloud computing management system and storage medium
CN114765550B (en) * 2020-12-31 2023-11-21 网联清算有限公司 Business security processing method and system
CN113256240B (en) * 2021-04-22 2023-04-07 支付宝(杭州)信息技术有限公司 Message processing method and device and server

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102455936A (en) * 2010-11-25 2012-05-16 中标软件有限公司 Trunk quick allocation method
CN104079657A (en) * 2014-07-07 2014-10-01 用友软件股份有限公司 Configurable cluster deployment device and method based on templates
CN104679717A (en) * 2015-02-15 2015-06-03 北京京东尚科信息技术有限公司 Method and management system of elastic cluster deployment
CN106254127A (en) * 2016-08-23 2016-12-21 浪潮电子信息产业股份有限公司 Automatic deployment method of RabbitMQ cluster service based on virtualization platform
CN106708597A (en) * 2015-11-17 2017-05-24 中国移动通信集团公司 Method, device and system for creating cluster environment on the basis of Openstack

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8661286B2 (en) * 2010-05-21 2014-02-25 Unisys Corporation QProcessor architecture in a cluster configuration

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102455936A (en) * 2010-11-25 2012-05-16 中标软件有限公司 Trunk quick allocation method
CN104079657A (en) * 2014-07-07 2014-10-01 用友软件股份有限公司 Configurable cluster deployment device and method based on templates
CN104679717A (en) * 2015-02-15 2015-06-03 北京京东尚科信息技术有限公司 Method and management system of elastic cluster deployment
CN106708597A (en) * 2015-11-17 2017-05-24 中国移动通信集团公司 Method, device and system for creating cluster environment on the basis of Openstack
CN106254127A (en) * 2016-08-23 2016-12-21 浪潮电子信息产业股份有限公司 Automatic deployment method of RabbitMQ cluster service based on virtualization platform

Also Published As

Publication number Publication date
CN110138577A (en) 2019-08-16

Similar Documents

Publication Publication Date Title
CN110138577B (en) Cluster creation method, first server and readable storage medium
CN108809722B (en) Method, device and storage medium for deploying Kubernetes cluster
CN110752947B (en) K8s cluster deployment method and device, and deployment platform
US10237118B2 (en) Efficient application build/deployment for distributed container cloud platform
US9454439B2 (en) Disaster recovery validation
EP3291499A1 (en) Method and apparatus for network service capacity expansion
CN108255497B (en) Application deployment method and device
CN113645071B (en) Cluster deployment method, system, medium and electronic terminal
US20180152339A1 (en) APPLICATION RESILIENCY USING APIs
US10817267B2 (en) State machine representation of a development environment deployment process
US20160139945A1 (en) Techniques for constructing virtual images for interdependent applications
CN109120444B (en) Cloud resource management method, processor and storage medium
US20220103555A1 (en) Service deployment method, device, system, and computer-readable storage medium
CN110286997B (en) Multi-container application creation method, device, computer equipment and storage medium
US11863419B2 (en) Network service management system and network service management method
CN110890987A (en) Method, device, equipment and system for automatically creating cluster
CN110928554A (en) Deployment method, device, equipment and storage medium
CN112328390A (en) Method and device for automatically implementing cloud management platform and storage medium
CN110489305B (en) Server management method and device
CN112003754A (en) Visual node registration method for OpenStack cluster
EP4050850A1 (en) Service upgrading method, device and system
US20230040842A1 (en) Network service management system and network service management method
CN113312148B (en) Big data service deployment method, device, equipment and medium
CN115220871A (en) Virtual machine cloning method, device and storage medium
CN114356357A (en) Mirror image file processing method and device and electronic equipment

Legal Events

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