Skip to content

Commit f76dbb0

Browse files
committed
docs: update Update docs for virtualenv use
1 parent 8dd218a commit f76dbb0

File tree

3 files changed

+26
-56
lines changed

3 files changed

+26
-56
lines changed

Diff for: docs/admin/Update.md

+24-54
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,10 @@ the update interval no new data has been published yet, it will go to sleep
6868
until the next expected update and only then attempt to download the next batch.
6969

7070
The one-time mode is particularly useful if you want to run updates continuously
71-
but need to schedule other work in between updates. For example, the main
72-
service at osm.org uses it, to regularly recompute postcodes -- a process that
73-
must not be run while updates are in progress. Its update script
74-
looks like this:
71+
but need to schedule other work in between updates. For example, you might
72+
want to regularly recompute postcodes -- a process that
73+
must not be run while updates are in progress. An update script refreshing
74+
postcodes regularly might look like this:
7575

7676
```sh
7777
#!/bin/bash
@@ -109,17 +109,19 @@ Unit=nominatim-updates.service
109109
WantedBy=multi-user.target
110110
```
111111

112-
And then a similar service definition: `/etc/systemd/system/nominatim-updates.service`:
112+
`OnUnitActiveSec` defines how often the individual update command is run.
113+
114+
Then add a service definition for the timer in `/etc/systemd/system/nominatim-updates.service`:
113115

114116
```
115117
[Unit]
116118
Description=Single updates of Nominatim
117119
118120
[Service]
119-
WorkingDirectory=/srv/nominatim
120-
ExecStart=nominatim replication --once
121-
StandardOutput=append:/var/log/nominatim-updates.log
122-
StandardError=append:/var/log/nominatim-updates.error.log
121+
WorkingDirectory=/srv/nominatim-project
122+
ExecStart=/srv/nominatim-venv/bin/nominatim replication --once
123+
StandardOutput=journald
124+
StandardError=inherit
123125
User=nominatim
124126
Group=nominatim
125127
Type=simple
@@ -128,9 +130,9 @@ Type=simple
128130
WantedBy=multi-user.target
129131
```
130132

131-
Replace the `WorkingDirectory` with your project directory. Also adapt user and
132-
group names as required. `OnUnitActiveSec` defines how often the individual
133-
update command is run.
133+
Replace the `WorkingDirectory` with your project directory. `ExecStart` points
134+
to the nominatim binary that was installed in your virtualenv earlier.
135+
Finally, you might need to adapt user and group names as required.
134136

135137
Now activate the service and start the updates:
136138

@@ -140,12 +142,13 @@ sudo systemctl enable nominatim-updates.timer
140142
sudo systemctl start nominatim-updates.timer
141143
```
142144

143-
You can stop future data updates, while allowing any current, in-progress
145+
You can stop future data updates while allowing any current, in-progress
144146
update steps to finish, by running `sudo systemctl stop
145147
nominatim-updates.timer` and waiting until `nominatim-updates.service` isn't
146-
running (`sudo systemctl is-active nominatim-updates.service`). Current output
147-
from the update can be seen like above (`systemctl status
148-
nominatim-updates.service`).
148+
running (`sudo systemctl is-active nominatim-updates.service`).
149+
150+
To check the output from the update process, use journalctl: `journalctl -u
151+
nominatim-updates.service`
149152

150153

151154
#### Catch-up mode
@@ -155,13 +158,13 @@ all changes from the server until the database is up-to-date. The catch-up mode
155158
still respects the parameter `NOMINATIM_REPLICATION_MAX_DIFF`. It downloads and
156159
applies the changes in appropriate batches until all is done.
157160

158-
The catch-up mode is foremost useful to bring the database up to speed after the
161+
The catch-up mode is foremost useful to bring the database up to date after the
159162
initial import. Give that the service usually is not in production at this
160163
point, you can temporarily be a bit more generous with the batch size and
161164
number of threads you use for the updates by running catch-up like this:
162165

163166
```
164-
cd /srv/nominatim
167+
cd /srv/nominatim-project
165168
NOMINATIM_REPLICATION_MAX_DIFF=5000 nominatim replication --catch-up --threads 15
166169
```
167170

@@ -173,13 +176,13 @@ replication catch-up at whatever interval you desire.
173176
When running scheduled updates with catch-up, it is a good idea to choose
174177
a replication source with an update frequency that is an order of magnitude
175178
lower. For example, if you want to update once a day, use an hourly updated
176-
source. This makes sure that you don't miss an entire day of updates when
179+
source. This ensures that you don't miss an entire day of updates when
177180
the source is unexpectedly late to publish its update.
178181

179182
If you want to use the source with the same update frequency (e.g. a daily
180183
updated source with daily updates), use the
181-
continuous update mode. It ensures to re-request the newest update until it
182-
is published.
184+
once mode together with a frequently run systemd script as described above.
185+
It ensures to re-request the newest update until they have been published.
183186

184187

185188
#### Continuous updates
@@ -197,36 +200,3 @@ parameters:
197200

198201
The update application keeps running forever and retrieves and applies
199202
new updates from the server as they are published.
200-
201-
You can run this command as a simple systemd service. Create a service
202-
description like that in `/etc/systemd/system/nominatim-updates.service`:
203-
204-
```
205-
[Unit]
206-
Description=Continuous updates of Nominatim
207-
208-
[Service]
209-
WorkingDirectory=/srv/nominatim
210-
ExecStart=nominatim replication
211-
StandardOutput=append:/var/log/nominatim-updates.log
212-
StandardError=append:/var/log/nominatim-updates.error.log
213-
User=nominatim
214-
Group=nominatim
215-
Type=simple
216-
217-
[Install]
218-
WantedBy=multi-user.target
219-
```
220-
221-
Replace the `WorkingDirectory` with your project directory. Also adapt user
222-
and group names as required.
223-
224-
Now activate the service and start the updates:
225-
226-
```
227-
sudo systemctl daemon-reload
228-
sudo systemctl enable nominatim-updates
229-
sudo systemctl start nominatim-updates
230-
```
231-
232-

Diff for: docs/customize/Import-Styles.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ defined primary names are forgotten.)
326326

327327
| Name | Description |
328328
| :----- | :---------- |
329-
| core | Basic set of recogniced names for all places. |
329+
| core | Basic set of recognized names for all places. |
330330
| address | Additional names useful when indexing full addresses. |
331331
| poi | Extended set of recognized names for pois. Use on top of the core set. |
332332

Diff for: docs/customize/Tokenizers.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ queries. This happens in two stages:
5050
as during the import process but may involve other processing like,
5151
for example, word break detection.
5252
2. The **token analysis** step breaks down the query parts into tokens,
53-
looks them up in the database and assignes them possible functions and
53+
looks them up in the database and assigns them possible functions and
5454
probabilities.
5555

5656
Query processing can be further customized while the rest of the analysis

0 commit comments

Comments
 (0)