mirror of
https://github.com/osm-search/Nominatim.git
synced 2026-02-14 18:37:58 +00:00
Compare commits
4 Commits
v5.1.0
...
docs-4.0.x
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a3343ab048 | ||
|
|
517eb52352 | ||
|
|
02bd1bad2d | ||
|
|
8d7afbfd4f |
@@ -101,7 +101,7 @@ This will get diffs from the replication server, import diffs and index
|
||||
the database. The default replication server in the
|
||||
script([Geofabrik](https://download.geofabrik.de)) provides daily updates.
|
||||
|
||||
## Importing Nominatim to an external PostgreSQL database
|
||||
## Using an external PostgreSQL database
|
||||
|
||||
You can install Nominatim using a database that runs on a different server when
|
||||
you have physical access to the file system on the other server. Nominatim
|
||||
@@ -109,6 +109,11 @@ uses a custom normalization library that needs to be made accessible to the
|
||||
PostgreSQL server. This section explains how to set up the normalization
|
||||
library.
|
||||
|
||||
!!! note
|
||||
The external module is only needed when using the legacy tokenizer.
|
||||
If you have choosen the ICU tokenizer, then you can ignore this section
|
||||
and follow the standard import documentation.
|
||||
|
||||
### Option 1: Compiling the library on the database server
|
||||
|
||||
The most sure way to get a working library is to compile it on the database
|
||||
@@ -167,3 +172,44 @@ NOMINATIM_DATABASE_MODULE_PATH="<directory on the database server where nominati
|
||||
|
||||
Now change the `NOMINATIM_DATABASE_DSN` to point to your remote server and continue
|
||||
to follow the [standard instructions for importing](Import.md).
|
||||
|
||||
|
||||
## Moving the database to another machine
|
||||
|
||||
For some configurations it may be useful to run the import on one machine, then
|
||||
move the database to another machine and run the Nominatim service from there.
|
||||
For example, you might want to use a large machine to be able to run the import
|
||||
quickly but only want a smaller machine for production because there is not so
|
||||
much load. Or you might want to do the import once and then replicate the
|
||||
database to many machines.
|
||||
|
||||
The important thing to keep in mind when transferring the Nominatim installation
|
||||
is that you need to transfer the database _and the project directory_. Both
|
||||
parts are essential for your installation.
|
||||
|
||||
The Nominatim database can be transferred using the `pg_dump`/`pg_restore` tool.
|
||||
Make sure to use the same version of PostgreSQL and PostGIS on source and
|
||||
target machine.
|
||||
|
||||
!!! note
|
||||
Before creating a dump of your Nominatim database, consider running
|
||||
`nominatim freeze` first. Your database looses the ability to receive further
|
||||
data updates but the resulting database is only about a third of the size
|
||||
of a full database.
|
||||
|
||||
Next install Nominatim on the target machine by following the standard installation
|
||||
instructions. Again make sure to use the same version as the source machine.
|
||||
|
||||
You can now copy the project directory from the source machine to the new machine.
|
||||
If necessary, edit the `.env` file to point it to the restored database.
|
||||
Finally run
|
||||
|
||||
nominatim refresh --website
|
||||
|
||||
to make sure that the local installation of Nominatim will be used.
|
||||
|
||||
If you are using the legacy tokenizer you might also have to switch to the
|
||||
PostgreSQL module that was compiled on your target machine. If you get errors
|
||||
that PostgreSQL cannot find or access `nominatim.so` then copy the installed
|
||||
version into the `module` directory of your project directory. The installed
|
||||
copy can usually be found under `/usr/local/lib/nominatim/module/nominatim.so`.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
site_name: Nominatim Documentation
|
||||
site_name: Nominatim 4.0.1
|
||||
theme: readthedocs
|
||||
docs_dir: ${CMAKE_CURRENT_BINARY_DIR}
|
||||
site_url: https://nominatim.org
|
||||
|
||||
@@ -35,12 +35,12 @@
|
||||
|
||||
sudo yum install -y postgresql11-server postgresql11-contrib postgresql11-devel \
|
||||
postgis25_11 postgis25_11-utils \
|
||||
wget git cmake make gcc gcc-c++ libtool policycoreutils-python \
|
||||
wget cmake make gcc gcc-c++ libtool policycoreutils-python \
|
||||
devtoolset-7 llvm-toolset-7 \
|
||||
php-pgsql php php-intl libpqxx-devel \
|
||||
proj-epsg bzip2-devel proj-devel boost-devel \
|
||||
python3-pip python3-setuptools python3-devel \
|
||||
expat-devel zlib-devel libicu-dev
|
||||
expat-devel zlib-devel libicu-devel
|
||||
|
||||
pip3 install --user psycopg2 python-dotenv psutil Jinja2 PyICU datrie pyyaml
|
||||
|
||||
@@ -117,26 +117,19 @@ sudo chown vagrant /srv/nominatim #DOCS:
|
||||
#
|
||||
if [ "x$1" == "xyes" ]; then #DOCS: :::sh
|
||||
cd $USERHOME
|
||||
git clone --recursive git://github.com/openstreetmap/Nominatim.git
|
||||
cd Nominatim
|
||||
wget https://nominatim.org/release/Nominatim-4.0.1.tar.bz2
|
||||
tar xf Nominatim-4.0.1.tar.bz2
|
||||
else #DOCS:
|
||||
cd $USERHOME/Nominatim #DOCS:
|
||||
fi #DOCS:
|
||||
|
||||
# When installing the latest source from github, you also need to
|
||||
# download the country grid:
|
||||
|
||||
if [ ! -f data/country_osm_grid.sql.gz ]; then #DOCS: :::sh
|
||||
wget --no-verbose -O data/country_osm_grid.sql.gz https://www.nominatim.org/data/country_grid.sql.gz
|
||||
fi #DOCS:
|
||||
|
||||
# The code must be built in a separate directory. Create this directory,
|
||||
# then configure and build Nominatim in there:
|
||||
|
||||
#DOCS: :::sh
|
||||
mkdir $USERHOME/build
|
||||
cd $USERHOME/build
|
||||
cmake $USERHOME/Nominatim
|
||||
cmake $USERHOME/Nominatim-4.0.1
|
||||
make
|
||||
sudo make install
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
#DOCS: :::sh
|
||||
sudo dnf --enablerepo=powertools install -y postgresql12-server \
|
||||
postgresql12-contrib postgresql12-devel postgis30_12 \
|
||||
wget git cmake make gcc gcc-c++ libtool policycoreutils-python-utils \
|
||||
wget cmake make gcc gcc-c++ libtool policycoreutils-python-utils \
|
||||
llvm-toolset ccache clang-tools-extra \
|
||||
php-pgsql php php-intl php-json libpq-devel \
|
||||
bzip2-devel proj-devel boost-devel \
|
||||
@@ -125,26 +125,19 @@ fi #DOCS:
|
||||
#
|
||||
if [ "x$1" == "xyes" ]; then #DOCS: :::sh
|
||||
cd $USERHOME
|
||||
git clone --recursive git://github.com/openstreetmap/Nominatim.git
|
||||
cd Nominatim
|
||||
wget https://nominatim.org/release/Nominatim-4.0.1.tar.bz2
|
||||
tar xf Nominatim-4.0.1.tar.bz2
|
||||
else #DOCS:
|
||||
cd $USERHOME/Nominatim #DOCS:
|
||||
fi #DOCS:
|
||||
|
||||
# When installing the latest source from github, you also need to
|
||||
# download the country grid:
|
||||
|
||||
if [ ! -f data/country_osm_grid.sql.gz ]; then #DOCS: :::sh
|
||||
wget --no-verbose -O data/country_osm_grid.sql.gz https://www.nominatim.org/data/country_grid.sql.gz
|
||||
fi #DOCS:
|
||||
|
||||
# The code must be built in a separate directory. Create this directory,
|
||||
# then configure and build Nominatim in there:
|
||||
|
||||
#DOCS: :::sh
|
||||
mkdir $USERHOME/build
|
||||
cd $USERHOME/build
|
||||
cmake $USERHOME/Nominatim
|
||||
cmake $USERHOME/Nominatim-4.0.1
|
||||
make
|
||||
sudo make install
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ export DEBIAN_FRONTEND=noninteractive #DOCS:
|
||||
postgresql-server-dev-10 postgresql-10-postgis-2.4 \
|
||||
postgresql-contrib-10 postgresql-10-postgis-scripts \
|
||||
php php-pgsql php-intl libicu-dev python3-pip \
|
||||
python3-psutil python3-jinja2 python3-icu git
|
||||
python3-psutil python3-jinja2 python3-icu
|
||||
|
||||
# Some of the Python packages that come with Ubuntu 18.04 are too old, so
|
||||
# install the latest version from pip:
|
||||
@@ -105,25 +105,18 @@ fi #DOCS:
|
||||
#
|
||||
if [ "x$1" == "xyes" ]; then #DOCS: :::sh
|
||||
cd $USERHOME
|
||||
git clone --recursive git://github.com/openstreetmap/Nominatim.git
|
||||
cd Nominatim
|
||||
wget https://nominatim.org/release/Nominatim-4.0.1.tar.bz2
|
||||
tar xf Nominatim-4.0.1.tar.bz2
|
||||
else #DOCS:
|
||||
cd $USERHOME/Nominatim #DOCS:
|
||||
fi #DOCS:
|
||||
|
||||
# When installing the latest source from github, you also need to
|
||||
# download the country grid:
|
||||
|
||||
if [ ! -f data/country_osm_grid.sql.gz ]; then #DOCS: :::sh
|
||||
wget -O data/country_osm_grid.sql.gz https://www.nominatim.org/data/country_grid.sql.gz
|
||||
fi #DOCS:
|
||||
|
||||
# The code must be built in a separate directory. Create this directory,
|
||||
# then configure and build Nominatim in there:
|
||||
|
||||
mkdir $USERHOME/build
|
||||
cd $USERHOME/build
|
||||
cmake $USERHOME/Nominatim
|
||||
cmake $USERHOME/Nominatim-4.0.1
|
||||
make
|
||||
sudo make install
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ export DEBIAN_FRONTEND=noninteractive #DOCS:
|
||||
postgresql-contrib-12 postgresql-12-postgis-3-scripts \
|
||||
php php-pgsql php-intl libicu-dev python3-dotenv \
|
||||
python3-psycopg2 python3-psutil python3-jinja2 \
|
||||
python3-icu python3-datrie git
|
||||
python3-icu python3-datrie
|
||||
|
||||
#
|
||||
# System Configuration
|
||||
@@ -99,8 +99,8 @@ fi #DOCS:
|
||||
#
|
||||
if [ "x$1" == "xyes" ]; then #DOCS: :::sh
|
||||
cd $USERHOME
|
||||
git clone --recursive git://github.com/openstreetmap/Nominatim.git
|
||||
cd Nominatim
|
||||
wget https://nominatim.org/release/Nominatim-4.0.1.tar.bz2
|
||||
tar xf Nominatim-4.0.1.tar.bz2
|
||||
else #DOCS:
|
||||
cd $USERHOME/Nominatim #DOCS:
|
||||
fi #DOCS:
|
||||
@@ -117,7 +117,7 @@ fi #DOCS:
|
||||
|
||||
mkdir $USERHOME/build
|
||||
cd $USERHOME/build
|
||||
cmake $USERHOME/Nominatim
|
||||
cmake $USERHOME/Nominatim-4.0.1
|
||||
make
|
||||
sudo make install
|
||||
|
||||
|
||||
Reference in New Issue
Block a user