From cf29dca14691349c8eeb37fcc1dedecd825d5c40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jose=20Garc=C3=ADa?= Date: Tue, 7 Jan 2025 15:38:34 +0100 Subject: [PATCH] Allow to configure the Elasticsearch connection in environment variables - documentation updates --- .../docs/install-guide/installing-index.md | 41 ++++++++++++++----- 1 file changed, 30 insertions(+), 11 deletions(-) diff --git a/docs/manual/docs/install-guide/installing-index.md b/docs/manual/docs/install-guide/installing-index.md index 870e764f3ed..57d86319f07 100644 --- a/docs/manual/docs/install-guide/installing-index.md +++ b/docs/manual/docs/install-guide/installing-index.md @@ -108,15 +108,34 @@ Older version may be supported but are untested. ## Configure GeoNetwork connection to Elasticsearch -1. Update Elasticsearch connection details in ```WEB-INF/config.properties```: - - ``` properties - es.protocol=http - es.port=9200 - es.host=localhost - es.url=${es.protocol}://${es.host}:${es.port} - es.username= - es.password= - ``` +By default, GeoNetwork expects Elasticsearch to be running at without authentication. If your Elasticsearch server is on a different host or port or requires authentication, you will need to configure connection details using either of these methods: + +* Define the connection details in Java properties. + + ```shell + export JAVA_OPTS="$JAVA_OPTS -Des.protocol=http -Des.port=9200 -Des.host=localhost -Des.url=http://localhost:9200 -Des.username= -Des.password=" + ``` + +* Define the connection details in environment variables. + + ```shell + export GEONETWORK_ES_HOST=localhost + export GEONETWORK_ES_PROTOCOL=http + export GEONETWORK_ES_PORT=9200 + export GEONETWORK_ES_URL=$GEONETWORK_ES_PROTOCOL://$GEONETWORK_ES_HOST:$GEONETWORK_ES_PORT + export GEONETWORK_ES_USERNAME= + export GEONETWORK_ES_PASSWORD= + ``` + +* Edit the values in ```WEB-INF/config.properties``` (not recommended): + + ```properties + es.protocol=#{systemEnvironment['GEONETWORK_ES_PROTOCOL']?:'http'} + es.port=#{systemEnvironment['GEONETWORK_ES_PORT']?:9200} + es.host=#{systemEnvironment['GEONETWORK_ES_HOST']?:'localhost'} + es.url=#{systemEnvironment['GEONETWORK_ES_URL']?:'http://localhost:9200'} + es.username=#{systemEnvironment['GEONETWORK_ES_USERNAME']?:''} + es.password=#{systemEnvironment['GEONETWORK_ES_PASSWORD']?:''} + ``` -2. Restart the application: +Once the configuration is complete, you will need to restart the application.