linux centos7 安装elasticsearch-head

1、操作系统版本

2、下载elasticsearch-head插件

下载地址:https://github.com/mobz/elasticsearch-head

3、下载node.js

https://cdn.npm.taobao.org/dist/node/v14.3.0/node-v14.3.0-linux-x64.tar.xz

4、安装node.js

解压 node-v14.3.0-linux-x64.tar.xz

export NODE_HOME=/u01/node-v14.3.0-linux-x64
export PATH=$PATH:$NODE_HOME/bin
export NODE_PATH=$NODE_HOME/lib/node_modules

查看是否安装成功

node -v 查看版本号

5、安装 elasticsearch-head

unzip elasticsearch-head-master.zip

mv elasticsearch-head-master elasticsearch-head

安装epel源

yum -y install epel-release

yum -y install npm

cd elasticsearch-head

npm install --如若报错

npm ERR! Linux 3.10.0-693.el7.x86_64
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "install"
npm ERR! node v6.17.1
npm ERR! npm  v3.10.10
npm ERR! code ELIFECYCLE

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 'node install.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the phantomjs-prebuilt package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node install.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs phantomjs-prebuilt
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls phantomjs-prebuilt
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /opt/software/elasticsearch-head/npm-debug.log
npm ERR! code 1

说明是网络源有问题

查看网络源

[root@microservice-test2 elasticsearch-head]# npm config get registry
https://registry.npmjs.org/

果然为国外源 设置为阿里

[root@microservice-test2 elasticsearch-head]# npm config set registry http://registry.npm.taobao.org
[root@microservice-test2 elasticsearch-head]# npm config get registry
http://registry.npm.taobao.org/

问题
用npm安装模块时,npm 报了这样的一个错误ERR! registry error parsing json。

方法
npm config delete registry 删除registry,继续安装模块就可以了

用 npm install 安装还报错,换成下面的命令成功:
npm install phantomjs-prebuilt@2.1.14 --ignore-scripts

安装这个项目会花费大量的时间

安装完后,会生成一个node_modes文件夹

可以通过grunt -version查看grunt版本号

6、 配置相关文件

1) 修改elasticsearch.yml,增加跨域的配置(需要重启es才能生效)

vi /etc/elasticsearch/elasticsearch.yml

加入配置:
   http.cors.enabled: true
   http.cors.allow-origin: “*”

2) 修改Gruntfile.js文件,修改服务监听地址(增加hostname属性,将其值设置为’0.0.0.0’)

92行添加:hostname:‘0.0.0.0’,

7、 重启elasticsearch服务、启动head插件服务

启动head插件服务:npm run start
  后台启动:
  nohup npm run start >> output.log 2>&1 &

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
CentOS 7.9版本(CentOS-7-i386-Everything-2009)适用于i386,必须集齐9个文件才能一起解压缩使用,9个文件下载地址: CentOS-7-i386-Everything-2009.part09.rar https://download.csdn.net/download/weixin_43800734/20433341 CentOS-7-i386-Everything-2009.part08.rar https://download.csdn.net/download/weixin_43800734/20433316 CentOS-7-i386-Everything-2009.part07.rar https://download.csdn.net/download/weixin_43800734/20433271 CentOS-7-i386-Everything-2009.part06.rar https://download.csdn.net/download/weixin_43800734/20433250 CentOS-7-i386-Everything-2009.part05.rar https://download.csdn.net/download/weixin_43800734/20433222 CentOS-7-i386-Everything-2009.part04.rar https://download.csdn.net/download/weixin_43800734/20433129 CentOS-7-i386-Everything-2009.part03.rar https://download.csdn.net/download/weixin_43800734/20433111 CentOS-7-i386-Everything-2009.part02.rar https://download.csdn.net/download/weixin_43800734/20433025 CentOS-7-i386-Everything-2009.part01.rar https://download.csdn.net/download/weixin_43800734/20432977 CentOS是免费的、开源的、可以重新分发的开源操作系统,CentOS(Community Enterprise Operating System,中文意思是社区企业操作系统)是Linux发行版之一。 CentOS Linux发行版是一个稳定的,可预测的,可管理的和可复现的平台,源于Red Hat Enterprise Linux(RHEL)依照开放源代码(大部分是GPL开源协议 )规定释出的源码所编译而成。自2004年3月以来,CentOS Linux一直是社区驱动的开源项目,旨在与RHEL在功能上兼容。

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值