Created
April 8, 2019 23:55
-
-
Save moosh3/420223895ce0e72f6735599c8a89e4ff to your computer and use it in GitHub Desktop.
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: '3.6' | |
| services: | |
| elasticsearch: &service | |
| container_name: elasticsearch | |
| image: docker.elastic.co/elasticsearch/elasticsearch:6.7.1 | |
| # deploy: | |
| # mode: global | |
| # restart_policy: | |
| # condition: on-failure | |
| # delay: 5s | |
| # max_attempts: 3 | |
| # window: 120s | |
| environment: | |
| - node.name=es01 | |
| - cluster.name=docker-cluster | |
| - bootstrap.memory_lock=true | |
| - "ES_JAVA_OPTS=-Xms512m -Xmx512m" | |
| logging: | |
| driver: none | |
| ulimits: | |
| nproc: 65535 | |
| memlock: | |
| soft: -1 | |
| hard: -1 | |
| cap_add: | |
| - ALL | |
| privileged: true | |
| volumes: | |
| - esdata:/usr/share/elasticsearch/data | |
| ports: | |
| - 9200:9200 | |
| - 9300:9300 | |
| networks: | |
| - elk | |
| healthcheck: | |
| test: curl -f localhost:9200 | |
| interval: 30s | |
| timeout: 10s | |
| retries: 5 | |
| elasticsearch2: | |
| <<: *service | |
| container_name: elasticsearch2 | |
| environment: | |
| - node.name=es02 | |
| - cluster.name=docker-cluster | |
| - bootstrap.memory_lock=true | |
| - "ES_JAVA_OPTS=-Xms512m -Xmx512m" | |
| - "discovery.zen.ping.unicast.hosts=elasticsearch" | |
| volumes: | |
| - esdata2:/usr/share/elasticsearch/data | |
| ports: [] | |
| kibana: | |
| container_name: kibana | |
| image: docker.elastic.co/kibana/kibana:6.7.1 | |
| logging: | |
| driver: none | |
| environment: | |
| SERVER_NAME: localhost | |
| ELASTICSEARCH_HOSTS: http://elasticsearch:9200/ | |
| ports: | |
| - 5601:5601 | |
| networks: | |
| - elk | |
| ulimits: | |
| nproc: 65535 | |
| memlock: | |
| soft: -1 | |
| hard: -1 | |
| depends_on: | |
| - elasticsearch | |
| healthcheck: | |
| test: curl -f localhost:5600 | |
| interval: 30s | |
| timeout: 10s | |
| retries: 5 | |
| filebeat: | |
| container_name: filebeat | |
| hostname: filebeat | |
| image: docker.elastic.co/beats/filebeat:6.7.1 | |
| command: --strict.perms=false -e | |
| privileged: true | |
| user: root | |
| volumes: | |
| - ./filebeat/config.yml:/usr/share/filebeat/filebeat.yml | |
| - ./filebeat/logs:/usr/share/filebeat/logs | |
| - /var/lib/docker/containers:/var/lib/docker/containers | |
| - /var/run/docker.sock:/var/run/docker.sock | |
| - '/var/log/:/mnt/log:ro' | |
| networks: | |
| - elk | |
| depends_on: ['elasticsearch', 'kibana'] | |
| healthcheck: | |
| test: filebeat test config | |
| interval: 30s | |
| timeout: 10s | |
| retries: 5 | |
| networks: | |
| elk: | |
| volumes: | |
| esdata: | |
| driver: local | |
| esdata2: | |
| driver: local |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment