A multi-instance creation method, platform, device and storage medium based on Ambari

By obtaining and generating target service templates in the Apache Ambari platform, the problem of multi-instance automated installation and deployment is solved, and concise and efficient multi-instance configuration and management are achieved.

CN114356349BActive Publication Date: 2025-09-19CHINA MOBILE (SUZHOU) SOFTWARE TECH CO LTD +1
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202011063325.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-09-30
Publication Date
2025-09-19
Estimated Expiration
2040-09-30

AI Technical Summary

Technical Problem

The existing Apache Ambari platform does not support multi-instance automated installation and deployment, requiring users to manually configure and use operation and maintenance tools, resulting in page redundancy.

Method used

By obtaining target information of the instance to be installed, determining a preset service template corresponding to the target information, generating a target service template, and sending it to the second device for installation, multi-instance automated deployment is achieved.

Benefits of technology

It realizes the automated installation and deployment of multiple instances, simplifies the configuration process, ensures the simplicity of the page, and improves resource utilization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114356349B_ABST
    Figure CN114356349B_ABST
Patent Text Reader

Abstract

The present application discloses a multi-instance creation method based on Ambari, which includes: obtaining target information of the instance to be installed; wherein the target information is the installation parameters when installing the instance to be installed; determining a preset service template corresponding to the target information; wherein the preset service template is a pre-configured template for implementing the basic service of the target information; generating a target service template based on the target information and the preset service template; sending the target service template to a second device; wherein the target service template is used for the second device to install the instance to be installed based on the target service template, thereby realizing a multi-instance automated installation and deployment method and ensuring the simplicity of the page. The present application also provides a multi-instance creation platform, device, and storage medium based on Ambari.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of big data, and in particular to a multi-instance creation method, platform, device, and storage medium based on Ambari. Background Art

[0002] At present, due to the advantages of Apache Ambari platform being intuitive and easy to operate, it has been widely used in the management of Hadoop. It can realize functions such as configuration, management and monitoring of Hadoop.

[0003] However, the current community version of the Apache Ambari platform generally does not support multi-instance installation and deployment. When users need to deploy multiple instances, they must manually configure settings in the Linux system backend, deploying multiple instances by deploying multiple Apache Ambari platforms. This manual deployment is then distributed through other operations and maintenance tools such as Ansible or Workstations. This currently prevents automated installation and deployment of multiple instances and results in redundant pages. Summary of the Invention

[0004] To solve the above technical problems, the embodiments of the present application hope to provide a multi-instance creation method, platform, device and storage medium based on Ambari, which solves the current problem of not being able to automatically install and deploy multiple instances, resulting in page redundancy, realizes a multi-instance automated installation and deployment method, and ensures the simplicity of the page.

[0005] The technical solution of this application is achieved as follows:

[0006] In a first aspect, a multi-instance creation method based on Ambari is provided, the method being applied to a first device in an Ambari cluster, the method comprising:

[0007] Obtain target information of the instance to be installed; wherein the target information is installation parameters when installing the instance to be installed;

[0008] Determining a preset service template corresponding to the target information; wherein the preset service template is a pre-configured template for implementing a basic service of the target information;

[0009] generating a target service template based on the target information and the preset service template;

[0010] The target service template is sent to a second device, wherein the target service template is used for the second device to install the instance to be installed based on the target service template.

[0011] Optionally, determining a preset service template corresponding to the target information includes:

[0012] Obtaining a target service type of the instance to be installed from the target information;

[0013] Acquire the preset service template corresponding to the target service type.

[0014] Optionally, generating a target service template based on the target information and the preset service template includes:

[0015] Acquire the first instance identification information and target configuration information of the instance to be installed from the target information;

[0016] The target service template is generated based on the first instance identification information, the target configuration information and the preset service template.

[0017] Optionally, acquiring the first instance identification information and target configuration information of the instance to be installed from the target information includes:

[0018] Obtaining the first instance identification information from the target information;

[0019] If the first instance identification information is different from the currently stored instance identification information, obtaining the target configuration information from the target information;

[0020] If the first instance identification information is the same as the currently stored instance identification information, a prompt message is generated to prompt the user to enter the second instance identification information of the instance to be installed, until the entered second instance identification information is different from the currently stored instance identification information, and the target configuration information is obtained from the target information; wherein the first instance identification information is different from the second instance identification information.

[0021] Optionally, the generating the target service template based on the first instance identification information, the target configuration information, and the preset service template includes:

[0022] Replacing corresponding content in the preset service template with the first instance identification information and the target configuration information to obtain the target service template;

[0023] Correspondingly, before sending the target service template to the second device, the method further includes:

[0024] Obtain device identification information of a second device to determine the second device; wherein the second device includes at least one device.

[0025] Optionally, the preset service template includes: alarm parameters for the target service type, configuration information running script, target service start / stop script corresponding to the target service type, monitoring alarm script, log collection template script, and start / stop sequence script between services associated with the target service and the target service.

[0026] Optionally, the method further includes:

[0027] Receiving a deletion instruction for third instance identification information displayed on a current display interface, wherein the current display interface is used to display installed instances;

[0028] In response to the deletion instruction, the third instance identification information is deleted.

[0029] Optionally, after obtaining the first instance identification information and target configuration information of the instance to be installed, the method further includes:

[0030] If a cancel instruction is received, exit the current display interface for obtaining the target configuration information.

[0031] Optionally, the target service type includes a distributed publish-subscribe messaging system service Kafka or a distributed system reliable coordination system service ZooKeeper.

[0032] In a second aspect, a multi-instance creation method based on Ambari is applied to a second device of an Ambari cluster, the method comprising:

[0033] Receive a target service template sent by the first device of the Ambari cluster;

[0034] generating a target service configuration file based on the target service template;

[0035] The target configuration file is used to install the instance to be installed corresponding to the target configuration file.

