CentOS7.9安装elasticsearch的Head插件

22 篇文章 0 订阅
2 篇文章 0 订阅

目录

1、下载安装包

2、安装依赖环境 

2.1 安装node

2.2 安装grunt

 3.安装head插件


1、下载安装包

CentOS7.9安装elasticsearch-8.3.1、kibana-8.3.1是以下文档安装的:

CentOS7.9安装elasticsearch-8.3.1、kibana-8.3.1和window 10安装elasticsearch-8.3.1、kibana-8.3.1_fyihdg的博客-CSDN博客CentOS7.9安装elasticsearch-8.3.1、kibana-8.3.1和window 10安装elasticsearch-8.3.1、kibana-8.3.1https://blog.csdn.net/fyihdg/article/details/125619236

下载安装包:

GitHub - mobz/elasticsearch-head: A web front end for an elastic search clusterA web front end for an elastic search cluster. Contribute to mobz/elasticsearch-head development by creating an account on GitHub.https://github.com/mobz/elasticsearch-head

需要运行node.js环境,安装node,下载地址:

Download | Node.jsNode.js® is a JavaScript runtime built on Chrome's V8 JavaScript engine.https://nodejs.org/en/download/

本次安装需要的包我上传了,可以免积分下载:

elasticsearch-head-master.zip和node-v16.16.0-linux-x64.tar.xz-Java文档类资源-CSDN下载2022年7月9日下载的,从官网下载的最新版elasticsearch-head-master.更多下载资源、学习资料请访问CSDN下载频道.https://download.csdn.net/download/fyihdg/85984805

2、安装依赖环境 

2.1 安装node

上传到服务器

解压到/opt 

tar -xvf node-v16.16.0-linux-x64.tar.xz  -C /opt

 添加node.js到环境变量

vi /etc/profile
 export NODE_HOME=/opt/node-v16.16.0-linux-x64
  
 $NODE_HOME/bin

 使文件生效

source /etc/profile

检查是否安装成功 

node -v

npm -v

 打印出版本号,证明安装成功了

2.2 安装grunt

grunt是一个很方便的构建工具,可以进行打包压缩、测试、执行等等的工作

输入命令安装:

 npm install -g grunt-cli

或者

由于 npm 是国外的源,下载速度比较慢,推荐使用国内淘宝镜像执行完上面的命令后就可以使用 cnpm 来代替上面的npm 命令

npm install -g cnpm --registry=https://registry.npm.taobao.org

 grunt -version命令检查是否安装成功

 可以看完,安装成功了

 3.安装head插件

elasticsearch-head-master.zip是一个zip包,要用unzip解压

unzip elasticsearch-head-master.zip

 切换到目录:/home/soft/elasticsearch-head-master,修改Gruntfile.js文件

vi Gruntfile.js 

 添加:

 hostname:'*'

 切换到ES目录:/opt/elasticsearch-8.3.1/config,修改 elasticsearch.yml 文件,添加:

http.cors.enabled: true
http.cors.allow-origin: "*"

 然后重启es

当前目录输入

npm install

 输入命令:

npm run start

[root@node05 elasticsearch-head-master]# npm run start

> elasticsearch-head@0.0.0 start
> grunt server

grunt-cli: The grunt command line interface (v1.4.3)

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:

https://gruntjs.com/getting-started
[root@node05 elasticsearch-head-master]# clear

提示unable to file local grunt,原因是因为当前工程(head工程中没有grunt的本地文件)

在head插件根目录执行

npm install -g grunt

 

再执行:

npm install grunt

 再次启动:

grunt server

 还是报错

[root@node05 elasticsearch-head-master]# grunt server
>> Local Npm module "grunt-contrib-clean" not found. Is it installed?
>> Local Npm module "grunt-contrib-concat" not found. Is it installed?
>> Local Npm module "grunt-contrib-watch" not found. Is it installed?
>> Local Npm module "grunt-contrib-connect" not found. Is it installed?
>> Local Npm module "grunt-contrib-copy" not found. Is it installed?
>> Local Npm module "grunt-contrib-jasmine" not found. Is it installed?
Warning: Task "connect:server" not found. Use --force to continue.

Aborted due to warnings.
[root@node05 elasticsearch-head-master]# 

缺少grunt支持部件,注意要在head根目录执行

挨个执行 

 npm install [缺少的插件名称]

npm install   grunt-contrib-clean

npm install   grunt-contrib-concat

npm install   grunt-contrib-watch

npm install   grunt-contrib-connect

npm install   grunt-contrib-jasmine

 再次启动:

 grunt server

 端口被占用,查询哪个程序占用

lsof -i:9100

 /home/soft/elasticsearch-head-master修改文件:vi Gruntfile.js ,修改端口,或者杀掉占用的进程

再次启动:

 grunt server

 浏览器输入:http://192.168.1.66:9106/

 

 

 安装成功了

按ctrl +C 在当前窗口,可以停止服务

还可以使用这个命令启动:

npm run start

 按ctrl +C 在当前窗口,也可以停止服务

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

fyihdg

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值