Docker安裝ElasticSearch

1. 下載鏡像

docker pull elasticsearch:6.8.0

2. 建立network

docker network create dnw_es_680

3. 建立容器

docker run -d --name es_680 --net dnw_es_680 -p 9200:9200 -p 9300:9300 -e "discovery.type=single-node" elasticsearch:6.8.0

4. 查看ES狀態

http://192.168.99.100:9200/

5. 安裝elasticsearch-head

docker pull mobz/elasticsearch-head:5
docker run -d --name es_admin -p 9100:9100 mobz/elasticsearch-head:5

6. 修改es配置,支持跨域訪問

docker exec -it es_680 /bin/bash
vi config/elasticsearch.yml
添加:
    http.cors.enabled: true
    http.cors.allow-origin: "*"
重啓容器:
    docker restart es_680

7. 訪問elasticsearch-head

http://192.168.99.100:9100/
相關文章
相關標籤/搜索