Summary of the invention
The embodiment of the invention provides a kind of methods for integrating Solr based on Ambari and Ambari server, it can be achieved that will
Solr is integrated into Ambari.
In a first aspect, being applied to Ambari the embodiment of the invention provides a kind of method for integrating Solr based on Ambari
Server, comprising:
S1: the corresponding file destination node of Solr serviced component is created under Ambari file directory to form target
Ambari file directory;
S2: Solr serviced component is obtained, and will be under Solr serviced component storage to the file destination node;
S3: after restarting Ambari server, the compiling instruction of the corresponding Solr serviced component is received;
S4: target Ambari is constructed according to the target Ambari file directory and the Solr serviced component.
Further,
It is described that the corresponding file destination node of Solr serviced component is created under Ambari file directory, comprising:
The corresponding target stack node of Solr serviced component is created under Ambari file directory;
The corresponding file destination node of Solr serviced component is created under the target stack node.
Further,
It include at least one history stack node under the Ambari file directory;
The Solr serviced component, comprising: description file metainfo.xml and Solr configuration file, wherein described to retouch
It states file metainfo.xml and records inheritance between the target stack node and at least one described history stack node, with
And record the mount message of the Solr configuration file.
Further,
A history file node is respectively included under each described history stack node, is stored under the history file node
At least one history serviced component;
It is described that target Ambari is constructed according to the target Ambari file directory and the Solr serviced component, comprising:
The target histories stack node of the corresponding target stack node is determined according to the inheritance;
According to the target Ambari file directory, the history file node extracted under the target stack node is stored extremely
A few target histories serviced component;
Mesh is constructed according at least one described target histories serviced component and the mount message, the Solr configuration file
Mark Ambari.
Further,
One of described at least one history serviced component, including following serviced component are a variety of:
ZOOKEEPER, HDFS (Hadoop Distributed File System, distributed file system) and YARN
(Yet Another Resource Negotiator, another resource coordination person).
Second aspect, the embodiment of the invention provides a kind of Ambari servers, comprising:
Setup module, for creating the corresponding file destination node of Solr serviced component under Ambari file directory with shape
At target Ambari file directory;
Processing module is stored, is stored for obtaining Solr serviced component, and by the Solr serviced component to the target
Under file node;
Command reception module, for after restarting Ambari server, receiving the volume of the corresponding Solr serviced component
Translate instruction;
Process of compilation module, for constructing target according to the target Ambari file directory and the Solr serviced component
Ambari。
Further, the setup module, comprising:
First setting subelement, for creating the corresponding goal stack section of Solr serviced component under Ambari file directory
Point;
Second setting subelement, for creating the corresponding file destination section of Solr serviced component under the target stack node
Point.
Further,
It include at least one history stack node under the Ambari file directory;
The Solr serviced component, comprising: description file metainfo.xml and Solr configuration file, wherein described to retouch
It states file metainfo.xml and records inheritance between the target stack node and at least one described history stack node, with
And record the mount message of the Solr configuration file.
Further,
The process of compilation module, comprising:
Subelement is determined, for determining the target histories stack section of the corresponding target stack node according to the inheritance
Point;
Subelement is extracted, for extracting the history under the target stack node according to the target Ambari file directory
At least one target histories serviced component of file node storage;
Subelement is compiled, for according at least one described target histories serviced component and the mount message, described
Solr configuration file constructs target Ambari.
Further,
One of described at least one history serviced component, including following serviced component are a variety of:
ZOOKEEPER, HDFS and YARN.
The embodiment of the invention provides a kind of method and Ambari server for integrating Solr based on Ambari, by
The corresponding file destination node of Solr serviced component is created under Ambari file directory in Ambari server to form target
Ambari file directory, and by under the storage to the file destination node of target Ambari file directory of Solr serviced component, it utilizes
Ambari server needs the characteristics of scanning file node after restart, under the scanning to file destination node of Ambari server
After the Solr serviced component of storage, the compiling of corresponding Solr serviced component ready to receive is instructed, and then according to target Ambari text
Solr is integrated in the building of Solr serviced component the target Ambari, target Ambari stored under part catalogue and file destination node
Serviced component;As it can be seen that the technical solution provided through the invention is, it can be achieved that be integrated into Ambari for Solr.
Specific embodiment
In order to make the object, technical scheme and advantages of the embodiment of the invention clearer, below in conjunction with the embodiment of the present invention
In attached drawing, technical scheme in the embodiment of the invention is clearly and completely described, it is clear that described embodiment is
A part of the embodiment of the present invention, instead of all the embodiments, based on the embodiments of the present invention, those of ordinary skill in the art
Every other embodiment obtained without making creative work, shall fall within the protection scope of the present invention.
As shown in Figure 1, being applied to Ambari the embodiment of the invention provides a kind of method for integrating Solr based on Ambari
Server, comprising:
S1: the corresponding file destination node of Solr serviced component is created under Ambari file directory to form target
Ambari file directory;
S2: Solr serviced component is obtained, and will be under Solr serviced component storage to the file destination node;
S3: after restarting Ambari server, the compiling instruction of the corresponding Solr serviced component is received;
S4: target Ambari is constructed according to the target Ambari file directory and the Solr serviced component.
In the above embodiment of the present invention, by creating Solr service under the Ambari file directory in Ambari server
The corresponding file destination node of component is stored Solr serviced component to target with forming target Ambari file directory
Under the file destination node of Ambari file directory, need to scan the spy of file node after restart using Ambari server
Point, after the Solr serviced component stored under Ambari server is scanned to file destination node, corresponding Solr clothes ready to receive
The compiling instruction of business component, and then according to the Solr serviced component stored under target Ambari file directory and file destination node
Target Ambari is constructed, is integrated with Solr serviced component in target Ambari;As it can be seen that the technical solution provided through the invention,
It can be achieved Solr being integrated into Ambari.
Further, since Ambari server is when different time sections are managed cluster, may use have not
With the Ambari of service item, i.e., there may be multiple Ambari versions in Ambari server, in order to enable being integrated with Solr
Target Ambari be different from the Ambari of other versions, it is described in Ambari file mesh in a preferred embodiment of the invention
The corresponding file destination node of the lower creation Solr serviced component of record, comprising:
The corresponding target stack node of Solr serviced component is created under Ambari file directory;
The corresponding file destination node of Solr serviced component is created under the target stack node.
Further, in order to improve working efficiency, no longer for already existing server component in Amabari server
It is developed respectively, includes at least one history stack section under the Ambari file directory in a preferred embodiment of the invention
Point;
The Solr serviced component, comprising: description file metainfo.xml and Solr configuration file, wherein described to retouch
It states file metainfo.xml and records inheritance between the target stack node and at least one described history stack node, with
And record the mount message of the Solr configuration file.
In the above embodiment of the present invention, description file metainfo.xml records the target stack node and described at least one
Inheritance between a history stack node is realized and is recorded in the target Ambari and Ambari server that will be constructed
Inheritance between existing Ambari, so that the target Ambari that will be constructed can directly be inherited in Ambari server
Through whole serviced components in an existing Ambari.
Correspondingly, in order to realize that target Ambari is directly inherited in Ambari server in an already existing Ambari
Whole serviced components;In a preferred embodiment of the invention, a history is respectively included under each described history stack node
File node stores at least one history serviced component under the history file node;
It is described that target Ambari is constructed according to the target Ambari file directory and the Solr serviced component, comprising:
The target histories stack node of the corresponding target stack node is determined according to the inheritance;
According to the target Ambari file directory, the history file node extracted under the target stack node is stored extremely
A few target histories serviced component;
Mesh is constructed according at least one described target histories serviced component and the mount message, the Solr configuration file
Mark Ambari.
Specifically, in a preferred embodiment of the invention, at least one described history serviced component, including service group as follows
One of part is a variety of:
ZOOKEEPER, HDFS and YARN.
As shown in Fig. 2, the embodiment of the invention provides a kind of method for integrating Solr based on Ambari, with need to construct
It, can be with for target Ambari directly inherits whole serviced components in Ambari server in an already existing Ambari
Include the following steps:
Step 201, the corresponding target of Solr serviced component is created under the Ambari file directory in Ambari server
Stack node.
In the embodiment of the present invention, target stack node is used to describe to integrate Solr in Ambari with the target Ambari's that is formed
Version information.
It should be noted that can have multiple history stack nodes under Ambari file directory in Ambari server, i.e.,
The Ambari for having multiple versions.
Step 202, the corresponding file destination node of Solr serviced component is created under target stack node.
In the embodiment of the present invention, created under file destination node, that is, target stack node for storage service component
Service node.
Step 203, Ambari server obtains Solr serviced component.
In the embodiment of the present invention, Solr serviced component includes description file metainfo.xml and Solr configuration file,
In, the description file metainfo.xml record between the target stack node and at least one described history stack node after
Relationship is held, and, record the mount message of the Solr configuration file;It should be understood that Solr serviced component can also wrap
Include alternative document, such as command script etc..
In the embodiment of the present invention, description file metainfo.xml record the target stack node with it is described at least one go through
Inheritance between history stack node is realized and is had existed in the target Ambari and Ambari server recorded and will constructed
Ambari between inheritance deposited in Ambari server so that the target Ambari that will be constructed can be inherited directly
An Ambari in whole serviced components.
It should be noted that Solr serviced component can be based on AFS (Advanced Streaming Format, it is advanced
Stream format) protocol development Solr serviced component.
It should also be noted that,
Step 204, Ambari server stores Solr serviced component under file destination node.
Step 205, restart Ambari server.
Step 206, Ambari server traverses target Ambari file directory, and Solr serviced component storage is arrived
Ambari database.
Step 207, the Solr clothes stored in Ambari database of the Ambari client by inquiry Ambari server
Business component, to send the compiling instruction of corresponding Solr serviced component to Ambari server.
In the embodiment of the present invention, by the Solr serviced component stored in inquiry Ambari database, in Ambari client
End selection addition Solr service, the compiling of corresponding Solr serviced component is sent to trigger Ambari client to Ambari server
Instruction.
Step 208, Ambari server is after the compiling instruction for receiving corresponding Solr serviced component, according to description file
The inheritance of middle record determines the target histories stack node of corresponding target stack node.
Step 209, Ambari server extracts the history file under target stack node according to target Ambari file directory
At least one target histories serviced component of node storage.
For example, target histories stack is inherited when description file metainfo.xml has recorded target stack node HDP-2.1
When node HDP-2.0.6, Ambari server is the history file node of extractable target histories stack node HDP-2.0.6
At least one the target histories serviced component stored under Service.
Here, at least one target histories serviced component includes but is not limited to ZOOKEEPER, HDFS and YARN.
Step 210, Ambari server is according to the peace carried at least one target histories serviced component and description file
Fill information, Solr configuration file constructs target Ambari.
In the above-mentioned each step of the embodiment of the present invention, realizes and be integrated in building one target Ambari, target Ambari
Solr serviced component is realized Solr being integrated into Ambari;Meanwhile target Ambari can be integrated in Ambari server
Whole serviced components in an existing Ambari.
As shown in figure 3, the embodiment of the invention provides a kind of Ambari servers, comprising:
Setup module 301, for creating the corresponding file destination node of Solr serviced component under Ambari file directory
To form target Ambari file directory;
Processing module 302 is stored, is stored for obtaining Solr serviced component, and by the Solr serviced component to the mesh
It marks under file node;
Command reception module 303, for after restarting Ambari server, receiving the corresponding Solr serviced component
Compiling instruction;
Process of compilation module 304, for being constructed according to the target Ambari file directory and the Solr serviced component
Target Ambari.
Further, since Ambari server is when different time sections are managed cluster, may use have not
With the Ambari of service item, i.e., there may be multiple Ambari versions in Ambari server, in order to enable being integrated with Solr
Target Ambari be different from the Ambari of other versions, as shown in figure 4, in a preferred embodiment of the invention, the setting
Module 301, comprising:
First setting subelement 3011, for creating the corresponding goal stack of Solr serviced component under Ambari file directory
Node;
Second setting subelement 3012, for creating the corresponding target text of Solr serviced component under the target stack node
Part node.
Further, in order to improve working efficiency, no longer for already existing server component in Amabari server
It is developed respectively, includes at least one history stack section under the Ambari file directory in a preferred embodiment of the invention
Point;
The Solr serviced component, comprising: description file metainfo.xml and Solr configuration file, wherein described to retouch
It states file metainfo.xml and records inheritance between the target stack node and at least one described history stack node, with
And record the mount message of the Solr configuration file.
Further, in order to realize that target Ambari directly inherits an already existing Ambari in Ambari server
In whole serviced components;As shown in figure 4, in a preferred embodiment of the invention, the process of compilation module 304, comprising:
Subelement 3041 is determined, for determining the target histories stack of the corresponding target stack node according to the inheritance
Node;
Subelement 3042 is extracted, for extracting under the target stack node according to the target Ambari file directory
At least one target histories serviced component of history file node storage;
Subelement 3043 is compiled, for according at least one described target histories serviced component and the mount message, institute
State Solr configuration file building target Ambari.
Further, in a preferred embodiment of the invention, at least one described history serviced component, including service as follows
One of component is a variety of:
ZOOKEEPER, HDFS and YARN.
The contents such as the information exchange between each unit, implementation procedure in above-mentioned apparatus, due to implementing with the method for the present invention
Example is based on same design, and for details, please refer to the description in the embodiment of the method for the present invention, and details are not described herein again.
The each embodiment of the present invention at least has the following beneficial effects:
1, by creating the corresponding target text of Solr serviced component under the Ambari file directory in Ambari server
Solr serviced component is stored the target to target Ambari file directory to form target Ambari file directory by part node
Under file node, the characteristics of scanning file node is needed after restart using Ambari server, is scanned in Ambari server
After the Solr serviced component stored under to file destination node, the compiling of corresponding Solr serviced component ready to receive is instructed, in turn
Target Ambari, target are constructed according to the Solr serviced component stored under target Ambari file directory and file destination node
Solr serviced component is integrated in Ambari;As it can be seen that the technical solution provided through the invention is, it can be achieved that Solr is integrated into
Ambari。
2, by description file metainfo.xml record between target stack node and at least one history stack node after
Relationship is held, it, can be according to the inheritance, directly succession Ambari when building is integrated with the target Amabri of Solr serviced component
Whole serviced components in server in an already existing Ambari.
It should be noted that, in this document, such as first and second etc relational terms are used merely to an entity
Or operation is distinguished with another entity or operation, is existed without necessarily requiring or implying between these entities or operation
Any actual relationship or order.Moreover, the terms "include", "comprise" or its any other variant be intended to it is non-
It is exclusive to include, so that the process, method, article or equipment for including a series of elements not only includes those elements,
It but also including other elements that are not explicitly listed, or further include solid by this process, method, article or equipment
Some elements.In the absence of more restrictions, the element limited by sentence " including one ", is not arranged
Except there is also other identical factors in the process, method, article or apparatus that includes the element.
Those of ordinary skill in the art will appreciate that: realize that all or part of the steps of above method embodiment can pass through
The relevant hardware of program instruction is completed, and program above-mentioned can store in computer-readable storage medium, the program
When being executed, step including the steps of the foregoing method embodiments is executed;And storage medium above-mentioned includes: ROM, RAM, magnetic disk or light
In the various media that can store program code such as disk.
Finally, it should be noted that the foregoing is merely presently preferred embodiments of the present invention, it is merely to illustrate skill of the invention
Art scheme, is not intended to limit the scope of the present invention.Any modification for being made all within the spirits and principles of the present invention,
Equivalent replacement, improvement etc., are included within the scope of protection of the present invention.