|
| 1 | +# Add this compose file to your docker compose command if you want to have a dedicated opensearch node for ML operations. |
| 2 | +services: |
| 3 | + search: |
| 4 | + environment: |
| 5 | + - cluster.name=os-docker-cluster # Search cluster name |
| 6 | + - node.name=opensearch-node-data # Name the node that will run in this container |
| 7 | + - discovery.seed_hosts=search # Nodes to look for when discovering the cluster |
| 8 | + - discovery.type= # Reset discovery.type |
| 9 | + search-ml: |
| 10 | + build: |
| 11 | + context: docker/search/ |
| 12 | + target: gally_opensearch2 |
| 13 | + environment: |
| 14 | + - cluster.name=os-docker-cluster # Search cluster name |
| 15 | + - node.name=opensearch-node-ml # Name the node that will run in this container |
| 16 | + - discovery.seed_hosts=search # Nodes to look for when discovering the cluster |
| 17 | + - cluster.initial_cluster_manager_nodes=opensearch-node-data # Nodes eligible to serve as cluster manager |
| 18 | + - OPENSEARCH_JAVA_OPTS=-Xms1g -Xmx1g # Set min and max JVM heap sizes to at least 50% of system RAM |
| 19 | + - bootstrap.memory_lock=true # Disable JVM heap memory swapping |
| 20 | + - node.roles=ml # Define this node as an ml node |
| 21 | + - cluster.routing.allocation.disk.threshold_enabled=false # Avoid ES going read-only because low disk space availability |
| 22 | + - plugins.ml_commons.allow_registering_model_via_url=true |
| 23 | + - plugins.ml_commons.native_memory_threshold=100 # Prevent memory issue after multiple deploy (https://github.com/opensearch-project/ml-commons/issues/2308) |
| 24 | + - plugins.ml_commons.jvm_heap_memory_threshold=100 # Prevent memory issue after multiple deploy (https://github.com/opensearch-project/ml-commons/issues/2308) |
| 25 | + - plugins.security.audit.type=debug # https://github.com/opensearch-project/security/issues/3130 |
| 26 | + - OPENSEARCH_INITIAL_ADMIN_PASSWORD=${OPENSEARCH_ADMIN_PASSWORD:-!ChangeMe0!} |
| 27 | + ulimits: |
| 28 | + memlock: |
| 29 | + soft: -1 |
| 30 | + hard: -1 |
| 31 | + volumes: |
| 32 | + - os2_ml_data:/usr/share/opensearch/data:rw |
| 33 | + healthcheck: |
| 34 | + test: test $$(curl -uadmin:$${OPENSEARCH_INITIAL_ADMIN_PASSWORD:-!ChangeMe0!} -k --write-out %{http_code} --fail --silent --output /dev/null https://localhost:9200/_cluster/health?wait_for_status=green&timeout=5s) -eq 200 |
| 35 | + interval: 10s |
| 36 | + timeout: 5s |
| 37 | + retries: 20 |
| 38 | + |
| 39 | +volumes: |
| 40 | + os2_ml_data: |
0 commit comments