Elasticsearch——Head插件安装

Head插件安装

head插件可以用来快速查看elasticsearch中的数据概况以及非全量的数据,也支持控件化查询和rest请求。

一、在es服务器上安装nodejs环境

  • 1、在官网上下载nodejs的包,并上传到服务器中
# 解压文件
[root@localhost nodejs]# tar -xf ./node-v16.9.0-linux-x64.tar.xz

在这里插入图片描述

  • 2、配置nodejs环境变量
# 编辑/etc/profile文件
[root@localhost bin]# vim /etc/profile
# 添加如下内容
export NODE_HOME=/home/software/nodejs/node-v16.9.0-linux-x64
export PATH=$PATH:$NODE_HOME/bin
# 使配置生效
[root@localhost bin]# source /etc/profile

在这里插入图片描述

二、安装head插件

  • 1、执行npm install -g grunt-cli命令
# 安装grunt-cli
[root@localhost bin]# npm install -g grunt-cli
# 查看grunt安装是否成功
[root@localhost bin]# grunt -version

在这里插入图片描述

  • 2、安装unzip解压软件
[root@localhost software]# yum -y install unzip
  • 3、上传head的zip包,并解压
[root@localhost elasticsearch]# unzip elasticsearch-head-master.zip 
  • 4、修改es的配置文件,开启head插件的访问配置
# 编辑es配置文件
[root@localhost config]# vim ./elasticsearch.yml 
http.cors.enabled: true
http.cors.allow-origin: "*"
  • 5、如果是多节点es,还需要修改head的配置文件
# 修改head的配置文件
[root@localhost elasticsearch-head-master]# vim Gruntfile.js 

在这里插入图片描述

  • 6、在head项目目录下,执行命令npm install,安装package.json中的依赖
[root@localhost elasticsearch-head-master]# npm install
# 因为npm下载过慢,所以我这边用的淘宝的cnpm命令
[root@localhost elasticsearch-head-master]# cnpm install
  • 7、启动head插件
[root@localhost elasticsearch-head-master]# grunt server

在这里插入图片描述

在这里插入图片描述

  • 8、启动es节点
[es@localhost bin]$ ./elasticsearch

在这里插入图片描述

  • 9、使用head连接es
    在这里插入图片描述
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值