记一次 Centos7 安装 Elasticsearch-head ( Elasticsearch 可视化工具)

QQ交流群:64655993   希望能对您有所帮助!!!

一、基础环境说明

1、系统说明

系统:CentOS-7-x86_64-Minimal-1708

下载地址: 

 http://archive.kernel.org/centos-vault/7.4.1708/isos/x86_64/   

2、使用工具

工具:xshell5

VMware 版本:VMware Workstation Pro15

3、安装虚拟机(也可基于已安装好的ES集群中的某一个节点,下文选择了集群的一个节点)

安装1个虚拟机

虚拟机配置:  1G内存  1核CPU

安装过程可参考:

https://blog.csdn.net/llwy1428/article/details/89328381

4、虚拟机接入互联网

网卡配置可参考:

https://blog.csdn.net/llwy1428/article/details/85058028

二、安装部署

1、安装部署 Elasticsearch 环境:

参考:

https://hunter.blog.csdn.net/article/details/89714709

2、修改配置文件

[root@node3 ~]# su es
[es@node3 ~]$ vim /opt/elasticsearch/elasticsearch-7.4.0/config/elasticsearch.yml
写入以下内容
http.cors.enabled: true
http.cors.allow-origin: "*"

3、安装 nodejs 环境

[root@node3 ~]# yum install epel-release git vim net-tool -y
[root@node3 ~]# yum install nodejs npm -y

4、下载 elasticsearch-head 源码

创建目录
[root@node3 ~]# mkdir /opt/eshead
进入目录
[root@node3 ~]# cd /opt/eshead/
下载源码
[root@node3 eshead]# git clone https://github.com/mobz/elasticsearch-head.git

5、查看源码目录

6、使用 npm 安装

[root@node3 ~]# cd /opt/eshead/elasticsearch-head

[root@node3 elasticsearch-head]# npm install

注意:如果 npm 安装速度太慢,可采用国内镜像

安装淘宝 npm 镜像请参考:

https://blog.csdn.net/llwy1428/article/details/90139929

7、控制台启动项目

[root@node3 elasticsearch-head]# npm run start

可看到如下效果,说明安装成功,但此时还不能与已安装好的 elasticsearch 集群相连接,需要进一步配置

8、修改 elasticsearch-head 中的配置文件

[root@node3 elasticsearch-head]# vim Gruntfile.js
增加如下内容(如下图)
hostname: '0.0.0.0',

[root@node3 elasticsearch-head]# vim _site/app.js
修改如下内容(如下图)
this.base_uri = this.config.base_uri || this.prefs.get("app-base_uri") || "http://192.168.11.133:9200";

9、重新启动项目(控制台启动)

[root@node3 elasticsearch-head]# ./node_modules/grunt/bin/grunt server

启动效果如下图(连接成功,集群健康值:green):

10、后台守护启动

[root@node3 elasticsearch-head]# ./node_modules/grunt/bin/grunt server &

11、查看启动状态

[root@node3 ~]# netstat -lntp

12、关闭服务

[root@node3 ~]# kill -9 8443(PID)

 

 

至此 Centos7 安装 Elasticsearch-head 操作完毕!

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章