PDA

View Full Version : Editing conf files for local network connectivity of one DB not working



xplore
12-22-2010, 05:36 AM
So I'm using this guide :
faq.holdemmanager.com/questions/90/Run+PostgreSQL+Over+a+Network+

Things I've done successfully, given the Desktop (comp with Postgre DB) a static IP address that has connectivity.

I know my password for the Database I'm wanting to connect to, and now the problem area.

I have verified that the ' postgresql.conf ' file has listen_address * filled for its value. That's been done and is saved.

When I go to edit the ' pg_hba.conf ' file and add a new entry which is

Type : host
Database : all
User : all
IP-Address : 192.168.1.0 (this is my local network, class C, 254 hosts addresses possible, my laptop typically has a 1.3-1.5 IP address, so i put it to this range of 192.168.1.0 since it's variable based on the DHCP server)
Method : md5


NOW I click save on the file, then exit the window, BUT when I go to open up the pg_hba.conf file once again, the entry I just entered no longer remains.

What gives???

Maybe a HM support person could set up a team viewer session with me and we can knock this out together? That guide is actually for version 8.3 of PostgreSQL and not 8.4, so maybe it will be beneficial for your FAQ as well.

Thanks for a hopefully speedy response.

netsrak
12-22-2010, 09:31 AM
Please edit the file directly as the pgadmin edit feature seems to be buggy:
1. create a backup copy of pg_hba.conf
2. copy the file to the desktop and open it in a texteditor
3. edit the file and save the changes
4. copy the file back to its original folder
5. restart the postgresql service

xplore
12-22-2010, 09:40 AM
I've done what you stated, but the problem seems to be more intricate.

When I load pgAdmin3 and double click on the Server to start it up, it retrieves the info of the server but will not like me connect to it. It brings up a ' Guru Hint - Server not listening ' window box stating this :

" 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 "127.0.0.1" and accepting TCP/IP connections on port 5432? .."

Help?

netsrak
12-23-2010, 04:38 AM
Is this before or after you edited the conf file?
If its after you should restore your original conf file and restart the postgresql service.

xplore
12-27-2010, 05:51 AM
Is this before or after you edited the conf file?
If its after you should restore your original conf file and restart the postgresql service.

Alright I've done some trouble shooting, I feel your FAQ on this should be updated if we solve this problem.

As per this guide, i've followed these steps and run into some problems,

FAQ - Hold'em Manager Poker Tracking Software :: Run PostgreSQL Over a Network (http://faq.holdemmanager.com/questions/90/Run+PostgreSQL+Over+a+Network+)

THINGS I'VE DONE WITH SUCCESS :

My DB now connects over a PW I know of, meaning I can go to Database Management on my desktop (main comp) and type in username/pw/port/ip and it connects successfully.

The postgresql file has the allw_address * by default filled in, so that works.

NOW the problem with the guide itself, firstly, within pgAdmin3, going File > open pg_hba to then fill in a new entry for allowable connections (ie host/all/192.168.1.5/md5) doesn't work and upon saving that entry, exiting the window, then going BACK to file>open pg_hba you'll see, that entry doesn't remain intact.

SO we go to the source, located C:\prog files\postrSQL\etc...\pg_hba open that up in wordpad, and finally we go here :

http://img824.imageshack.us/img824/6948/pghbascreen.png (http://img824.imageshack.us/i/pghbascreen.png/)

Uploaded with ImageShack.us (http://imageshack.us)


Notice, the entry under IPv4 follows the same suit as the first entry, but the IP is a static address which my laptop possesses, I've set the auth to trust so I need no pw to connect to the DB through my local network.

The moment I save this pg_hba then go to pgAdmin III and do Tools > Start Service, there is a considerable pause, the Server DOES start, BUT trying to connect to the Server (double clicking PostgreSQL 8.4) Fails and brings up a Guru Hint saying ' Server not listening '.

Upon removing the pg_hba IPv4 entry connecting works fine once again. So this is where we're currently at boys.

I'm a total noob with this DB stuff so help me!

netsrak
12-27-2010, 06:06 AM
This is beyond our standard support, so i don't think there is much we can do for you.

But i think there is a /32 missing behind your 2nd IP address

I'll forward the FAQ problems.

xplore
12-27-2010, 06:17 AM
OKAY it would seem I'm completely brain dead and forgot the most basic entry. In the pg_hba, you need IP/CIDR i forgot /32 after the laptop's IP address.

All works now, will report back how if i can get this to work over the internet.