[0036] In a third aspect, a first device is provided for creating multiple instances based on Ambari, the device comprising a first memory, a first processor, and a first communication bus; wherein:

[0037] The first memory is used to store executable instructions;

[0038] The first communication bus is used to implement a communication connection between the first processor and the first memory;

[0039] The first processor is configured to execute the Ambari-based multi-instance creation program stored in the first memory to implement the following steps:

[0040] Obtain target information of the instance to be installed; wherein the target information is installation parameters when installing the instance to be installed;

[0041] Determining a preset service template corresponding to the target information; wherein the preset service template is a pre-configured template for implementing a basic service of the target information;

[0042] generating a target service template based on the target information and the preset service template;

[0043] The target service template is sent to a second device, wherein the target service template is used for the second device to install the instance to be installed based on the target service template.

[0044] In a fourth aspect, a second device is created based on multiple instances of Ambari, the device comprising a second memory, a second processor, and a second communication bus; wherein:

[0045] The second memory is used to store executable instructions;

[0046] The second communication bus is used to implement a communication connection between the second processor and the second memory;

[0047] The second processor is configured to execute the Ambari-based multi-instance creation program stored in the second memory to implement the following steps:

[0048] Receive a target service template sent by the first device of the Ambari cluster;

[0049] generating a target service configuration file based on the target service template;

[0050] The target configuration file is used to install the instance to be installed corresponding to the target configuration file.

[0051] In a fifth aspect, a multi-instance creation platform based on Ambari is provided, the platform comprising: a first device and a second device; wherein:

[0052] The first device is configured to obtain target information of an instance to be installed, wherein the target information is installation parameters when installing the instance to be installed; determine a preset service template corresponding to the target information; generate a target service template based on the target information and the preset service template; and send the target service template to the second device;

[0053] The second device is configured to receive the target service template sent by the first device; generate a target service configuration file based on the target service template; and use the target configuration file to install the instance to be installed corresponding to the target configuration file.

[0054] In a sixth aspect, a storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the steps of the Ambari-based multi-instance creation method as described in any one of the above items.

[0055] The multi-instance creation method, platform, device and storage medium based on Ambari provided in the embodiment of the present application obtains the target information of the instance to be installed and determines the preset service template corresponding to the target information, then generates the target service template based on the target information and the preset service template, and sends the target service template to the second device. The second device receives the target service template sent by the first device and generates a target service configuration file based on the target service template. The target configuration file is used according to the instance to be installed corresponding to the target configuration file. In this way, the first device automatically generates the target service template through the target information and the preset service template and sends it to the second device, so that the second device generates the target configuration file based on the target service template sent by the first device, and installs the corresponding instance to be installed based on the generated target configuration file. This solves the current problem of not being able to automatically install and deploy multiple instances, resulting in page redundancy, and realizes the automatic installation and deployment method of multiple instances, ensuring the simplicity of the page. BRIEF DESCRIPTION OF THE DRAWINGS

[0056] Figure 1 A schematic diagram of a multi-instance creation method based on Ambari provided in an embodiment of the present application;

[0057] Figure 2 A schematic diagram of another Ambari-based multi-instance creation method provided in an embodiment of the present application;

[0058] Figure 3 A schematic diagram of a process for creating multiple instances based on Ambari provided in an embodiment of the present application;

[0059] Figure 4 A schematic diagram of a flow chart of a multi-instance creation method based on Ambari provided in another embodiment of the present application;

[0060] Figure 5 A schematic diagram of a flow chart of another Ambari-based multi-instance creation method provided in another embodiment of the present application;

[0061] Figure 6 A schematic diagram of a flow chart of another Ambari-based multi-instance creation method provided in another embodiment of the present application;

[0062] Figure 7 This is an application example of a multi-instance creation method based on Ambari provided in an embodiment of the present application;

[0063] Figure 8 This is another application example of the multi-instance creation method based on Ambari provided in the embodiment of the present application;

[0064] Figure 9 This is another application example of a multi-instance creation method based on Ambari provided in an embodiment of the present application;

[0065] Figure 10 A schematic structural diagram of a first device provided in an embodiment of the present application;

[0066] Figure 11 A schematic structural diagram of a second device provided in an embodiment of the present application;

[0067] Figure 12 A schematic diagram of the structure of a multi-instance creation platform based on Ambari provided in an embodiment of the present application. DETAILED DESCRIPTION

[0068] It should be noted that the terms "one," "another," and "yet another" mentioned in the accompanying drawings do not limit a particular embodiment. In some application scenarios, the various embodiments of this application can be combined arbitrarily without conflict.

[0069] The technical solutions in the embodiments of the present application will be described clearly and completely below in conjunction with the drawings in the embodiments of the present application.

[0070] The embodiment of the present application provides a multi-instance creation method based on Ambari, referring to Figure 1 As shown, the method is applied to a first device based on Ambari, and the method includes the following steps:

[0071] Step 101: Obtain target information of the instance to be installed.

[0072] The target information is the installation parameters when installing the instance to be installed.

[0073] In an embodiment of the present application, the first device is a device that runs a node with management authority in the Ambari cluster, and the node with management authority can be called a management (server) node. The installation parameters of the instance to be installed include at least: the service type of the instance to be installed, the identification information of the second device for installing the embodiment to be installed, and the configuration parameters of the instance to be installed, etc. The way in which the first device obtains the target information of the embodiment to be installed can include the user performing corresponding operations on the terminal device running the first device and inputting the target information of the instance to be installed. In some application scenarios, the target information of the instance to be installed can also be sent to the first device by other devices. The instance to be installed includes at least one instance.

[0074] It should be noted that at this time, the Ambari cluster to which the first device belongs can run at least one instance of the same service, that is, when the Ambari cluster to which the first device belongs runs at least one instance of a certain service, the target information of the instance to be installed belonging to the service can continue to be obtained through the first device, so that the Ambari cluster to which the first device belongs can run multiple instances of the same service at the same time.

