携手创造,共同生长!这是我参与「日新计划 8 月更文应战」的第9天,点击检查活动概况

装置elasticsearch-head插件

1.装置head插件

1.1.谷歌浏览器装置es-head插件

装置完谷歌head插件后,服务器无需布置head服务也可以链接es集群

github.com/liufengji/e…

下载后将插件crx后缀修改为zip,然后解压文件

两种方式部署elasticsearch-head插件(四)

点击谷歌浏览器—更多东西—扩展程序—加载现已解压的程序—挑选文件夹即可

两种方式部署elasticsearch-head插件(四)
两种方式部署elasticsearch-head插件(四)

2.1.装置head插件

1.装置nodejs环境
[root@elastic soft]# wget https://nodejs.org/dist/v10.16.3/node-v10.16.3-linux-x64.tar.xz
[root@elastic soft]# tar xf node-v10.16.3-linux-x64.tar.xz -C /usr/local/
[root@elastic soft]# vim /etc/profile
export NODE_HOME=/usr/local/node-v10.16.3-linux-x64
export PATH=$NODE_HOME/bin:$PATH
[root@elastic soft]# source /etc/profile
[root@elastic soft]# node -v
v10.16.3
[root@elastic soft]# npm -v
6.9.0
2.装置head
[root@elastic soft]# git clone git://github.com/mobz/elasticsearch-head.git
[root@elastic soft]# cd elasticsearch-head/
[root@elastic elasticsearch-head]# npm install
3.发动head
[root@elastic elasticsearch-head]# npm run start &
> elasticsearch-head@0.0.0 start /root/soft/elasticsearch-head
> grunt server
Running "connect:server" (connect) task
Waiting forever...
Started connect web server on http://localhost:9100
4.检查端口
[root@elastic phantomjs]# netstat -lnpt | grep 9100
tcp        0      0 0.0.0.0:9100            0.0.0.0:*               LISTEN      41450/grunt

两种方式部署elasticsearch-head插件(四)

访问head插件

两种方式部署elasticsearch-head插件(四)

2.2.配置elasticsearch答应head插件远程访问

[root@elastic ~]# vim /etc/elasticsearch/elasticsearch.yml
http.cors.enabled: true
http.cors.allow-origin: "*"
[root@elastic ~]# systemctl restart elasticsearch

2.3.登录head插件

填写es服务器点击连接即可

两种方式部署elasticsearch-head插件(四)

3.装置head插件报错解决

3.1.npm install软件长期不响应

如果npm install的时分长期不加载则去浏览器把这个软件下载下来

github.com/Medium/phan…

两种方式部署elasticsearch-head插件(四)

下载好放到这个目录

/tmp/phantomjs/phantomjs-2.1.1-linux-x86_64.tar.bz2

两种方式部署elasticsearch-head插件(四)

3.2.npm install报错解决

报错如下图

两种方式部署elasticsearch-head插件(四)

[root@elastic elasticsearch-head]# npm audit fix

修正一下,在履行npm install

如果仍是修正不成功则运用如下修正方式

​ 1.淘宝镜像源会自动修正,然后下载相关依靠包。

​ 2.运用nrm use taobao,nrm如果没有装置,就运用npm i -g nrm,然后再运用nrm use taobao

​ 3.再运用npm i 装置一遍所有依靠包,这时分没下载的会自动下载,再运用npm install进行初始化即可

[root@elastic elasticsearch-head]# npm i -g nrm
[root@elastic elasticsearch-head]# nrm use taobao
   Registry has been set to: https://registry.npm.taobao.org/
[root@elastic elasticsearch-head]# npm i
[root@elastic elasticsearch-head]# npm install
npm WARN elasticsearch-head@0.0.0 license should be a valid SPDX license expression
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.13 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
up to date in 4.652s