Elasticsearch 5.0
Elasticsearch 5.0
使用ES的基本都会使用过head,但是版本升级到5.0后,head插件就不好使了。下面就看看如何在5.0中启动Head插件吧!
官方粗略教程
Running with built in server
enable cors by adding http.cors.enabled: true in elasticsearch configuration. Don’t forget to also set http.cors.allow-origin because no origin allowed by default. http.cors.allow-origin: "*" is valid value, however it’s considered as a security risk as your cluster is open to cross origin from anywhere.
Check Elasticsearch documentation on this parameter:
git clone git://github.com/mobz/elasticsearch-head.git
cd elasticsearch-head
npm install
grunt server
open http://localhost:9100/
This will start a local webserver running on port 9100 serving elasticsearch-head
Best option if you are likely to connect to several different clusters
部署5.0版本的ES
5.0版本的ES跟之前的版本最大的不同之处就是多了很多环境的校验,比如jdk,max-files等等。
设置内核参数
vi /etc/sysctl.conf
# 增加下面的内容
fs.file-max=65536
vm.max_map_count=262144
设置资源参数
vi /etc/security/limits.conf
# 修改
* soft nofile 32768
* hard nofile 65536
修改elasticsearch的参数
修改一下es使用的参数:
# 换个集群的名字,免得跟别人的集群混在一起
cluster.name: es-5.0-test
# 换个节点名字
node.name: node-101
# 修改一下ES的监听地址,这样别的机器也可以访问
network.host: 0.0.0.0
# 默认的就好
http.port: 9200
# 增加新的参数,这样head插件可以访问es
http.cors.enabled: true
http.cors.allow-origin: "*"
注意,设置参数的时候:后面要有空格!
安装部署head
第一步,安装git
需要从github上面下载代码,因此先要安装git
yum -y install git
安装完成后,就可以直接下载代码了:
git clone git://github.com/mobz/elasticsearch-head.git
下载后,修改下777权限(简单粗暴),因为是独立启动head的,所以随便放一个位置就行了,参考:
/usr/elk/head/*****
第二步,安装node
由于head插件本质上还是一个nodejs的工程,因此需要安装node,使用npm来安装依赖的包。(npm可以理解为maven)
去官网下载nodejs,https://nodejs.org/en/download/

下载下来的jar包是xz格式的,一般的linux可能不识别,还需要安装xz.
yum -y install xz
然后解压nodejs的安装包:
xz -d node*.tar.xz
tar -xvf node*.tar
解压完node的安装文件后,需要配置下环境变量,编辑/etc/profile,添加
# set node environment
export NODE_HOME=/usr/elk/node-v6.9.1-linux-x64
export PATH=$PATH:$NODE_HOME/bin
别忘记立即执行以下
source /etc/profile
这个时候可以测试一下node是否生效:
[root@localnode1 node-v6.9.1-linux-x64]# echo $NODE_HOME
/usr/elk/node-v6.9.1-linux-x64
[root@localnode1 node-v6.9.1-linux-x64]# node -v
v6.9.1
[root@localnode1 node-v6.9.1-linux-x64]# npm -v
3.10.8
第三步,安装grunt
grunt是一个很方便的构建工具,可以进行打包压缩、测试、执行等等的工作,5.0里的head插件就是通过grunt启动的。因此需要安装一下grunt:
npm install grunt-cli
安装完成后检查一下:
[root@localnode1 elasticsearch-head]# grunt -version
grunt-cli v1.2.0
grunt v0.4.5
第四步,修改head源码
由于head的代码还是2.6版本的,直接执行有很多限制,比如无法跨机器访问。因此需要用户修改两个地方:
修改服务器监听地址
目录:head/Gruntfile.js
connect: {
server: {
options: {
port: 9100,
hostname: '*',
base: '.',
keepalive: true
}
}
}
增加hostname属性,设置为*
修改连接地址:
目录:head/_site/app.js
修改head的连接地址:
this.base_uri = this.config.base_uri || this.prefs.get("app-base_uri") || "http://localhost:9200";
把localhost修改成你es的服务器地址,如:
this.base_uri = this.config.base_uri || this.prefs.get("app-base_uri") || "http://10.10.10.10:9200";
第五步,运行head
首先开启5.0 ES。
然后在head目录中,执行npm install 下载以来的包:
npm install
最后,启动nodejs
grunt server
访问:target:9100
这个时候,访问http://xxx:9100就可以访问head插件了.

参考
Elasticsearch 5.0的更多相关文章
- Elasticsearch 5.0 中term 查询和match 查询的认识
Elasticsearch 5.0 关于term query和match query的认识 一.基本情况 前言:term query和match query牵扯的东西比较多,例如分词器.mapping ...
- 在Windows上安装Elasticsearch 5.0
在windows上安装Elasticsearch Elasticsearch可以使用.zip软件包安装在Windows上. elasticsearch-service.bat命令,它将设置Elasti ...
- ElasticSearch 5.0.0 集群安装部署文档
1. 搭建环境 3台物理机 操作系统 centos7 es1 192.168.31.141 4g内存 2核 es2 192.168.31.142 4g内存 2核 es3 ...
- ElasticSearch 5.0及head插件安装
一.elasticsearch安装配置 1.官网下载源码包 https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.0 ...
- Elasticsearch学习之ElasticSearch 5.0.0 安装部署常见错误或问题
ElasticSearch 5.0.0 安装部署常见错误或问题 问题一: [--06T16::,][WARN ][o.e.b.JNANatives ] unable to install syscal ...
- elasticsearch 6.0在Ubuntu下的安装
1:直接下载 elasticsearch 6.0 zip文件 https://www.elastic.co/downloads/past-releases 2:解压:进入到解压后的bin目录,执行 ...
- ElasticSearch 5.0 简介
参考:http://blog.csdn.net/wzhg0508/article/details/52063676 Elasticsearch 5.0 简介(medcl微信直播实录) 大家好,非常高兴 ...
- elasticsearch 6.0.0及之后移除了一个索引允许映射多个类型的操作(Removal of mapping types)
分给线一下内容为理解错误内容,实际允许建立父子分档,只是类型改成来 join 官方demo: join datatypeedit The join datatype is a special fiel ...
- elasticsearch 5.0 获取 TransportClient 操作客户端java API
本文转载自:http://blog.csdn.net/likui1314159/article/details/53233881 elasticsearch 5.0 获取 TransportClien ...
随机推荐
- IT技术方案最佳实践方案的收集
一.图片鉴别服务 1. 阿里云,腾讯云等公开的服务. 2. 图谱科技提供的API 二. 网络直播服务器 1. SRS2 开源服务器 (https://github.com/ossrs/srs/wiki ...
- ASP.NET多线程下使用HttpContext.Current
本来要实现asp.net下使用tcp通讯方式向服务器获取数据,开始采用的方式是 参考: ASP.NET多线程下使用HttpContext.Current为null解决方案 http://www.cnb ...
- 主机、虚拟机、开发板(u-boot)之间的连接 - ping测试
1.设置主机的IP地址(这里注意,设置一定要设置网线宽带IP,不要选成无线网络的) 查看重点是否本地以太网卡(Realtek PCIe……) 2.修改本地连接3个IP地址,一定主机.虚拟机.开发板 三 ...
- 跟我学习dubbo-使用Maven构建Dubbo服务的可执行jar包(4)
Dubbo服务的运行方式: 1.使用Servlet容器运行(Tomcat.Jetty等)----不可取 缺点:增加复杂性(端口.管理) 浪费资源(内存) 官方:服务容器是一个standalone的启动 ...
- Swift学习链接
http://wiki.jikexueyuan.com/project/swift/chapter1/02_a_swift_tour.html
- ASP.NET MVC自定义路由 - 实现IRouteConstraint限制控制器名(转载)
自定义约束前 namespace MvcApplication2 { public class RouteConfig { public static void RegisterRoutes(Rout ...
- Linux下动态共享库加载及使用详解【转】
原文地址:http://blog.chinaunix.net/uid-29025972-id-3855500.html 对动态库的实际应用还不太熟悉的读者可能曾经遇到过类似“error while l ...
- (转)RabbitMQ消息队列的小伙伴: ProtoBuf(Google Protocol Buffer)
什么是ProtoBuf? 一种轻便高效的结构化数据存储格式,可以用于结构化数据串行化,或者说序列化.它很适合做数据存储或 RPC 数据交换格式.可用于通讯协议.数据存储等领域的语言无关.平台无关.可扩 ...
- 南阳理工ACM954--N!
http://acm.nyist.net/JudgeOnline/problem.php?pid=954 循环的可怕之处!! 所有的测试数据结果完全一样.只是超时!!TimeLimitExceeded ...
- GDAL Configure in Visual Studio 2010 for Win7/ GDAL+VisualStudio2010 Win7 配置
配置环境: OS:Win& *86 Ultimate Edition(EN) VS:Visual Studio 2010(EN) Step1: GDAL源码下载:http://www.gisi ...