[0075] Step 102: Determine a preset service template corresponding to the target information.

[0076] The preset service template is a pre-configured template for implementing basic services of target information.

[0077] In an embodiment of the present application, a preset service template may be a service template pre-stored in a common storage area accessible to the first device or all devices running management nodes in an Ambari cluster, such as a cloud storage area; or a service template pre-stored in a storage area corresponding to the first device, such as a local storage area of ​​the first device or a total service template of the cloud storage area of ​​the first device. A preset service template refers to a script template pre-set for creating instances to be installed for different services.

[0078] Step 103: Generate a target service template based on the target information and the preset service template.

[0079] In an embodiment of the present application, the first device supplements the relevant parameters in the preset service template according to the received target information to obtain a target service template corresponding to the instance to be installed.

[0080] Step 104: Send the target service template to the second device.

[0081] The target service template is used by the second device to install the instance to be installed based on the target service template.

[0082] In the embodiment of the present application, the second device is a device that belongs to the same Ambari cluster as the first device and runs a client (Agent) node. The second device includes at least one device.

[0083] The first device sends the target service template to the second device so that the second device can install the instance to be installed based on the target service template. Since the first device has the target service template for the instance to be installed installed by the second device, the first device can manage and control the instance to be installed after it is installed on the second device based on the relevant information in the target service template. Furthermore, automatically creating the target service template from the preset service template to install the instance to be installed simplifies the process of creating new instances, improves the automation level of installing the instance to be installed, and can automatically create multiple instances based on the preset service template on the first device as needed, resolving the current issue of not being able to automatically create individual instances.

[0084] The Ambari-based multi-instance creation method provided in an embodiment of the present application obtains target information of the instance to be installed, determines a preset service template corresponding to the target information, and then generates a target service template based on the target information and the preset service template, and sends the target service template to the second device. In this way, the first device automatically generates a target service template based on the target information and the preset service template, and sends it to the second device, so that the second device generates a target configuration file based on the target service template received from the first device, and installs the corresponding instance to be installed based on the generated target configuration file. This solves the current problem of being unable to automatically install and deploy multiple instances, resulting in page redundancy, and implements a multi-instance automated installation and deployment method, ensuring the simplicity of the page.

[0085] Based on the above embodiments, the embodiments of the present application provide a multi-instance creation method based on Ambari, referring to Figure 2 As shown, the method is applied to the second device of Ambari, and the method includes the following steps:

[0086] Step 201: Receive a target service template sent by a first device in an Ambari cluster.

[0087] In the embodiment of the present application, the second device is a device that belongs to the same Ambari cluster as the first device and runs a client (Agent) node. The second device includes at least one device.

[0088] Step 202: Generate a target service configuration file based on the target service template.

[0089] In the embodiment of the present application, after receiving the target service template, the second device dynamically generates a target service configuration file based on the target service template.

[0090] Step 203: Use the target configuration file to install the instance to be installed corresponding to the target configuration file.

[0091] In an embodiment of the present application, the second device configures the instance to be installed according to the target configuration file, thereby enabling the deployment of multiple instances in the same Ambari cluster.

[0092] The Ambari-based multi-instance creation method provided in an embodiment of the present application receives a target service template sent by a first device through a second device, generates a target service configuration file based on the target service template, and uses the target configuration file to install the corresponding instance to be installed according to the target configuration file. In this way, the second device generates a target configuration file based on the target service template received from the first device, and installs the corresponding instance to be installed based on the generated target configuration file. This solves the current problem of being unable to automatically install and deploy multiple instances, resulting in page redundancy, and implements a multi-instance automated installation and deployment method, ensuring page simplicity.

[0093] Based on the above embodiments, the embodiments of the present application provide a multi-instance creation method based on Ambari, referring to Figure 3 As shown, the method includes the following steps:

[0094] Step 301: The first device obtains target information of the instance to be installed.

[0095] The target information is the installation parameters when installing the instance to be installed.

[0096] In the embodiments of the present application, the target information of the instance to be installed obtained by the first device is input to the first device by a user through an input operation on a terminal device running the first device, such as a computer device. The first device receives the target information of the instance to be installed input by the user, including the target service type, first instance identification information, and target configuration information. In some application scenarios, the target service type may include at least one, and each type of target service type may include at least one first instance identification information that can be input simultaneously. Each identification information in the first instance identification information corresponds to a piece of target configuration information.

[0097] Step 302: The first device obtains the target service type of the instance to be installed from the target information.

[0098] The target service types include Kafka, a distributed publish-subscribe messaging system service, or ZooKeeper, a distributed system reliable coordination system service.

[0099] In the embodiment of the present application, in addition to Kafka and ZooKeeper, the target service type can also be other services included in the Ambari cluster, such as Hadoop.

[0100] Step 303: The first device obtains a preset service template corresponding to the target service type.

[0101] Among them, the preset service template includes: alarm parameters for the target service type, configuration information running script, target service start / stop script corresponding to the target service type, monitoring alarm script, log collection template script, and start / stop sequence script between services associated with the target service and the target service.

[0102] In the embodiment of the present application, the target service type is ZooKeeper as an example for explanation. The preset service template can be implemented in the form of code. For example, the corresponding preset service template can be shown as follows:

[0103]

[0104]

[0105]

[0106] Among them, the alarm parameters of the target service type are used to limit several alarms for ZooKeeper and the delay when the alarm is issued; the configuration information running script mainly sets some default configuration parameters and configuration parameters that can be replaced according to needs; the target service start / stop script corresponding to the target service type is used to limit when the target service starts and when it stops running, thereby realizing target service status detection and availability service detection; the monitoring alarm script includes alarm information when the alarm conditions are met.

