【ElasticSearch系列(二)】elasticsearch安装head插件

安装步骤如下:

一、安装nodejs

head插件是nodejs实现的,所以必须先安装Nodejs

安装步骤:https://blog.csdn.net/zhanyu1/article/details/88082758

二、安装git

由于要使用git方式下载head插件,因此需要先安装git
安装步骤:https://blog.csdn.net/zhanyu1/article/details/88083041

三、下载并安装head插件

进入/usr/local目录下
[root@localhost ~]# cd /usr/local
执行以下步骤:

上述步骤中,npm install这个步骤执行太慢,需要按照以下方法改造下npm镜像地址

1、npm get registry --显示当前的镜像网址

[root@localhost elasticsearch-head]# npm get registry
https://registry.npmjs.org/

2、修改npm镜像地址

[root@localhost elasticsearch-head]# npm config set registry http://registry.npm.taobao.org

3、再次运行npm get registry,则npm镜像地址已改变

[root@localhost elasticsearch-head]# npm get registry
http://registry.npm.taobao.org/

四、进入elasticsearch配置文件配置head插件

[root@localhost ~]# cd /home/es/elasticsearch-6.3.0/config/
打开 elasticsearch.yml,文件最后加上以下内容

http.cors.enabled: true
http.cors.allow-origin: “*”

五、安装测试

1)启动elasticsearch
[elastic@localhost root]$ sh /home/es/elasticsearch-6.3.0/bin/elasticsearch -d

2)执行npm run start 启动插件,出现以下情况,说明启动成功
[elastic@localhost elasticsearch-head]$ npm run start
在这里插入图片描述

3)浏览器输入 http://192.168.1.102:9100/
红色框输入 http://192.168.1.102:9200/ 点击连接,出现以下情况,则说明整个配置过程正常完成。
在这里插入图片描述

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