首页 > IT基础架构 > > elasticsearch-head 安装介绍
elasticsearch-head 是用于监控 Elasticsearch 状态的客户端插件,包括数据可视化、执行增删改查操作等。elasticsearch-head 插件的安装在 Linux 和 Windows 没什么区别,安装之前确保当前系统已经安装 nodejs 即可。
Elasticsearch 5.0之后的安装方式和之前不太一样
elasticsearch-head,可以直接下压缩包,也可以通过 git clone。
输入命令,等待下载完成:
git clone git://github.com/mobz/elasticsearch-head.git
npm install -g grunt-cli
elasticsearch-head 下载完成后,进入 elasticsearch-head 文件夹,执行命令:
npm install grunt --save
npm install
所有依赖包安装成功后,修改 elasticsearch-head 目录下的 Gruntfile.js 文件,在 options 属性内增加 hostname,设置为 0.0.0.0。
connect: {
server: {
options: {
hostname: '0.0.0.0',
port: 9100,
base: '.',
keepalive: true
}
}
}
在配置文件最后增加两个配置项,这样 elasticsearch-head 插件才可以访问 Elasticsearch 。
http.cors.enabled: true
http.cors.allow-origin: "*"
在 elasticsearch-head 目录下,执行命令:
grunt server
输出如下内容表示启动成功:
Running "connect:server" (connect) task
Waiting forever...
Started connect web server on http://localhost:9100
访问 http://localhost:9100 地址,就可以看到当前 Elasticsearch 集群信息。
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/69946831/viewspace-3129862/ ,如需转载,请注明出处,否则将追究法律责任。