【docker】elasticsearch-head无法连接elasticsearch的原因和解决,集群健康值:未连接,ElasticSearch——跨域访问的问题

 环境

====================

虚拟机启动 centos 7  ip:192.168.92.130

elasticsearch 5.6.9   port:9200  9201

elasticSearch-head 5  port:9100

===================

首先确定的是,elasticsearch-head启动无误,elasticsearch启动无误。

点击连接elasticsearch出现这个问题:提示未连接

F12查看:

 浏览器直接访问地址:

http://192.168.92.130:9200/_cluster/state

返回结果:

 既然可以访问,为什么连接不上呢??

从上面错误可以看出,是跨域访问的问题

Access to XMLHttpRequest at 'http://192.168.92.130:9200/_cluster/state' from origin 'http://192.168.92.130:9100' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.

解决方案:

猜你喜欢

转载自www.cnblogs.com/sxdcgaq8080/p/10025113.html