[0107] For example, the specific code content of the ZooKeeper instance alert template, i.e., the above alerts, can be as follows:

[0108]

[0109]

[0110] Step 304: The first device obtains first instance identification information and target configuration information of the instance to be installed from the target information.

[0111] Step 305: The first device generates a target service template based on the first instance identification information, the target configuration information, and the preset service template.

[0112] In the embodiment of the present application, the first device replaces the relevant information in the preset service template with the first instance identification information and the target configuration information, thereby obtaining the target service template corresponding to the first instance identification information. In this way, by having preset service templates for commonly used big data services built into the first device, after receiving the first instance identification information and target configuration information sent by the user, multiple instances can be managed by simply configuring the page by entering the name of the newly added instance.

[0113] Step 306: The first device sends the target service template to the second device.

[0114] The target service template is used by the second device to install the instance to be installed based on the target service template.

[0115] In the embodiment of the present application, the first device and the second device can communicate through the Internet.

[0116] Step 307: The second device receives the target service template sent by the first device of the Ambari cluster.

[0117] Step 308: The second device generates a target service configuration file based on the target service template.

[0118] Step 309: The second device uses the target configuration file to configure the instance to be installed, and installs the instance to be installed corresponding to the target configuration file.

[0119] It should be noted that, for the description of the same steps and contents in this embodiment as those in other embodiments, reference can be made to the description in other embodiments and will not be repeated here.

[0120] The multi-instance creation method based on Ambari provided in the embodiment of the present application obtains the target information of the instance to be installed and determines the preset service template corresponding to the target information. Then, based on the target information and the preset service template, a target service template is generated and sent to the second device. The second device receives the target service template sent by the first device and generates a target service configuration file based on the target service template. The target configuration file is used to install the instance to be installed corresponding to the target configuration file. In this way, the first device automatically generates the target service template based on the target information and the preset service template and sends it to the second device, so that the second device generates the target configuration file based on the target service template sent by the first device and installs the corresponding instance to be installed based on the generated target configuration file. This solves the current problem of not being able to automatically install and deploy multiple instances, resulting in page redundancy, realizes a multi-instance automated installation and deployment method, and ensures the simplicity of the page. A large number of service templates of different service types are pre-set in the first device so that the preset service template corresponding to the target service type can be quickly obtained. In this way, when determining the service of the target service type, the preset service template is directly called, which effectively improves the resource utilization of the node and reduces the waste of CPU resources.

[0121] Based on the above embodiments, the embodiments of the present application provide a multi-instance creation method based on Ambari, referring to Figure 4 As shown, the method includes the following steps:

[0122] Step 401: The first device obtains target information of the instance to be installed.

[0123] The target information is the installation parameters when installing the instance to be installed.

[0124] In an embodiment of the present application, when the first device obtains target information of the instance to be installed, the target information that needs to be input by the user can be displayed on a pre-set display interface.

[0125] Step 402: The first device obtains the target service type of the instance to be installed from the target information.

[0126] The target service types include Kafka, a distributed publish-subscribe messaging system service, or ZooKeeper, a distributed system reliable coordination system service.

[0127] In an embodiment of the present application, the user first inputs the target service type of the instance to be installed in the target information on the currently displayed interface.

[0128] Step 403: The first device obtains a preset service template corresponding to the target service type.

[0129] Among them, the preset service template includes: alarm parameters for the target service type, configuration information running script, target service start / stop script corresponding to the target service type, monitoring alarm script, log collection template script, and start / stop sequence script between services associated with the target service and the target service.

[0130] Step 404: The first device obtains first instance identification information from the target information.

[0131] In the embodiment of the present application, after the first device executes step 404, it may choose to execute step 405 and steps 407 to 412, or execute step 406 and steps 407 to 412.

[0132] Step 405: If the first instance identification information is different from the currently stored instance identification information, the first device obtains target configuration information from the target information.

[0133] Step 406: If the first instance identification information is the same as the currently stored instance identification information, the first device generates prompt information for prompting the user to enter the second instance identification information of the instance to be installed, until the entered second instance identification information is different from the currently stored instance identification information, and obtains the target configuration information from the target information.

[0134] The first instance identification information is different from the second instance identification information.

[0135] Step 407: The first device uses the first instance identification information and the target configuration information to replace the corresponding content in the preset service template to obtain the target service template.

[0136] Step 408: The first device obtains the device identification information of the second device and identifies the second device.

[0137] The second device includes at least one device.

[0138] In an embodiment of the present application, the device identification information of the second device may be input by the user, that is, the user selects which second devices to install the instance to be installed corresponding to the target service type. In this case, when the user selects the second device, he or she may also choose to install the corresponding instance to be installed on the first device. The second device includes at least one device.

[0139] Step 409: The first device sends the target service template to the second device.

[0140] The target service template is used by the second device to install the instance to be installed based on the target service template.

[0141] Step 410: The second device receives the target service template sent by the first device of the Ambari cluster.

[0142] Step 411: The second device generates a target service configuration file based on the target service template.

[0143] Step 412: The second device uses the target configuration file to configure the instance to be installed, and installs the instance to be installed corresponding to the target configuration file.

[0144] In other embodiments of this application, refer to Figure 5 As shown, after step 412, the first device may further perform steps 413 to 414:

[0145] Step 413: The first device receives a deletion instruction for the third instance identification information displayed on the current display interface.

[0146] The current display interface is used to display installed instances.

[0147] In an embodiment of the present application, the third instance identification information currently displayed on the display interface refers to the identification information of the instance to be deleted, which is currently deployed in the Ambari cluster and can be managed and controlled by the first device. In some application scenarios, the third instance identification information can be the identification information of an installed instance. In some application scenarios, the third instance identification information can also be the identification information of at least two installed instances, that is, to implement batch deletion management.

[0148] Step 414: The first device responds to the deletion instruction and deletes the third instance identification information.

