安装elasticsearch-head插件(mac os 10.12.5)

5.x以前版本作为插件安装在elasticsearch中,而5.X版本需要运行为一个独立的wepapp

注:需要node环境,因我本机以前有node环境,所以直接可以使用。
推荐使用nvm去安装Node,可以任意切换版本。
也可以去官方网站下载最新版本的包进行安装。

1.mac os 10.12.5安装node.js
2.安装head插件

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

安装完之后,打开http://localhost:9100,发现连不上elasticsearch。
打开浏览器console,一看,原来是跨域,elasticsearch端口是9200的。
百度elasticsearch head 跨域,得到解决方案:
在elasticsearch.yml添加如下配置

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

修改配置文件之后,重启elasticsearch服务,发现访问正常了。

Github上面有详细的安装和使用方法
https://github.com/mobz/elasticsearch-head

发布了18 篇原创文章 · 获赞 5 · 访问量 2万+

猜你喜欢

转载自blog.csdn.net/mingleizhen/article/details/76084874