Skip to content

Commit

Permalink
Use a single OpenSearch node in production
Browse files Browse the repository at this point in the history
As we only deploy RADIS on one performant server we don't need multiple OpenSearch nodes. We also don't need the security plugin enabled as nothing of OpenSearch is directly exposed to the user (its always behind the Django app). Even if we would use multiple nodes on different machines, then Docker Swarm can provide the network encryption and we wouldn't need SSL/TLS.
  • Loading branch information
medihack authored Jun 13, 2024
1 parent 664de53 commit 44a7fdd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 58 deletions.
5 changes: 3 additions & 2 deletions compose/docker-compose.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,12 @@ services:
volumes:
- opensearch_data1:/usr/share/opensearch/data
environment:
discovery.type: single-node # https://github.com/gitpod-io/gitpod/issues/8399
OPENSEARCH_JAVA_OPTS: "-Xms512m -Xmx512m"
DISABLE_SECURITY_PLUGIN: "true"
discovery.type: single-node # https://github.com/gitpod-io/gitpod/issues/8399
ports:
- 9200:9200
- 9200:9200 # REST API
- 9600:9600 # Performance Analyzer
profiles: ["opensearch"]

opensearch-dashboards:
Expand Down
60 changes: 4 additions & 56 deletions compose/docker-compose.prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,10 @@ services:
image: opensearchproject/opensearch:2
hostname: opensearch-node1.local
environment:
- cluster.name=opensearch-cluster
- node.name=opensearch-node1
- discovery.seed_hosts=opensearch-node1,opensearch-node2,opensearch-node3
- cluster.initial_cluster_manager_nodes=opensearch-node1,opensearch-node2,opensearch-node3
- bootstrap.memory_lock=true
- "OPENSEARCH_JAVA_OPTS=-Xms512m -Xmx512m"
discovery.type: single-node # https://github.com/gitpod-io/gitpod/issues/8399
bootstrap.memory_lock: "true"
OPENSEARCH_JAVA_OPTS: "-Xms4g -Xmx4g"
DISABLE_SECURITY_PLUGIN: "true"
env_file:
- ../.env.prod
ulimits:
Expand All @@ -136,54 +134,6 @@ services:
deploy:
<<: *deploy

opensearch-node2:
image: opensearchproject/opensearch:2
hostname: opensearch-node2.local
environment:
- cluster.name=opensearch-cluster
- node.name=opensearch-node2
- discovery.seed_hosts=opensearch-node1,opensearch-node2,opensearch-node3
- cluster.initial_cluster_manager_nodes=opensearch-node1,opensearch-node2,opensearch-node3
- bootstrap.memory_lock=true
- "OPENSEARCH_JAVA_OPTS=-Xms512m -Xmx512m"
env_file:
- ../.env.prod
ulimits:
memlock:
soft: -1
hard: -1
nofile:
soft: 65536
hard: 65536
volumes:
- opensearch-data2:/usr/share/opensearch/data
deploy:
<<: *deploy

opensearch-node3:
image: opensearchproject/opensearch:2
hostname: opensearch-node3.local
environment:
- cluster.name=opensearch-cluster
- node.name=opensearch-node3
- discovery.seed_hosts=opensearch-node1,opensearch-node2,opensearch-node3
- cluster.initial_cluster_manager_nodes=opensearch-node1,opensearch-node2,opensearch-node3
- bootstrap.memory_lock=true
- "OPENSEARCH_JAVA_OPTS=-Xms512m -Xmx512m"
env_file:
- ../.env.prod
ulimits:
memlock:
soft: -1
hard: -1
nofile:
soft: 65536
hard: 65536
volumes:
- opensearch-data3:/usr/share/opensearch/data
deploy:
<<: *deploy

opensearch-dashboards:
image: opensearchproject/opensearch-dashboards:2
ports:
Expand Down Expand Up @@ -220,7 +170,5 @@ services:
volumes:
models_data:
opensearch-data1:
opensearch-data2:
opensearch-data3:
vespa_data:
vespa_logs:

0 comments on commit 44a7fdd

Please sign in to comment.