君之所向,一往无前
安装Elasticsearch head之后,npm install && npm run start启动项目发现无法连接Elasticsearch,报错cluster health: not connected Elasticsearch head unable to connect to Cluster。是由于在Elasticsearch终于未开启前端跨域引起的。
npm install && npm run start
cluster health: not connected Elasticsearch head unable to connect to Cluster
在{ealsticsaerch_dir}/config/elasticsearch.yml中添加
{ealsticsaerch_dir}/config/elasticsearch.yml
12
http.cors.enabled: truehttp.cors.allow-origin: "*"