02-windows下elasticsearch安装elasticsearch-head

1.简介

elasticsearch-head是一个界面化的集群操作和管理工具,可以对集群进行傻瓜式操作。你可以通过插件把它集成到es(首选方式),也可以安装成一个独立webapp。

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

显示集群的拓扑,并且能够执行索引和节点级别操作
搜索接口能够查询集群中原始json或表格格式的检索数据
能够快速访问并显示集群的状态
有一个输入窗口,允许任意调用RESTful API。这个接口包含几个选项,可以组合在一起以产生有趣的结果;
  1. 请求方法(get、put、post、delete),查询json数据,节点和路径
  2. 支持JSON验证器
  3. 支持重复请求计时器
  4. 支持使用javascript表达式变换结果
  5. 收集结果的能力随着时间的推移(使用定时器),或比较的结果
  6. 能力图表转换后的结果在一个简单的条形图(包括时间序列)

官方的文档:
https://github.com/mobz/elasticsearch-head

2.安装

  1. 第一种安装方式

    我们只介绍插件的安装方式,另外的方式大家看官方文档即可。ES-head作为插件,有两个安装方式:
    通过elasticseach自带的plugin命令
    如下图:
    D:\Program Files\Elasticsearch\6.4.2\bin>elasticsearch-plugin install elasticsearch-head
    A tool for managing installed elasticsearch plugins
    以前使用命令
    elasticsearch/bin/plugin -install mobz/elasticsearch-head
    但是6.X版本,改成elasticsearch-plugin了,但是没有安装成功。说没有这个包(未解决)

  2. 第2种安装方式

下载:https://github.com/mobz/elasticsearch-head
zip包安装
3. https://github.com/mobz/elasticsearch-head下载zip 解压
4. 建立elasticsearch-2.3.1\plugins\head文件
5. 将解压后的elasticsearch-head-master文件夹下的文件copy到head
6. 运行es
7. 打开http://localhost:9200/_plugin/head/
打不开页面

  1. 第3种安装方式

在6.X中,elasticsearch-head
不能放在elasticsearch的 plugins、modules 目录下
不能使用 elasticsearch-plugin install
安装 elasticsearch-head
修改 elasticsearch/config/elasticsearch.yml
添加 以下两个配置(跨域访问)
<http.cors.enabled: true
http.cors.allow-origin: “*”>
下载 elasticsearch-head 或者 git clone 到随便一个文件夹
https://github.com/mobz/elasticsearch-head
我是直接下载到D:\elasticsearch\elasticsearch-6.2.0\myplungins\elasticsearch-head-master目录的.
1.安装nodejs
http://blog.csdn.net/qq_21383435/article/details/79280866(教程地址)
2.安装 grunt
grunt是一个很方便的构建工具,可以进行打包压缩、测试、执行等等的工作
安装好node.js后使用命令提示符:
#2.1 安装grunt命令行工具grunt-cli:
cd D:\Program Files\Elasticsearch\myplugins\elasticsearch-head-master
>npm install -g grunt-cli
#2.2 安装grunt及其插件(同上路径下)
npm install grunt --save-dev
#查看安装版本情况
grunt -version)
3 启动head插件
(grunt server)
D:\Program Files\Elasticsearch\6.4.2\myplugins\elasticsearch-head-master>grunt s
erver
报错:

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.

这些是Gruntfile.js中引用的,分别下载(详见文章:https://blog.csdn.net/phoenix2121/article/details/25910919)
npm install grunt-contrib-clean
npm install grunt-contrib-concat
npm install grunt-contrib-watch
npm install grunt-contrib-connect
npm install grunt-contrib-copy
npm install grunt-contrib-jasmine

再次启动:grunt server或者 输入npm run start启动
D:\Program Files\Elasticsearch\6.4.2\myplugins\elasticsearch-head-master>grunt s
erver

(node:9268) ExperimentalWarning: The http2 module is an experimental API.
Running “connect:server” (connect) task
Waiting forever…
Started connect web server on http://localhost:9100

访问head页面: http://localhost:9100/
在这里插入图片描述

9100链接9200,并且测试,查看集群的健康状况在这里插入图片描述

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值