Servicios de desarrollo para Elasticsearch
If any Elasticsearch-related extension is present (e.g. quarkus-elasticsearch-rest-client or quarkus-hibernate-search-orm-elasticsearch),
Dev Services for Elasticsearch automatically starts an Elasticsearch server in dev mode and when running tests.
So, you don’t have to start a server manually.
The application is configured automatically.
Activación/desactivación de los servicios de desarrollo para Elasticsearch
Los servicios de desarrollo para Elasticsearch se activan automáticamente a menos que:
-
quarkus.devservices.enabledse fija enfalse. -
quarkus.elasticsearch.devservices.enabledse ajusta afalse -
la propiedad hosts está configurada, dependiendo de la extensión utilizada puede ser:
-
quarkus.elasticsearch.hosts -
quarkus.hibernate-search-orm.elasticsearch.hosts
Dev Services for Elasticsearch relies on Docker to start the server. If your environment does not support Docker, you will need to start the server manually, or connect to an already running server.
Elasticsearch compartido
Sometimes you need to share the server between applications. Dev Services for Elasticsearch implements a service discovery mechanism for your multiple Quarkus applications running in dev mode to share a single server.
Dev Services for Elasticsearch inicia el contenedor con la etiqueta quarkus-dev-service-elasticsearch que se utiliza para identificar el contenedor.
|
If you need multiple (shared) servers, you can configure the quarkus.elasticsearch.devservices.service-name attribute and indicate the server name.
It looks for a container with the same value, or starts a new one if none can be found.
The default service name is elasticsearch.
Sharing is enabled by default in dev mode, but disabled in test mode.
You can disable the sharing with quarkus.elasticsearch.devservices.shared=false.
Ajuste del puerto
By default, Dev Services for Elasticsearch picks a random port and configures the application.
You can set the port by configuring the quarkus.elasticsearch.devservices.port property.
Tenga en cuenta que la propiedad de hosts de Elasticsearch se configura automáticamente con el puerto elegido.
Configuración de la imagen
Dev Services for Elasticsearch only support Elasticsearch based images, OpenSearch is not supported at the moment.
If you need to use a different image than the default one you can configure it via:
quarkus.elasticsearch.devservices.image-name={elasticsearch-image}
Limitaciones actuales
Actualmente, sólo se admite el backend predeterminado para Hibernate Search Elasticsearch, porque Dev Services for Elasticsearch sólo puede iniciar un contenedor de Elasticsearch.
Referencia de configuración
Configuration property fixed at build time - All other configuration properties are overridable at runtime
Tipo |
Por defecto |
|
|---|---|---|
If Dev Services for Elasticsearch has been explicitly enabled or disabled. Dev Services are generally enabled by default, unless there is an existing configuration present. For Elasticsearch, Dev Services starts a server unless Environment variable: Show more |
boolean |
|
Optional fixed port the dev service will listen to. If not defined, the port will be chosen randomly. Environment variable: Show more |
int |
|
The Elasticsearch container image to use. Defaults to the elasticsearch image provided by Elastic. Environment variable: Show more |
string |
|
The value for the ES_JAVA_OPTS env variable. Defaults to setting the heap to 512MB min - 1GB max. Environment variable: Show more |
string |
|
Indicates if the Elasticsearch server managed by Quarkus Dev Services is shared. When shared, Quarkus looks for running containers using label-based service discovery. If a matching container is found, it is used, and so a second one is not started. Otherwise, Dev Services for Elasticsearch starts a new container.
The discovery uses the Environment variable: Show more |
boolean |
|
The value of the Environment variable: Show more |
string |
|