Problem with pgAgent on Ubuntu

Started by P. Broennimannabout 14 years ago3 messagesgeneral
Jump to latest
#1P. Broennimann
peter.broennimann@gmail.com

Hi there

My PostgreSQL 9.1 installed on an Ubuntu/64 10.04 machine is running fine.

I installed pgAgent with "sudo apt-get install pgagent" (that is probably
version 3.0.1).

I executed the .sql script to create the pgagent objects in the database.

sudo su postgres
psql -d postgres
postgres-# \dn
List of schemas
Name | Owner
---------+----------
pgagent | postgres
public | postgres
(2 rows)

-> Database seems fine!

-> The problem I am having is that I can not start pgagent. When I try:

cd /usr/bin
./pgagent hostaddr=127.0.0.1 port=5432 dbname=postgres user=postgres

and I get the following errors:

/usr/bin$ WARNING: Couldn't create the primary connection (attempt 1):
could not connect to server: Connection refused
Is the server running on host "127.0.0.1" and accepting
TCP/IP connections on port 5432?
WARNING: Couldn't create the primary connection (attempt 2): could not
connect to server: Connection refused
Is the server running on host "127.0.0.1" and accepting
TCP/IP connections on port 5432?
WARNING: Couldn't create the primary connection (attempt 3): could not
connect to server: Connection refused
Is the server running on host "127.0.0.1" and accepting
TCP/IP connections on port 5432?
WARNING: Couldn't create the primary connection (attempt 4): could not
connect to server: Connection refused
Is the server running on host "127.0.0.1" and accepting
TCP/IP connections on port 5432?

Any idea?

P.S: I also tried to run pgagent with sudo..... -> The same errors!

Thanks,
P.

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: P. Broennimann (#1)
Re: Problem with pgAgent on Ubuntu

"P. Broennimann" <peter.broennimann@gmail.com> writes:

-> The problem I am having is that I can not start pgagent. When I try:

cd /usr/bin
./pgagent hostaddr=127.0.0.1 port=5432 dbname=postgres user=postgres

and I get the following errors:

/usr/bin$ WARNING: Couldn't create the primary connection (attempt 1):
could not connect to server: Connection refused
Is the server running on host "127.0.0.1" and accepting
TCP/IP connections on port 5432?

"Connection refused" is a kernel-level error, not Postgres refusing the
connection. Either the postmaster is not actually listening on that
port, or there is a packet filter rejecting the traffic. I'd bet on the
latter given what you've said.

regards, tom lane

#3P. Broennimann
peter.broennimann@gmail.com
In reply to: Tom Lane (#2)
Re: Problem with pgAgent on Ubuntu

Eureka!

I changed 127.0.0.1 for the PG's assiged IP address 192.168..... and now it
works :)

Thx & cheers,
P.

2012/1/16 Tom Lane <tgl@sss.pgh.pa.us>

Show quoted text

"P. Broennimann" <peter.broennimann@gmail.com> writes:

-> The problem I am having is that I can not start pgagent. When I try:

cd /usr/bin
./pgagent hostaddr=127.0.0.1 port=5432 dbname=postgres user=postgres

and I get the following errors:

/usr/bin$ WARNING: Couldn't create the primary connection (attempt 1):
could not connect to server: Connection refused
Is the server running on host "127.0.0.1" and accepting
TCP/IP connections on port 5432?

"Connection refused" is a kernel-level error, not Postgres refusing the
connection. Either the postmaster is not actually listening on that
port, or there is a packet filter rejecting the traffic. I'd bet on the
latter given what you've said.

regards, tom lane