报错信息
Request Header:
content-encoding: gzip
content-length: 327
content-type: application/json; charset=UTF-8
Warning: 299 Elasticsearch-7.14.0-dd5a0a2acaa2045ff9624f3729fc8a6f40835aa1 "Elasticsearch built-in security features are not enabled. Without authentication, your cluster could be accessible to anyone. See https://www.elastic.co/guide/en/elasticsearch/reference/7.14/security-minimal-setup.html to enable security."
X-elastic-product: Elasticsearch
解决办法
由报错提示可以知道在使用elasticsearch-head-master连接elasticsearch时出现跨域问题,那么就需要我们找到elasticsearch下的elasticsearch.yml文件进行跨域配置,elasticsearch.yml在elasticsearch\config文件夹下。
http.cors.enabled: true
http.cors.allow-origin: "*"
配置好以后就可以解决head-master连接ES的跨域问题。