Elasticsearch6.0 安装elasticsearch-head插件

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Elasticsearch6.0 安装elasticsearch-head插件相关的知识,希望对你有一定的参考价值。

es-head主要有三个方面的操作:

  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-head

 

1、Elasticsearch6.0安装插件,这个和低版本安装不一样.需要先安装nodejs

1)、下载npm包
官网下载npm安装包,https://nodejs.org/en/
[[email protected] elasticsearch-head]# wget  https://nodejs.org/dist/v8.9.1/node-v8.9.1-linux-x64.tar.xz

2)、解压,创建链接
[[email protected] elasticsearch-head]#tar xf node-v8.9.1-linux-x64.tar.xz
[[email protected] elasticsearch-head]#mv node-v8.9.1-linux-x64 /usr/local
[[email protected] elasticsearch-head]#ln -s /usr/local/node-v8.9.1-linux-x64/bin/node /usr/local/bin/node
[[email protected] elasticsearch-head]#ln -s /usr/local/node-v8.9.1-linux-x64/bin/npm /usr/local/bin/npm

2、安装elasticsearch-head

[[email protected] ]#cd /usr/local
[[email protected] ]# git clone git://github.com/mobz/elasticsearch-head.git
[[email protected] ]# cd elasticsearch-head
[[email protected] elasticsearch-head]# npm install
[[email protected] elasticsearch-head]# npm install grunt --save-dev
[[email protected] elasticsearch-head]# rm -f /usr/local/bin/grunt
[[email protected] elasticsearch-head]# ln -s /usr/local/elasticsearch-head/node_modules/grunt/bin/grunt /usr/local/bin/grunt

出现如下错误,需要安装缺少的包:

[[email protected] 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.

安装方法如下:

[[email protected] elasticsearch-head]# npm install grunt-contrib-clean -registry=https://registry.npm.taobao.org 
[[email protected] elasticsearch-head]# npm install grunt-contrib-concat -registry=https://registry.npm.taobao.org 
[[email protected] elasticsearch-head]# npm install grunt-contrib-watch -registry=https://registry.npm.taobao.org 
[[email protected] elasticsearch-head]# npm install grunt-contrib-connect -registry=https://registry.npm.taobao.org 
[[email protected] elasticsearch-head]# npm install grunt-contrib-copy -registry=https://registry.npm.taobao.org 
[[email protected] elasticsearch-head]# npm install grunt-contrib-jasmine -registry=https://registry.npm.taobao.org

启动head插件:
[[email protected] 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

3、安装完成后,在网页浏览

技术分享图片

 



以上是关于Elasticsearch6.0 安装elasticsearch-head插件的主要内容,如果未能解决你的问题,请参考以下文章

Elasticsearch6.0及其head插件安装

Elasticsearch6.0安装

Elasticsearch6.0 安装elasticsearch-head插件

Elasticsearch6.0 重大变化之Java API

ElasticSearch6.0 索引模板

您可以连接到亚马逊以外的 Amazon ElastiСache Redis 吗?