Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to simply deploy ElasticSearch with Docker

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly introduces how to use Docker simple deployment of ElasticSearch related knowledge, the content is detailed and easy to understand, the operation is simple and fast, has a certain reference value, I believe you will have something to gain after reading this article on how to simply deploy ElasticSearch with Docker, let's take a look at it.

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:

In this way, we have finished using docker to provide elasticsearch services without polluting the host environment, which also has the advantage that docker is an ideal solution if we want to start multiple different versions of elastcsearch or other services at the same time.

This is the end of the article on "how to simply deploy ElasticSearch with Docker". Thank you for reading! I believe that everyone has a certain understanding of the knowledge of "how to simply deploy ElasticSearch with Docker". If you want to learn more, you are welcome to follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report