Elasticsearch5安装Elasticsearch-head插件

 

1,解压后,配置node环境变量

vim /etc/profile

export NODE_HOME=/opt/node-v10.15.3-linux-x64
export PATH=$PATH:$NODE_HOME/bin

是环境变量生效
$source /etc/profile
测试安装是否成功
$node -v
 v10.15.3
$npm -v
 6.4.1

2,安装grunt 

npm install grunt-cli
npm install grunt-cli --registry=https://registry.npm.taobao.org --no-proxy

grunt --version

找不到程序,配置环境变量
export PATH=/app/elasticsearch-head-master/node_modules/grunt-cli/bin:$PATH

3,安装head

1,unzip elasticsearch-head-master.zip
cd elasticsearch-head-master

执行安装
npm install 

2,修改配置文件 elasticsearch-head-master/Gruntfile.js

connect: {
    server: {
        options: {
            port: 9100,
            hostname: '*',
            base: '.',
            keepalive: true
        }
    }
}


3,elasticsearch-head-master/_site/app.js

修改前:

this.base_uri = this.config.base_uri || this.prefs.get("app-base_uri") || "http://localhost:9200";

修改后:

this.base_uri = this.config.base_uri || this.prefs.get("app-base_uri") || "http://172.16.X.X:9200";

4,启动

  • 启动head
    nohup grunt server 
    

5,遇到的问题

1) npm  install时卡住不动

npm install --global smart-npm --registry=https://registry.npm.taobao.org/

2)提示:npm ERR! Error: EACCES: permission denied, access

(1)创建global安装任务的目录 
mkdir ~/.npm-global 
(2)配置npm使用新的目录 
npm config set prefix '~/.npm-global' 
(3)在~/.profile文件中增加配置 
export PATH=~/.npm-global/bin:$PATH 
(4)配置文件立即生效 
source ~/.profile 
(5)重新执行命令 
npm install

3)安装grunt报错

   run `npm audit fix` to fix them, or `npm audit` for details html

$npm audit fix

    npm audit fix --force` to install breaking changes; or do it by hand

$npm audit fix --force

$npm audit

 

 

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值