Elasticsearch集群可视化工具:elasticsearch-head

在企业生产环境中,由于网络安全要求或特殊业务场景,我们经常需要在完全离线的环境下部署Elasticsearch管理工具。本文将详细介绍如何在内网环境中离线安装和使用elasticsearch-head--这款轻量级的Elasticsearch集群可视化工具,帮助您在没有互联网连接的情况下实现高效的集群管理。

1 elasticsearch-head简介

elasticsearch-head是Elasticsearch的一个开源Web前端插件,主要功能包括:
  • 实时监控集群健康状态
  • 可视化展示节点和分片分布
  • 索引管理和数据浏览
  • 直接执行REST API命令
相比于Kibana,elasticsearch-head更加轻量,适合快速部署和日常运维使用

2 离线安装准备

2.1 资源下载

elasticsearch-head下载地址: Tags · mobz/elasticsearch-head · GitHub
nodejs下载地址: https://nodejs.org/dist

2.2 解压elasticsearch-head

# 上传并解压elasticsearch-head-5.0.0.tar.gz 
tar -zxvf elasticsearch-head-5.0.0.tar.gz

2.3 解压nodejs

# 上传并解压node-v14.17.6-linux-x64.tar.xz 
tar -xvf node-v14.17.6-linux-x64.tar.xz

3 配置nodejs环境变量

echo 'export PATH=$PATH:/export/home/es-head/node-v14.17.6-linux-x64/bin' >> /etc/profile
source /etc/profile

[root@node6 es-head]# npm -v
6.14.15
[root@node6 es-head]# node -v
v14.17.6
[root@node6 es-head]# 

4 配置Elasticsearch跨域访问

# 编辑elasticsearch.yml,添加如下内容
http.cors.enabled: true
http.cors.allow-origin: *
http.cors.allow-methods: GET,POST,PUT,DELETE
http.cors.allow-headers: Content-Type,Authorization,X-Requested-With


# 重启elasticsearch
ps -ef |grep elasticsearch|grep -v grep |awk '{print $2}'|xargs kill -9 
/export/home/elasticsearch-7.10.1/bin/elasticsearch -d

5 启动服务

# 后台启动 
nohup npm run start > /var/log/es-head.log 2>&1 &

6 验证

7 常见问题:缺少依赖

# 在有网络的机器上安装相同依赖,然后打包复制整个node_modules目录到elasticsearch-head-5.0.0目录下解压 
npm install

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

打赏作者

IT成长日记

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

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

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

打赏作者

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

抵扣说明:

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

余额充值