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
Logo

更多推荐