CentOS 7 安装 Elasticsearch5.2.2 的 Head 插件

来源:互联网 发布:牛奶 知乎 编辑:程序博客网 时间:2024/04/27 22:32

一、安装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了


 

0 0
原创粉丝点击