es安装elasticsearch-head插件

es安装elasticsearch-head插件

1. elasticsearch-head需要依赖 node.js

1.1 下载nodeJs

# 下载 nodejs
wget https://nodejs.org/dist/v9.9.0/node-v9.9.0-linux-x64.tar.xz

1.2 解压

# 1. 解压
tar -xf node-v9.9.0-linux-x64.tar.xz
# 2. 解压文件夹重命名
mv node-v9.9.0-linux-x64 nodeJs

1.3 新增到系统环境变量

编辑文件 /etc/profile

# nodejs环境变量/home/head/nodeJs为解压文件夹
export PATH=/home/head/nodeJs/bin:$PATH
# 刷新
source /etc/profile
# node版本查看
[root@localhost head]# node -v
v9.9.0

2 下载head插件

2.1 直接下载
wget https://github.com/mobz/elasticsearch-head/archive/master.zip
2.2 百度网盘下载

https://pan.baidu.com/s/10dFFbLXlLM4x9YKa-ZCp3A
提取码:mrhf

2.3 解压
# 1. 程序包解压
unzip master.zip
# 2. 使用淘宝的镜像库进行下载,速度很快,下载需要写时间,下载成功后续的所有npm可改为cnpm
npm install -g cnpm --registry=https://registry.npm.taobao.org
# 3. 进入解压文件,下载node_module依赖包,在install可能因为确实其他包报错,根据报错信息百度下载解决,在重新执行install
cnpm installnpm install
2.4 配置文件

进入解压文件夹下

  1. 修改 Gruntfile.js文件:hostname: ‘*’
    在这里插入图片描述
  2. 修改_site/app.js
    找到:app.App = ui.AbstractWidget.extend
    在这里插入图片描述
  3. elasticsearch的elasticsearch.yml文件新增
    解决http访问es跨域问题,需要重启es
http.cors.enabled: true
http.cors.allow-origin: "*"
http.cors.allow-methods: OPTIONS, HEAD, GET, POST, PUT, DELETE
http.cors.allow-headers: "X-Requested-With, Content-Type, Content-Length, X-User"

4. head插件启动关闭

4.1 守护进程启动

# 进入该目录启动 /安装目录/node_modules/grunt/bin
[root@localhost bin]# pwd
/home/head/elasticsearch-head-master/node_modules/grunt/bin
# 启动
[root@localhost bin]# nohup ./grunt server >/dev/null 2>&1 &
[1] 9248

4.2 关闭,kill -9 pid

[root@localhost config]# netstat -nltp | grep 9100
tcp6       0      0 :::9100                 :::*                    LISTEN      8784/grunt          
[root@localhost config]# kill -9 8784

5 访问

http://xxx.xxx.xxx.xxx:9100/

在这里插入图片描述

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值