Обсуждение: Connection error

Поиск
Список
Период
Сортировка

Connection error

От
Fst Procurement
Дата:
Hi ,

I am trying to connect to postgres on Win 2003 server std version but I
keep on getting an error . "Are you sure the server is running and that
connections for the client's IP address have been enabled" . The Win
2003 is a 64 bit edition.

I am sure of my settings. I have installed on a Win 2000 server with no
problems.

The only difference between this installation and the Win 2000
installation is that I installed the database on logical drive D and the
program was installed on drive C.

I have checked all settings that I can think of. Do you have any other
ideas for me?

I have used EMS SqlManager to transfer data and that worked Ok. However
when trying to make a backup with PgAdmin 1.7 I get the same connection
error. I tried installing PgAdmin 1.8 but this will not connect at all -
not even to the Win 2000 server.

I have tried changing some parameters in the conf file. I first stop the
service, change the settings and re-start the service. On some changes
the service will not re-start. I have to undo these changes to get the
service to start again. Are there some settings which cannot be changed?

regards,

Jimmy.

Re: Connection error

От
Richard Huxton
Дата:
Fst Procurement wrote:
> Hi ,
>
> I am trying to connect to postgres on Win 2003 server std version but I
> keep on getting an error . "Are you sure the server is running and that
> connections for the client's IP address have been enabled" . The Win
> 2003 is a 64 bit edition.
>
> I am sure of my settings. I have installed on a Win 2000 server with no
> problems.

So is PostgreSQL listening on the port you've set?
Can you connect to that port from the client machine?
What do the logs show (you have turned connection logging on, haven't you)?

> The only difference between this installation and the Win 2000
> installation is that I installed the database on logical drive D and the
> program was installed on drive C.

And the fact that they are different machines, running different
operating systems.

> I have checked all settings that I can think of. Do you have any other
> ideas for me?

There's no need to check all your settings. Just work through the basic
steps to check PG (or any service) is running:
1. Does the service start?
    - does it say started in your service manager?
    - does it appear in your process list?
    - what do the logs say?
2. Is it listening to the right port?
    - what does netstat say?
3. Can you connect to that port?
    - Will a telnet to that port connect?
    - do your firewall logs show anything?

If you pass these 3 then you should be able to get PG to log a
connection attempt (whether it passes or fails).

> I have used EMS SqlManager to transfer data and that worked Ok.

Hang on - can you connect, or can't you? If you can connect with
SqlManager but not pgadmin that suggests your settings in pgadmin,
doesn't it?

 > However
> when trying to make a backup with PgAdmin 1.7 I get the same connection
> error. I tried installing PgAdmin 1.8 but this will not connect at all -
> not even to the Win 2000 server.

I don't think they released a version 1.7 of pgAdmin-III, and I know 1.8
is in beta. Stick to the working releases if you're trying to diagnose a
problem.

> I have tried changing some parameters in the conf file. I first stop the
> service, change the settings and re-start the service. On some changes
> the service will not re-start. I have to undo these changes to get the
> service to start again. Are there some settings which cannot be changed?

No. You might get the syntax wrong, in which case you might stop the
system from starting. Your logs should say why.

--
   Richard Huxton
   Archonet Ltd

Re: Connection error

От
Richard Huxton
Дата:
Don't forget to cc: the list

Fst Procurement wrote:
> Netstat has the following two entries.
>
> Local address                                Foreign address.
>
> fstserver1:2359                              fstserver1.fst.co.za:5432
> fstserver1:5432                              fstserver1.fst.co.za:2359

OK, so it looks like something is listening on the right port.
Furthermore, you have a connection too!

> The service starts, a new log file is created every time the service
> starts, the conf file has been set to listen on all ip addresses and the
> pg_hba.conf is exactly the same as the Win 2000 server.

And what is in the log-file? Does it show evidence of connections.

> Perhaps I should recap.
>
> We acquired a new server, installed Win 2003, installed Postgresql and
> configured it with the same databases etc as the old one. We then tried
> to run our 3rd party software to access the database on the new server
> and received the connection error. The software uses ODBC to connect and
> the only change that was required for the ODBC was to set the host
> parameter to point to the new server. If I use the "Test" button it
> returns "connection successful".

Well, if your odbc test works but the application doesn't then you need
to find out what is different between the two.

> I can connect to the server with PgAdmin running from a remote machine,
> but when I try and make a backup of the database through PgAdmin from
> the remote machine, I get the same error message as that of the 3rd
> party software.

OK, so there clearly isn't a problem with the server side of things. If
you can connect with pgadmin, then you can connect.

Hmm - pgadmin just seems to run pg_dump with the relevant parameters.
One of the following is different between pgadmin connecting normally
and running pg_dump:
  - host
  - port
  - user
  - password
See the server logs for details (assuming you've turned connection
logging on)

> When changing parameters in the conf file all I do is remove the comment
> in the relevant line and then with some parameters the service refuses
> to re-start. If I replace the comment it re-starts.

Something will be logged. Although, if you're uncommenting the default
values I can't see how you can get errors.

> I have no fire wall set up and also don't have anti-virus running on the
> server. I have also switched off DEP on the new server.

It's not your server, it's your clients.

--
   Richard Huxton
   Archonet Ltd

Re: Connection error

От
Fst Procurement
Дата:
Hi Richard,

Thanks for all your help. It is working. I think.- not sure - I removed
PgAdmin 1.7 from my computer and now everything is working. Got it
somewhere on the net. Can't remember where.

Moral of the story . Beware where you obtain software

regards,

Jimmy


Re: Connection error

От
Raymond O'Donnell
Дата:
On 24/07/2007 15:19, Fst Procurement wrote:

> Thanks for all your help. It is working. I think.- not sure - I removed
> PgAdmin 1.7 from my computer and now everything is working. Got it
> somewhere on the net. Can't remember where.

1.7 was a development version of pgAdmin, so you must have got a
snapshot from the pgAdmin site. The current stable version is 1.6, and
1.8 is in beta.

Ray.


---------------------------------------------------------------
Raymond O'Donnell, Director of Music, Galway Cathedral, Ireland
rod@iol.ie
---------------------------------------------------------------