Skip to content

Commit

Permalink
Allow to configure the Elasticsearch connection in environment variab…
Browse files Browse the repository at this point in the history
…les - documentation updates
  • Loading branch information
josegar74 committed Jan 7, 2025
1 parent 0119e1c commit cf29dca
Showing 1 changed file with 30 additions and 11 deletions.
41 changes: 30 additions & 11 deletions docs/manual/docs/install-guide/installing-index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 <http://localhost:9200> 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.

0 comments on commit cf29dca

Please sign in to comment.