Docker安裝elasticsearch 7.7.0


  1. pull 鏡像
docker pull docker.elastic.co/elasticsearch/elasticsearch:7.7.0
  1. 運行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.0
node.name: node0
http.host: 0.0.0.0
http.cors.enabled: true
http.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


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM