This article is a mirror article of machine translation, please click here to jump to the original article.

View: 9826|Reply: 1

Deploy the Elasticsearch service using Docker

[Copy link]
Posted on 11/10/2021 10:10:14 PM | | | |
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:

Centos 7 installation and deployment elasticsearch-6.5.2 tutorial
https://www.itsvse.com/thread-6173-1-1.html



Tutorial on installing elasticsearch-analysis-ik in elasticsearch-6.5.2
https://www.itsvse.com/thread-6191-1-1.html

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:

Install Docker containers on CentOS 7
https://www.itsvse.com/thread-9999-1-1.html

Docker package conflict issue when installing CentOS 8
https://www.itsvse.com/thread-10115-1-1.html

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:

How Docker containers and hosts copy files to each other
https://www.itsvse.com/thread-5121-1-1.html

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:

Install the elasticsearch-6.5.2 elasticsearch-head plugin
https://www.itsvse.com/thread-6190-1-1.html



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:

【Practical Action】Kibana installation tutorial for Elasticsearch
https://www.itsvse.com/thread-6400-1-1.html

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)





Previous:Java java.util.AbstractMap.SimpleImmutableEntry for details
Next:Spring annotations for @AutoConfigureBefore and @AutoConfigureAfter
Posted on 11/11/2021 8:42:01 AM |
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com