Fork me on GitHub

Elasticsearch 5.X 使用 Docker 运行使用 Head 插件

ES 5.X 版本后就不支持 elasticsearch-head  以插件方式来安装了。

for Elasticsearch 5.x: site plugins are not supported. Run as a standalone server

for Elasticsearch 2.x: sudo elasticsearch/bin/plugin install mobz/elasticsearch-head

for Elasticsearch 1.x: sudo elasticsearch/bin/plugin -install mobz/elasticsearch-head/1.x

for Elasticsearch 0.x: sudo elasticsearch/bin/plugin -install mobz/elasticsearch-head/0.9

open http://localhost:9200/_plugin/head/

Google 一番发现很多都是使用源码的方式, node ,grunt 繁琐的配置 ,相对比较繁琐;其实 elasticsearch-head 官方还可以使用 docker 容器的方式来运行,简单粗暴

Running with docker

for Elasticsearch 5.x: docker run -p 9100:9100 mobz/elasticsearch-head:5

for Elasticsearch 2.x: docker run -p 9100:9100 mobz/elasticsearch-head:2

for Elasticsearch 1.x: docker run -p 9100:9100 mobz/elasticsearch-head:1

for fans of alpine there is mobz/elasticsearch-head:5-alpine

最后记得配置跨域,重启 ES ,访问 http://localhost:9100/

#Enable CORS in elasticsearch
http.cors.enabled: true
http.cors.allow-origin: "*"

备注:还有另外一种更简单安装 chrome 插件的方式, https://chrome.google.com/webstore/detail/elasticsearch-head/ffmkiejjmecolpfloofpjologoblkegm?utm_source=chrome-app-launcher-info-dialog

REFER:
https://docs.docker.com/engine/installation/linux/docker-ce/ubuntu/
https://github.com/mobz/elasticsearch-head

posted @ 2017-07-13 22:42  花儿笑弯了腰  阅读(1353)  评论(2编辑  收藏  举报