-
Notifications
You must be signed in to change notification settings - Fork 449
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
provide external PostgreSQL support #245
Comments
Well, I would not be opposed to a feature where you override the postgres connection string via an env variable. Be aware that in such a case an empty, unused postgres instance would still be running in the container but that wouldn't be too resource intensive. Lets see what the other maintainers think. However, have you seen the comments in this similar request? #238 Seems that you need filesystem access to the host where the database is deployed which rules out RDS, doesn't it? |
@sghaida Just override the NOMINATIM_DATABASE_DSN variable. I'm doing so in my Helm chart and it works with an external database. |
Something weird happens when initialising the container with NOMINATIM_DATABASE_DSN... Line 78 in 2e8428a
e.g.
Relevant output:
|
Just guessing: the last line shows the value of NOMINATIM_DATABASE_DSN cut off after the first semicolon. Did you not copy the complete line or the bug somewhere in this area? |
That's the whole output, I'm not cutting it off. |
This requirement should go away with #307 . |
You could try removing the line with the database check and see what happens. Perhaps there is a bug in it. Or raise a ticket with upstream nominatim. |
Made it work in #308 |
#245 Pass environment variables to all sudo commands
Of course! Here's an example command:
At the moment you have to duplicate the connection details since NOMINATIM_DATABASE_DSN is used for the nominatim commands and PGDATABASE et al are used for psql. As you said above Postgres is still started within the container but it's not used. Maybe in the future the scripts could detect NOMINATIM_DATABASE_DSN and not start Postgres if present. Also note that when using an external Postgres it's up to you to make sure that the tokenizer is correctly configured (either use ICU or install the tokenizer on your Postgres separately). |
Point documentation to issues, closes #245
@MALKARAJ if you're trying to connect it to a postgres instance running outside the nominatim container then the hostaddr can't be 127.0.0.1 |
@mausch how can this config work if I add mounted volume "nominatim-data" so I don't need to re-import every time I restart/rebuild the service? Question in my head is how to connect that mounted volume to external postgres? Or is it simply nominatim can detect if it's external postgres then no need to re-import? Sorry for many confusions I have here. |
@inovramadani Not sure why you're mounting a volume or what you plan to put in it... I recommend posting on https://github.com/mediagis/nominatim-docker/discussions with more details. |
If you want to connect to a hostname use |
I tried moving the posgresql database used to Azure Postgresql, but ran into this errror: The error message you're seeing indicates that the hstore extension, which is required by the public.location_property_osmline table, is not allowed for azure_pg_admin users in Azure Database for PostgreSQL. Azure Database for PostgreSQL has a list of allowed extensions, and hstore is not included in this list for azure_pg_admin users. This is a restriction imposed by Azure for security and stability reasons. I want to move the database to Azure Postgresql. Do yo have any suggestions? The way I did this was to use pgadmin to create a backup of the generated postgresql database in docker and then I tried importing it into the Azure Postgresql Flexible database. I was then going to change the docker version so I could move it to Azure Container Apps. Maybe there are better ways? But I want to use the Azure Postgresql database since I have other stuff in it already! And I have to pay for it anyway. |
This github issue was closed 18 months ago. Problems with Azure are outside the scope of Nominatim. |
I am following the steps outlined in this issue and am running into the following error. I can gladly create a new issue but I feel it is applicable to this thread. Please let me know if you'd like me to move it. Thank you 2024-02-20 17:26:47: Using project directory: /nominatim Checking indexing status ... OK |
Is your feature request related to a problem? Please describe.
this feature request is all about maintainability of the database installation, backup
Describe the solution you'd like
i would like to contribute a PR to support connectivity to external Database and to be able to do so i need to update some ENVs and initialization scripts of the container along with the Dockerfile also it would be nice to contribute this pr to you so i don't need to maintain different fork for every version update. in the PR i will maintain both ways of deployments (Local DB, Remote DB).
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
on cloud provider mounting the DB on external volume using NFS will make sense but then we need to worry about the database backup using some external scripts , in case the volume got corrupted then we can recover.
Additional context
the reason for that, im trying to run the container on AWS ECS but running DB inside the container is limiting, and time consuming on initialization, not to mention mounting DB on external volume is not reliable, in terms if the NFS volume got corrupted
The text was updated successfully, but these errors were encountered: