mirror of
https://github.com/osm-search/Nominatim.git
synced 2026-02-25 18:48:15 +00:00
docs: update Update docs for virtualenv use
This commit is contained in:
@@ -68,10 +68,10 @@ the update interval no new data has been published yet, it will go to sleep
|
|||||||
until the next expected update and only then attempt to download the next batch.
|
until the next expected update and only then attempt to download the next batch.
|
||||||
|
|
||||||
The one-time mode is particularly useful if you want to run updates continuously
|
The one-time mode is particularly useful if you want to run updates continuously
|
||||||
but need to schedule other work in between updates. For example, the main
|
but need to schedule other work in between updates. For example, you might
|
||||||
service at osm.org uses it, to regularly recompute postcodes -- a process that
|
want to regularly recompute postcodes -- a process that
|
||||||
must not be run while updates are in progress. Its update script
|
must not be run while updates are in progress. An update script refreshing
|
||||||
looks like this:
|
postcodes regularly might look like this:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
@@ -109,17 +109,19 @@ Unit=nominatim-updates.service
|
|||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
```
|
```
|
||||||
|
|
||||||
And then a similar service definition: `/etc/systemd/system/nominatim-updates.service`:
|
`OnUnitActiveSec` defines how often the individual update command is run.
|
||||||
|
|
||||||
|
Then add a service definition for the timer in `/etc/systemd/system/nominatim-updates.service`:
|
||||||
|
|
||||||
```
|
```
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=Single updates of Nominatim
|
Description=Single updates of Nominatim
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
WorkingDirectory=/srv/nominatim
|
WorkingDirectory=/srv/nominatim-project
|
||||||
ExecStart=nominatim replication --once
|
ExecStart=/srv/nominatim-venv/bin/nominatim replication --once
|
||||||
StandardOutput=append:/var/log/nominatim-updates.log
|
StandardOutput=journald
|
||||||
StandardError=append:/var/log/nominatim-updates.error.log
|
StandardError=inherit
|
||||||
User=nominatim
|
User=nominatim
|
||||||
Group=nominatim
|
Group=nominatim
|
||||||
Type=simple
|
Type=simple
|
||||||
@@ -128,9 +130,9 @@ Type=simple
|
|||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
```
|
```
|
||||||
|
|
||||||
Replace the `WorkingDirectory` with your project directory. Also adapt user and
|
Replace the `WorkingDirectory` with your project directory. `ExecStart` points
|
||||||
group names as required. `OnUnitActiveSec` defines how often the individual
|
to the nominatim binary that was installed in your virtualenv earlier.
|
||||||
update command is run.
|
Finally, you might need to adapt user and group names as required.
|
||||||
|
|
||||||
Now activate the service and start the updates:
|
Now activate the service and start the updates:
|
||||||
|
|
||||||
@@ -140,12 +142,13 @@ sudo systemctl enable nominatim-updates.timer
|
|||||||
sudo systemctl start nominatim-updates.timer
|
sudo systemctl start nominatim-updates.timer
|
||||||
```
|
```
|
||||||
|
|
||||||
You can stop future data updates, while allowing any current, in-progress
|
You can stop future data updates while allowing any current, in-progress
|
||||||
update steps to finish, by running `sudo systemctl stop
|
update steps to finish, by running `sudo systemctl stop
|
||||||
nominatim-updates.timer` and waiting until `nominatim-updates.service` isn't
|
nominatim-updates.timer` and waiting until `nominatim-updates.service` isn't
|
||||||
running (`sudo systemctl is-active nominatim-updates.service`). Current output
|
running (`sudo systemctl is-active nominatim-updates.service`).
|
||||||
from the update can be seen like above (`systemctl status
|
|
||||||
nominatim-updates.service`).
|
To check the output from the update process, use journalctl: `journalctl -u
|
||||||
|
nominatim-updates.service`
|
||||||
|
|
||||||
|
|
||||||
#### Catch-up mode
|
#### Catch-up mode
|
||||||
@@ -155,13 +158,13 @@ all changes from the server until the database is up-to-date. The catch-up mode
|
|||||||
still respects the parameter `NOMINATIM_REPLICATION_MAX_DIFF`. It downloads and
|
still respects the parameter `NOMINATIM_REPLICATION_MAX_DIFF`. It downloads and
|
||||||
applies the changes in appropriate batches until all is done.
|
applies the changes in appropriate batches until all is done.
|
||||||
|
|
||||||
The catch-up mode is foremost useful to bring the database up to speed after the
|
The catch-up mode is foremost useful to bring the database up to date after the
|
||||||
initial import. Give that the service usually is not in production at this
|
initial import. Give that the service usually is not in production at this
|
||||||
point, you can temporarily be a bit more generous with the batch size and
|
point, you can temporarily be a bit more generous with the batch size and
|
||||||
number of threads you use for the updates by running catch-up like this:
|
number of threads you use for the updates by running catch-up like this:
|
||||||
|
|
||||||
```
|
```
|
||||||
cd /srv/nominatim
|
cd /srv/nominatim-project
|
||||||
NOMINATIM_REPLICATION_MAX_DIFF=5000 nominatim replication --catch-up --threads 15
|
NOMINATIM_REPLICATION_MAX_DIFF=5000 nominatim replication --catch-up --threads 15
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -173,13 +176,13 @@ replication catch-up at whatever interval you desire.
|
|||||||
When running scheduled updates with catch-up, it is a good idea to choose
|
When running scheduled updates with catch-up, it is a good idea to choose
|
||||||
a replication source with an update frequency that is an order of magnitude
|
a replication source with an update frequency that is an order of magnitude
|
||||||
lower. For example, if you want to update once a day, use an hourly updated
|
lower. For example, if you want to update once a day, use an hourly updated
|
||||||
source. This makes sure that you don't miss an entire day of updates when
|
source. This ensures that you don't miss an entire day of updates when
|
||||||
the source is unexpectedly late to publish its update.
|
the source is unexpectedly late to publish its update.
|
||||||
|
|
||||||
If you want to use the source with the same update frequency (e.g. a daily
|
If you want to use the source with the same update frequency (e.g. a daily
|
||||||
updated source with daily updates), use the
|
updated source with daily updates), use the
|
||||||
continuous update mode. It ensures to re-request the newest update until it
|
once mode together with a frequently run systemd script as described above.
|
||||||
is published.
|
It ensures to re-request the newest update until they have been published.
|
||||||
|
|
||||||
|
|
||||||
#### Continuous updates
|
#### Continuous updates
|
||||||
@@ -197,36 +200,3 @@ parameters:
|
|||||||
|
|
||||||
The update application keeps running forever and retrieves and applies
|
The update application keeps running forever and retrieves and applies
|
||||||
new updates from the server as they are published.
|
new updates from the server as they are published.
|
||||||
|
|
||||||
You can run this command as a simple systemd service. Create a service
|
|
||||||
description like that in `/etc/systemd/system/nominatim-updates.service`:
|
|
||||||
|
|
||||||
```
|
|
||||||
[Unit]
|
|
||||||
Description=Continuous updates of Nominatim
|
|
||||||
|
|
||||||
[Service]
|
|
||||||
WorkingDirectory=/srv/nominatim
|
|
||||||
ExecStart=nominatim replication
|
|
||||||
StandardOutput=append:/var/log/nominatim-updates.log
|
|
||||||
StandardError=append:/var/log/nominatim-updates.error.log
|
|
||||||
User=nominatim
|
|
||||||
Group=nominatim
|
|
||||||
Type=simple
|
|
||||||
|
|
||||||
[Install]
|
|
||||||
WantedBy=multi-user.target
|
|
||||||
```
|
|
||||||
|
|
||||||
Replace the `WorkingDirectory` with your project directory. Also adapt user
|
|
||||||
and group names as required.
|
|
||||||
|
|
||||||
Now activate the service and start the updates:
|
|
||||||
|
|
||||||
```
|
|
||||||
sudo systemctl daemon-reload
|
|
||||||
sudo systemctl enable nominatim-updates
|
|
||||||
sudo systemctl start nominatim-updates
|
|
||||||
```
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -326,7 +326,7 @@ defined primary names are forgotten.)
|
|||||||
|
|
||||||
| Name | Description |
|
| Name | Description |
|
||||||
| :----- | :---------- |
|
| :----- | :---------- |
|
||||||
| core | Basic set of recogniced names for all places. |
|
| core | Basic set of recognized names for all places. |
|
||||||
| address | Additional names useful when indexing full addresses. |
|
| address | Additional names useful when indexing full addresses. |
|
||||||
| poi | Extended set of recognized names for pois. Use on top of the core set. |
|
| poi | Extended set of recognized names for pois. Use on top of the core set. |
|
||||||
|
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ queries. This happens in two stages:
|
|||||||
as during the import process but may involve other processing like,
|
as during the import process but may involve other processing like,
|
||||||
for example, word break detection.
|
for example, word break detection.
|
||||||
2. The **token analysis** step breaks down the query parts into tokens,
|
2. The **token analysis** step breaks down the query parts into tokens,
|
||||||
looks them up in the database and assignes them possible functions and
|
looks them up in the database and assigns them possible functions and
|
||||||
probabilities.
|
probabilities.
|
||||||
|
|
||||||
Query processing can be further customized while the rest of the analysis
|
Query processing can be further customized while the rest of the analysis
|
||||||
|
|||||||
Reference in New Issue
Block a user