Skip to content

Commit faedde1

Browse files
authored
Ks 40 (#42)
* Spring AI OpenSearch Integration * SpringAI and OpenSearch * Spring AI OpenSearch * Spring AI opensearch * rename file * check in docker compose
1 parent 0367709 commit faedde1

1 file changed

Lines changed: 69 additions & 0 deletions

File tree

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
services:
2+
opensearch-node1: # This is also the hostname of the container within the Docker network (i.e. https://opensearch-node1/)
3+
image: opensearchproject/opensearch:latest
4+
container_name: opensearch-node1
5+
environment:
6+
- DISABLE_SECURITY_PLUGIN=true
7+
- cluster.name=opensearch-cluster # Name the cluster
8+
- node.name=opensearch-node1 # Name the node that will run in this container
9+
- discovery.seed_hosts=opensearch-node1,opensearch-node2 # Nodes to look for when discovering the cluster
10+
- cluster.initial_cluster_manager_nodes=opensearch-node1,opensearch-node2 # Nodes eligibile to serve as cluster manager
11+
- bootstrap.memory_lock=true # Disable JVM heap memory swapping
12+
- "OPENSEARCH_JAVA_OPTS=-Xms512m -Xmx512m" # Set min and max JVM heap sizes to at least 50% of system RAM
13+
- OPENSEARCH_INITIAL_ADMIN_PASSWORD=${OPENSEARCH_INITIAL_ADMIN_PASSWORD} # Sets the demo admin user password when using demo configuration (for OpenSearch 2.12 and later)
14+
ulimits:
15+
memlock:
16+
soft: -1 # Set memlock to unlimited (no soft or hard limit)
17+
hard: -1
18+
nofile:
19+
soft: 65536 # Maximum number of open files for the opensearch user - set to at least 65536
20+
hard: 65536
21+
volumes:
22+
- opensearch-data1:/usr/share/opensearch/data # Creates volume called opensearch-data1 and mounts it to the container
23+
ports:
24+
- 9200:9200 # REST API
25+
- 9600:9600 # Performance Analyzer
26+
networks:
27+
- opensearch-net # All of the containers will join the same Docker bridge network
28+
opensearch-node2:
29+
image: opensearchproject/opensearch:latest # This should be the same image used for opensearch-node1 to avoid issues
30+
container_name: opensearch-node2
31+
environment:
32+
- DISABLE_SECURITY_PLUGIN=true
33+
- cluster.name=opensearch-cluster
34+
- node.name=opensearch-node2
35+
- discovery.seed_hosts=opensearch-node1,opensearch-node2
36+
- cluster.initial_cluster_manager_nodes=opensearch-node1,opensearch-node2
37+
- bootstrap.memory_lock=true
38+
- "OPENSEARCH_JAVA_OPTS=-Xms512m -Xmx512m"
39+
- OPENSEARCH_INITIAL_ADMIN_PASSWORD=${OPENSEARCH_INITIAL_ADMIN_PASSWORD}
40+
ulimits:
41+
memlock:
42+
soft: -1
43+
hard: -1
44+
nofile:
45+
soft: 65536
46+
hard: 65536
47+
volumes:
48+
- opensearch-data2:/usr/share/opensearch/data
49+
networks:
50+
- opensearch-net
51+
opensearch-dashboards:
52+
image: opensearchproject/opensearch-dashboards:latest # Make sure the version of opensearch-dashboards matches the version of opensearch installed on other nodes
53+
container_name: opensearch-dashboards
54+
ports:
55+
- 5601:5601 # Map host port 5601 to container port 5601
56+
expose:
57+
- "5601" # Expose port 5601 for web access to OpenSearch Dashboards
58+
environment:
59+
- OPENSEARCH_HOSTS=["http://opensearch-node1:9200","http://opensearch-node2:9200"] # Define the OpenSearch nodes that OpenSearch Dashboards will query
60+
- DISABLE_SECURITY_DASHBOARDS_PLUGIN=true
61+
networks:
62+
- opensearch-net
63+
64+
volumes:
65+
opensearch-data1:
66+
opensearch-data2:
67+
68+
networks:
69+
opensearch-net:

0 commit comments

Comments
 (0)