es-head主要有三個方面的操做:javascript
官方的文檔:
https://github.com/mobz/elasticsearch-headjava
一、Elasticsearch6.0安裝插件,這個和低版本安裝不同.須要先安裝nodejsnode
1)、下載npm包
官網下載npm安裝包,https://nodejs.org/en/
[root@es-jypay-1 elasticsearch-head]# wget https://nodejs.org/dist/v8.9.1/node-v8.9.1-linux-x64.tar.xz
2)、解壓,建立連接
[root@es-jypay-1 elasticsearch-head]#tar xf node-v8.9.1-linux-x64.tar.xz
[root@es-jypay-1 elasticsearch-head]#mv node-v8.9.1-linux-x64 /usr/local
[root@es-jypay-1 elasticsearch-head]#ln -s /usr/local/node-v8.9.1-linux-x64/bin/node /usr/local/bin/node
[root@es-jypay-1 elasticsearch-head]#ln -s /usr/local/node-v8.9.1-linux-x64/bin/npm /usr/local/bin/npm
二、安裝elasticsearch-headlinux
[root@es-jypay-1 ]#cd /usr/local
[root@es-jypay-1 ]# git clone git://github.com/mobz/elasticsearch-head.git
[root@es-jypay-1 ]# cd elasticsearch-head
[root@es-jypay-1 elasticsearch-head]# npm install
[root@es-jypay-1 elasticsearch-head]# npm install grunt --save-dev
[root@es-jypay-1 elasticsearch-head]# rm -f /usr/local/bin/grunt
[root@es-jypay-1 elasticsearch-head]# ln -s /usr/local/elasticsearch-head/node_modules/grunt/bin/grunt /usr/local/bin/grunt
出現以下錯誤,須要安裝缺乏的包:
[root@es-jypay-1 elasticsearch-head]# /usr/share/elasticsearch/plugins/elasticsearch-head/node_modules/grunt/bin/grunt server
>> Local Npm module "grunt-contrib-clean" not found. Is it installed?
>> Local Npm module "grunt-contrib-concat" not found. Is it installed?
>> Local Npm module "grunt-contrib-watch" not found. Is it installed?
>> Local Npm module "grunt-contrib-connect" not found. Is it installed?
>> Local Npm module "grunt-contrib-copy" not found. Is it installed?
>> Local Npm module "grunt-contrib-jasmine" not found. Is it installed?
Warning: Task "connect:server" not found. Use --force to continue.
安裝方法以下:
[root@es-jypay-1 elasticsearch-head]# npm install grunt-contrib-clean -registry=https://registry.npm.taobao.org
[root@es-jypay-1 elasticsearch-head]# npm install grunt-contrib-concat -registry=https://registry.npm.taobao.org
[root@es-jypay-1 elasticsearch-head]# npm install grunt-contrib-watch -registry=https://registry.npm.taobao.org
[root@es-jypay-1 elasticsearch-head]# npm install grunt-contrib-connect -registry=https://registry.npm.taobao.org
[root@es-jypay-1 elasticsearch-head]# npm install grunt-contrib-copy -registry=https://registry.npm.taobao.org
[root@es-jypay-1 elasticsearch-head]# npm install grunt-contrib-jasmine -registry=https://registry.npm.taobao.org
啓動head插件:
[root@es-jypay-1 elasticsearch-head]# grunt --gruntfile=/usr/share/elasticsearch/plugins/elasticsearch-head/Gruntfile.js server --force &
elasticsearch/plugins/elasticsearch-head/Gruntfile.js server --force
(node:3719) ExperimentalWarning: The http2 module is an experimental API.
Running "connect:server" (connect) task
Waiting forever...
Started connect web server on http://localhost:9100
三、安裝完成後,在網頁瀏覽git