You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
geonetwork: fix Elasticsearch version for 4.4 images (#2674)
* geonetwork: fix Elasticsearch version for 4.4 images
The geonetwork:4.4 tag now resolves to 4.4.10, which requires
Elasticsearch 8.x. The compose.yaml and quick-start examples still
referenced elasticsearch:7.17.15, causing 400 errors due to ES 8
treating text-field aggregations differently.
Changes:
- compose.yaml: upgrade elasticsearch and kibana to 8.14.3, add
xpack.security.enabled=false (required for local ES 8 without TLS),
remove Jetty-specific JVM flags, update DB type to postgres, upgrade
PostgreSQL to 17-3.5, simplify postgres service (no debug logging)
- content.md: update quick-start docker run to ES 8.14.3, add
Elasticsearch/GeoNetwork version compatibility table, correct
Tomcat/Jetty history note and H2 database path description
Fixes: geonetwork/docker-geonetwork#144
* geonetwork: fix compose healthchecks and postgres image
- Use postgres:17 instead of postgis/postgis (multi-arch, no PostGIS
needed with GEONETWORK_DB_TYPE=postgres)
- Database healthcheck: verify geonetwork db/user exist via psql
instead of pg_isready (avoids race with PostgreSQL init restart)
- GeoNetwork healthcheck: check actual app endpoint, add start_period
- Remove pglog volume (no longer needed)
* geonetwork: fix markdownfmt and ymlfmt formatting
Align the Elasticsearch/GeoNetwork version compatibility table in
content.md and fix YAML quoting style issues in compose.yaml to
satisfy the CI format checks.
* geonetwork: update docs for 4.4.10 and 4.2.15 releases
- Bump Elasticsearch and Kibana versions to 8.19.13 in compose.yaml
and the quick-start example in content.md
- Add REMOTE_IP_INTERNAL_PROXIES env var (new in both 4.4.10 and
4.2.15 with the Jetty-to-Tomcat migration)
- Add WEBAPP_CONTEXT_PATH env var for 4.4.x images
- Fix ES_INDEX_RECORDS / es.index.records default value: gn-records
(hyphen), not gn_records (underscore)
* geonetwork: warn about root user in Tomcat-based images
Tomcat-based images (GN 3, 4.2.15+, 4.4.10+) run as root, while the
previous Jetty-based images ran as the jetty user. Add a file
permissions section warning users upgrading from Jetty-based images
that they may need to update ownership of existing mounted volumes.
* geonetwork: document Jetty-to-Tomcat migration and WEBAPP_CONTEXT_PATH validation
Add a new "Upgrading from Jetty-based images" section listing the
breaking changes introduced when 4.2.15 and 4.4.10 switched from Jetty
to Tomcat: $JETTY_HOME/$JETTY_BASE are no longer set, the webapp path
changed, and the startup command changed.
Also document the WEBAPP_CONTEXT_PATH format validation added in 4.4.11,
which causes the container to exit with an error if the value does not
match the expected pattern.
* Update geonetwork/content.md
Co-authored-by: Tianon Gravi <admwiggin@gmail.com>
---------
Co-authored-by: Tianon Gravi <admwiggin@gmail.com>
Copy file name to clipboardExpand all lines: geonetwork/content.md
+39-6Lines changed: 39 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,12 +19,12 @@ GeoNetwork 4 uses an Elasticsearch server to store the index of the documents it
19
19
This is a quick example of how to get GeoNetwork 4.4 Latest up and running for demo purposes. This configuration doesn't keep the data if containers are removed.
20
20
21
21
```console
22
-
docker pull elasticsearch:7.17.15
22
+
docker pull elasticsearch:8.19.13
23
23
docker pull %%IMAGE%%:4
24
24
25
25
docker network create gn-network
26
26
27
-
docker run -d --name my-es-host --network gn-network -e "discovery.type=single-node" elasticsearch:7.17.15
@@ -42,6 +42,17 @@ docker run --name %%REPO%%-host --network gn-network -e ES_HOST=my-es-host -e ES
42
42
43
43
To be sure about what Elasticsearch version to use you can check the [GeoNetwork documentation](https://docs.geonetwork-opensource.org/4.4/install-guide/installing-index/) for your GN version or the `es.version` property in the [`pom.xml`](https://github.com/geonetwork/core-geonetwork/blob/main/pom.xml#L1528C17-L1528C24) file of the GeoNetwork release used.
44
44
45
+
The following table summarises the required Elasticsearch version for each GeoNetwork release series:
46
+
47
+
| GeoNetwork version | Elasticsearch version |
48
+
|--------------------|-----------------------|
49
+
| 4.0.0 - 4.0.5 | 7.9.2 |
50
+
| 4.0.6 - 4.2.7 | 7.11.1 |
51
+
| 4.2.8 - 4.4.2 | 7.17.x |
52
+
| 4.4.3 - 4.4.5 | 8.11.3 |
53
+
| 4.4.6 - 4.4.9 | 8.14.3 |
54
+
| 4.4.10+ | 8.19.13 |
55
+
45
56
### Default credentials
46
57
47
58
After installation, use the default credentials: **`admin`** (username) and **`admin`** (password). It is recommended to update the default password after installation.
@@ -56,11 +67,16 @@ Since GeoNetwork 4.4.0, use Java properties passed in the `GN_CONFIG_PROPERTIES`
56
67
-`es.port`*optional* (default `9200`): The port where Elasticsearch server is listening to.
57
68
-`es.protocol`*optional* (default `http`): The protocol used to talk to Elasticsearch. Can be `http` or `https`.
58
69
-`es.url`: **mandatory if host, port or protocol aren't the default values** (default `http://localhost:9200`): Full URL of the Elasticsearch server.
59
-
-`es.index.records`*optional* (default `gn_records`): In case you have more than GeoNetwork instance using the same Elasticsearch cluster each one needs to use a different index name. Use this variable to define the name of the index used by each GeoNetwork.
70
+
-`es.index.records`*optional* (default `gn-records`): In case you have more than GeoNetwork instance using the same Elasticsearch cluster each one needs to use a different index name. Use this variable to define the name of the index used by each GeoNetwork.
60
71
-`es.username`*optional* (default empty): username used to connect to Elasticsearch.
61
72
-`es.password`*optional* (default empty): password used to connect to Elasticsearch.
62
73
-`kb.url`*optional* (default `http://localhost:5601`): The URL where Kibana is listening.
63
74
75
+
The following environment variables are also available for 4.4.x images:
76
+
77
+
-`WEBAPP_CONTEXT_PATH`*optional* (default `/geonetwork`): The context path used to deploy GeoNetwork. Since 4.4.11, the value must start with `/` followed by one or more letters, digits, hyphens, or underscores (e.g. `/geonetwork`); an invalid value causes the container to exit with an error at startup.
78
+
-`REMOTE_IP_INTERNAL_PROXIES`*optional* (since 4.4.10): Regular expression matching IP addresses of trusted reverse proxies. Enables `X-Forwarded-For` header processing for correct client IP detection behind a proxy. When not set, the RemoteIp Valve is disabled. Example: `192\.168\.0\.10|192\.168\.0\.11`.
79
+
64
80
Example Docker Compose YAML snippet:
65
81
66
82
```yaml
@@ -85,10 +101,11 @@ For versions older than 4.4.0, configure Elasticsearch using environment variabl
85
101
- `ES_HOST` **mandatory**: The host name of the Elasticsearch server.
86
102
- `ES_PORT` *optional* (default `9200`): The port where Elasticsearch server is listening to.
87
103
- `ES_PROTOCOL` *optional* (default `http`): The protocol used to talk to Elasticsearch. Can be `http` or `https`.
88
-
- `ES_INDEX_RECORDS` *optional* (default `gn_records`): In case you have more than GeoNetwork instance using the same Elasticsearch cluster each one needs to use a different index name. Use this variable to define the name of the index used by each GeoNetwork.
104
+
- `ES_INDEX_RECORDS` *optional* (default `gn-records`): In case you have more than GeoNetwork instance using the same Elasticsearch cluster each one needs to use a different index name. Use this variable to define the name of the index used by each GeoNetwork.
89
105
- `ES_USERNAME` *optional* (default empty): username used to connect to Elasticsearch.
90
106
- `ES_PASSWORD` *optional* (default empty): password used to connect to Elasticsearch.
91
107
- `KB_URL` *Optional* (default `http://localhost:5601`): The URL where Kibana is listening.
108
+
- `REMOTE_IP_INTERNAL_PROXIES` *optional* (since 4.2.15): Regular expression matching IP addresses of trusted reverse proxies. Enables `X-Forwarded-For` header processing for correct client IP detection behind a proxy. When not set, the RemoteIp Valve is disabled. Example: `192\.168\.0\.10|192\.168\.0\.11`.
92
109
93
110
### Database configuration
94
111
@@ -104,7 +121,7 @@ By default GeoNetwork uses a local **H2 database** for demo use (this one is **n
104
121
105
122
### Start GeoNetwork
106
123
107
-
This command will start a debian-based container, running a Tomcat (GN 3) or Jetty (GN 4) web server, with a GeoNetwork WAR deployed on the server:
124
+
This command will start a Debian-based container, running a Tomcat web server, with a GeoNetwork WAR deployed on the server. Note: GeoNetwork 4.0.0-4.2.14 and 4.4.0-4.4.9 used Jetty 9 instead of Tomcat.
Then, if you are running docker on Linux, you may access geonetwork at http://localhost:8080/geonetwork.
122
139
140
+
### File permissions
141
+
142
+
The Tomcat-based images (GN 3, 4.2.15+, and 4.4.10+) run as `root`, whereas the previous Jetty-based images (GN 4.0.0-4.2.14 and 4.4.0-4.4.9) ran as the `jetty` user. If you are **upgrading from a Jetty-based image** and mounting a host directory or named volume for the data directory, you may need to update the ownership of existing data to avoid permission errors:
The switch from Jetty to Tomcat (GN 4.2.15+ and 4.4.10+) introduces additional breaking changes beyond file ownership for users who extend these images or reference Jetty-specific paths in custom scripts:
151
+
152
+
- `$JETTY_HOME`and `$JETTY_BASE` environment variables are no longer set.
153
+
- The GeoNetwork web application path changed: it is now at `/usr/local/tomcat/webapps/geonetwork/` (GN 4.2.x) or `/opt/geonetwork/` (GN 4.4.10+), replacing the previous `/var/lib/jetty/webapps/geonetwork/`.
154
+
- The container startup command is now `catalina.sh run` instead of `java -jar /usr/local/jetty/start.jar`.
155
+
123
156
### Set the data directory and H2 db file
124
157
125
158
The data directory is the location on the file system where the catalog stores much of its custom configuration and uploaded files. It is also where it stores a number of support files, used for various purposes (e.g.: spatial index, thumbnails). The default variant also uses a local H2 database to store the metadata catalog itself.
126
159
127
-
By default, GeoNetwork sets the data directory on `/opt/geonetwork/WEB-INF/data` and H2 database file to the Jetty dir `/var/lib/jetty/gn.h2.db` (since GN 4.0.0) or Tomcat `/usr/local/tomcat/gn.h2.db` (for GN 3), but you may override these values by injecting environment variables into the container: - `-e DATA_DIR=...` (defaults to `/opt/geonetwork/WEB-INF/data`) and `-e GEONETWORK_DB_NAME=...` (defaults to `gn` which sets up database `gn.h2.db` in tomcat bin dir `/usr/local/tomcat`). Note that setting the database location via `GEONETWORK_DB_NAME` only works from version 3.10.3 onwards.
160
+
By default, GeoNetwork sets the data directory on `/opt/geonetwork/WEB-INF/data` and the H2 database file to `/usr/local/tomcat/gn.h2.db` (Tomcat-based images: GN 3, 4.2.15+, and 4.4.10+) or `/var/lib/jetty/gn.h2.db` (Jetty-based images: GN 4.0.0-4.2.14 and 4.4.0-4.4.9), but you may override these values by injecting environment variables into the container: - `-e DATA_DIR=...` (defaults to `/opt/geonetwork/WEB-INF/data`) and `-e GEONETWORK_DB_NAME=...` (defaults to `gn` which sets up database `gn.h2.db` in tomcat bin dir `/usr/local/tomcat`). Note that setting the database location via `GEONETWORK_DB_NAME` only works from version 3.10.3 onwards.
128
161
129
162
Since version 4.4.0 the data directory needs to be configued using Java properties passed in the `GN_CONFIG_PROPERTIES` environment variable. For example:
0 commit comments