1.简介
elasticsearch-head是一个界面化的集群操作和管理工具,可以对集群进行傻瓜式操作。你可以通过插件把它集成到es(首选方式),也可以安装成一个独立webapp。
es-head主要有三个方面的操作:
- 显示集群的拓扑,并且能够执行索引和节点级别操作
- 搜索接口能够查询集群中原始json或表格格式的检索数据
- 能够快速访问并显示集群的状态
- 有一个输入窗口,允许任意调用RESTful API。这个接口包含几个选项,可以组合在一起以产生有趣的结果;
1. 请求方法(get、put、post、delete),查询json数据,节点和路径
2. 支持JSON验证器
3. 支持重复请求计时器
4. 支持使用javascript表达式变换结果
5. 收集结果的能力随着时间的推移(使用定时器),或比较的结果
6. 能力图表转换后的结果在一个简单的条形图(包括时间序列)
官方的文档:
GitHub - mobz/elasticsearch-head: A web front end for an elastic search cluster
2.安装
第一种安装方式
- 我们只介绍插件的安装方式,另外的方式大家看官方文档即可。ES-head作为插件,有两个安装方式:
通过elasticseach自带的plugin命令
如下图:
D:\elasticsearch\elasticsearch-6.2.0\bin>elasticsearch-plugin install elasticsearch-head
A tool for managing installed elasticsearch plugins
Commands
--------
list - Lists installed elasticsearch plugins
install - Install a plugin
remove - removes a plugin from Elasticsearch
Non-option arguments:
command
Option Description
------ -----------
-h, --help show help
-s, --silent show minimal output
-v, --verbose show verbose output
ERROR: Unknown plugin elasticsearch-head
以前使用命令
elasticsearch/bin/plugin -install mobz/elasticsearch-head
- 1
但是6.X版本,改成elasticsearch-plugin了,具体看下图
但是没有安装成功。说没有这个包(未解决)
第2种安装方式
第二种方式就是不通过Elasticsearch插件方式进行安装
1、下载elasticsearch-head的源码包
地址:https://github.com/mobz/elasticsearch-head/releases
2、安装node运行环境
地址:https://nodejs.org/en/download/
3、安装完node之后编译elasticsearch-head
执行npm install -g grunt-cli 编译源码
执行npm install 安装服务
执行grunt server启动服务
启动服务之后访问Node Exporter
4、接下来还需要修改elasticsearch相关配置
修改 elasticsearch/config/elasticsearch.yml
添加
http.cors.enabled: true
http.cors.allow-origin: "*"
接下来在浏览器访问Node Exporter