[0149] In an embodiment of the present application, when the first device responds to a delete instruction, only the display icon corresponding to the third instance identification information displayed on the current display interface is deleted, and the corresponding running script stored in the background, i.e., the target configuration file and the target service template, may not be deleted. However, in some application scenarios, it can also be set to delete the target configuration file and the target service template corresponding to the third instance identification information deployed in the Ambari cluster at the same time as the third instance identification information is deleted. Whether to delete the target configuration file and the target service template corresponding to the third instance identification information can be determined according to the user's settings. In this way, multiple instances can be scaled up or down, that is, when a service needs to be expanded or deleted, the expansion or deletion operation can be conveniently performed.

[0150] It should be noted that steps 413 to 414 can also be executed by the second device. When the first device and the second device execute steps 413 to 414, they are not executed after a specific step. As long as the first device or the second device receives a deletion instruction for the third instance identification information displayed on the current display interface, steps 413 to 414 are executed.

[0151] In other embodiments of this application, refer to Figure 6 As shown, after step 405, the first device may further perform step 415:

[0152] Step 415: If a cancel instruction is received, the first device exits the current display interface for obtaining target configuration information.

[0153] In an embodiment of the present application, the cancel instruction can be used to indicate the cancellation of the configuration process, and correspondingly, the first device will exit the display interface currently displayed for obtaining the target configuration information.

[0154] In an embodiment of the present application, after the first device receives the cancel instruction, it exits the current display interface used to obtain the target configuration information, and the corresponding operation is no longer performed, but steps 413 to 414 can be selected for execution based on whether a deletion instruction is received for the third instance identification information displayed on the current display interface.

[0155] For example, during the application process, the user can create a demand instance according to the method of this application as shown in Figure 7, using different ZooKeeper instances for different services. Among them, the distributed file system (Hadoop Distributed FileSystem, HDFS), the distributed resource management system (Yet Another Resource Negotiator, YARN) and the memory readout (Memory Read, MR) use ZooKeeper instance group 1 instance; Kafka1, Kafka2 and Kafka3 use ZooKeeper instance group 2; ...; the storage database (Hadoop Database, HBase) and others use ZooKeeper instance group n; wherein n is an integer greater than or equal to 1, and the specific value of n is determined by the actual needs of the user. It should be noted that the objects and quantity included in each ZooKeeper instance group are specifically determined by the actual needs of the user. This is only an example and does not impose any limitation.

[0156] Alternatively, the user can create a demand instance according to the application method as follows Figure 8As shown, different ZooKeeper instances are used for different Kafka instance groups. Kafka4, Kafka5, and Kafka6 use ZooKeeper instance group 1; Kafka7, Kafka8, and Kafka9 use ZooKeeper instance group 2; and Kafka10, Kafka11, and Kafka12 use ZooKeeper instance group m, where m is an integer greater than or equal to 1. The specific value of m depends on actual user needs. It should be noted that the objects and number of instances included in each ZooKeeper instance group are determined by actual user needs. This is for illustrative purposes only and is not intended to be limiting.

[0157] Alternatively, the user can create a demand instance according to the application method as follows Figure 9 As shown, different Kafka instances share a single ZooKeeper instance. Kafka instance group 1, which includes Kafka A, Kafka B, and Kafka C; Kafka instance group 2, which includes Kafka D, KafkaE, and KafkaF; and Kafka instance group p, which includes KafkaG, KafkaH, and KafkaI, all share a single ZooKeeper instance. Here, p is an integer greater than or equal to 1, and the specific value of p depends on actual user needs. It should be noted that the objects and number of instances included in each ZooKeeper instance group are determined by actual user needs. This is provided for illustrative purposes only and is not intended to be limiting.

[0158] It should be noted that, for the description of the same steps and contents in this embodiment as those in other embodiments, reference can be made to the description in other embodiments and will not be repeated here.

[0159] The multi-instance creation method based on Ambari provided in the embodiment of the present application obtains the target information of the instance to be installed and determines the preset service template corresponding to the target information. Then, based on the target information and the preset service template, a target service template is generated and sent to the second device. The second device receives the target service template sent by the first device and generates a target service configuration file based on the target service template. The target configuration file is used to install the instance to be installed corresponding to the target configuration file. In this way, the first device automatically generates the target service template based on the target information and the preset service template and sends it to the second device, so that the second device generates the target configuration file based on the target service template sent by the first device and installs the corresponding instance to be installed based on the generated target configuration file. This solves the current problem of not being able to automatically install and deploy multiple instances, resulting in page redundancy, and realizes a multi-instance automated installation and deployment method, ensuring the simplicity of the page. It makes full use of existing machine resources and can deploy, configure, monitor and alarm multiple instances, so that users can perceive instance changes and handle exceptions in a timely manner; it supports Kafka and ZooKeeper multi-instance management, and can deploy multiple instances of the same service on multiple nodes according to actual storage needs, thereby improving node resource utilization and reducing CPU resource waste; in addition, through the deployment of multiple Kafka instances, the flexibility of using Kafka instances is enhanced, the use of configuration groups is reduced, and the fault tolerance performance of the product is improved; the use of configuration groups is reduced, and the flexibility of product management is increased; new instances are managed through different ZooKeeper instances, and deployment management will not affect previously deployed Hadoop clusters.

[0160] Based on the above embodiments, the embodiments of the present application provide a first device which can be applied to Figure 1 、 3 In the Ambari-based multi-instance creation method provided in the embodiments corresponding to 6, refer to Figure 10 As shown, the first device 6 may include: a first memory 61, a first processor 62 and a first communication bus 63; wherein:

[0161] A first memory 61, for storing executable instructions;

[0162] A first communication bus 63 is used to implement communication between the first processor 62 and the first memory 61;

[0163] The first processor 62 is configured to execute the Ambari-based multi-instance creation program stored in the first memory to implement the following steps:

