centos7 安装 elasticsearch 5.2head插件

centos7 安装es教程

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

  • 发表于 2017-11-11 23:28
  • 阅读 ( 1721 )
  • 分类:Java

0 条评论

请先 登录 后评论
不写代码的码农
威猛的小站长

124 篇文章

作家榜 »

  1. 威猛的小站长 124 文章
  2. Jonny 65 文章
  3. 江南烟雨 36 文章
  4. - Nightmare 33 文章
  5. doublechina 31 文章
  6. HJ社区-肖峰 29 文章
  7. 伪摄影 22 文章
  8. Alan 14 文章