|
| 1 | +# Copyright The OpenTelemetry Authors |
| 2 | +# SPDX-License-Identifier: Apache-2.0 |
| 3 | + |
| 4 | + |
| 5 | +version: '3.9' |
| 6 | +x-default-logging: &logging |
| 7 | + driver: "json-file" |
| 8 | + options: |
| 9 | + max-size: "5m" |
| 10 | + max-file: "2" |
| 11 | + |
| 12 | +volumes: |
| 13 | + opensearch-data1: |
| 14 | + opensearch-data2: |
| 15 | + |
| 16 | +networks: |
| 17 | + default: |
| 18 | + name: opensearch-dashboards-demo |
| 19 | + driver: bridge |
| 20 | + |
| 21 | +services: |
| 22 | + # OpenSearch store - node1 |
| 23 | + opensearch-node1: # This is also the hostname of the container within the Docker network (i.e. https://opensearch-node1/) |
| 24 | + image: opensearchproject/opensearch:${VERSION} # Specifying the latest available image - modify if you want a specific version |
| 25 | + container_name: opensearch-node1 |
| 26 | + environment: |
| 27 | + - cluster.name=opensearch-cluster # Name the cluster |
| 28 | + - node.name=opensearch-node1 # Name the node that will run in this container |
| 29 | + - discovery.seed_hosts=opensearch-node1,opensearch-node2 # Nodes to look for when discovering the cluster |
| 30 | + - cluster.initial_cluster_manager_nodes=opensearch-node1,opensearch-node2 # Nodes eligible to serve as cluster manager |
| 31 | + - bootstrap.memory_lock=true # Disable JVM heap memory swapping |
| 32 | + - "OPENSEARCH_JAVA_OPTS=-Xms512m -Xmx512m" # Set min and max JVM heap sizes to at least 50% of system RAM |
| 33 | + ulimits: |
| 34 | + memlock: |
| 35 | + soft: -1 # Set memlock to unlimited (no soft or hard limit) |
| 36 | + hard: -1 |
| 37 | + nofile: |
| 38 | + soft: 65536 # Maximum number of open files for the opensearch user - set to at least 65536 |
| 39 | + hard: 65536 |
| 40 | + volumes: |
| 41 | + - opensearch-data1:/usr/share/opensearch/data # Creates volume called opensearch-data1 and mounts it to the container |
| 42 | + healthcheck: |
| 43 | + test: ["CMD", "curl", "-f", "https://opensearch-node1:9200/_cluster/health?wait_for_status=yellow", "-ku ${USER}:${PASSWORD}"] |
| 44 | + interval: 5s |
| 45 | + timeout: 25s |
| 46 | + retries: 4 |
| 47 | + ports: |
| 48 | + - "9200:9200" |
| 49 | + - "9600:9600" |
| 50 | + |
| 51 | + # OpenSearch store - node2 |
| 52 | + opensearch-node2: |
| 53 | + image: opensearchproject/opensearch:${VERSION} # This should be the same image used for opensearch-node1 to avoid issues |
| 54 | + container_name: opensearch-node2 |
| 55 | + environment: |
| 56 | + - cluster.name=opensearch-cluster |
| 57 | + - node.name=opensearch-node2 |
| 58 | + - discovery.seed_hosts=opensearch-node1,opensearch-node2 |
| 59 | + - cluster.initial_cluster_manager_nodes=opensearch-node1,opensearch-node2 |
| 60 | + - bootstrap.memory_lock=true |
| 61 | + - "OPENSEARCH_JAVA_OPTS=-Xms512m -Xmx512m" |
| 62 | + ulimits: |
| 63 | + memlock: |
| 64 | + soft: -1 |
| 65 | + hard: -1 |
| 66 | + nofile: |
| 67 | + soft: 65536 |
| 68 | + hard: 65536 |
| 69 | + volumes: |
| 70 | + - opensearch-data2:/usr/share/opensearch/data |
| 71 | + |
| 72 | + # OpenSearch store - dashboard |
| 73 | + opensearch-dashboards: |
| 74 | + container_name: opensearch-dashboards |
| 75 | + build: |
| 76 | + context: ./ |
| 77 | + dockerfile: Dockerfile |
| 78 | + args: |
| 79 | + - VERSION=${VERSION} |
| 80 | + |
| 81 | + ports: |
| 82 | + - 5601:5601 # Map host port 5601 to container port 5601 |
| 83 | + expose: |
| 84 | + - "5601" # Expose port 5601 for web access to OpenSearch Dashboards |
| 85 | + environment: |
| 86 | + OPENSEARCH_HOSTS: '["https://opensearch-node1:9200","https://opensearch-node2:9200"]' # Define the OpenSearch nodes that OpenSearch Dashboards will query |
| 87 | + depends_on: |
| 88 | + - opensearch-node1 |
| 89 | + - opensearch-node2 |
| 90 | + |
0 commit comments