Elasticsearch is an open-source search engine based on Apache Lucene(TM), which can be considered the most advanced, best-performing, and most feature-featured search engine library to date, both in open source and proprietary domains. However, Lucene is just a library. To make it powerful, you need to use Java and integrate it into your application. Lucene is very complex, and you need to have a deep understanding of retrieval to understand how it works. Elasticsearch is also written in Java and uses Lucene to index and implement search functionality, but it aims to make full-text search simple and hide the complexity of Lucene through a simple and coherent RESTful API.
Review:
Now ready to convert server applications and middleware into containerized deployments, using Docker image deployment only requires a few simple commands or a yml file, and the entire system can be running, ditching the hassle of traditional deployment, such as various configuration file modifications. Most importantly, if you make the service stateless, it is easier to migrate.
This article uses elasticsearch:6.5.2 image as a demonstration tutorial for CentOS 8
Install Docker
First, you need to install the docker service, and the tutorial is as follows:
Launch the Elasticsearch app
The hyperlink login is visible.A list of all published Docker images and tags is provided
Using elasticsearch:6.5.2 as the base image, the launch command is as follows:
Use your browser to access the intranet serverip:9200You can see the following:
{ "name" : "YDBU8PG", "cluster_name" : "docker-cluster", "cluster_uuid" : "VexaBtA2Q-qAZlwbvUHjXA", "version" : { "number" : "6.5.2", "build_flavor" : "default", "build_type" : "tar", "build_hash" : "9434bed", "build_date" : "2018-11-29T23:58:20.891072Z", "build_snapshot" : false, "lucene_version" : "7.5.0", "minimum_wire_compatibility_version" : "5.6.0", "minimum_index_compatibility_version" : "5.0.0" }, "tagline" : "You Know, for Search"
}
Install the word segmentation plugin elasticsearch-analysis-ik
We need to go into the container to install the IK participle plugin, the command is as follows:
Once you enter the container, you will enter it by default/usr/share/elasticsearchBelow the directory, the install plugin command is as follows:
Note: The version of elasticsearch-analysis-ik must correspond to the current elasticsearch version!
Once the installation is complete, you can enter it/usr/share/elasticsearch/config/analysis-ikUnder the table of contents, findIKAnalyzer.cfg.xml file to customize the thesaurus, for example:
After the configuration is completed, upload your own my.dic file under /usr/share/elasticsearch/config/analysis-ik, and you can copy the host's files to the container through the docker cp command, as follows:
Launch the elasticsearch-head app
Similarly, you can create an elasticsearch-head application using the docker command to connect to the elasticsearch service through elasticsearch-head, with the following command:
Launch the Kibana app
Of course, you can also install Kibana to manage the elasticsearch service, an open-source analytics and visualization platform designed to work with Elasticsearch. You can use Kibana to search, view, and interact with data stored in Elasticsearch indexes. You can easily perform advanced data analysis and visualize your data in various charts, tables, and maps. References are as follows:
You can also quickly create a Kibana app using docker commands, which are as follows:
Note: --link aliases must use elasticsearch, and using other aliases will result in the following error:
Once the startup is complete, accesshttp://ip:5601/As shown below:
Compatibility with Elasticsearch-related products (5.x, 6.x, 7.x) can be referenced as follows:The hyperlink login is visible.
(End)
|