Elasticsearch6.0 安裝elasticsearch-head插件

es-head主要有三個方面的操做:javascript

  1. 顯示集羣的拓撲,而且可以執行索引和節點級別操做
  2. 搜索接口可以查詢集羣中原始json或表格格式的檢索數據
  3. 可以快速訪問並顯示集羣的狀態
  4. 有一個輸入窗口,容許任意調用RESTful API。這個接口包含幾個選項,能夠組合在一塊兒以產生有趣的結果; 
    1. 請求方法(get、put、post、delete),查詢json數據,節點和路徑
    2. 支持JSON驗證器
    3. 支持重複請求計時器
    4. 支持使用javascript表達式變換結果
    5. 收集結果的能力隨着時間的推移(使用定時器),或比較的結果
    6. 能力圖表轉換後的結果在一個簡單的條形圖(包括時間序列)

官方的文檔: 
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

相關文章
相關標籤/搜索