From 662ce85cb8b84ccb8f63a9160c366c864968817d Mon Sep 17 00:00:00 2001 From: Grzegorz Adam Kowalski Date: Sat, 16 Mar 2019 23:35:15 +0100 Subject: [PATCH 1/4] turn off autovacuum; fix psql errors --- run.sh | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/run.sh b/run.sh index 701d33e..5039751 100755 --- a/run.sh +++ b/run.sh @@ -12,11 +12,8 @@ fi if [ "$1" = "import" ]; then # Initialize PostgreSQL + sudo -u postgres echo "autovacuum = off" >> /etc/postgresql/10/main/postgresql.custom.conf service postgresql start - sudo -u postgres createuser renderer - sudo -u postgres createdb -E UTF8 -O renderer gis - sudo -u postgres psql -d gis -c "CREATE EXTENSION postgis;" - sudo -u postgres psql -d gis -c "CREATE EXTENSION hstore;" sudo -u postgres psql -d gis -c "ALTER TABLE geometry_columns OWNER TO renderer;" sudo -u postgres psql -d gis -c "ALTER TABLE spatial_ref_sys OWNER TO renderer;" From 42b5783486ed1de2607f80955e768c511fcdaaf7 Mon Sep 17 00:00:00 2001 From: Grzegorz Adam Kowalski Date: Sun, 17 Mar 2019 01:01:52 +0100 Subject: [PATCH 2/4] revert changes --- run.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/run.sh b/run.sh index 5039751..97e2dbe 100755 --- a/run.sh +++ b/run.sh @@ -14,6 +14,10 @@ if [ "$1" = "import" ]; then # Initialize PostgreSQL sudo -u postgres echo "autovacuum = off" >> /etc/postgresql/10/main/postgresql.custom.conf service postgresql start + sudo -u postgres createuser renderer + sudo -u postgres createdb -E UTF8 -O renderer gis + sudo -u postgres psql -d gis -c "CREATE EXTENSION postgis;" + sudo -u postgres psql -d gis -c "CREATE EXTENSION hstore;" sudo -u postgres psql -d gis -c "ALTER TABLE geometry_columns OWNER TO renderer;" sudo -u postgres psql -d gis -c "ALTER TABLE spatial_ref_sys OWNER TO renderer;" From c8f8d0fd71c686bd34b076715b27fcc8f48bad0e Mon Sep 17 00:00:00 2001 From: Grzegorz Adam Kowalski Date: Sun, 17 Mar 2019 20:33:06 +0100 Subject: [PATCH 3/4] verify SSL --- Dockerfile | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index 51b205e..87f0229 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,6 +10,7 @@ RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone # Install dependencies RUN echo "deb [ allow-insecure=yes ] http://apt.postgresql.org/pub/repos/apt/ bionic-pgdg main" >> /etc/apt/sources.list.d/pgdg.list \ && apt-get update \ + && apt-get install -y apt-transport-https ca-certificates \ && apt-get install -y --no-install-recommends --allow-unauthenticated \ apache2 \ apache2-dev \ @@ -69,8 +70,6 @@ RUN echo "deb [ allow-insecure=yes ] http://apt.postgresql.org/pub/repos/apt/ bi RUN adduser --disabled-password --gecos "" renderer USER renderer -ENV GIT_SSL_NO_VERIFY=true - # Install latest osm2pgsql RUN mkdir /home/renderer/src WORKDIR /home/renderer/src @@ -105,14 +104,12 @@ WORKDIR /home/renderer/src RUN git clone https://github.com/gravitystorm/openstreetmap-carto.git WORKDIR /home/renderer/src/openstreetmap-carto USER root -RUN npm config set strict-ssl=false \ - && npm install -g carto +RUN npm install -g carto USER renderer RUN carto project.mml > mapnik.xml # Load shapefiles WORKDIR /home/renderer/src/openstreetmap-carto -ENV PYTHONHTTPSVERIFY=0 RUN scripts/get-shapefiles.py # Configure renderd From c99368d160934465ffb423db396eadefd04c7cba Mon Sep 17 00:00:00 2001 From: Grzegorz Adam Kowalski Date: Tue, 19 Mar 2019 16:47:57 +0100 Subject: [PATCH 4/4] Info about shared memory error issue #3 --- README.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/README.md b/README.md index 97618f2..1f7e583 100644 --- a/README.md +++ b/README.md @@ -35,6 +35,21 @@ The import and tile serving processes use 4 threads by default, but this number docker run -p 80:80 -e THREADS=24 -v openstreetmap-data:/var/lib/postgresql/10/main -d overv/openstreetmap-tile-server run +## Troubleshooting + +### ERROR: could not resize shared memory segment + +If you encounter such entries in the log, it will mean that the default shared memory limit (64 MB) is too low for the container and it should be raised: + + renderd[126]: ERROR: failed to render TILE ajt 6 32-39 16-23, + renderd[126]: reason: Postgis Plugin: ERROR: could not resize shared memory segment + +To raise it use `--shm-size` parameter. For example: + + docker run -p 80:80 -v openstreetmap-data:/var/lib/postgresql/10/main --shm-size="192m" -d overv/openstreetmap-tile-server run + +For too high values you may notice excessive CPU load and memory usage. It might be that you will have to experimentally find the best values for yourself. + ## License ```