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 &
相关推荐
彧azz9 小时前
Git 入门实操实例:从安装到远程仓库全流程
大数据·笔记·git·学习·elasticsearch
醉颜凉10 小时前
Canal 与 Elasticsearch 实时同步:增量索引更新、删除处理与全量重建方案
elasticsearch·canal·数据同步·增量更新·全量重建
Meta3916 小时前
cenots8安装docker
docker·容器·centos
无风听海17 小时前
深入解析 Elasticsearch 的 match_phrase_prefix与 match_bool_prefix
大数据·elasticsearch·mybatis
天天喝旺仔18 小时前
Elasticsearch 全文检索实战:Lucene 倒排索引与 NoSQL 文档检索落地
elasticsearch·搜索引擎·全文检索·nosql·lucene
浅念-1 天前
一文吃透Git:本地操作|冲突处理|远程协作|GitFlow工作流详解
大数据·git·elasticsearch·搜索引擎·gitflow
vx-程序开发1 天前
【计算机毕设】基于Spring Boot的古城景区管理系统88564
java·数据库·spring boot·后端·spring·elasticsearch·课程设计
czhc11400756631 天前
2026-09-11 一日综合:树的父链、git 概念、三方死锁、静默失败
大数据·git·elasticsearch
持敬chijing2 天前
CentOS 从零搭建 LAMP 环境完整实战指南
linux·运维·web安全·网络安全·centos
Merlyj2 天前
华为 ASG Manager 镜像日志接收链路故障排查流程
centos·asg