[0164] Obtain target information of the instance to be installed; wherein the target information is the installation parameters when installing the instance to be installed;

[0165] Determine a preset service template corresponding to the target information; wherein the preset service template is a pre-configured template for implementing a basic service of the target information;

[0166] Generate a target service template based on the target information and the preset service template;

[0167] Sending the target service template to the second device; wherein the target service template is used for the second device to install the instance to be installed based on the target service template.

[0168] In other embodiments of the present application, when the first processor executes the step of determining the preset service template corresponding to the target information, it can be specifically implemented by the following steps:

[0169] Get the target service type of the instance to be installed from the target information;

[0170] Get the preset service template corresponding to the target service type.

[0171] In other embodiments of the present application, when the first processor generates a target service template based on the target information and the preset service template in the execution step, it can be specifically implemented by the following steps:

[0172] Obtaining first instance identification information and target configuration information of the instance to be installed from the target information;

[0173] A target service template is generated based on the first instance identification information, the target configuration information, and the preset service template.

[0174] In other embodiments of the present application, when the first processor executes the step of obtaining the first instance identification information and target configuration information of the instance to be installed from the target information, it can be specifically implemented by the following steps:

[0175] Obtaining first instance identification information from the target information;

[0176] If the first instance identification information is different from the currently stored instance identification information, obtaining target configuration information from the target information;

[0177] If the first instance identification information is the same as the currently stored instance identification information, a prompt message is generated to prompt the user to enter the second instance identification information of the instance to be installed, until the entered second instance identification information is different from the currently stored instance identification information, and the target configuration information is obtained from the target information; wherein the first instance identification information is different from the second instance identification information.

[0178] In other embodiments of the present application, when the first processor generates a target service template based on the first instance identification information, the target configuration information, and the preset service template, the following steps may be performed:

[0179] Generate a target service template based on the first instance identification information, the target configuration information and the preset service template;

[0180] Correspondingly, before executing the step of sending the target service template to the second device, the first processor is further configured to execute the following steps:

[0181] Obtain device identification information of a second device to determine the second device; wherein the second device includes at least one device.

[0182] In other embodiments of the present application, the preset service template includes: alarm parameters for the target service type, configuration information running script, target service start / stop script corresponding to the target service type, monitoring alarm script, log collection template script, and start / stop sequence script between services associated with the target service and the target service.

[0183] In other embodiments of the present application, after executing the step of obtaining the first instance identification information and target configuration information of the instance to be installed, the first processor is further configured to execute the following steps:

[0184] If a cancel command is received, exit the current display interface for obtaining target configuration information.

[0185] In other embodiments of the present application, the target service type includes the distributed publish-subscribe messaging system service Kafka or the distributed system reliable coordination system service ZooKeeper.

[0186] In other embodiments of the present application, the first processor is further configured to perform the following steps:

[0187] Receiving a deletion instruction for third instance identification information displayed on a current display interface; wherein the current display interface is used to display installed instances;

[0188] In response to the deletion instruction, the third instance identification information is deleted. It should be noted that the specific implementation process of information interaction between the components in the first device of this embodiment can refer to Figure 1 、 3 The implementation process of the multi-instance creation method based on Ambari provided in the embodiments corresponding to 6 will not be repeated here.

[0189] The first device provided in the embodiment of the present application obtains the target information of the instance to be installed, determines the preset service template corresponding to the target information, and then generates the target service template based on the target information and the preset service template, and sends the target service template to the second device. In this way, the first device automatically generates the target service template through the target information and the preset service template, and sends it to the second device, so that the second device generates a target configuration file based on the target service template sent by the first device, and installs the corresponding instance to be installed based on the generated target configuration file, which solves the current problem of not being able to automatically install and deploy multiple instances, resulting in page redundancy, realizes a multi-instance automated installation and deployment method, and ensures the simplicity of the page. A large number of service templates of different service types are pre-set in the first device, so that the preset service template corresponding to the target service type can be quickly obtained, which effectively improves the resource utilization of the node and reduces the waste of CPU resources.

[0190] Based on the above embodiments, the embodiments of the present application provide a second device which can be applied to Figures 2 to 6 In the Ambari-based multi-instance creation method provided in the corresponding embodiment, refer to Figure 11 As shown, the second device 7 may include: a second memory 71, a second processor 72 and a second communication bus 73; wherein:

[0191] A second memory 71, for storing executable instructions;

[0192] A second communication bus 73 is used to implement communication between the second processor 72 and the second memory 71;

[0193] The second processor 72 is configured to execute the Ambari-based multi-instance creation program stored in the second memory to implement the following steps:

[0194] Receive a target service template sent by the first device of the Ambari cluster;

[0195] Generate target service configuration file based on target service template;

[0196] Use the target configuration file to install the instance to be installed corresponding to the target configuration file.

[0197] It should be noted that the specific implementation process of information interaction between the components in the second device of this embodiment can be referred to Figures 2 to 6 The implementation process of the Ambari-based multi-instance creation method provided in the corresponding embodiment will not be repeated here.

[0198] The second device provided in the embodiment of the present application receives the target service template sent by the first device through the second device, and generates a target service configuration file based on the target service template. The target configuration file is then used to install the corresponding instance to be installed according to the target configuration file. In this way, the second device generates a target configuration file based on the target service template sent by the first device, and installs the corresponding instance to be installed based on the generated target configuration file. This solves the current problem of being unable to automatically install and deploy multiple instances, resulting in page redundancy, and implements a multi-instance automated installation and deployment method, ensuring the simplicity of the page.

[0199] Based on the above embodiments, the embodiments of the present application provide a multi-instance creation platform based on Ambari, which can be applied to Figures 1 to 6 In the Ambari-based multi-instance creation method provided in the corresponding embodiment, refer to Figure 12 As shown, the Ambari-based multi-instance creation platform 8 may include: a first device 81 and a second device 82, wherein:

