在Elasticsearch 5.x下安装elasticsearch-head

来源:互联网 发布:软件一键位安装 编辑:程序博客网 时间:2024/06/06 17:45

转自:http://www.cnblogs.com/zklidd/p/6433123.html

Elasticsearch 5.x不支持通过插件的方式安装elasticsearch-head了。这次用服务端的模式来运行。

准备环境

系统:centos 6 / 7
如果没npm,需要先安装下。

yum -y install nodejs npm

换下npm源,这里使用淘宝的

npm config set registry https://registry.npm.taobao.org

安装grunt

npm install grunt-clinpm install grunt

安装elasticsearch-head

git clone git://github.com/mobz/elasticsearch-head.gitcd elasticsearch-headvim _site/app.js# 修改 『http://localhost:9200』字段到本机ES端口与IP

更改es配置

vim /etc/elasticsearch/elasticsearch.yml#添加http.cors.enabled: truehttp.cors.allow-origin: "*"#重启下es

启动elasticsearch-head

cd elasticsearch-headgrunt server

浏览器打开http://服务器ip:9100/