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. diff --git a/web/src/main/webResources/WEB-INF/config.properties b/web/src/main/webResources/WEB-INF/config.properties index 6704931e473..c002af37f1d 100644 --- a/web/src/main/webResources/WEB-INF/config.properties +++ b/web/src/main/webResources/WEB-INF/config.properties @@ -11,12 +11,12 @@ usersavedselection.watchlist.searchurl=catalog.search#/search?_uuid={{filter}} # Define the link to each record sent by email by the watchlist notifier usersavedselection.watchlist.recordurl=api/records/{{index:uuid}} -es.protocol=${es.protocol} -es.port=${es.port} -es.host=${es.host} -es.url=\${es.protocol}://\${es.host}:\${es.port} -es.username=${es.username} -es.password=${es.password} +es.protocol=#{systemEnvironment['GEONETWORK_ES_PROTOCOL']?:'${es.protocol}'} +es.port=#{systemEnvironment['GEONETWORK_ES_PORT']?:${es.port}} +es.host=#{systemEnvironment['GEONETWORK_ES_HOST']?:'${es.host}'} +es.url=#{systemEnvironment['GEONETWORK_ES_URL']?:'${es.url}'} +es.username=#{systemEnvironment['GEONETWORK_ES_USERNAME']?:'${es.username}'} +es.password=#{systemEnvironment['GEONETWORK_ES_PASSWORD']?:'${es.password}'} es.index.features=${es.index.features} es.index.features.type=${es.index.features.type} # Define the number of decimals to apply when converting geometries to GeoJSON @@ -33,7 +33,7 @@ es.index.records_public=${es.index.records_public} es.index.searchlogs=${es.index.searchlogs} es.index.searchlogs.type=${es.index.searchlogs.type} -kb.url=${kb.url} +kb.url=#{systemEnvironment['GEONETWORK_KIBANA_URL']?:'${kb.url}'} es.index.checker.interval=0/5 * * * * ?