[0200] The first device 81 is configured to obtain target information of the instance to be installed, wherein the target information is installation parameters for installing the instance to be installed; determine a preset service template corresponding to the target information, wherein the preset service template is a preconfigured template for implementing the basic service of the target information; generate a target service template based on the target information and the preset service template; and send the target service template to the second device;

[0201] The second device 82 is configured to receive the target service template sent by the first device; generate a target service configuration file based on the target service template; and use the target configuration file to install the instance to be installed corresponding to the target configuration file.

[0202] In other embodiments of the present application, when the first device performs the step of determining the preset service template corresponding to the target information, it can be specifically implemented by the following steps:

[0203] Get the target service type of the instance to be installed from the target information;

[0204] Get the preset service template corresponding to the target service type.

[0205] In other embodiments of the present application, when the first device generates a target service template based on the target information and the preset service template in the execution step, it can be specifically implemented by the following steps:

[0206] Obtaining first instance identification information and target configuration information of the instance to be installed from the target information;

[0207] A target service template is generated based on the first instance identification information, the target configuration information, and the preset service template.

[0208] In other embodiments of the present application, when the first device executes the step of obtaining the first instance identification information and target configuration information of the instance to be installed from the target information, it can be specifically implemented by the following steps:

[0209] Obtaining first instance identification information from the target information;

[0210] If the first instance identification information is different from the currently stored instance identification information, obtaining target configuration information from the target information;

[0211] If the first instance identification information is the same as the currently stored instance identification information, a prompt message is generated to prompt the user to enter the second instance identification information of the instance to be installed, until the entered second instance identification information is different from the currently stored instance identification information, and the target configuration information is obtained from the target information; wherein the first instance identification information is different from the second instance identification information.

[0212] In other embodiments of the present application, when the first device generates a target service template based on the first instance identification information, the target configuration information, and the preset service template, the following steps may be performed:

[0213] Replacing corresponding content in a preset service template with the first instance identification information and the target configuration information to obtain a target service template;

[0214] Correspondingly, before executing the step of sending the target service template to the second device, the first device is further configured to execute the following steps:

[0215] Obtain device identification information of a second device to determine the second device; wherein the second device includes at least one device.

[0216] In other embodiments of the present application, the preset service template includes: alarm parameters for the target service type, configuration information running script, target service start / stop script corresponding to the target service type, monitoring alarm script, log collection template script, and start / stop sequence script between services associated with the target service and the target service.

[0217] In other embodiments of the present application, after executing the step of obtaining the first instance identification information and target configuration information of the instance to be installed, the first device is further configured to execute the following steps:

[0218] If a cancel command is received, exit the current display interface for obtaining target configuration information.

[0219] In other embodiments of the present application, the target service type includes the distributed publish-subscribe messaging system service Kafka or the distributed system reliable coordination system service ZooKeeper.

[0220] In other embodiments of the present application, the first device is further configured to perform the following steps:

[0221] Receiving a deletion instruction for third instance identification information displayed on a current display interface; wherein the current display interface is used to display installed instances;

[0222] In response to the deletion instruction, the third instance identification information is deleted. It should be noted that the specific implementation process of information interaction between units and modules in the multi-instance creation platform based on Ambari in this embodiment can be referred to. Figures 1 to 6 The implementation process of the Ambari-based multi-instance creation method provided in the corresponding embodiment will not be repeated here.

[0223] The multi-instance creation platform based on Ambari provided by the embodiment of the present application obtains the target information of the instance to be installed and determines the preset service template corresponding to the target information. Then, based on the target information and the preset service template, it generates the target service template and sends the target service template to the second device. The second device receives the target service template sent by the first device and generates a target service configuration file based on the target service template. The target configuration file is used to install the instance to be installed corresponding to the target configuration file. In this way, the first device automatically generates the target service template based on the target information and the preset service template and sends it to the second device, so that the second device generates the target configuration file based on the target service template sent by the first device and installs the corresponding instance to be installed based on the generated target configuration file. This solves the current problem of not being able to automatically install and deploy multiple instances, resulting in page redundancy, and realizes a multi-instance automated installation and deployment method, ensuring the simplicity of the page. It makes full use of existing machine resources and can deploy, configure, monitor and alarm multiple instances, so that users can perceive instance changes and handle exceptions in a timely manner; it supports Kafka and ZooKeeper multi-instance management, and can deploy multiple instances of the same service on multiple nodes according to actual storage needs, thereby improving node resource utilization and reducing CPU resource waste; in addition, through the deployment of multiple Kafka instances, the flexibility of using Kafka instances is enhanced, the use of configuration groups is reduced, and the fault tolerance performance of the product is improved; the use of configuration groups is reduced, and the flexibility of product management is increased; new instances are managed through different ZooKeeper instances, and deployment management will not affect previously deployed Hadoop clusters.

[0224] Based on the above embodiments, the embodiments of the present application provide a computer-readable storage medium, referred to as a storage medium, which stores one or more programs, which can be executed by one or more processors to implement the reference Figures 1 to 6The implementation process of the Ambari-based multi-instance creation method provided in the corresponding embodiment will not be repeated here.

[0225] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of hardware embodiments, software embodiments, or embodiments combining software and hardware. Furthermore, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage and optical storage, etc.) containing computer-usable program code.

[0226] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable device to produce a machine, so that the instructions executed by the processor of the computer or other programmable device generate instructions for implementing the steps in the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0227] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.

[0228] These computer program instructions can also be loaded onto a computer or other programmable device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions executed on the computer or other programmable device for implementing the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.

[0229] The above description is merely a preferred embodiment of the present application and is not intended to limit the scope of protection of the present application.

Claims

