pull 映象
docker pull docker。elastic。co/elasticsearch/elasticsearch:7。7。0
執行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
測試環境加上-e “discovery。type=single-node”
3、安裝ik分詞外掛
docker exec -it elastic770 /bin/bash 。/bin/elasticsearch-plugin install https://jeecgos。oss-cn-beijing。aliyuncs。com/eoafile/elasticsearch-analysis-ik-7。7。0。zip
4、其他配置
建立 elasticsearch。yml
cluster。name: “elasticsearch7。7。0”network。host: 0。0。0。0node。name: node0http。host: 0。0。0。0http。cors。enabled: truehttp。cors。allow-origin: “*”
複製到docker容器中,覆蓋原有配置檔案
docker cp elasticsearch。yml elastic770:/usr/share/elasticsearch/config
點選http://127。0。0。1:9200 ,檢視ES狀態
5、安裝視覺化管理工具
docker run -p 9800:9800 -d ——link elastic770:hd containerize/elastichd
在瀏覽器開啟http://localhost:9800 。預設未連線,需要手工修改連線為
http://hd:9200