Docker 运行ES和Kibana

1. docker pull image
docker pull elasticsearch:6.7.2
docker pull mobz/elasticsearch-head:5
docker pull kibana:6.7.2


2. run ES in docker
docker run -it --name elasticsearch -d -p 9200:9200 -p 9300:9300 -p 5601:5601 elasticsearch:6.7.2

注意事项
- kibana的container共用elasticsearch的网络
- elasticsearch服务有跨域问题,导致elasticsearch-head无法连接到ES,因此需要进入ES容器修改配置
- docker exec -it elasticsearch /bin/bash
- vi config/elasticsearch.yml
- 加入跨域配置
http.cors.enabled: true
http.cors.allow-origin: "*"
- docker restart elasticsearch

3. run Kibana in docker
- kibana的container共用elasticsearch的网络
docker run -it -d -e ELASTICSEARCH_URL=http://127.0.0.1:9200 --name kibana --network=container:elasticsearch kibana:6.7.2


4. run elasticsearch-head in docker
docker run -it --name elasticsearch-head -d -p 9100:9100 docker.io/mobz/elasticsearch-head:5


Kibana入门手册 https://www.elastic.co/guide/cn/kibana/current/introduction.html

ElasticSearch 查询所有index /_cat/indices
posted @ 2019-05-15 21:34  Vincen_shen  阅读(4919)  评论(0编辑  收藏  举报