From 4bd5fbc1e7ef2f66d83095d2f48ad9a4987e2fa3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sami=20M=C3=A4kinen?= Date: Tue, 17 Jun 2025 13:48:21 +0300 Subject: [PATCH 1/3] Prefix index-names with defaults from pom.xml --- source/install-guide/installing-index.rst | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/source/install-guide/installing-index.rst b/source/install-guide/installing-index.rst index fe0306f9..800e289a 100644 --- a/source/install-guide/installing-index.rst +++ b/source/install-guide/installing-index.rst @@ -49,13 +49,13 @@ User may want to customize the index settings for example to change language con .. code-block:: shell cd $GN_DATA_DIRECTORY/config/index - curl -X DELETE http://localhost:9200/features - curl -X DELETE http://localhost:9200/records - curl -X DELETE http://localhost:9200/searchlogs + curl -X DELETE http://localhost:9200/gn-features + curl -X DELETE http://localhost:9200/gn-records + curl -X DELETE http://localhost:9200/gn-searchlogs - curl -X PUT http://localhost:9200/features -H 'Content-Type: application/json' -d @features.json - curl -X PUT http://localhost:9200/records -H 'Content-Type: application/json' -d @records.json - curl -X PUT http://localhost:9200/searchlogs -H 'Content-Type: application/json' -d @searchlogs.json + curl -X PUT http://localhost:9200/gn-features -H 'Content-Type: application/json' -d @features.json + curl -X PUT http://localhost:9200/gn-records -H 'Content-Type: application/json' -d @records.json + curl -X PUT http://localhost:9200/gn-searchlogs -H 'Content-Type: application/json' -d @searchlogs.json Install using Maven From 2132e298e0bb3d955dbf8dc4b58e0d116b45c57b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sami=20M=C3=A4kinen?= Date: Tue, 17 Jun 2025 14:07:51 +0300 Subject: [PATCH 2/3] Note about env variables for es --- source/install-guide/installing-index.rst | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/source/install-guide/installing-index.rst b/source/install-guide/installing-index.rst index 800e289a..74ac899e 100644 --- a/source/install-guide/installing-index.rst +++ b/source/install-guide/installing-index.rst @@ -94,4 +94,15 @@ Update Elasticsearch connection details in ```WEB-INF/config.properties``` and r es.username= es.password= + +Alternatively these can also be configured as system environment variables: + +.. code-block:: shell + + GEONETWORK_ES_HOST=localhost + GEONETWORK_ES_PROTOCOL=http + GEONETWORK_ES_PORT=9200 + GEONETWORK_ES_USERNAME= + GEONETWORK_ES_PASSWORD= + It is not needed nor recommended to open port 9200 to the outside. GeoNetwork is protecting the Elasticsearch instance exposing only the search API and taking care of user privileges. From 10f90847a211722a91b2551969d99c94f8753948 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sami=20M=C3=A4kinen?= Date: Tue, 17 Jun 2025 14:49:38 +0300 Subject: [PATCH 3/3] Mention using env/Java system props as config option --- source/install-guide/configuring-database.rst | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/source/install-guide/configuring-database.rst b/source/install-guide/configuring-database.rst index adb636f3..9e5a7f67 100644 --- a/source/install-guide/configuring-database.rst +++ b/source/install-guide/configuring-database.rst @@ -31,7 +31,7 @@ is created: Configuring a database via config files --------------------------------------- -The database dialect is configured in :file:`/WEB-INF/config-node/srv.xml`. Uncomment the dialect to use. +The database dialect is configured in :file:`/WEB-INF/config-node/srv.xml`. Uncomment the dialect to use or use Java System property to configure it with `-Dgeonetwork.db.type=postgres` as described in https://github.com/geonetwork/core-geonetwork/blob/4.2.7/web/src/main/webResources/WEB-INF/config-node/srv.xml#L36. A jdbc driver is included for PostgreSQL, Oracle and H2. Other dialects require a jdbc driver to be installed. Download the jdbc library for the dialect and place it in ``/WEB-INF/lib`` or in the tomcat or GeoNetwork lib folder. @@ -98,6 +98,18 @@ Setting configuration properties via environment variables is common in containe Within PostgreSQL it is possible to configure `postgres` or `postgis`. In the latter case GeoNetwork will use spatial capabilities of PostGIS to filter metadata. In the first case (and for other database dialects) a Shapefile is created for storage of metadata coverage. +Alternative environment variables are also supported for non-container (WAR-file) environments: + +.. code-block:: text + + GEONETWORK_DB_USERNAME=example + GEONETWORK_DB_PASSWORD=xxx + GEONETWORK_DB_NAME=example + GEONETWORK_DB_HOST=localhost + GEONETWORK_DB_PORT=5432 + +Based on compile-time settings: https://github.com/geonetwork/core-geonetwork/blob/4.2.7/pom.xml#L1457-L1462 + Logging -------