一、安装nodejs
curl -sL -o /etc/yum.repos.d/khara-nodejs.repo https://copr.fedoraproject.org/coprs/khara/nodejs/repo/epel-7/khara-nodejs-epel-7.repo
yum install -y nodejs nodejs-npm
二、安装grunt
npm install grunt-cli
npm install grunt
grunt -version
三、安装head
git clone git://github.com/mobz/elasticsearch-head.git
cd elasticsearch-head
npm install
vim _site/app.js
# 修改 『http://localhost:9200』字段到本机ES端口与IP
grunt server
# 打开浏览器 http://localhost:9100
在浏览器访问haed
默认地址:http://127.0.0.1:9100/
到这里haed就已经启动成功了
但是现在发现:集群健康值: 未连接
因为elasticsearch5之后对对其安全性进行了加强
这里需要修改elasticsearch-5.2.0\config\elasticsearch.yml文件
在文件elasticsearch.yml中添加配置如下:
#避免出现跨域问题
http.cors.enabled: true
http.cors.allow-origin: "*"
注意:配置中冒号后面需要有一个空格!!
然后重启elasticsearch
再次访问:http://127.0.0.1:9100/
这里head就已经连上elasticsearch了
124 篇文章
如果觉得我的文章对您有用,请随意打赏。你的支持将鼓励我继续创作!