ElasticSearch5.x安装Elasticsearch-head插件

推荐使用Google插件:ElasticSearch Head

一、安装Node.js环境

# cd /usr/local
# wget https://nodejs.org/dist/v8.11.4/node-v8.11.4-linux-x64.tar.xz
# yum install -y xz
# xz -d node-v8.11.4-linux-x64.tar.xz
# tar -xf node-v8.11.4-linux-x64.tar
# cd /usr/local/bin   //全局使用 npm 和 node,需要做相关软链
# ln -s /usr/local/node-v8.11.4-linux-x64/bin/node
# ln -s /usr/local/node-v8.11.4-linux-x64/bin/npm
# node -v
# npm -v
// 使用淘宝镜像
# npm config get registry // https://registry.npmjs.org/
# npm config set registry https://registry.npm.taobao.org

二、下载插件包

https://github.com/mobz/elasticsearch-head 下载代码上传到服务器上

# cd elasticsearch-head
# npm install -g grunt -cli
# npm install   //有报错忽略
# npm install grunt --save  //有报错忽略
# vim Gruntfile.js   // server.options增加 hostname: '0.0.0.0',
# vim _site/app.js  //修改ES端口与IP 默认为 http://localhost:9200

三、修改Elasticsearch配置

修改elasticsearch.yml文件加入以下内容:

# 是否支持跨域
http.cors.enabled: true
# *表示支持所有域名
http.cors.allow-origin: "*"

四、重启Elasticsearch(一定要重启不然配置不生效)

五、启动elasticsearch-head插件

# cd /usr/local/bin/
# ln -s /usr/local/node-v8.11.4-linux-x64/bin/grunt
# cd /usr/local/elasticsearch-5.5.2/elasticsearch-head
# grunt server (后台运行 + &)   

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

友情链接更多精彩内容