Elasticsearch可视化插件Head搭建

以下我们在Centos7操作系统上以elasticsearch-head为例来进行一下安装

环境准备

开始安装

  • 安装grunt

    • 将下载下来的elasticsearch-head插件上传至联网机器的任意目录,然后解压并重命名为head

    • 进入head目录执行命令

      npm install -g grunt --registry=https://registry.npm.taobao.org
      

      执行结果

    • 将/root/.nvm/versions/node/v9.5.0/lib/下node_modules目录拷贝到head目录下

    • 修改head目录下的Gruntfile.js文件,在connect出新增属性

        hostname:'192.168.23.1',
      

      保存并退出,说明:这里的端口修改为9201

      如图所示

    • 打包elasticsearch-head插件,执行命令zip -q -r head.zip head/*

    • 将联网机器上打包好的head.zip插件下载到本地,并上传至risen01的/usr/local/elasticsearch安装目录下并解压即可(不要放在plugins目录下,es5之后和es2之间有很大的改动)

    • 进入到/usr/local/elasticsearch安装目录/head目录执行启动head插件命令:node_modules/grunt/bin/grunt server,可能出现以下截图报错:
      报错

      • 报错原因:缺少很多grunt的依赖
        • 解决:返回到联网机器然后进入到head目录进行逐一安装依赖,会发现node_modules目录下出现很多新的依赖包,此时却把之前的node_modules目录下grunt这个目录给覆盖了,那么重新执行命令npm install -g grunt --registry=https://registry.npm.taobao.org,然后将两个node_modules进行合并为一个即可。再次打包替换掉之前head,然后重新启动
          npm install grunt-contrib-clean --registry=https://registry.npm.taobao.org
          npm install grunt-contrib-watch --registry=https://registry.npm.taobao.org
          npm install grunt-contrib-connect --registry=https://registry.npm.taobao.org
          npm install grunt-contrib-copy --registry=https://registry.npm.taobao.org
          npm install grunt-contrib-jasmine --registry=https://registry.npm.taobao.org
          npm install grunt-contrib-concat --registry=https://registry.npm.taobao.org
        
    • 启动结果

      启动结果

      • 后台运行只需在执行命令后面加上&符号即可
    • head可视化插件结果如图下所示

  • 注意事项:

    • 如果报错权限问题,需要安装 npm install --unsafe-perm
    • 安装grunt依赖时需要在head目录下,这样依赖才会安装在head下的node_modules中
    • 注意,es需要开启支持跨域配置项
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

我教你啊

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值