Hi Ian,
I did not check everything that you wrote but I answer as far as I can.
First, you should be able to connect to every port on your virtual machine. But: Are your services (postgres and geoserver) only running on localhost or are they reachable about network? Try „netstat –antp | grep LISTEN“ in your linux shell to filter all listening tcp-ports. Your postgres should listen on your configured port. Next thing: You are talking about port 5433 but the standard port for postgres is 5432. I think that you know that but just for being sure about it.
If geoserver and postgres are running on the same machine you don’t need any port forwarding, just connect to localhost. If you are using another postgresql port than standard you also have to enter it in the geoserver datasource configuration, for example 127.0.0.1:5433
So:
-check listening port of postgresql
-check if postgresql allows tcp connections
-use the correct port when defining datasource in GeoServer
For debugging you could try to connect to the postgresql port with telnet:
telnet localhost 5433
This lets you connect to port 5433 on localhost. If it connects your postgresql accepts connections on this port. If not you should check again your configuration.
Greetings
Stefan
From: Ian Tangert [mailto:itangert@…84…]
Sent: Thursday, March 07, 2013 5:42 AM
To: geoserver-users@lists.sourceforge.net
Subject: [bulk]: [Geoserver-users] Geoserver and Virtual Machine Port Forwarding
greetings,
I get the following error when trying to connect to a port-forwarded PostgreSQL/PostGIS database running in a VM:
“Error creating data store, check the parameters. Error message: Unable to obtain connection: Cannot create PoolableConnectionFactory (Connection refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.)”
The host machine is OSX and I have a VirtualBox instance of Ubuntu server 12.04 port forwarding set to 5433 and 8083 for postgres and geoserver respectively. I can connect to Postgres using pgAdmin in the host machine using 127.0.01:5433, and can also connect to the geoserver admin in the host with a web browser at localhost:8083/geoserver/web.
But when I try to make a data source with the localhost and 5433 in geoserver I get that error. When I look at the port 5433 on the host machine it says pyrrho, whereas port 5432 says postgresql (a host based, non port-forwarded instance that works with geoserver). Should this be possible or is the virtual machine port forwarding thing too murky? Or am i just missing something else?
thanks