linux安装elasticsearch-head

elasticsearch-head需要依赖node,先安装node

安装node

  1. 下载node
    从https://nodejs.org/en/download/下载node-v10.16.0-linux-x64.tar.xz,使用wcp工具放入目录/usr/local
  2. 解压node-v10.16.0-linux-x64.tar.xz
tar -Jxvf node-v10.16.0-linux-x64.tar.xz

3.修改名称为node-v10.16.0

mv node-v10.16.0-linux-x64 node-v10.16.0
  1. 修改 /etc/profile
vim /etc/profile
export NODE_HOME=/usr/local/node-v10.16.0
export PATH=$PATH:$NODE_HOME/bin
export NODE_PATH=$NODE_HOME/lib/node_modules

5.重启 source /etc/profile
source /etc/profile

安装elasticsearch-head

  1. 下载elasticsearch-head
    从https://github.com/mobz/elasticsearch-head下载elasticsearch-head-master.zip,放入/usr/local/

  2. 解压elasticsearch-head
    (如果没有unzip命令,执行yum install -y unzip zip进行安装)

unzip elasticsearch-head-master.zip
  1. 进入head文件中,执行 npm install -g grunt-cli安装grunt
npm install -g grunt-cli
npm install -g grunt
  1. 修改文件Gruntfile.js,添加hostname
connect: {
        server: {
            options: {
                hostname: '0.0.0.0',
                port: 9100,
                base: '.',
                keepalive: true
            }
        }
    } 
  1. 启动elasticsearch-head(启动时可能会报错,见报错说明)
grunt server

11.浏览器访问:http://39.100.113.100:9100/检查结果

可能出现的报错:

grunt-cli: The grunt command line interface (v1.2.0)

Fatal error: Unable to find local grunt.

If you're seeing this message, grunt hasn't been installed locally to
your project. For more information about installing and configuring grunt,
please see the Getting Started guide:

http://gruntjs.com/getting-started

解决方式1:
输入以下命令(但是没有解决问题,使用了第二种解决方式)

npm install -g grunt

解决方式2:

npm install grunt

下载后,运行grunt server会继续报错,按照报错信息进行安装:

>> Local Npm module "grunt-contrib-copy" not found. Is it installed?
>> Local Npm module "grunt-contrib-concat" not found. Is it installed?
>> Local Npm module "grunt-contrib-uglify" not found. Is it installed?
>> Local Npm module "grunt-css" not found. Is it installed?

以次安装以上报错提示

npm install grunt-contrib-copy
npm install grunt-contrib-concat
npm install grunt-contrib-uglify
npm install grunt-css
  • 0
    点赞
  • 11
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值