Get the App
SLTechnology News&Howtos  ›  Development  › 

A simple way for Docker to deploy ElasticSearch

Shulou Source: shulou.com Published: 2022-06-01 03:35:47 09月12日 Update

Most people do not understand the knowledge points of this article "Docker simple deployment of ElasticSearch", so the editor summarizes the following content, detailed content, clear steps, and has a certain reference value. I hope you can get something after reading this article. Let's take a look at this "Docker simple deployment of ElasticSearch method" article.

What is elasticsearch?

Elasticsearch also uses java development and uses lucene as its core to implement all indexing and search functions, but its goal is to hide the complexity of lucene through simple restful api, thus making full-text search simple.

However, elasticsearch is not just about lucene and full-text search, we can also describe it like this:

Distributed real-time file storage in which each field is requested

Citation and can be searched for distributed real-time analysis search engine

Can scale to hundreds of servers to handle pb-level structured or unstructured data

II. Docker deployment of elasticsearch

2.1 pull the image

Docker pull docker.elastic.co/elasticsearch/elasticsearch:6.3.2

2.2 run the container

The default port of elasticsearch is 9200. By mapping port 9200 of the hosting environment to port 9200 in the docker container, we can access the elasticsearch service in the docker container, and we name the container es.

The copy code is as follows:

Docker run-d-- name es-p 9200 discovery.type=single-node 9200-p 9300 discovery.type=single-node 9300

2.3 configure cross-domain

2.3.1 enter the container

Because of the configuration, you need to go to the container to modify the corresponding configuration information.

Docker exec-it es / bin/bash

2.3.2 configure

# display file ls results are as follows: license.txt readme.textile config lib modulesnotice.txt bin data logs plugins# enter configuration folder cd config# display file ls results are as follows: elasticsearch.keystore ingest-geoip log4j2.properties roles.yml users_roleselasticsearch.yml jvm.options role_mapping.yml users# modify configuration file vi elasticsearch.yml# join cross-domain configuration http.cors.enabled: truehttp.cors.allow-origin: "*"

2.3 restart the container

Because the configuration has been modified, the elasticsearch container needs to be restarted.

Docker restart es

The display is as follows:

III. Docker deployment of elasticsearch-head

Why install elasticsearch-head because you need an administrative interface to view elasticsearch-related information

3.1 pull the image

Docker pull mobz/elasticsearch-head:5

3.2 run the container

Docker run-d-name es_admin-p 9100V 9100 mobz/elasticsearch-head:5

The display is as follows:

The above is the content of this article on "Docker simple deployment of ElasticSearch". I believe we all have some understanding. I hope the content shared by the editor will be helpful to you. If you want to know more about the relevant knowledge, please follow the industry information channel.

Tags: Container configuration content file search method port code information full-text distributed real-time article knowledge article index structure result image service Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Technology vpn MariaDB Microsoft Redmi