Skip to content
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

allow connecting to a host on a different server #552

Closed
wants to merge 1 commit into from

Conversation

dogmatic69
Copy link

Currently its not possible to configure when the psql server is not localhost. This fixes that

@lonvia
Copy link
Member

lonvia commented Oct 18, 2016

This breaks the standard server setting pgsql://@/nominatim. I'd also like to see some solution for providing the module/nominatim.so on the other server (for example by adding the ability to set a custom location for nominatim.so). At least there should be a sensible error message, if nominatim.so is not found.

Please see also #112 , in particular #112 (comment)

@dogmatic69
Copy link
Author

Should be easy enough to make this work pgsql://@/nominatim

As for the .so file, I have just copied it to the location on the server. Anyone can easily ln -s the file to where ever it needs to be.

Or go all out and make it a configuration option.

@lonvia
Copy link
Member

lonvia commented Oct 18, 2016

I'd lean toward a config option in settings/local.php for the path that is mandatory to be set when the host is something other than localhost but I'm open for other suggestions. The problem with nominatim.so is that the import breaks in non-obvious ways when it is missing and I'd like to avoid situations where people naively set a different host then report a bug because it doesn't work.

@billsinc
Copy link

This worked for me for #566 except for the functions dependent on nominatim.so as RDS doesn't permit that. Still looking for a workaround.

@billsinc
Copy link

I believe this also doesn't fix the limitations around the update.php function not working remotely either, correct?

@dsbaars
Copy link

dsbaars commented Nov 15, 2016

I'm also working on a fix, couldn't find this issue because I was looking for the term "external" in the pull request title. I also improved update.php. Still need to run the tests but you can check it out at https://github.com/dsbaars/Nominatim/tree/external-pgsql-fix

@otbutz
Copy link
Contributor

otbutz commented Jun 29, 2017

Would it be possible to recreate the functionality of nominatim.so with pure PL/pgSQL? This would solve the issue once and for all.

@lonvia
Copy link
Member

lonvia commented Jun 29, 2017

There is a PL/pgSQL version floating somewhere around the internet. Unfortunately I can't seem to find it anymore. If you can dig it up and update it so that it works with the current version, I'd be willing to take a PR that offers it as an alternative. Be aware though that there is a performance penalty to be paid when using PL/pgSQL.

@karambolishe
Copy link

Where I should specify password for connect to remote database (aws rds)?
I changed settings file (settings/settings.php) according to tips and finally I have this example:

@define('CONST_Database_DSN', 'pgsql://nominatim:nominatim@Endpoint_to_rds_database.rds.amazonaws.com:5432/nominatim');

I run this command:
./utils/setup.php --osm-file ../geofabrik/algeria-latest.osm.pbf --all --osm2pgsql-cache 28000

and during every 'SET' to database I should enter password... but in the end I encounter the error.
I guess that application doesn't know what password it should use.

WARNING: resetting threads to 1
Create DB
Password: 
Setup DB
Postgres version found: 9.6
Password for user nominatim: 
CREATE EXTENSION
Password for user nominatim: 
CREATE EXTENSION
Postgis version found: 2.3
Password for user nominatim: 
SET
SET
SET
SET
SET
SET
SET
SET
CREATE TABLE
CREATE INDEX
REVOKE
Password for user nominatim: 
SET
SET
SET
SET
SET
SET
SET
SET
SET
CREATE TABLE
CREATE INDEX
CREATE INDEX
Password for user nominatim: 
SET
SET
SET
SET
SET
SET
SET
SET
SET
CREATE TABLE
CREATE INDEX
Password for user nominatim: 
SET
SET
SET
SET
SET
SET
SET
SET
SET
CREATE TABLE
Password for user nominatim: 
SET
SET
SET
SET
SET
SET
SET
Password for user nominatim: 
SET
SET
SET
SET
SET
SET
SET
SET
SET
CREATE TABLE
Password for user nominatim: 
CREATE TABLE
Password for user nominatim: 
CREATE TYPE
Import
osm2pgsql version 0.93.0-dev (64 bit id space)

Using projection SRS 4326 (Latlong)
Connection to database failed: fe_sendauth: no password supplied

If some one knows how it fix, help please.
Thanks in advance

@mtmail
Copy link
Collaborator

mtmail commented Sep 1, 2017

@karambolishe Nominatim requires a custom extension (the compiled nominatim.so) to exist on the remote database server. With Amazon RDS you have no way to copy/install that. See #112 Even if the password is set (not sure why your example doesn't work) the installation would fail at a later point.

@karambolishe
Copy link

Thank you for your answer, at least I'm sure that sample with rds isn't working.

@lonvia
Copy link
Member

lonvia commented Jul 22, 2018

Closing in favour of #1095.

@lonvia lonvia closed this Jul 22, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants