mediagis / nominatim-docker

100% working container for Nominatim
Creative Commons Zero v1.0 Universal
1.08k stars 442 forks source link

Amazon ECS: Setting initialize to false in docker deployment. #412

Open mohit-bureau opened 1 year ago

mohit-bureau commented 1 year ago

We are trying to install it on the AWS ECS platform. There are external postgres database which has already imported data. But still, nominatim is trying to import the data. Is there any env variable to disable initialization?

Database: Google Cloud SQL

The database is imported by helm chart provided in k8s deployment methods. Now, I wanted to use the same database with the service deployed on ECS. I am not sure why it is creating the database.

Logs:

+ '[' '!' -f /var/lib/postgresql/14/main/PG_VERSION ']'
+ cp /etc/postgresql/14/main/conf.d/postgres-import.conf.disabled /etc/postgresql/14/main/conf.d/postgres-import.conf
+ sudo service postgresql start
 * Starting PostgreSQL 14 database server                                                                                            [ OK ]
+ sudo -E -u postgres psql postgres -tAc 'SELECT 1 FROM pg_roles WHERE rolname='\''nominatim'\'''
+ grep -q 1
+ sudo -E -u postgres createuser -s nominatim
createuser: error: creation of new role failed: ERROR:  must be superuser to create superusers
+ sudo -E -u postgres createuser -SDR www-data
createuser: error: creation of new role failed: ERROR:  role "www-data" already exists
+ chown -R nominatim:nominatim /nominatim
+ cd /nominatim
+ '[' '' = true ']'
+ sudo -E -u nominatim nominatim import --osm-file /nominatim/data.osm.pbf --threads 16
2022-12-22 08:16:22: Using project directory: /nominatim
2022-12-22 08:16:23: Creating database
createdb: error: database creation failed: ERROR:  database "nominatim" already exists
2022-12-22 08:16:24: FATAL: Creating new database failed.
CRSylar commented 1 year ago

same problem, but using RDS postrgres. Worth mention that spawning a task on ecs works "fine" ( not mentioning the persistency problems) but using a ecs Service to spawn the task do not work, the container kinda freeze after the db creation. after more than 1h no more logs had been written...

jimboboliver commented 9 months ago

Hey guys, did you find a solution for this?