1. Pull the mirror
Docker pull docker. Elastic. Co/elasticsearch/elasticsearch: 7.7.0Copy the code
  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 add -e “discovery.type=single-node”

3, install IK word segmentation plug-in

Docker exec – it elastic770 / bin/bash, / bin/elasticsearch – plugin install jeecgos.oss-cn-beijing.aliyuncs.com/eoafile/ela…

4. Other configurations

Create elasticsearch. Yml

Cluster. name: "elasticSearch7.7.0" net. host: 0.0.0.0 node.name: node0 http.host: 0.0.0.0 http.core. enabled: true http.cors.allow-origin: "*"Copy the code

Copy to docker container and overwrite the original configuration file

docker cp elasticsearch.yml  elastic770:/usr/share/elasticsearch/config
Copy the code

Check out ES status at http://127.0.0.1:9200

5. Install visual management tools

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

Open the http://localhost:9800. The connection is disconnected by default. Manually change the connection to http://hd:9200