Skip to content

Commit 152cdca

Browse files
committed
[Examples] Fix cluster name conflict between Elasticsearch and OpenSearch
1 parent da3c61a commit 152cdca

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

examples/compose.yaml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ services:
127127
elasticsearch:
128128
image: docker.elastic.co/elasticsearch/elasticsearch:9.2.2
129129
environment:
130+
cluster.name: 'elasticsearch-cluster'
130131
discovery.type: 'single-node'
131132
xpack.security.enabled: false
132133
ES_JAVA_OPTS: '-Xms512m -Xmx512m'
@@ -149,10 +150,13 @@ services:
149150
opensearch:
150151
image: opensearchproject/opensearch
151152
environment:
153+
cluster.name: 'opensearch-cluster'
152154
discovery.type: 'single-node'
153155
bootstrap.memory_lock: true
154156
indices.requests.cache.maximum_cacheable_size: 256
157+
DISABLE_INSTALL_DEMO_CONFIG: true
155158
DISABLE_SECURITY_PLUGIN: true
159+
plugins.security.disabled: true
156160
OPENSEARCH_JAVA_OPTS: '-Xms512m -Xmx512m'
157161
ulimits:
158162
memlock:
@@ -162,11 +166,11 @@ services:
162166
soft: 65536
163167
hard: 65536
164168
healthcheck:
165-
test: [ 'CMD', 'curl', "-f", "http://127.0.0.1:9200" ]
166-
interval: 30s
169+
test: [ 'CMD', 'curl', '-f', 'http://127.0.0.1:9200/_cluster/health?wait_for_status=yellow&timeout=1s' ]
170+
interval: 10s
167171
start_period: 120s
168-
timeout: 20s
169-
retries: 3
172+
timeout: 5s
173+
retries: 5
170174
ports:
171175
- '9200:9200'
172176
- '9600:9600'

0 commit comments

Comments
 (0)