1. Pull the mirror
Docker pull docker. Elastic. Co/elasticsearch/elasticsearch: 7.7.0
  1. Run the elasticsearch

docker run –name=elastic770 -p 9200:9200 -p 9300:9300 -e “discovery.type=single-node” -v /var/docker/elastic/data:/data Docker. Elastic. Co/elasticsearch/elasticsearch: 7.7.0

Test environment with -e “Discovery. Type =single-node”

3, install IK word segmentation plug-in

docker exec -it elastic770 /bin/bash ./bin/elasticsearch-plugin install

4. Other configurations

Create elasticsearch. Yml

Cluster.name: "ElasticSearch7.7.0" network.host: node0 http.host: http.cors.enabled: true http.cors.allow-origin: "*"

Copy it to the Docker container, overwriting the original configuration file

docker cp elasticsearch.yml  elastic770:/usr/share/elasticsearch/config

Check out the ES status at

5. Install visual management tools

docker run -p 9800:9800 -d --link elastic770:hd containerize/elastichd

Open the http://localhost:9800. By default no connection, manually change the connection to http://hd:9200