Last active
February 2, 2022 20:34
-
-
Save calhaudev/632d436877ddbceeb40726db88d5cc49 to your computer and use it in GitHub Desktop.
Docker compose file to build an environment with elasticsearch nodes and kibana
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| version: '2.2' | |
| services: | |
| es01: | |
| image: docker.elastic.co/elasticsearch/elasticsearch:7.16.3 | |
| container_name: es01 | |
| environment: | |
| - node.name=es01 | |
| - cluster.name=es-docker-cluster | |
| - discovery.seed_hosts=es02 | |
| - cluster.initial_master_nodes=es01,es02 | |
| - "ES_JAVA_OPTS=-Xms512m -Xmx512m" | |
| volumes: | |
| - data01:/usr/share/elasticsearch/data | |
| ports: | |
| - 9201:9200 | |
| networks: | |
| - elasticnet | |
| es02: | |
| image: docker.elastic.co/elasticsearch/elasticsearch:7.16.3 | |
| container_name: es02 | |
| environment: | |
| - node.name=es02 | |
| - cluster.name=es-docker-cluster | |
| - discovery.seed_hosts=es01 | |
| - cluster.initial_master_nodes=es01,es02 | |
| - "ES_JAVA_OPTS=-Xms512m -Xmx512m" | |
| volumes: | |
| - data02:/usr/share/elasticsearch/data | |
| ports: | |
| - 9202:9200 | |
| networks: | |
| - elasticnet | |
| # es03: | |
| # image: docker.elastic.co/elasticsearch/elasticsearch:7.16.3 | |
| # container_name: es03 | |
| # environment: | |
| # - node.name=es03 | |
| # - cluster.name=es-docker-cluster | |
| # - discovery.seed_hosts=es01,es02 | |
| # - cluster.initial_master_nodes=es01,es02,es03 | |
| # - "ES_JAVA_OPTS=-Xms512m -Xmx512m" | |
| # volumes: | |
| # - data03:/usr/share/elasticsearch/data | |
| # networks: | |
| # - elasticnet | |
| kibana: | |
| image: docker.elastic.co/kibana/kibana:7.16.3 | |
| container_name: es-kibana | |
| environment: | |
| ELASTICSEARCH_HOSTS: '["http://es01:9200","http://es02:9200"]' | |
| ports: | |
| - 5601:5601 | |
| networks: | |
| - elasticnet | |
| depends_on: | |
| - es01 | |
| - es02 | |
| volumes: | |
| data01: | |
| driver: local | |
| data02: | |
| driver: local | |
| # data03: | |
| # driver: local | |
| networks: | |
| elasticnet: | |
| name: elasticnet | |
| driver: bridge |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment