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 &
相关推荐
Elastic 中国社区官方博客15 小时前
我们如何在 Elasticsearch Serverless 上将向量搜索吞吐量提升一倍
大数据·数据库·人工智能·elasticsearch·搜索引擎·云原生·serverless
愤怒的苹果ext18 小时前
Flink同步到ES时间遇到的问题
elasticsearch·flink·时间
共享家952718 小时前
OpenClaw核心功能
大数据·elasticsearch·搜索引擎
醉颜凉21 小时前
实战教程:如何使用 Kibana 对 Elasticsearch 数据进行可视化和操作(从入门到精通)
大数据·elasticsearch·jenkins
oioihoii21 小时前
CentOS 7单机部署Elasticsearch:这些坑和关键配置,生产环境踩过才知道
linux·elasticsearch·centos
Elastic 中国社区官方博客21 小时前
Kibana 仪表板即代码:在 Elastic 9.4 中用于 Kibana 仪表板的 GitOps、漂移检测与 Terraform
大数据·人工智能·elasticsearch·搜索引擎·云原生·kibana·terraform
MemoriKu1 天前
【端侧 AI 部署】MobileCLIP 导出 ONNX/TFLite 并发布到 Hugging Face 的完整实践
大数据·人工智能·elasticsearch·搜索引擎·重构·开源
逸Y 仙X1 天前
文章五:Elasticsearch安全通信
java·大数据·安全·elasticsearch·搜索引擎·全文检索·jenkins
linksinke1 天前
在 CentOS 7.x 外网环境离线构建便携式 Python 3.11.4 的方案参考
linux·python·centos
daqinzl1 天前
Mpegts.js+FFmpeg+WebSocket+Node实时视频流实现方案
websocket·ffmpeg·node·mpegts.js