PDA

View Full Version : PostgreSQL problem - sharing database on network



Thibaut_
10-18-2010, 02:37 PM
Hello,

I have some issues with my HEM, in particular with the postgreSQL software, when i try to share my databases over network.

I want to be able to acces my HEM database on my main pc on my laptop via local network. There is a nice post in the FAQ section about this. I followed the steps.

When i altered the pg_hba file with the right IP adres , and I try to restart the service , the problems begin. It won't let me restart the server. When i try to acces it it says:


Server doesn't listen
The server doesn't accept connections: the connection library reports
could not connect to server: Connection refused (0x0000274D/10061) Is the server running on host "localhost" and accepting TCP/IP connections on port 5432? could not connect to server: Connection refused (0x0000274D/10061) Is the server running on host "localhost" and accepting TCP/IP connections on port 5432?
If you encounter this message, please check if the server you're trying to contact is actually running PostgreSQL on the given port. Test if you have network connectivity from your client to the server host using ping or equivalent tools. Is your network / VPN / SSH tunnel / firewall configured correctly?
For security reasons, PostgreSQL does not listen on all available IP addresses on the server machine initially. In order to access the server over the network, you need to enable listening on the address first.
For PostgreSQL servers starting with version 8.0, this is controlled using the "listen_addresses" parameter in the postgresql.conf file. Here, you can enter a list of IP addresses the server should listen on, or simply use '*' to listen on all available IP addresses. For earlier servers (Version 7.3 or 7.4), you'll need to set the "tcpip_socket" parameter to 'true'.
You can use the postgresql.conf editor that is built into pgAdmin III to edit the postgresql.conf configuration file. After changing this file, you need to restart the server process to make the setting effective.
If you double-checked your configuration but still get this error message, it's still unlikely that you encounter a fatal PostgreSQL misbehaviour. You probably have some low level network connectivity problems (e.g. firewall configuration). Please check this thoroughly before reporting a bug to the PostgreSQL community.

This is NOT the problem though. Router is configured right and I can ping to the adres and such.

The problem is that the service that normally runs in my task manager stopped working. When i try to restart it manually it gives me error messages, I fix some and get others.

When I try to acces HEM via my laptop on the right IP and such it says the service is not running. It asks if HEM needs to start it and fails.

I can't acces my local HEM anymore now.

When i reinstall postgreSQL completly it works again, untill I alter the pg_hba file and rince and repeat


If anyone has any thoughts on how to fix this please let me know!

urs sincerily,

Thibaut Van Weehaeghe

morny
10-18-2010, 11:16 PM
I had to set something like this up myself a while back and to be honest the FAQ is just a rough guide, from what ive seen from googling it varies a lot what settings work. I spent the best part of a couple of days messing with settings after googling different threads so even if i had those settings now there unlikely to work for you.

My advice google this and you should find a bunch of people with similar issues and keep trying until you get lucky, in short its an advanced feature and tricky to get that config file working