一.在docker容器中進入elasticsearch對應的容器
docker exec -it [容器名] /bin/bash
二.安裝vim編輯器
因為我們需要更改配置文件,安裝過的朋友就不用安裝了
apt-get update
apt-get install vim
三.進入到/config/elasticsearch.yml配置文件,添加一下兩行代碼
http.cors.enabled: true http.cors.allow-origin: "*"
四.重啟容器,配置完成
docker restart -t=60 [CONTAINER ID]