Elasticsearch5.x Head插件安装
在5.0版本中不支持直接安装head插件,需要启动一个服务。
由于head插件本质上还是一个nodejs的工程,因此需要安装node,使用npm来安装依赖的包。(npm可以理解为maven)
1、安装Node.js
官网nodejs,https://nodejs.org/en/download/
wget https://nodejs.org/dist/v6.10.2/node-v6.10.2-linux-x64.tar.xz xz –d node-v6.10.2-linux-x64.tar.xz
tar xvf node-v6.10.2-linux-x64.tar
mv node-v6.10.2-linux-x64 /usr/local/node vim /etc/profile
export NODE_HOME=/usr/local/node
export PATH=$PATH:$NODE_HOME/bin source /etc/profile # node –v
v6.10.2 # npm –v
3.10.10
说明:前面讲了,npm相当于是maven,但npm究竟在哪?其实npm已经在Node.js安装的时候顺带装好了。
2、下载插件包
如果找不到git,请先安装:
yum install –y git
git clone https://github.com/mobz/elasticsearch-head.git
3、安装grunt
cd elasticsearch-head
npm install -g grunt --registry=https://registry.npm.taobao.org
4、安装Head插件
npm install

在elasticsearch-head目录下node_modules/grunt下如果没有grunt二进制程序,需要执行:
cd elasticsearch-head
npm install grunt --save
5、修改配置
修改elasticsearch-head下Gruntfile.js文件,默认监听在127.0.0.1下9200端口:
hostname: ‘192.168.33.50’,

修改 _site/app.js
修改http://localhost:9200字段到本机ES端口与IP:
21行:http://192.168.33.50:9200
6、修改Elasticsearch配置
修改elasticsearch.yml文件加入以下内容:
# 是否支持跨域
http.cors.enabled: true # *表示支持所有域名
http.cors.allow-origin: "*"
7、启动服务
/elasticsearch-head/node_modules/grunt/bin/grunt server (后台运行 + &)

浏览器访问 http://192.168.33.50:9100/

附:
wiki上的解释是 Cross-origin resource sharing (CORS) is a mechanism that allows restricted resources ,即跨域访问。
这个字段默认为false,在Elasticsearch安装集群之外的一台机上用Sense、Head等监控插件访问Elasticsearch是不允许的。这个字段最早可以追溯到1.4.x版本,而非5.x特有。
具体这个http.cors.x字段还有哪些用途和用法,见下表:
|
http.cors.enabled |
是否支持跨域,默认为false |
|
http.cors.allow-origin |
当设置允许跨域,默认为*,表示支持所有域名,如果我们只是允许某些网站能访问,那么可以使用正则表达式。比如只允许本地地址。 /https?:\/\/localhost(:[0-9]+)?/ |
|
http.cors.max-age |
浏览器发送一个“预检”OPTIONS请求,以确定CORS设置。最大年龄定义多久的结果应该缓存。默认为1728000(20天) |
|
http.cors.allow-methods |
允许跨域的请求方式,默认OPTIONS,HEAD,GET,POST,PUT,DELETE |
|
http.cors.allow-headers |
跨域允许设置的头信息,默认为X-Requested-With,Content-Type,Content-Length |
|
http.cors.allow-credentials |
是否返回设置的跨域Access-Control-Allow-Credentials头,如果设置为true,那么会返回给客户端。 |
Elasticsearch5.x Head插件安装的更多相关文章
- Elasticsearch5 及 head插件 安装说明
Elasticsearch5.X及 head插件 安装说明: 1.下载elasticsearch安装文件: a) 下载官方源码: https://artifacts.elastic.co/downlo ...
- elasticsearch5.0及head插件安装
这个瞎jb整了半天.准备把es2.4升级到5.0,结果老报错 环境:centos6.5+es2.4是ok的换成es5就出毛病.也不能说啥 ,我用的是最新的 源码解压启动时候报错,具体错误for ...
- [elk]elasticsearch5.0及head插件安装
ElasticSearch2.3/2.4升级到ElasticSearch5.0 参考文档(排名不分先后)https://www.elastic.co/guide/en/elasticsearch/re ...
- elasticsearch及head插件安装与配置
1. 环境软件版本说明 系统:ubuntu14.04.1 JDK:1.8 elasticsearch:5.5.2 node:9.11.1 elasticsearch:5.X 2. 环境软件下载说明 1 ...
- ElasticSearch 5.0及head插件安装
一.elasticsearch安装配置 1.官网下载源码包 https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.0 ...
- ElasticSearch5.5.1插件分类
ElasticSearch5.5.1插件分类 附官网介绍:https://www.elastic.co/guide/en/elasticsearch/plugins/5.5/intro.html 一. ...
- ElasticSearch安装和head插件安装
本文主要介绍elasticsearch5.0安装及head插件安装.确保系统已经安装好jdk1.8以上,操作系统CentOS6以上. 一.elasticsearch安装配置 1.官网下载源码包 下载不 ...
- ELK安装和配置及常用插件安装
环境 CentOS 7.3 root 用户 JDK 版本:1.8(最低要求),主推:JDK 1.8.0_121 以上 关闭 firewall systemctl stop firewalld.serv ...
- [Android Studio]SQLScout插件安装破解
以下内容为原创,欢迎转载,转载请注明 来自天天博客:http://www.cnblogs.com/tiantianbyconan/p/5972138.html [Android Studio]SQLS ...
随机推荐
- 【react】---context的基本使用新版---【巷子】
一.全局定义context对象 globalContext.js import React from "react"; const GlobalContext = React.cr ...
- ABP之事件总线(3)
承接上一篇时间总线的学习,在上一篇中我们实现了取消显式注册事件的方式,采用使用反射的方式.这样的好处可以解除Publisher和Scriber的显式依赖,但是问题又来了,因为我们只有Publisher ...
- Oracle的字符连接函数 concat 和 || 的区别
总结:concat 只能连接两个字符串,|| 可以连接多个
- .net webservice的get支持,
默认创建的webservices.asmx是不支持get的, 如 [WebMethod] public string HelloWorld() { return "Hello World&q ...
- toggle显示与隐藏切换
jQuery中显示与隐藏切换toggle方法 show与hide是一对互斥的方法.需要对元素进行显示隐藏的互斥切换,通常情况是需要先判断元素的display状态,然后调用其对应的处理方法.比如显示的元 ...
- angularjs 异步请求无法更新数据
angularjs 有个问题就是第二次ajax请求数据再次赋值给 $scope.data,需要更新视图数据的时候,却不能更改视图数据,这个是因为angularjs的$watch不能监听到JS对$sco ...
- present simple, continuous, and be going to 三者区别
https://www.youtube.com/watch?v=a03VKQL0dZg&list=PLZOJurmtexYozmvQGAJnVg3lgiZw0mj-y HOW TO USE F ...
- Visio 画图
流程图 圆角矩形表示"开始"与"结束" 矩形表示行动方案.普通工作环节用 菱形表示问题判断或判定(审核/审批/评审)环节 平行四边形表示输入输出 箭头代表工作流 ...
- 深探树形dp
看到同学在写一道树形dp,好奇直接拿来写,发现很不简单. 如图,看上去是不是很像选课,没错这不是选课,升级版吧,多加了点东西罢了.简单却调了一晚上和一上午. 思路:很简单强联通分量+缩点+树形dp.直 ...
- Android抓包方法 之Fiddler代理
1.抓包原理 Fiddler是类似代理服务器的形式工作,它能够记录所有你的电脑和互联网之间的http(S)通讯,可以查看.修改所有的“进出”的数据.使用代理地址:127.0.0.1, 默认端口:888 ...