1. A multi-instance creation method based on Ambari, characterized in that: The method is applied to a first electronic device in an Ambari cluster, and the method includes: Obtain target information of the instance to be installed; wherein the target information is installation parameters when installing the instance to be installed; Determine a preset service template corresponding to the target information; wherein the preset service template is a pre-configured template for implementing the basic service of the target information, and is a script template for creating the instance to be installed; generating a target service template based on the target information and the preset service template; Sending the target service template to a second electronic device; wherein the target service template is used for the second electronic device to install the instance to be installed based on the target service template; The determining of the preset service template corresponding to the target information includes: Obtaining a target service type of the instance to be installed from the target information; Acquire the preset service template corresponding to the target service type.

2. The method according to claim 1, characterized in that The generating a target service template based on the target information and the preset service template includes: Acquire the first instance identification information and target configuration information of the instance to be installed from the target information; The target service template is generated based on the first instance identification information, the target configuration information and the preset service template.

3. The method according to claim 2, characterized in that The acquiring, from the target information, the first instance identification information and the target configuration information of the instance to be installed includes: Obtaining the first instance identification information from the target information; If the first instance identification information is different from the currently stored instance identification information, obtaining the target configuration information from the target information; If the first instance identification information is the same as the currently stored instance identification information, a prompt message is generated to prompt the user to enter the second instance identification information of the instance to be installed, until the entered second instance identification information is different from the currently stored instance identification information, and the target configuration information is obtained from the target information; wherein the first instance identification information is different from the second instance identification information.

4. The method according to claim 2 or 3, characterized in that The generating the target service template based on the first instance identification information, the target configuration information, and the preset service template includes: Replacing corresponding content in the preset service template with the first instance identification information and the target configuration information to obtain the target service template; Correspondingly, before sending the target service template to the second electronic device, the method further includes: Acquire device identification information of a second electronic device to determine the second electronic device; wherein the second electronic device includes at least one device.

5. The method according to any one of claims 1 to 3, characterized in that: The preset service template includes: alarm parameters for the target service type, configuration information running script, target service start / stop script corresponding to the target service type, monitoring alarm script, log collection template script, and start / stop sequence script between services associated with the target service and the target service.

6. The method according to claim 2, characterized in that After obtaining the first instance identification information and target configuration information of the instance to be installed, the method further includes: If a cancel instruction is received, the current display interface for obtaining the target configuration information is exited.

7. The method according to claim 1, characterized in that The target service type includes a distributed publish-subscribe messaging system service Kafka or a distributed system reliable coordination system service ZooKeeper.

8. The method according to claim 1, characterized in that The method further comprises: Receiving a deletion instruction for third instance identification information displayed on a current display interface, wherein the current display interface is used to display installed instances; In response to the deletion instruction, the third instance identification information is deleted.

9. A multi-instance creation method based on Ambari, characterized in that: The method is applied to a second electronic device in an Ambari cluster, and the method includes: Receiving a target service template sent by the first electronic device of the Ambari cluster; wherein the target service template is generated by the first electronic device based on a preset service template corresponding to the target service type of the instance to be installed and the target information of the instance to be installed, and the preset service template is a script template for creating the instance to be installed; generating a target service configuration file based on the target service template; The target service configuration file is used to install the instance to be installed corresponding to the target service configuration file.

10. A first electronic device, characterized in that: The device includes a first memory, a first processor and a first communication bus; wherein: The first memory is used to store executable instructions; The first communication bus is used to implement a communication connection between the first processor and the first memory; The first processor is configured to execute the Ambari-based multi-instance creation program stored in the first memory to implement the following steps: Obtain target information of the instance to be installed; wherein the target information is installation parameters when installing the instance to be installed; Determine a preset service template corresponding to the target information; wherein the preset service template is a pre-configured template for implementing the basic service of the target information, and is a script template for creating the instance to be installed; generating a target service template based on the target information and the preset service template; Sending the target service template to a second electronic device; wherein the target service template is used for the second electronic device to install the instance to be installed based on the target service template; The determining of the preset service template corresponding to the target information includes: Obtaining a target service type of the instance to be installed from the target information; Acquire the preset service template corresponding to the target service type.

11. A second electronic device, characterized in that: The device includes a second memory, a second processor, and a second communication bus; wherein: The second memory is used to store executable instructions; The second communication bus is used to implement a communication connection between the second processor and the second memory; The second processor is configured to execute the Ambari-based multi-instance creation program stored in the second memory to implement the following steps: Receiving a target service template sent by a first electronic device of an Ambari cluster; wherein the target service template is generated by the first electronic device based on a preset service template corresponding to a target service type of the instance to be installed and target information of the instance to be installed, and the preset service template is a script template for creating the instance to be installed; generating a target service configuration file based on the target service template; The target service configuration file is used to install the instance to be installed corresponding to the target service configuration file.

12. A multi-instance creation system based on Ambari, characterized in that: The system includes: a first electronic device and a second electronic device; wherein: The first electronic device is configured to obtain target information of an instance to be installed, wherein the target information is installation parameters when installing the instance to be installed; determine a preset service template corresponding to the target information; wherein the preset service template is a pre-configured template for implementing a basic service of the target information, and is a script template for creating the instance to be installed; generate a target service template based on the target information and the preset service template; and send the target service template to the second electronic device; Wherein, the determining of the preset service template corresponding to the target information includes: acquiring the target service type of the instance to be installed from the target information; Acquire the preset service template corresponding to the target service type; The second electronic device is configured to receive the target service template sent by the first electronic device; generate a target service configuration file based on the target service template; and install the to-be-installed instance corresponding to the target service configuration file using the target service configuration file.

13. A storage medium, characterized in that: The storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the steps of the Ambari-based multi-instance creation method according to any one of claims 1 to 8 or claim 9.

Citation Information

Patent Citations

  • Automatic Solr service deploying and monitoring method and device

    CN106961359A