ElasticSearch插件es-head安装及使用

环境要求

es-head需要nodejs环境编译,先看看机器中是否已经有nodejs环境,如果没有的话我们先要安装nodejs环境

nodejs下载地址

https://nodejs.org/en/download/

#解压
tar xvJf node-v12.17.0-linux-x64.tar.xz
 
#配置环境变量
mv node-v12.17.0-linux-x64 /opt/app/
vim /etc/profile
 
#新增下面的内容
export NODE_HOME=/opt/app/node-v12.17.0-linux-x64
export PATH=$NODE_HOME/bin:$PATH
 
#刷新环境变量
source /etc/profile

es-head下载地址

https://codechina.csdn.net/mirrors/mobz/elasticsearch-head?utm_source=csdn_github_accelerator

在这里插入图片描述
解压

[root@76-yace-es soft]# unzip elasticsearch-head-master.zip 

编译安装

cd elasticsearch-head-master/
[root@76-yace-es elasticsearch-head-master]# npm install

修改npm源

如果npm install一直卡在fetchMetadata: sill 不动的话,是因为访问的npm registry网络不行,我们可以修改为淘宝的仓库:

#查看npm仓库
npm config get registry
#或
npm info express
 
#修改为淘宝的源
npm config set registry https://registry.npm.taobao.org

这时候再执行npm install 速度就快很多了

注意:如果这时候出现这个错误

> phantomjs-prebuilt@2.1.16 install /home/wyk/elasticsearch-head-master/node_modules/phantomjs-prebuilt
> node install.js
 
internal/modules/cjs/loader.js:969
  throw err;
  ^
 
Error: Cannot find module '/home/wyk/elasticsearch-head-master/node_modules/phantomjs-prebuilt/install.js'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:966:15)
    at Function.Module._load (internal/modules/cjs/loader.js:842:27)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)
    at internal/main/run_main_module.js:17:47 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}
...
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! phantomjs-prebuilt@2.1.16 install: `node install.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the phantomjs-prebuilt@2.1.16 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
 
npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2020-05-27T03_40_09_380Z-debug.log

忽略phantomjs-prebuilt@2.1.16,修改安装命令再安装就行了

[root@76-yace-es elasticsearch-head-master]# npm install phantomjs-prebuilt@2.1.16 --ignore-scripts

需要在es中加上这两个参数

vim elasticsearchElasticsearch-7.13.2/config/elasticsearch.yml
http.cors.enabled: true
http.cors.allow-origin: "*"

es-head启动

上面修改完es配置后,重启所有es节点,在es-head目录下使用下面的命令启动es-head

[root@76-yace-es elasticsearch-head-master]# npm start  >/dev/null 2>&1 &

在这里插入图片描述

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值