CN111428114A - Index creating method and device for Elasticissearch search engine - Google Patents

Index creating method and device for Elasticissearch search engine Download PDF

Info

Publication number
CN111428114A
CN111428114A CN202010229745.0A CN202010229745A CN111428114A CN 111428114 A CN111428114 A CN 111428114A CN 202010229745 A CN202010229745 A CN 202010229745A CN 111428114 A CN111428114 A CN 111428114A
Authority
CN
China
Prior art keywords
index
node
resource group
elasticissearch
information
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202010229745.0A
Other languages
Chinese (zh)
Other versions
CN111428114B (en
Inventor
林立成
翁晓俊
王能
杨登科
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Industrial and Commercial Bank of China Ltd ICBC
Original Assignee
Industrial and Commercial Bank of China Ltd ICBC
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Industrial and Commercial Bank of China Ltd ICBC filed Critical Industrial and Commercial Bank of China Ltd ICBC
Priority to CN202010229745.0A priority Critical patent/CN111428114B/en
Publication of CN111428114A publication Critical patent/CN111428114A/en
Application granted granted Critical
Publication of CN111428114B publication Critical patent/CN111428114B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/951Indexing; Web crawling techniques

Abstract

The invention discloses an index creating method and device of an Elasticissearch search engine, wherein the method comprises the following steps: obtaining an index creation request, wherein the index creation request comprises: resource group information; determining Elasticisarch node information corresponding to the resource group information; generating index configuration according to the Elasticissearch node information; and sending the index configuration to an Elasticissearch node in the Elasticissearch node information, so that the Elasticissearch node generates an index corresponding to the index creation request according to the index configuration. The invention realizes the resource isolation of the elastic search and solves the problem that when a great amount of node resources are used by one tenant, the cluster can not provide the computing capability or the service capability to other tenants.

Description

Index creating method and device for Elasticissearch search engine
Technical Field
The invention relates to an Elasticissearch search engine, in particular to an index creating method and device of the Elasticissearch engine.
Background
The Elasticissearch cluster stores data in one or more indexes, and the indexes are collections of documents with similar characteristics.
Disclosure of Invention
The invention provides an index creating method and device for an elastic search engine, aiming at solving at least one technical problem in the background technology.
In order to achieve the above object, according to an aspect of the present invention, there is provided an index creating method of an Elasticsearch search engine, the method including:
obtaining an index creation request, wherein the index creation request comprises: resource group information;
determining Elasticisarch node information corresponding to the resource group information;
generating index configuration according to the Elasticissearch node information;
and sending the index configuration to an Elasticissearch node in the Elasticissearch node information, so that the Elasticissearch node generates an index corresponding to the index creation request according to the index configuration.
Optionally, the index creation request further includes: a first index name of an index to be created;
the index creation method of the Elasticissearch search engine further comprises the following steps:
and generating a second index name of the index to be created according to the resource group information and the first index name of the index to be created.
Optionally, the sending the index configuration to the Elasticsearch node in the Elasticsearch node information enables the Elasticsearch node to generate the index corresponding to the index creation request according to the index configuration, and specifically includes:
and sending the index configuration and the second index name to an Elasticissearch node in the Elasticissearch node information, so that the Elasticissearch node generates the index to be created according to the index configuration and the second index name.
Optionally, the method for creating an index of an Elasticsearch engine further includes:
acquiring a first operation request for performing an increasing, deleting, modifying and checking operation on data in a target index, wherein the first operation request comprises: resource group information and a first index name of the target index;
determining Elasticissearch node information corresponding to the resource group information in the first operation request;
determining a second index name of the target index according to the resource group information in the first operation request and the first index name of the target index;
and generating a second operation request according to the second index name and the first operation request, and sending the second operation request to an Elasticissearch node in Elasticissearch node information corresponding to the resource group information in the first operation request.
Optionally, the method for creating an index of an Elasticsearch engine further includes:
acquiring a node change request of a target resource group, wherein the node change request comprises: node change information;
determining all indexes corresponding to the target resource group;
and updating the index configuration of all indexes corresponding to the target resource group according to the node change information.
In order to achieve the above object, according to another aspect of the present invention, there is provided an index creating apparatus of an Elasticsearch search engine, the apparatus including:
an index creation request obtaining unit, configured to obtain an index creation request, where the index creation request includes: resource group information;
the node determining unit is used for determining Elasticissearch node information corresponding to the resource group information;
the index configuration generating unit is used for generating index configuration according to the Elasticissearch node information;
and the index creation information sending unit is used for sending the index configuration to the Elasticissearch node in the Elasticissearch node information so that the Elasticissearch node generates the index corresponding to the index creation request according to the index configuration.
Optionally, the index creation request further includes: a first index name of an index to be created;
the index creating device of the Elasticsearch engine further comprises:
and the index name generation unit is used for generating a second index name of the index to be created according to the resource group information and the first index name of the index to be created.
Optionally, the index creation information sending unit is specifically configured to send the index configuration and the second index name to an Elasticsearch node in the Elasticsearch node information, so that the Elasticsearch node generates the index to be created according to the index configuration and the second index name.
Optionally, the index creating device of the Elasticsearch engine further includes:
a data add, delete, and modify request obtaining unit, configured to obtain a first operation request for performing an add, delete, modify, and modify operation on data in a target index, where the first operation request includes: resource group information and a first index name of the target index;
a node information determining unit, configured to determine Elasticsearch node information corresponding to the resource group information in the first operation request;
an index name determining unit, configured to determine a second index name of the target index according to the resource group information in the first operation request and the first index name of the target index;
and the operation request sending unit is used for generating a second operation request according to the second index name and the first operation request, and sending the second operation request to an Elasticissearch node in Elasticissearch node information corresponding to the resource group information in the first operation request.
Optionally, the index creating device of the Elasticsearch engine further includes:
a node change request obtaining unit, configured to obtain a node change request of a target resource group, where the node change request: node change information;
the index query unit is used for determining all indexes corresponding to the target resource group;
and the index configuration updating unit is used for updating the index configurations of all indexes corresponding to the target resource group according to the node change information.
In order to achieve the above object, according to another aspect of the present invention, there is also provided a computer device, including a memory, a processor, and a computer program stored on the memory and executable on the processor, the processor implementing the steps in the index creation method of the Elasticsearch engine described above when executing the computer program.
In order to achieve the above object, according to another aspect of the present invention, there is also provided a computer-readable storage medium storing a computer program which, when executed in a computer processor, implements the steps in the index creation method of the aforementioned Elasticsearch engine.
The invention has the beneficial effects that: according to the embodiment of the invention, through setting the resource groups, each tenant corresponds to one resource group, configuring a plurality of corresponding Elasticissearch nodes for each resource group, writing the Elasticissearch nodes corresponding to the resource groups into the index configuration when generating the indexes corresponding to the resource groups, and limiting the nodes which can be used by the generated indexes, the resource isolation of the Elasticissearch is realized, and the problem that a cluster can not provide the computing capability or the service capability to other tenants can be reduced when a great amount of node resources are used by one tenant at present is solved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to these drawings without creative efforts. In the drawings:
FIG. 1 is a flow chart of an index creation method according to a first embodiment of the present invention;
FIG. 2 is a flow chart of an index creation method according to a second embodiment of the present invention;
FIG. 3 is a flowchart illustrating a first embodiment of the present invention to perform an add/delete modify operation on data in an index;
FIG. 4 is a flowchart illustrating changing nodes corresponding to resource groups according to an embodiment of the present invention;
FIG. 5 is a flowchart of an index creation method according to a third embodiment of the present invention;
FIG. 6 is a flowchart illustrating a second embodiment of the present invention to perform an add/delete modify operation on data in an index;
FIG. 7 is a diagram illustrating a usage scenario of an index creation method according to an embodiment of the present invention;
FIG. 8 is a block diagram showing the structure of an index creating apparatus according to an embodiment of the present invention;
FIG. 9 is a schematic diagram of a computer apparatus according to an embodiment of the present invention.
Detailed Description
In order to make the technical solutions of the present invention better understood, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
It should be noted that the terms "comprises" and "comprising," and any variations thereof, in the description and claims of the present invention and the above-described drawings, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
It should be noted that the embodiments and features of the embodiments may be combined with each other without conflict. The present invention will be described in detail below with reference to the embodiments with reference to the attached drawings.
The invention provides an index creating method of an Elasticissearch search engine, which realizes resource isolation of Elasticissearch. Fig. 7 is a schematic view of a usage scenario of an index creating method according to an embodiment of the present invention, and as shown in fig. 7, the present invention implements resource isolation by using a customized client and adding a service agent module. By the method, the operation and maintenance cost in the internal use of enterprises can be reduced.
When the invention uses the Elasticissearch, different Resource groups (Resource groups) are defined for the resources needing to be isolated, one Resource Group corresponds to a plurality of Elasticissearch nodes, and each Resource Group can only use the corresponding Elasticissearch node in the Elasticissearch cluster. Optionally, one "resource group" corresponds to at least 3 Elasticsearch nodes.
As shown in fig. 7, the usage scenario of the index creation method according to the embodiment of the present invention includes: the system comprises a client, a service agent module, a metadata storage module and an Elasticissearch cluster.
And the client is used by the tenant to connect the service agent module. When a client instantiates, a resource group name may be passed in, and the following interfaces may be provided:
Figure BDA0002428927320000051
and the service agent module is used for receiving and processing a request from a client by an externally accessed server, interactively acquiring the stored metadata storing the relation among the resource group, the node, the physical machine or the virtual machine with the metadata storage module, and performing data operation with the Elasticissearch cluster.
The metadata storage module may be a database, a metadata table recording the relationship among resource groups, nodes, physical machines, or virtual machines in the database includes 3 fields of a node name, an IP address, and a resource group name, and the table building statement may be as follows:
Figure BDA0002428927320000061
fig. 1 is a flowchart of an index creating method of an Elasticsearch engine according to an alternative embodiment of the present invention, and as shown in fig. 1, the index creating method of an Elasticsearch engine according to the present embodiment includes steps S101 to S104.
Step S101, an index creation request is obtained, wherein the index creation request comprises: resource group information.
In the embodiment of the invention, the service agent module receives an index creation request sent by a user through a client. Each user corresponds to one resource group, and the index creation request comprises resource group information corresponding to the user. In alternative embodiments of the present invention, the resource group information may be a resource group name or a resource group number.
Step S102, determining Elasticissearch node information corresponding to the resource group information.
In the embodiment of the invention, each resource group corresponds to a plurality of preset Elasticissearch nodes. The corresponding relation among the resource groups, the Elasticissearch nodes, the physical machines or the virtual machines is stored in the metadata storage module. In this step, the service agent module may query the Elasticsearch node information corresponding to the resource group information through accessing the metadata storage module.
Step S103, generating index configuration according to the Elasticissearch node information.
In this step, the service agent module writes the information of the Elasticsearch node corresponding to the resource group into the index configuration of the index to be generated, and the index configuration limits the Elasticsearch node which can be used by the index to be generated, thereby realizing resource isolation.
Step S104, sending the index configuration to the Elasticissearch node in the Elasticissearch node information, so that the Elasticissearch node generates the index corresponding to the index creation request according to the index configuration.
In this step, the service agent module sends the index configuration to any one of the above described Elasticsearch node information in the Elasticsearch cluster, and the Elasticsearch node creates a corresponding index according to the index configuration.
Therefore, according to the embodiment of the invention, by setting the resource groups, each tenant corresponds to one resource group, configuring a plurality of corresponding Elasticissearch nodes for each resource group, writing the Elasticissearch nodes corresponding to the resource groups into the index configuration when generating the indexes corresponding to the resource groups, and limiting the nodes which can be used by the generated indexes, the resource isolation of the Elasticissearch is realized, and the problem that a cluster can not provide the computing capability or the service capability to other tenants is reduced when a great amount of node resources are used by one tenant at present is solved.
Fig. 2 is a flowchart of an index creating method of an Elasticsearch engine according to another alternative embodiment of the present invention, and as shown in fig. 2, the index creating method of an Elasticsearch engine according to this embodiment includes steps S201 to S205.
Step S201, obtaining an index creating request, where the index creating request includes: resource group information and a first index name of an index to be created.
In an optional embodiment of the present invention, the first index name is an index name of an index to be created, which is set by a user.
Step S202, determining Elasticissearch node information corresponding to the resource group information.
Step S203, generating index configuration according to the Elasticissearch node information.
Step S204, generating a second index name of the index to be created according to the resource group information and the first index name of the index to be created.
In an optional embodiment of the present invention, in this step, the resource group information may be spliced with the first index name to generate a second index name. Specifically, the resource group information may be used as a prefix of the first index name to generate the second index name. In the embodiment of the present invention, the second index name is an index name actually in the Elasticsearch cluster.
In the embodiment of the present invention, one index includes two index names, that is, an index name set by a user and an index name actually in the Elasticsearch cluster. When the client interacts with the service agent module, the index name set by the user is used in the data, and when the service agent module interacts with the elastic search cluster, the index name actually used in the elastic search cluster is used in the data, and the service agent module may store a corresponding relationship between the index name set by the user and the index name actually used in the elastic search cluster. By adopting the method, the indexes with the same name can be effectively prevented from being created in the Elasticissearch cluster by different users, and the users can conveniently manage the created indexes.
Step S205, sending the index configuration and the second index name to an Elasticsearch node in the Elasticsearch node information, so that the Elasticsearch node generates the index to be created according to the index configuration and the second index name.
In this step, the service agent module sends the index configuration and the second index name to any one of the above described elastic search node information in the elastic search cluster, and the elastic search node creates a corresponding index according to the index configuration and the second index name.
Fig. 3 is a flowchart of the first embodiment of the present invention for performing an add/delete and modify operation on data in an index, and as shown in fig. 3, the flow of performing an add/delete and modify operation on data in an index in the embodiment of the present invention includes steps S301 to S304.
Step S301, obtaining a first operation request for performing an add/delete/modify/check operation on data in a target index, where the first operation request includes: resource group information and a first index name of the target index.
In the embodiment of the present invention, the service agent module receives the first operation request sent by the user through the client. In an alternative embodiment of the present invention, the first operation request may be a data query request for the target index, a data write request for the target index, a data delete request for the target index, and a data modification request for the target index. The first operation request also comprises data processing information.
Step S302, determining Elasticsearch node information corresponding to the resource group information in the first operation request.
Step S303, determining a second index name of the target index according to the resource group information in the first operation request and the first index name of the target index.
In this embodiment of the present invention, in this step, the resource group information may be used as a prefix of the first index name to obtain a second index name of the target index. In other optional embodiments of the present invention, the service agent module may store a correspondence between each first index name and a second index name in each resource group, and the step may determine, according to the correspondence, a second index name corresponding to a certain first index name in a certain resource group.
Step S304, generating a second operation request according to the second index name and the first operation request, and sending the second operation request to an Elasticsearch node in Elasticsearch node information corresponding to the resource group information in the first operation request.
In an alternative embodiment of the present invention, in this step, the first index name in the first operation request may be replaced by the second index name, so as to obtain the second operation request. In this step, the service agent module sends the second operation request to any one of the aforementioned elastic search node information in the elastic search cluster, and then the elastic search node finds the target index according to the second index name in the second operation request, and then executes the data processing operation corresponding to the second operation request.
Fig. 4 is a flowchart illustrating a process of changing a node corresponding to a resource group according to an embodiment of the present invention, and as shown in fig. 4, in an alternative embodiment of the present invention, the process of changing a node corresponding to a resource group includes steps S401 to S403.
Step S401, acquiring a node change request of a target resource group, where the node change request: and changing information by the node.
In the embodiment of the invention, the service agent module receives a node change request sent by a user through a client. In an optional embodiment of the present invention, the node change request may be a request for newly adding an Elasticsearch node corresponding to the target resource group, a request for deleting a certain/some Elasticsearch nodes corresponding to the target resource group, and a request for replacing a certain/some Elasticsearch nodes corresponding to the target resource group.
Step S402, determining all indexes corresponding to the target resource group.
In the embodiment of the invention, the service agent module sends a query request to the Elasticissearch cluster to query all indexes corresponding to the target resource group. In an optional embodiment of the present invention, since the name (second index name) of the index in the Elasticsearch cluster includes a resource group information prefix, the Elasticsearch cluster may search all indexes corresponding to the target resource group by determining whether the prefix of the index name is the same as the target resource group.
Step S403, updating the index configurations of all indexes corresponding to the target resource group according to the node change information.
In the embodiment of the present invention, after finding all indexes corresponding to the target resource group, the Elasticsearch cluster updates the index configuration of each found index according to the node change information, thereby completing node change on the target resource group.
In the embodiment of the invention, after the nodes of the target resource group are changed, the metadata storage module updates the corresponding relation between the target resource group and the Elasticissearch node.
Fig. 5 is a flowchart of an index creating method according to a third embodiment of the present invention, and in an alternative embodiment of the present invention, the flowchart of the index creating method according to the present invention may specifically include steps S501 to S509.
Step S501, the client sends a new index request to the service agent module.
Step S502, after the service agent module receives the request, the service agent module analyzes the resource group information from the request.
Step S503, according to step S502, if the service agent module obtains the resource group information, step S504 is executed; if the resource group information is not acquired, step S509 is executed.
Step S504, obtain the node information of the resource group from the metadata storage module.
Step S505, the service agent module generates an index configuration, and the node used for limiting the index in the configuration is the node acquired in step S504.
Step S506, the service agent module adds a resource group prefix to the index name to be newly created, and generates an index name in the actual cluster.
Step S507, the service agent module sends a new index request to any one of the Elasticsearch nodes corresponding to the resource group in the Elasticsearch cluster, where the new index request includes the index configuration and the index name in the actual cluster.
Step S508, the service agent module packs the springsearch cluster return information and returns it to the client as the success or failure information of creating the index.
In step S509, the service agent module returns an error message to the client, and informs that the request does not include resource group information.
Fig. 6 is a flowchart of the second embodiment of the present invention for performing an operation of increasing, deleting, and modifying data in an index, as shown in fig. 6, in an alternative embodiment of the present invention, the flow of the operation of increasing, deleting, and modifying data in an index specifically includes steps S601 to S608.
Step S601, the client sends a data adding, deleting and modifying request, and the data adding, deleting and modifying request comprises an index name of an index where the data is located.
Step S602, after the service agent module receives the request, the service agent module analyzes the resource group information from the request.
Step S603, according to step S602, if the service agent module acquires resource group information, step S604 is executed; if the resource group information is not acquired, step S608 is executed.
Step S604, the service agent module obtains the node information of the resource group from the metadata storage module.
Step S605, the service agent module adds a resource group prefix to the index name to obtain the index name in the cluster;
step S606, the service agent module sends a data add, delete, modify and search request to any one of the Elasticsearch nodes corresponding to the resource group in the Elasticsearch cluster, where the data add, delete, modify and search request includes an index name in the cluster.
In step S607, the service agent module obtains the information returned by the Elasticsearch cluster in step S606, modifies the index name therein to remove the resource group prefix, and returns the information to the client as the return information of the data add, delete, modify and check operation.
In step S608, the service agent module returns the information of the client HTTP status code 404, which indicates that there is no operating resource group.
In an optional embodiment of the present invention, the process of performing capacity expansion on an Elasticsearch node corresponding to a certain resource group is as follows:
step 1, the client sends a Rest request to the service agent module, and the request contains the information of the comparison relationship between the new node and the resource group.
And 2, after receiving the request, the service agent module inserts the new node and the resource group contrast relationship into the metadata storage module.
And 3, the service agent module sends a request to the Elasticissearch cluster to acquire all indexes in the resource group.
And 4, the service agent module sends a request to the Elasticissearch cluster to update the range of the nodes which are allowed to be used and acquire the index in the step 3.
And 5, the service agent module returns a message of success or failure of the client.
From the above embodiments, it can be seen that the present invention achieves at least the following beneficial effects: according to the method, the resource groups are set, each tenant corresponds to one resource group, a plurality of corresponding Elasticissearch nodes are configured for each resource group, when the index corresponding to the resource group is generated, the Elasticissearch nodes corresponding to the resource group are written into the index configuration, the nodes which can be used by the generated index are limited, the resource isolation of the Elasticissearch is realized, the operation and maintenance cost of a plurality of clusters can be effectively reduced, and no extra burden is generated on the using party.
It should be noted that the steps illustrated in the flowcharts of the figures may be performed in a computer system such as a set of computer-executable instructions and that, although a logical order is illustrated in the flowcharts, in some cases, the steps illustrated or described may be performed in an order different than presented herein.
Based on the same inventive concept, the embodiment of the present invention further provides an index creating apparatus for an Elasticsearch engine, which can be used to implement the index creating method for an Elasticsearch engine described in the above embodiment, as described in the following embodiments. As the principle of solving the problem of the index creating device of the Elasticsearch engine is similar to the index creating method of the Elasticsearch engine, the embodiments of the index creating device of the Elasticsearch engine can refer to the embodiments of the index creating method of the Elasticsearch engine, and repeated details are omitted. As used hereinafter, the term "unit" or "module" may be a combination of software and/or hardware that implements a predetermined function. Although the means described in the embodiments below are preferably implemented in software, an implementation in hardware, or a combination of software and hardware is also possible and contemplated.
Fig. 8 is a block diagram of an index creating apparatus of an Elasticsearch engine according to an embodiment of the present invention, and as shown in fig. 8, the index creating apparatus of the Elasticsearch engine according to the embodiment of the present invention includes: an index creation request acquisition unit 1, a node determination unit 2, an index configuration generation unit 3, and an index creation information transmission unit 4.
An index creation request obtaining unit 1, configured to obtain an index creation request, where the index creation request includes: resource group information.
And the node determining unit 2 is configured to determine the Elasticsearch node information corresponding to the resource group information.
And the index configuration generating unit 3 is configured to generate an index configuration according to the Elasticsearch node information.
And an index creation information sending unit 4, configured to send the index configuration to an Elasticsearch node in the Elasticsearch node information, so that the Elasticsearch node generates an index corresponding to the index creation request according to the index configuration.
In an optional embodiment of the invention, the index creation request further comprises: a first index name of an index to be created. The index creating device of the Elasticsearch engine further comprises: and the index name generation unit is used for generating a second index name of the index to be created according to the resource group information and the first index name of the index to be created.
In an optional embodiment of the present invention, the index creating information sending unit 4 is specifically configured to send the index configuration and the second index name to an Elasticsearch node in the Elasticsearch node information, so that the Elasticsearch node generates the index to be created according to the index configuration and the second index name.
In an alternative embodiment of the present invention, the index creating apparatus of the Elasticsearch engine of the present invention further includes:
a data add, delete, and modify request obtaining unit, configured to obtain a first operation request for performing an add, delete, modify, and modify operation on data in a target index, where the first operation request includes: resource group information and a first index name of the target index;
a node information determining unit, configured to determine Elasticsearch node information corresponding to the resource group information in the first operation request;
an index name determining unit, configured to determine a second index name of the target index according to the resource group information in the first operation request and the first index name of the target index;
and the operation request sending unit is used for generating a second operation request according to the second index name and the first operation request, and sending the second operation request to an Elasticissearch node in Elasticissearch node information corresponding to the resource group information in the first operation request.
In an alternative embodiment of the present invention, the index creating apparatus of the Elasticsearch engine of the present invention further includes:
a node change request obtaining unit, configured to obtain a node change request of a target resource group, where the node change request: node change information;
the index query unit is used for determining all indexes corresponding to the target resource group;
and the index configuration updating unit is used for updating the index configurations of all indexes corresponding to the target resource group according to the node change information.
To achieve the above object, according to another aspect of the present application, there is also provided a computer apparatus. As shown in fig. 9, the computer device comprises a memory, a processor, a communication interface and a communication bus, wherein a computer program that can be run on the processor is stored in the memory, and the steps of the method of the embodiment are realized when the processor executes the computer program.
The processor may be a Central Processing Unit (CPU). The Processor may also be other general purpose processors, Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components, or a combination thereof.
The memory, which is a non-transitory computer readable storage medium, may be used to store non-transitory software programs, non-transitory computer executable programs, and units, such as the corresponding program units in the above-described method embodiments of the present invention. The processor executes various functional applications of the processor and the processing of the work data by executing the non-transitory software programs, instructions and modules stored in the memory, that is, the method in the above method embodiment is realized.
The memory may include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function; the storage data area may store data created by the processor, and the like. Further, the memory may include high speed random access memory, and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid state storage device. In some embodiments, the memory optionally includes memory located remotely from the processor, and such remote memory may be coupled to the processor via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The one or more units are stored in the memory and when executed by the processor perform the method of the above embodiments.
The specific details of the computer device may be understood by referring to the corresponding related descriptions and effects in the above embodiments, and are not described herein again.
In order to achieve the above object, according to another aspect of the present application, there is also provided a computer-readable storage medium storing a computer program which, when executed in a computer processor, implements the steps in the index creation method of the aforementioned Elasticsearch engine. It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by a computer program, which can be stored in a computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. The storage medium may be a magnetic Disk, an optical Disk, a Read-only Memory (ROM), a Random Access Memory (RAM), a Flash Memory (Flash Memory), a Hard Disk (Hard Disk Drive, abbreviated as HDD) or a Solid State Drive (SSD), etc.; the storage medium may also comprise a combination of memories of the kind described above.
It will be apparent to those skilled in the art that the modules or steps of the present invention described above may be implemented by a general purpose computing device, they may be centralized on a single computing device or distributed across a network of multiple computing devices, and they may alternatively be implemented by program code executable by a computing device, such that they may be stored in a storage device and executed by a computing device, or fabricated separately as individual integrated circuit modules, or fabricated as a single integrated circuit module from multiple modules or steps. Thus, the present invention is not limited to any specific combination of hardware and software.
The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (12)

1. An index creation method of an Elasticsearch engine, comprising:
obtaining an index creation request, wherein the index creation request comprises: resource group information;
determining Elasticisarch node information corresponding to the resource group information;
generating index configuration according to the Elasticissearch node information;
and sending the index configuration to an Elasticissearch node in the Elasticissearch node information, so that the Elasticissearch node generates an index corresponding to the index creation request according to the index configuration.
2. The index creation method of the Elasticsearch engine of claim 1, wherein the index creation request further comprises: a first index name of an index to be created;
the index creation method of the Elasticissearch search engine further comprises the following steps:
and generating a second index name of the index to be created according to the resource group information and the first index name of the index to be created.
3. The index creation method of the Elasticsearch engine according to claim 2, wherein the index configuration is sent to the Elasticsearch node in the Elasticsearch node information, so that the Elasticsearch node generates the index corresponding to the index creation request according to the index configuration, specifically:
and sending the index configuration and the second index name to an Elasticissearch node in the Elasticissearch node information, so that the Elasticissearch node generates the index to be created according to the index configuration and the second index name.
4. The index creation method of the Elasticsearch engine of claim 3, further comprising:
acquiring a first operation request for performing an increasing, deleting, modifying and checking operation on data in a target index, wherein the first operation request comprises: resource group information and a first index name of the target index;
determining Elasticissearch node information corresponding to the resource group information in the first operation request;
determining a second index name of the target index according to the resource group information in the first operation request and the first index name of the target index;
and generating a second operation request according to the second index name and the first operation request, and sending the second operation request to an Elasticissearch node in Elasticissearch node information corresponding to the resource group information in the first operation request.
5. The index creation method of the Elasticsearch engine of claim 1, further comprising:
acquiring a node change request of a target resource group, wherein the node change request comprises: node change information;
determining all indexes corresponding to the target resource group;
and updating the index configuration of all indexes corresponding to the target resource group according to the node change information.
6. An index creation apparatus of an Elasticsearch engine, comprising:
an index creation request obtaining unit, configured to obtain an index creation request, where the index creation request includes: resource group information;
the node determining unit is used for determining Elasticissearch node information corresponding to the resource group information;
the index configuration generating unit is used for generating index configuration according to the Elasticissearch node information;
and the index creation information sending unit is used for sending the index configuration to the Elasticissearch node in the Elasticissearch node information so that the Elasticissearch node generates the index corresponding to the index creation request according to the index configuration.
7. The index creation apparatus of the Elasticsearch engine of claim 6, wherein the index creation request further comprises: a first index name of an index to be created;
the index creating device of the Elasticsearch engine further comprises:
and the index name generation unit is used for generating a second index name of the index to be created according to the resource group information and the first index name of the index to be created.
8. The index creating apparatus of the Elasticsearch engine of claim 7, wherein the index creating information sending unit is specifically configured to send the index configuration and the second index name to an Elasticsearch node in the Elasticsearch node information, so that the Elasticsearch node generates the index to be created according to the index configuration and the second index name.
9. The index creation apparatus of the Elasticsearch engine of claim 8, further comprising:
a data add, delete, and modify request obtaining unit, configured to obtain a first operation request for performing an add, delete, modify, and modify operation on data in a target index, where the first operation request includes: resource group information and a first index name of the target index;
a node information determining unit, configured to determine Elasticsearch node information corresponding to the resource group information in the first operation request;
an index name determining unit, configured to determine a second index name of the target index according to the resource group information in the first operation request and the first index name of the target index;
and the operation request sending unit is used for generating a second operation request according to the second index name and the first operation request, and sending the second operation request to an Elasticissearch node in Elasticissearch node information corresponding to the resource group information in the first operation request.
10. The index creation apparatus of the Elasticsearch engine of claim 6, further comprising:
a node change request obtaining unit, configured to obtain a node change request of a target resource group, where the node change request: node change information;
the index query unit is used for determining all indexes corresponding to the target resource group;
and the index configuration updating unit is used for updating the index configurations of all indexes corresponding to the target resource group according to the node change information.
11. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor implements the method of any of claims 1 to 5 when executing the computer program.
12. A computer-readable storage medium, in which a computer program is stored which, when executed in a computer processor, implements the method of any one of claims 1 to 5.
CN202010229745.0A 2020-03-27 2020-03-27 Index creation method and device of elastic search engine Active CN111428114B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010229745.0A CN111428114B (en) 2020-03-27 2020-03-27 Index creation method and device of elastic search engine

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010229745.0A CN111428114B (en) 2020-03-27 2020-03-27 Index creation method and device of elastic search engine

Publications (2)

Publication Number Publication Date
CN111428114A true CN111428114A (en) 2020-07-17
CN111428114B CN111428114B (en) 2024-04-09

Family

ID=71548983

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010229745.0A Active CN111428114B (en) 2020-03-27 2020-03-27 Index creation method and device of elastic search engine

Country Status (1)

Country Link
CN (1) CN111428114B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113568749A (en) * 2021-07-28 2021-10-29 新华智云科技有限公司 Shard distribution method based on Elasticissearch cluster
CN114564485A (en) * 2022-04-28 2022-05-31 深圳竹云科技股份有限公司 User data processing method based on Elastic Search

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150254290A1 (en) * 2014-03-05 2015-09-10 Software Ag Systems and/or methods for on-demand repository bootstrapping at runtime in a scalable, distributed multi-tenant environment
CN109063077A (en) * 2018-07-24 2018-12-21 新华三大数据技术有限公司 A kind of data access method and device based on elasticity search
CN109144994A (en) * 2017-06-19 2019-01-04 华为技术有限公司 Index updating method, system and relevant apparatus
CN110019200A (en) * 2017-09-30 2019-07-16 阿里巴巴集团控股有限公司 A kind of foundation of index, application method and device
CN110569302A (en) * 2019-08-16 2019-12-13 苏宁云计算有限公司 method and device for physical isolation of distributed cluster based on lucene

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150254290A1 (en) * 2014-03-05 2015-09-10 Software Ag Systems and/or methods for on-demand repository bootstrapping at runtime in a scalable, distributed multi-tenant environment
CN109144994A (en) * 2017-06-19 2019-01-04 华为技术有限公司 Index updating method, system and relevant apparatus
CN110019200A (en) * 2017-09-30 2019-07-16 阿里巴巴集团控股有限公司 A kind of foundation of index, application method and device
CN109063077A (en) * 2018-07-24 2018-12-21 新华三大数据技术有限公司 A kind of data access method and device based on elasticity search
CN110569302A (en) * 2019-08-16 2019-12-13 苏宁云计算有限公司 method and device for physical isolation of distributed cluster based on lucene

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113568749A (en) * 2021-07-28 2021-10-29 新华智云科技有限公司 Shard distribution method based on Elasticissearch cluster
CN113568749B (en) * 2021-07-28 2023-09-05 新华智云科技有限公司 Method for distributing shards based on elastic search cluster
CN114564485A (en) * 2022-04-28 2022-05-31 深圳竹云科技股份有限公司 User data processing method based on Elastic Search

Also Published As

Publication number Publication date
CN111428114B (en) 2024-04-09

Similar Documents

Publication Publication Date Title
US11809726B2 (en) Distributed storage method and device
US10715485B2 (en) Managing dynamic IP address assignments
US9053167B1 (en) Storage device selection for database partition replicas
CN102419770B (en) File sharing system, method for realizing file sharing, and file index service equipment
CN103067433B (en) A kind of data migration method of distributed memory system, equipment and system
US8214355B2 (en) Small table: multitenancy for lots of small tables on a cloud database
CN105138571B (en) Distributed file system and method for storing massive small files
US11734248B2 (en) Metadata routing in a distributed system
US10860604B1 (en) Scalable tracking for database udpates according to a secondary index
KR20170073605A (en) Composite partition functions
US10579597B1 (en) Data-tiering service with multiple cold tier quality of service levels
US10013449B1 (en) Validating and non-validating secondary indexes for a table in a non-relational data store
US11151081B1 (en) Data tiering service with cold tier indexing
US10817203B1 (en) Client-configurable data tiering service
CN105550306A (en) Multi-copy data reading/writing method and system
US10747739B1 (en) Implicit checkpoint for generating a secondary index of a table
WO2022134797A1 (en) Data fragmentation storage method and apparatus, a computer device, and a storage medium
CN111428114B (en) Index creation method and device of elastic search engine
US11461053B2 (en) Data storage system with separate interfaces for bulk data ingestion and data access
CN113051250A (en) Database cluster capacity expansion method and device, electronic equipment and storage medium
CN113111038A (en) File storage method, device, server and storage medium
CN103905512A (en) Data processing method and equipment
CN110798358B (en) Distributed service identification method and device, computer readable medium and electronic equipment
CN115510161A (en) Data synchronization method, device, equipment and storage medium
US11727022B2 (en) Generating a global delta in distributed databases

Legal Events

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