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 ...
随机推荐
- 7.26-STOIRegularMatch-08-#14
A-3 SRM 08 描述 给一个 01 串设为其 S,询问是否存在只出现两次的 01 串 T. 这里的出现定义为存在一串下标 ,满足 且 . 输入格式 一行,一个 01 串 输出格式 一行,字母 ...
- CodeForces 1099E - Nice table - [好题]
题目链接:https://codeforces.com/problemset/problem/1099/E You are given an $n×m$ table, consisting of ch ...
- [No0000113]Keyboard shortcuts for Windows Visual Studio Code
General 常用Ctrl+Shift+P, F1 Show Command Palette 显示命令行Ctrl+P Quick Open, Go to File… 快速打开Ctrl+Shift+N ...
- 为什么实数系里不存在最小正数?(Why the smallest positive real number doesn't exist in the real number system ?)
We define the smallest positive real number as the number which is explicitly greater than zero and ...
- php值callback类型和匿名函数(闭包)
callback.callable类型 自PHP5.4起可以使用callable类型制定回调类型callback. 本文档基于同样理由使用callback类型信息. 一些函数如call_user_fu ...
- mac mysql提示mysql.sock'
Warning: World-writable config file '/Applications/XAMPP/xamppfiles/etc/my.cnf' is ignored ERROR 200 ...
- [cloud][OVS][sdn] Open vSwitch 初步了解
What is Open vSwitch? Open vSwitch is a production quality, multilayer virtual switch licensed under ...
- 动态代理Dynamic Proxy
代理模式是常用的Java设计模式,他的特征是代理类与委托类有同样的接口,代理类主要负责为委托类 预处理消息,过滤消息,把消息转发给委托类,以及事后处理消息等. 代理类与委托类之间通常会存在关联关系,一 ...
- 《Redis 持久化》
一:什么是持久化? - Redis 是内存级别的数据库.所谓持久化,即把数据(如内存中的对象)保存到可永久保存的存储设备中(如磁盘)中. - 可以持久读取操作等的数据. - Redis 支持 R ...
- sqlserver2014两台不同服务器上数据库同步
sqlserver2014两台不同服务器上数据库同步 同步了快一个月了,哈哈,因为途中比较麻烦,第一次,遇到烦的地方就停下了,今天终于同步成功了,哈哈,下面我就来介绍一下我实现两台数据库同步的过程 ...