Skip to content

Commit

Permalink
Merge pull request #35 from yrodiere/elasticsearch
Browse files Browse the repository at this point in the history
Revert some backend changes
  • Loading branch information
yrodiere authored Nov 3, 2023
2 parents 493b386 + e951f81 commit 365ac40
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 17 deletions.
6 changes: 3 additions & 3 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ podman pod create -p 8080:8080 -p 9000:9000 -p 9200:9200 --name search.quarkus.i
podman container run -d --name elasticearch --pod search.quarkus.io \
-e "discovery.type=single-node" -e "xpack.security.enabled=false" \
-e "ES_JAVA_OPTS=-Xms1g -Xmx1g" -e "cluster.routing.allocation.disk.threshold_enabled=false" \
docker.io/opensearchproject/opensearch:2.11.0
elastic/elasticsearch:8.10.2
# Then the app; this will fetch the actual data on startup (might take a while):
podman container run -it --rm --pod search.quarkus.io search-quarkus-io:999-SNAPSHOT
# OR, if you already have a local clone of quarkus.io:
Expand Down Expand Up @@ -107,10 +107,10 @@ you will need to set up a few things manually:
Secret environment variables for the application.
Put in there whatever secret configuration you need for your specific cluster.
`search-backend-config`::
Environment variables for the OpenSearch instances.
Environment variables for the Elasticsearch instances.
Put in there whatever configuration you need for your specific cluster.
`search-backend-secret`::
Secret environment variables for the OpenSearch instances.
Secret environment variables for the Elasticsearch instances.
Put in there whatever secret configuration you need for your specific cluster.

[[license]]
Expand Down
23 changes: 13 additions & 10 deletions src/main/kubernetes/openshift.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ spec:
spec:
containers:
- name: search-backend
image: opensearch:2.11.0
image: elasticsearch:8.10.2
imagePullPolicy: Always
resources:
limits:
Expand All @@ -75,26 +75,29 @@ spec:
protocol: TCP
volumeMounts:
- name: data
mountPath: /usr/share/opensearch/data
mountPath: /usr/share/elasticsearch/data
env:
- name: cluster.name
value: search-quarkus-io
- name: node.name
valueFrom:
fieldRef:
fieldPath: metadata.name
# https://opensearch.org/docs/latest/install-and-configure/install-opensearch/docker/#sample-docker-composeyml
# https://www.elastic.co/guide/en/elasticsearch/reference/current/important-settings.html#discovery-settings
# Rely on OpenShift's internal DNS to address the other hosts
- name: discovery.seed_hosts
value: "search-backend-0.search-backend,search-backend-1.search-backend,search-backend-2.search-backend"
- name: cluster.initial_cluster_manager_nodes
- name: cluster.initial_master_nodes
value: "search-backend-0,search-backend-1,search-backend-2"
# Not exposed to the internet, no sensitive data
# => We don't bother with HTTPS and pesky self-signed certificates
- name: plugins.security.disabled
value: "true"
- name: xpack.security.enabled
value: "false"
- name: bootstrap.memory_lock
value: "true"
# https://www.elastic.co/guide/en/elasticsearch/reference/current/docker.html#_configure_and_start_the_cluster
- name: ES_PORT
value: 127.0.0.1:9200
envFrom:
- configMapRef:
name: search-backend-config
Expand Down Expand Up @@ -124,20 +127,20 @@ spec:
- search-backend
from:
kind: ImageStreamTag
name: opensearch:2.11.0
name: elasticsearch:8.10.2
---
apiVersion: "v1"
kind: "ImageStream"
metadata:
name: opensearch
name: elasticsearch
labels:
app.kubernetes.io/name: search-backend
app.kubernetes.io/component: datastore
app.kubernetes.io/part-of: search-quarkus-io
app.kubernetes.io/managed-by: quarkus
spec:
tags:
- name: 2.11.0
- name: 8.10.2
from:
kind: DockerImage
name: docker.io/opensearchproject/opensearch:2.11.0
name: docker.elastic.co/elasticsearch/elasticsearch:8.10.2
8 changes: 4 additions & 4 deletions src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ quarkus.http.header."Strict-Transport-Security".value=max-age=31536000; includeS
quarkus.datasource.jdbc.url=jdbc:h2:mem:searchquarkusio
quarkus.hibernate-orm.database.generation=drop-and-create
## Hibernate Search
quarkus.hibernate-search-orm.elasticsearch.version=opensearch:2.11
quarkus.elasticsearch.devservices.image-name=docker.io/opensearchproject/opensearch:2.11.0
## We need to apply a custom OpenSearch mapping to exclude very large fields from the _source
quarkus.hibernate-search-orm.elasticsearch.version=8.10
quarkus.elasticsearch.devservices.image-name=docker.io/elastic/elasticsearch:8.10.2
## We need to apply a custom Elasticsearch mapping to exclude very large fields from the _source
quarkus.hibernate-search-orm.elasticsearch.schema-management.mapping-file=indexes/mapping-template.json
## We don't expect OpenSearch to be reachable when the application starts
## We don't expect Elasticsearch to be reachable when the application starts
quarkus.hibernate-search-orm.elasticsearch.version-check.enabled=false
## ... and the application automatically creates indexes upon first indexing anyway.
quarkus.hibernate-search-orm.schema-management.strategy=none
Expand Down

0 comments on commit 365ac40

Please sign in to comment.