Mac上安装elasticsearch-head插件

安装node

brew install node

下载插件并安装

插件主页:https://github.com/mobz/elasticsearch-head

git clone git://github.com/mobz/elasticsearch-head.git
cd elasticsearch-head
npm install

安装完成后在elasticsearch-head/node_modules目录下会出现grunt文件。
如果没有grunt二进制程序,需要执行

cd elasticsearch-head
npm install grunt --save

修改服务器监听地址

修改elasticsearch-head下Gruntfile.js文件,默认监听在127.0.0.1下9200端口

图片.png

修改连接地址

cd elasticsearch-head/_site
vim app.js

this.base_uri = this.config.base_uri || this.prefs.get("app-base_uri") || "http://localhost:9200";

重新运行npm install(此处是否一定需要重新运行,尚不确定)

启动服务

elasticsearch-head/node_modules/grunt/bin/grunt server &

访问:http://localhost:9100/

图片.png

集群健康值:显示“未连接”

解决方案:
vim $ES_HOME$/config/elasticsearch.yml
增加如下字段

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

重启es,并刷新head页面,发现已经可以连接上:

图片.png
图片.png

其他注意事项:
目前es5.5版本貌似与java9版本不兼容,使用jdk8可以运行es。

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容