X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/21156fc2a211eb418dc94028e1430619771e1dc3..15a66e7b7d79d273f1674f673161cb440458ca7d:/docs/admin/Update.md diff --git a/docs/admin/Update.md b/docs/admin/Update.md index 49a4c4bf..5d1324d0 100644 --- a/docs/admin/Update.md +++ b/docs/admin/Update.md @@ -59,47 +59,6 @@ imported multiple country extracts and want to keep them up-to-date, [Advanced installations section](Advanced-Installations.md) contains instructions to set up and update multiple country extracts. -#### Continuous updates - -This is the easiest mode. Simply run the replication command without any -parameters: - - nominatim replication - -The update application keeps running forever and retrieves and applies -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 -``` - #### One-time mode When the `--once` parameter is given, then Nominatim will download exactly one @@ -131,6 +90,63 @@ done A cron job then creates the file `/srv/nominatim/schedule-maintenance` once per night. +##### One-time mode with systemd + +You can run the one-time mode with a systemd timer & service. + +Create a timer description like `/etc/systemd/system/nominatim-updates.timer`: + +``` +[Unit] +Description=Timer to start updates of Nominatim + +[Timer] +OnActiveSec=2 +OnUnitActiveSec=1min +Unit=nominatim-updates.service + +[Install] +WantedBy=multi-user.target +``` + +And then a similar service definition: `/etc/systemd/system/nominatim-updates.service`: + +``` +[Unit] +Description=Single updates of Nominatim + +[Service] +WorkingDirectory=/srv/nominatim +ExecStart=nominatim replication --once +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. `OnUnitActiveSec` defines how often the individual +update command is run. + +Now activate the service and start the updates: + +``` +sudo systemctl daemon-reload +sudo systemctl enable nominatim-updates.timer +sudo systemctl start nominatim-updates.timer +``` + +You can stop future data updates, while allowing any current, in-progress +update steps to finish, by running `sudo systemctl stop +nominatim-updates.timer` and waiting until `nominatim-updates.service` isn't +running (`sudo systemctl is-active nominatim-updates.service`). Current output +from the update can be seen like above (`systemctl status +nominatim-updates.service`). + #### Catch-up mode @@ -158,9 +174,59 @@ replication catch-up at whatever interval you desire. 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 source. This makes sure that you don't miss an entire day of updates when - the source is unexpectely 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 updated source with daily updates), use the continuous update mode. It ensures to re-request the newest update until it is published. + + +#### Continuous updates + +!!! danger + This mode is no longer recommended to use and will removed in future + releases. systemd is much better + suited for running regular updates. Please refer to the setup + instructions for running one-time mode with systemd above. + +This is the easiest mode. Simply run the replication command without any +parameters: + + nominatim replication + +The update application keeps running forever and retrieves and applies +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 +``` + +