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 &
相关推荐
Elasticsearch20 小时前
更少的位数,相同的召回率:DiskBBQ 更保守的自动校准扫描
elasticsearch
瑞克-桑切斯2 天前
docker Harbor 单机部署手册
大数据·运维·elasticsearch·docker·容器
Elasticsearch4 天前
对 OpenTelemetry Kafka 接收器的两项改动,避免一个缓慢的租户拖住其他租户
elasticsearch
David猪大卫4 天前
【Linux修炼】环境变量、进程地址空间
linux·c语言·经验分享·笔记·学习·ubuntu·centos
全栈陈序员5 天前
Git】从入门到精通(八)—— git log:查看提交历史
大数据·git·elasticsearch
Percep_gan5 天前
Linux中安装gitea,很详细
linux·elasticsearch·gitea
木棉软糖6 天前
5 步确认 TiDB 历史抽数的 Logstash 有没有真的写进 ES
elasticsearch·oracle·tidb
Dragon~Snow6 天前
Centos Stream10 安装 MySQL-9.7.2-linux-glibc2.28-x86_64.tar
linux·mysql·centos
全栈陈序员6 天前
【Git】从入门到精通(十一)—— git reset 三种模式详解
git·elasticsearch
Elasticsearch6 天前
Elasticsearch:稠密向量字段类型
elasticsearch