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 &
相关推荐
何朴尧8 小时前
centos/cuos如何开启软件源
linux·运维·centos
橘子在努力10 小时前
【橘子ES】如何本地调试ES源码
elasticsearch·搜索引擎
柳贯一(逆流河版)11 小时前
ElasticSearch 实战:全文检索与数据聚合分析的完整指南
大数据·elasticsearch·全文检索
Jammingpro12 小时前
【Git版本控制】Git初识、安装、仓库初始化与仓库配置(含git init、git config与配置无法取消问题)
java·git·elasticsearch
IT 小阿姨(数据库)13 小时前
PostgreSQL REST API 介绍
运维·数据库·sql·postgresql·centos
失散1315 小时前
分布式专题——44 ElasticSearch安装
java·分布式·elasticsearch·架构
stark张宇16 小时前
攻克 CRMRB 部署难点:从 PHP 扩展、数据库配置到进程守护
nginx·centos·php
罗政16 小时前
【免费】轻量级服务器centos监控程序+内存+cpu+nginx+适合小型站长使用
服务器·nginx·centos
arvin_xiaoting17 小时前
#zsh# #Ubuntu# 一键安装zsh、oh-my-zsh、常用插件
linux·ubuntu·elasticsearch
bemyrunningdog18 小时前
IntelliJ IDEA合并分支到master全攻略
大数据·elasticsearch·intellij-idea