Centos7 下安裝此插件
1、下載插件
elasticsearch-head配置包,下載地址:https://github.com/mobz/elasticsearch-head
2、安裝node
自行安裝
3、安裝grunt
https://gruntjs.com/getting-started
我們可以通過(guò)grunt進(jìn)行啟動(dòng)
4、解壓elasticsearch-head配置包
執(zhí)行g(shù)runt命令進(jìn)行啟動(dòng)
通過(guò)9100端口進(jìn)行訪問(wèn)即可
5、問(wèn)題
安裝上之后,發(fā)現(xiàn)連接不上es結(jié)點(diǎn)。
F12查看是因?yàn)椋篈ccess to XMLHttpRequest at 'http://node1:9200/' from origin 'http://server88:9100' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.
解決方案:
在elasticsearch配置文件中添加:
http.cors.enabled: true
http.cors.allow-origin: "*"