您的位置:首页 > 其它

Elasticsearch 5.1.1 head插件安装指南

2017-01-17 16:05 405 查看

一、下载安装包

下载Elasticsearch 5.1.1

下载地址:https://www.elastic.co/downloads/elasticsearch

zip和tar格式是各种系统都通用的,解压之后启动Elasticsearch即可。

下载elasticsearch-head

下载地址:https://github.com/mobz/elasticsearch-head,下载后解压缩。

二、安装node、npm、grunt

node下载地址nodejs.org/

$ node -v
v6.8.1

npm下载地址https://www.npmjs.com

$ npm -v
3.10.8

使用npm安装grunt:

npm install –g grunt–cli

三、npm 安装依赖

到elasticsearch-head-master目录下,运行命令:

npm install

如果速度较慢或者安装失败,可以使用国内镜像:

npm install -g cnpm --registry=https://registry.npm.taobao.org

四、修改Elasticsearch配置文件

编辑elasticsearch-5.1.1/config/elasticsearch.yml,加入以下内容:

http.cors.enabled: true
http.cors.allow-origin: "*"

五、修改Gruntfile.js

打开elasticsearch-head-master/Gruntfile.js,找到下面connect属性,新增hostname: ‘0.0.0.0’:

connect: {
server: {
options: {
hostname: '0.0.0.0',
port: 9100,
base: '.',
keepalive: true
}
}
}

六、启动elasticsearch-head

在elasticsearch-head-master/目录下,运行启动命令:

grunt server

截图如下:



访问9100端口:



七、后台启动elasticsearch-head

后台启动grunt server命令;

nohup grunt server &exit

如果想关闭head插件,使用Linux查找进程命令:

ps aux|grep head

结束进程:

kill 进程号


内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: