2020-09-27
docker run -t -p 9200:9200 -p 9300:9300 -e "discovery.type=single-node" -e "http.cors.enabled=true" -e "http.cors.allow-origin=*" docker.elastic.co/elasticsearch/elasticsearch:7.9.2
ps:
为了让elasticsearch-head跨域访问成功,需要在elasticsearch.yml配置文件中添加:
http.cors.enabled: true
http.cors.allow-origin: "*"