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

A simple way for Docker to deploy ElasticSearch

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

Share

Shulou(Shulou.com)06/01 Report--

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.

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