Centos7 安装配置elasticsearch-head

安装nodejs

  1. 配置yum源

     curl --silent --location https://rpm.nodesource.com/setup_7.x | bash -
    
  2. 安装nodejs和npm

     yum install -y nodejs
    

配置淘宝npm镜像

  1. 通过config命令

     npm config set registry https://registry.npm.taobao.org 
     npm info underscore (如果上面配置正确这个命令会有字符串response)
    
  2. 命令行指定

     npm --registry https://registry.npm.taobao.org info underscore 
    
  3. 编辑 ~/.npmrc 加入下面内容

     registry = https://registry.npm.taobao.org
    

安装phantomjs(elasticsearch-head依赖)

  1. 下载
  2. 安装配置
     tar xvf phantomjs-2.1.1-linux-x86_64.tar.bz2
     export PHANTOMJS_HOME=/path/phantomjs/bin
    

安装配置运行elasticsearch-head

  1. 安装

     git clone git://github.com/mobz/elasticsearch-head.git
    
  2. 配置

     npm install
    
     vim ./_site/app.js
     app.App = ui.AbstractWidget.extend({
             defaults: {
                     base_uri: "http://10.2.6.2:9200"
             }
    
  3. 运行访问

     npm run start
     http://10.2.6.2:9100