CentOS系统环境搭建(十四)——CentOS7.9安装elasticsearch-head

centos系统环境搭建专栏🔗点击跳转

关于node的安装请看上一篇CentOS系统环境搭建(十三)------CentOS7安装nvm,🔗点击跳转

CentOS7.9安装elasticsearch-head

文章目录

这个的安装非常简单,既然我们的node环境已经安装完毕,就让我们快速完成。

1.下载

bash 复制代码
wget -O /usr/local/elasticsearch-head-5.0.0.zip https://github.com/mobz/elasticsearch-head/archive/refs/tags/v5.0.0.zip

2.解压

bash 复制代码
cd /usr/local
bash 复制代码
unzip elasticsearch-head-5.0.0.zip

3.修改Gruntfile.js

bash 复制代码
vim Gruntfile.js

添加hostname: '*'

3.安装

bash 复制代码
cd /usr/local/elasticsearch-head-5.0.0
bash 复制代码
npm update
bash 复制代码
npm install

如果报错,使用淘宝镜像再尝试一下。

bash 复制代码
npm install -g cnpm --registry=https://registry.npm.taobao.org

4.启动elasticsearch-head服务

bash 复制代码
npm run start

5.解决跨域

访问http://ip:9200/后你发现明明elasticsearch已经启动,为什么head没有监控到?那仅仅是因为出现了跨域问题而已,这时候需要你修改配置了。

修改elasticsearch.yml文件

bash 复制代码
vim /usr/local/elasticsearch-7.17.12/config/elasticsearch.yml

在末尾添加如下内容

bash 复制代码
http.cors.enabled: true
http.cors.allow-origin: "*"

重启你的elasticsearch,然后再次访问http://ip:9100/

6.效果如下

我的ip要写成云服务器ip,各位本地启动,想必直接可以了。

7.后台启动

bash 复制代码
nohup npm run-script start &
相关推荐
Elasticsearch2 天前
如何通过 Claude Code 来写入 CSV 数据到 Elasticsearch
elasticsearch
大志哥1234 天前
ES和Logstash日志链路系统上线后遭遇切片爆炸(解决)
大数据·elasticsearch
TableRow4 天前
参数化搜索的实现原理:从多维索引到查询优化
elasticsearch·全文检索
2601_961875244 天前
决战申论100题2026|最新|范文
linux·容器·centos·debian·ssh·fabric·vagrant
醉颜凉4 天前
Elasticsearch高性能优化:Bulk API大规模数据导入性能调优全攻略
elasticsearch·性能优化·jenkins
Ysouy4 天前
Spring Data Elasticsearch 全流程学习教程
java·spring·elasticsearch
沪飘大军4 天前
goldRush-专门分析黄金的投资理财agent
java·开发语言·elasticsearch
让学习成为一种生活方式4 天前
samblaster v.0.1.26安装与使用--生信工具096
大数据·elasticsearch·搜索引擎
小马爱打代码4 天前
Elasticsearch 容器化部署(单机版):从零搭建你的搜索和分析引擎
elasticsearch
西敏寺的乐章4 天前
排序三阶段:粗排→精排→重排,把业务信号灌进 ES 排序管道
elasticsearch·搜索引擎