Elasticsearch5以后就不能用安装的方式启动head插件了,所以必须通过单独的程序去启动,安装的时候遇到head程序报错如下:
Failed to load http://10.4.109.81:9200/_all: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://10.4.109.81:9100' is therefore not allowed access. The response had HTTP status code 403.
解决办法是在elasticsearch.yml里面增加:
http.cors.enabled : true
http.cors.allow-origin : "*"
即可解决问题。