ElasticSearch-head 5.5.2 安装及配置
一、ElasticSearch-head介绍
ElasticSearch-head(后续简称es-head)是ElasticSearch的一个插件,提供了es 的可视化操作界面。在es 2.X版本后,该插件不在支持es的插件安装方式安装及启动,而是使用grunt方式启动。
ElasticSearch-head 地址:https://github.com/mobz/elasticsearch-head
二、ElasticSearch-head安装
1.环境介绍:
ElasticSearch-head:5.X
Elasticsearch:5.5.2版本
操作系统:Centos 7
JDK: 1.8
2.安装JDK 1.8及ElasticSearch安装
Jdk和es的安装参考上一篇: 《elasticsearch-head5.5.2安装配置》
3. ElasticSearch-head的安装配置
1.安装es-head依赖node npm
es 5.x版本以后es-head的安装需要依赖node 和 npm ,需要先安装node和npm,安装后在检查node及npm的安装,命令如下:
yum -y install nodejs npm
node -v
npm -v
2. 下载es-head并安装
使用git 下载es-head资源,这里如果没有安装git,需要先安装git,然后切换到es-head的跟目录下安装node_modules目录,具体命令如下:
git clone https://github.com/mobz/elasticsearch-head.git
cd elasticsearch-head/
npm install
3.修改es和es-head配置
a. 修改elasticsearch.yml,增加跨域的配置(需要重启es才能生效)
http.cors.enabled: true
http.cors.allow-origin: "*"
b. 编辑%es-head%/Gruntfile.js,修改服务器监听地址,增加hostname属性,如下:
connect: {
server: {
options: {
hostname: '0.0.0.0',
port: 9100,
base: '.',
keepalive: true
}
}
}
4.重启es,再启动es-head
修改es配置后,需要重启es,然后切换到es-head跟目录,执行如下语句启动es-head:
./node_modules/grunt/bin/grunt server
启动后,访问:http://ip:9100/ 然后配置es地址,如下: