vendredi 28 novembre 2014

osm2pgsql cannot connect to postgis database, running on a Bitnami project installer


Based on this guide I am trying to import an .osm.pbf file into my PostGIS database, which is running on my Postgres Bitnami installation here:



[bitnami@ip-xxx]/usr/share/proj$ which postgres
/opt/bitnami/postgresql/bin/postgres


but I am getting an error, where osm2pgsql seems unable to connect to my database:



[bitnami@xxx]/home/.../geoserver_data/OSM$ osm2pgsql -E 900913 -d geodb -U geouser -W -S /usr/share/osm2pgsql/default.style washington-latest.osm.pbf
osm2pgsql SVN version 0.82.0 (64bit id space)

Password:
Error: Connection to database failed: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?


Yet my Postgres install is listening to port 5432 under /opt/bitnami/postgresql/.s.PGSQL.5432 as follows:


[bitnami@ip-xxx]/home/.../postgresql/share$ sudo netstat -nlp | grep 5432 tcp 0 0 127.0.0.1:5432 0.0.0.0:* LISTEN 13969/postgres

unix 2 [ ACC ] STREAM LISTENING 1876491 13969/postgres /opt/bitnami/postgresql/.s.PGSQL.5432


It seems that osm2pgsql is having trouble finding my database. I know that I have my postgres server running, as shown here:



[bitnami@ip-xxx]/usr/share/proj$ ps aux | grep postgres
postgres 982 0.0 0.0 247712 468 ? S Oct21 0:17 /usr/lib/postgresql/9.3/bin/postgres -D /var/lib/postgresql/9.3/main -c config_file=/etc/postgresql/9.3/main/postgresql.conf
postgres 986 0.0 0.6 247856 7028 ? Ss Oct21 0:00 postgres: checkpointer process
postgres 987 0.0 0.0 247712 140 ? Ss Oct21 0:14 postgres: writer process
postgres 988 0.0 0.0 247712 104 ? Ss Oct21 0:12 postgres: wal writer process
postgres 989 0.0 0.1 248568 1088 ? Ss Oct21 0:12 postgres: autovacuum launcher process
postgres 990 0.0 0.0 103520 536 ? Ss Oct21 0:22 postgres: stats collector process
postgres 11111 0.0 1.1 171996 11876 ? S 04:28 0:00 /opt/bitnami/postgresql/bin/postgres -D /opt/bitnami/postgresql/data
postgres 11113 0.0 0.0 171996 876 ? Ss 04:28 0:00 postgres: checkpointer process
postgres 11114 0.0 0.1 171996 1696 ? Ss 04:28 0:00 postgres: writer process
postgres 11115 0.0 0.0 171996 932 ? Ss 04:28 0:00 postgres: wal writer process
postgres 11116 0.0 0.2 172844 2084 ? Ss 04:28 0:00 postgres: autovacuum launcher process
postgres 11117 0.0 0.1 27812 1120 ? Ss 04:28 0:00 postgres: stats collector process
bitnami 13358 0.0 0.0 11752 924 pts/6 S+ 09:10 0:00 grep --color=auto postgres
root 26079 0.0 0.0 64536 32 pts/7 S Nov26 0:00 su postgres
postgres 26080 0.0 0.0 21100 200 pts/7 S Nov26 0:00 bash


I also have the following under my /etc/postgresql/9.3/main/pg_hba.conf, /opt/bitnami/postgres/share/pg_hba.conf and my /opt/bitnami/postgres/data/pg_hba.conf, which seems like is should allow access for my geouser:



# TYPE DATABASE USER ADDRESS METHOD
local geodb geouser md5


Any suggestions about how I can import my OSM data?





Aucun commentaire:

Enregistrer un commentaire